A substation patrol task scheduling method and system based on multi-thread pool scheduling

CN122431823APending Publication Date: 2026-07-21NANJING GUODIAN NANZI POWER GRID AUTOMATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NANJING GUODIAN NANZI POWER GRID AUTOMATION CO LTD
Filing Date
2026-04-15
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

Existing substation inspection systems suffer from low efficiency and poor reliability in executing inspection tasks, as well as problems such as preset position errors and image errors caused by camera resource conflicts, making it difficult to meet the high-frequency inspection needs of large-scale substations.

Method used

A multi-thread pool-based scheduling method is adopted, which uses a scheduling strategy that combines parallel and serial operations. Mutex locks are used to control camera resources, the camera's arrival status is dynamically detected, exclusive access to the camera is achieved, tasks of different cameras are executed in parallel, tasks of the same camera are executed serially, and the number of threads in the thread pool is dynamically configured.

Benefits of technology

It improves the efficiency of inspection tasks and the stability of the system, avoids resource conflicts, enhances the real-time performance and reliability of the system, and is suitable for large-scale automatic inspection of substations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431823A_ABST
    Figure CN122431823A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on the scheduling of multithread pool substation patrol task scheduling method and system, belong to electric power system intelligent operation and maintenance technical field.The method includes: generating patrol task according to the patrol demand of target substation, the patrol task is composed of several patrol point tasks;For each patrol point task, match the corresponding target camera, according to the preset position and maximum timeout of target camera confirmed by patrol point task;Each patrol point task is encapsulated as an independently executed task unit and submitted to the preset thread pool for scheduling and execution.The application can improve the overall execution efficiency and system throughput of substation patrol task, enhance the real-time, reliability and stability of the patrol system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of intelligent operation and maintenance technology of power systems, and relates to a method and system for scheduling substation inspection tasks based on multi-thread pool scheduling. Background Technology

[0002] With the continuous advancement of unmanned and intelligent inspection technologies in substations, automated inspections based on video surveillance systems have gradually become the mainstream inspection method. In existing inspection systems, preset positions are typically used to control the camera to rotate to a designated location before capturing images. However, current technologies generally face a series of problems in practical applications. Traditional inspection methods often use a serial approach to call inspection points one by one, resulting in a long overall execution time. This makes it difficult to meet the urgent needs of large-scale substations for high-frequency inspections, leading to low efficiency. Furthermore, when multiple inspection tasks are executed concurrently, camera resource conflicts often occur. Different tasks simultaneously call different preset positions of the same camera, causing camera control commands to overlap, leading to preset position errors, image capture failures, or image errors.

[0003] Furthermore, the time required for the camera to rotate to the preset target position is affected by a combination of factors, including pan-tilt load, movement distance, and mechanical condition. A fixed delay mechanism is difficult to adapt to all real-world scenarios, easily leading to premature image capture or prolonged idle waiting, increasing the uncertainty of rotation time and posing significant challenges to the synchronization of inspection tasks. Simultaneously, the existing system lacks a unified scheduling and thread management mechanism for inspection point tasks, limiting system scalability and impacting stability and reliability. Therefore, there is an urgent need for a method to effectively improve the execution efficiency, stability, and reliability of substation inspection systems. Summary of the Invention

[0004] The purpose of this invention is to provide a method and system for scheduling substation inspection tasks based on multi-threaded pool scheduling, in order to solve the problems of low efficiency and poor reliability in scheduling substation inspection tasks.

[0005] To achieve the above objectives, the technical solution of the present invention is as follows:

[0006] In a first aspect, the present invention provides a substation inspection task scheduling method based on multi-threaded pool scheduling, comprising the following steps:

[0007] An inspection task is generated based on the inspection requirements of the target substation, and the inspection task includes several inspection point tasks.

[0008] Match a corresponding target camera to each inspection point task, and determine the preset position and maximum timeout time of the target camera based on the inspection point task;

[0009] Each patrol point task is encapsulated into an independently executable task unit and submitted to a pre-defined thread pool for scheduling and execution;

[0010] The scheduling strategy of the thread pool is as follows:

[0011] Tasks for different inspection points corresponding to different target cameras are executed in parallel;

[0012] Tasks for different inspection points corresponding to the same target camera are executed sequentially;

[0013] The execution process of the task unit includes:

[0014] Activate the mutex lock of the target camera, send a preset position call command to the target camera, and control the target camera to rotate to the preset position;

[0015] Within the maximum timeout period, the positioning status of the target camera relative to the preset position is periodically detected. Based on the positioning status, a capture command is sent to the target camera to obtain the inspection results of the inspection point task, the current inspection point task is ended, and the mutex lock is released.

[0016] The method for obtaining the inspection results of the inspection point task by sending a capture command to the target camera based on the arrival status is as follows:

[0017] If the arrival status is not in place within the maximum timeout period, continue to wait for the next detection; if the arrival status is in place, immediately stop detection, send an immediate image capture command to the target camera, output the image captured by the target camera as the inspection result and store it.

[0018] If the arrival status is not in place and the detection time exceeds the maximum timeout, a capture command that does not require shooting is sent to the target camera, and the acquisition failure information is output as the inspection result and stored.

[0019] The preset position records the attitude parameters of the target camera pan-tilt lens when shooting, including: horizontal rotation parameters, vertical pitch parameters, and focal length parameters.

[0020] The detection of the positioning status involves comparing the current attitude parameters of the target camera's pan-tilt lens with the attitude parameters of a preset position one by one.

[0021] Each patrol point task corresponds to at least one target camera, and each target camera corresponds to at least one patrol point task.

[0022] Before activating the mutex lock of the target camera, the following steps are also included:

[0023] Acquire the mutex lock of the target camera, check whether the mutex lock is active, if active, add the patrol point task to the waiting queue of the corresponding thread, wait for the mutex lock of the target camera to be released, and execute the patrol point tasks in the waiting queue in sequence.

[0024] The final inspection results are obtained based on the execution results of all inspection point tasks. The images of the inspection results are classified and stored based on the inspection task number, the inspection point task number, and the timestamp.

[0025] A dynamic constraint strategy is used to configure the number of threads in the thread pool. The maximum concurrency of the thread pool = min(system hardware concurrency capacity, preset configuration upper limit), where min() represents the minimum value function. In a first aspect, this invention provides a substation inspection task scheduling system based on multi-threaded pool scheduling, comprising:

[0026] The task generation module is used to generate inspection tasks based on the inspection requirements of the target substation.

[0027] The point analysis module is used to determine several inspection points based on the location of the target camera and the location information of the area to be inspected. The inspection task is then split into multiple inspection point tasks based on the inspection points.

[0028] The thread pool module is used to build thread pools and uniformly schedule patrol point tasks;

[0029] The task execution module is used to control the execution of patrol point tasks in each thread according to the scheduling strategy of the thread pool module.

[0030] The camera module is used to control the camera to move to a preset position and take pictures according to the execution control instructions of the task execution module, and output the task results of the inspection point;

[0031] The results management module is used to summarize the results of the inspection points to obtain the final inspection results and store the inspection results.

[0032] Beneficial effects

[0033] This invention combines parallel and serial scheduling of thread pools with exclusive camera control to achieve efficient collaborative execution of multiple inspection points, improve the overall execution efficiency of inspection tasks and system throughput, and avoid inspection failures and image acquisition errors caused by preset position contention. It enhances the real-time performance, reliability and stability of the inspection system and is suitable for large-scale substation automatic inspection application scenarios. Attached Figure Description

[0034] Figure 1 This is a flowchart of the substation inspection task scheduling method based on multi-thread pool scheduling according to the present invention;

[0035] Figure 2 This is a flowchart illustrating the execution process of the inspection point task in this invention. Detailed Implementation

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] Example 1

[0038] refer to Figure 1 and Figure 2 As shown, a substation inspection task scheduling method based on multi-threaded pool scheduling includes the following steps:

[0039] An inspection task is generated based on the inspection requirements of the target substation, and the inspection task includes several inspection point tasks.

[0040] Match a corresponding target camera to each inspection point task, and determine the preset position and maximum timeout time of the target camera based on the inspection point task;

[0041] Each patrol point task is encapsulated into an independently executable task unit and submitted to a pre-defined thread pool for scheduling and execution;

[0042] The final inspection results are obtained based on the execution results of all inspection point tasks. The images of the inspection results are stored and archived according to the inspection task number, the inspection point task number, and the timestamp.

[0043] In this embodiment, an inspection task is generated based on the inspection requirements of the target substation. The inspection task consists of several inspection point tasks. The inspection requirements include key information such as the inspection cycle and inspection range. Several inspection points are determined within the inspection range. The inspection task is then divided into several inspection point tasks, with each inspection point corresponding to one inspection point task. The inspection point task specifies the location, time, and other requirements to be inspected.

[0044] The inspection task includes the following fields:

[0045] Patrol Task Number (task_patrol_id): Serves as a unique identifier for patrol tasks, used to distinguish different patrol tasks and facilitate the system's tracking and management of each task.

[0046] Inspection point set (point_list): Used to store information on all inspection points included in this inspection task.

[0047] The inspection point task includes the following fields:

[0048] Inspection point task number (inspect_point_id): A unique number assigned to each inspection point to accurately identify and locate the specific inspection point.

[0049] Target camera number (patroldevice_code): A unique identifier for the camera, which identifies the camera device responsible for patrolling the corresponding patrol point.

[0050] Preset position number (preset_id): Specifies the preset position that the camera needs to rotate to when inspecting a certain inspection point.

[0051] Maximum timeout: Specifies the maximum time limit from the start of the inspection to completion or timeout for this inspection point, in order to ensure the timeliness and efficiency of the inspection task.

[0052] Numerous cameras are installed within the target substation for inspection. A corresponding camera is matched to each inspection point task based on its location, serving as the target camera. The preset position number and maximum timeout time of the target camera are confirmed according to the inspection point task. Each inspection point task requires at least one target camera to perform the task. The target camera's shooting area can fully cover or partially include the location to be inspected. The initial position of the target camera and its preset position during shooting are obtained, and the target camera's motion trajectory is generated.

[0053] The pose parameters of the target camera and its preset position include the following fields:

[0054] Horizontal rotation parameter (p): This represents the direction parameter of the pan-tilt-zoom (PTZ) and indicates the horizontal orientation setting of the camera's PTN. This parameter determines the camera's shooting angle and the left-right movement of the field of view. The value range can be determined based on the actual horizontal rotation range of the camera, for example, between -180 degrees and 180 degrees. Different values ​​correspond to different horizontal shooting directions.

[0055] Vertical tilt parameter (t): Represents the tilt parameter of the pan-tilt, indicating the vertical tilt setting of the camera pan-tilt. It controls the up-and-down movement of the camera, thus affecting the vertical changes in the shooting angle and field of view. The value range is also set according to the vertical rotation range of the camera, such as between -90 degrees and 90 degrees. Different values ​​allow the camera to capture targets at different heights.

[0056] Focal length parameter (z): This parameter represents the focal length setting of the camera's pan-tilt lens. This parameter affects the camera's focal length, thereby adjusting the magnification of the captured image. The value range is determined by the camera's optical zoom capability, for example, 1x - 10x zoom. Different values ​​can allow the camera to capture images at different distances and with different levels of sharpness.

[0057] Each patrol point task is encapsulated into an independently executable task unit and submitted to a preset thread pool for concurrent scheduling and execution;

[0058] The task unit includes all information and execution logic of the inspection point and its corresponding target camera. The thread pool performs unified scheduling and management of the task units, avoiding the performance overhead caused by frequent creation and destruction of threads, and improving the system's operating efficiency and stability.

[0059] The execution process of a task unit includes:

[0060] Based on the target camera number information of the inspection point task, obtain the mutex lock of the corresponding target camera, check whether the mutex lock is active, if active, add the inspection point task to the waiting queue of the corresponding thread, wait for the target camera mutex lock to be released, and execute the inspection point tasks in the waiting queue in sequence.

[0061] Activate the mutex lock of the target camera, send a preset position call command to the target camera, and control the target camera to rotate to the preset position;

[0062] Within the maximum timeout period, the positioning status of the target camera relative to the preset position is periodically detected. Based on the positioning status, a capture command is sent to the target camera to obtain the inspection results of the inspection point task, the current inspection point task is ended, and the mutex lock is released.

[0063] By using mutex locks, it is ensured that only one patrol point can access the camera at any given time, thus achieving exclusive access to the camera resource and avoiding resource conflicts.

[0064] A dynamic waiting mechanism is employed to control the target camera's shooting. Specifically, after the target camera has rotated to its predetermined motion trajectory and a minimum waiting time has elapsed, a cyclic detection method is used to continuously acquire the target camera's attitude parameters and compare them with the attitude parameters of a preset position to determine whether the camera has rotated to the preset position. Within the maximum timeout period, if the "positioned" state is not yet in position, the system continues to wait for the next detection and sends a capture command to the target camera. If the "positioned" state is in position, the detection immediately stops, and an immediate capture command is sent to the target camera. The image captured by the target camera is output as the inspection result, and the current target camera image is stored and released. A mutex lock on the camera head ends its exclusive use of the camera resource, allowing other patrol point tasks to use the camera and preventing the entire system from being blocked due to the abnormality of a single task. If the "in-place" status is "not in-place" and the detection time exceeds the maximum timeout, it indicates that the camera may be faulty. A capture command that does not require shooting is sent to the target camera, and abnormal information (including the time of the abnormality, the patrol point task number, the target camera number, and the abnormality type, etc., are recorded in the log file) is output and recorded for subsequent manual retraining and fault diagnosis, and the current patrol point task is terminated. The maximum timeout is set to 20 seconds, and the camera's attitude parameters are obtained every 500 milliseconds. Setting a minimum waiting time can avoid triggering detection immediately after the command is sent to the camera, because the camera needs a certain amount of time to respond and perform rotation operations after receiving the command, and immediate detection may lead to misjudgment. For example, the minimum waiting time can be set to 5 seconds.

[0065] When at least two inspection points correspond to the same camera within the same inspection task, the inspection points corresponding to that camera are sorted, and the cameras are called sequentially using a mutex lock mechanism to achieve serial execution. For inspection point tasks using different cameras, there is no resource conflict issue, so they can be executed in parallel. By parallel execution, the system's multi-threaded resources are fully utilized, improving the execution efficiency of inspection tasks.

[0066] The inspection images are stored and archived according to the inspection task number, the inspection point task number, and the timestamp. The timestamp unit is seconds, and the format is "yyyy-mm-dd-hh-mm-ss", which is "year-month-day-hour-minute-second".

[0067] The number of threads in the thread pool is configured using a dynamic constraint strategy. The maximum concurrency of the thread pool is min(system hardware concurrency capability, preset configuration limit), where min() represents the minimum value function.

[0068] In one possible implementation, the preset configuration limit of the thread pool can be flexibly configured according to the number of patrol points and the number of cameras.

[0069] Example 2

[0070] A substation inspection task scheduling system based on multi-threaded pool scheduling includes:

[0071] The task generation module is used to generate inspection tasks based on the inspection requirements of the target substation.

[0072] The point analysis module is used to determine several inspection points based on the location of the target camera and the location information of the area to be inspected. The inspection task is then split into multiple inspection point tasks based on the inspection points.

[0073] The thread pool module is used to build thread pools and uniformly schedule patrol point tasks;

[0074] The task execution module is used to control the execution of patrol point tasks in each thread according to the scheduling strategy of the thread pool module.

[0075] The camera module is used to control the camera to move to a preset position and take pictures according to the execution control instructions of the task execution module, and output the task results of the inspection point;

[0076] The results management module is used to summarize the results of the inspection points to obtain the final inspection results and store the inspection results.

[0077] In summary, this invention combines parallel and serial scheduling of thread pools with exclusive camera control to achieve efficient collaborative execution of multiple inspection points, improving the overall execution efficiency and system throughput of inspection tasks. At the same time, it avoids inspection failures and image acquisition errors caused by preset position contention, enhancing the real-time performance, reliability, and stability of the inspection system. It is suitable for large-scale substation automatic inspection application scenarios.

[0078] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for scheduling substation inspection tasks based on multi-threaded pool scheduling, characterized in that, Includes the following steps: An inspection task is generated based on the inspection requirements of the target substation, and the inspection task includes several inspection point tasks. Match a corresponding target camera to each inspection point task, and determine the preset position and maximum timeout time of the target camera based on the inspection point task; Each patrol point task is encapsulated into an independently executable task unit and submitted to a pre-defined thread pool for scheduling and execution; The scheduling strategy of the thread pool is as follows: Tasks for different inspection points corresponding to different target cameras are executed in parallel; Tasks for different inspection points corresponding to the same target camera are executed sequentially; The execution process of the task unit includes: Activate the mutex lock of the target camera, send a preset position call command to the target camera, and control the target camera to rotate to the preset position; Within the maximum timeout period, the positioning status of the target camera relative to the preset position is periodically detected. Based on the positioning status, a capture command is sent to the target camera to obtain the inspection results of the inspection point task, the current inspection point task is ended, and the mutex lock is released.

2. The substation inspection task scheduling method based on multi-threaded pool scheduling according to claim 1, characterized in that, The method for obtaining the inspection results of the inspection point task by sending a capture command to the target camera based on the arrival status is as follows: If the arrival status is not in place within the maximum timeout period, continue to wait for the next detection; if the arrival status is in place, immediately stop detection, send an immediate image capture command to the target camera, output the image captured by the target camera as the inspection result and store it. If the arrival status is not in place and the detection time exceeds the maximum timeout, a capture command that does not require shooting is sent to the target camera, and abnormal information is output as the inspection result and stored.

3. The substation inspection task scheduling method based on multi-threaded pool scheduling according to claim 1, characterized in that, The preset position records the attitude parameters of the target camera pan-tilt lens when shooting, including: horizontal rotation parameters, vertical pitch parameters, and focal length parameters. The detection of the positioning status involves comparing the current attitude parameters of the target camera's pan-tilt lens with the attitude parameters of a preset position one by one.

4. The substation inspection task scheduling method based on multi-threaded pool scheduling according to claim 1, characterized in that, Each patrol point task corresponds to at least one target camera, and each target camera corresponds to at least one patrol point task.

5. The substation inspection task scheduling method based on multi-threaded pool scheduling according to claim 1, characterized in that, Before activating the mutex lock of the target camera, the following steps are also included: Acquire the mutex lock of the target camera, check whether the mutex lock is active, if active, add the patrol point task to the waiting queue of the corresponding thread, wait for the mutex lock of the target camera to be released, and execute the patrol point tasks in the waiting queue in sequence.

6. The substation inspection task scheduling method based on multi-threaded pool scheduling according to claim 1, characterized in that, The final inspection results are obtained based on the execution results of all inspection point tasks. The images of the inspection results are classified and stored based on the inspection task number, the inspection point task number, and the timestamp.

7. The substation inspection task scheduling method based on multi-threaded pool scheduling according to claim 1, characterized in that, The number of threads in the thread pool is configured using a dynamic constraint strategy. The maximum concurrency of the thread pool is min(system hardware concurrency capability, preset configuration limit), where min() represents the minimum value function.

8. A substation inspection task scheduling system based on multi-threaded pool scheduling, characterized in that, include: The task generation module is used to generate inspection tasks based on the inspection requirements of the target substation. The point analysis module is used to determine several inspection points based on the location of the target camera and the location information of the area to be inspected. The inspection task is then split into multiple inspection point tasks based on the inspection points. The thread pool module is used to build thread pools and uniformly schedule patrol point tasks; The task execution module is used to control the execution of patrol point tasks in each thread according to the scheduling strategy of the thread pool module. The camera module is used to control the camera to move to a preset position and take pictures according to the execution control instructions of the task execution module, and output the task results of the inspection point; The results management module is used to summarize the results of the inspection points to obtain the final inspection results and store the inspection results.