Cruise control method, device and electronic equipment for pan-tilt camera

By acquiring the time consumption characteristics of the preset position of the PTZ camera, the cruise path with the shortest time is planned, which solves the problems of low cruise efficiency and uneven motor wear of the PTZ camera, and achieves efficient cruise and extended motor life.

CN116668841BActive Publication Date: 2026-07-31ZHEJIANG UNIVIEW TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ZHEJIANG UNIVIEW TECH CO LTD
Filing Date
2023-05-15
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing PTZ cameras have low cruise efficiency, and the uncoordinated movement of the horizontal and vertical motors leads to uneven motor wear, affecting the lifespan of the equipment.

Method used

By acquiring the time consumption characteristics of the preset position of the PTZ camera, the cruise path with the minimum time consumption is planned. Taking into account the operation of the horizontal and vertical motors, the path is optimized using greedy and heuristic algorithms to improve cruise efficiency and extend motor life.

Benefits of technology

This minimizes the time spent on the pan-tilt camera's navigation path, improves navigation efficiency, balances the lifespan of the horizontal and vertical motors, and extends the overall lifespan of the equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116668841B_ABST
    Figure CN116668841B_ABST
Patent Text Reader

Abstract

This invention provides a cruise control method, device, and electronic device for a PTZ camera, relating to the field of surveillance technology. The method includes: acquiring preset positions of the PTZ camera; determining a first time consumption (STDC) value for the horizontal PTZ motor of the PTZ camera to move from a first preset position to a second preset position within a cruise cycle, and a second STDC value for the vertical PTZ motor of the PTZ camera to move from the first preset position to the second preset position; planning a cruise path based on the first and second STDC values, with the goal of minimizing the time required to complete the cruise cycle, to obtain a target cruise path; and controlling the PTZ operation of the PTZ camera based on the target cruise path. The technical solution provided by this invention can improve the cruise capture efficiency of the PTZ camera while also considering the overall lifespan of the PTZ.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surveillance technology, and in particular to a cruise control method, device, and electronic device for a PTZ camera. Background Technology

[0002] A PTZ camera is a camera equipped with a pan / tilt / zoom (PTZ) mechanism. By rotating the PTZ, the camera's monitoring angle can be adjusted, enabling monitoring over a wider area. Preset position navigation is a crucial function of PTZ cameras. It allows the PTZ to be controlled to rotate the camera to a preset monitoring point for snapshot capture, completing the navigation monitoring. The preset position navigation of a PTZ camera traverses each preset position only once within a single navigation cycle, eventually returning to the starting preset position. In real-world monitoring scenarios, a large number of preset positions can lead to very long navigation cycles. Therefore, planning the preset position navigation path is crucial for improving the efficiency of navigation monitoring.

[0003] In related technologies, a cruise path can be formed based on the numbering sequence of preset positions configured by the user to control the rotation of the gimbal. For example, Figure 1 The diagram illustrates the principle of forming a cruise path based on the preset position numbering sequence. The pan-tilt unit can operate according to the preset position numbering sequence A to G to complete the cruise capture. However, in this method, the pan-tilt camera moves a large range, the movement path to complete one cruise cycle is long, and the cruise efficiency is low.

[0004] Meanwhile, since the horizontal and vertical motors of the gimbal are two different motors, the horizontal and vertical movements are actually performed separately during the process of moving from one preset position to another. This may result in the possibility that after the movement in one direction is completed, the motor in the other direction is still moving. Therefore, various algorithms based on traditional motion methods (vehicles, drones) cannot be directly applied to preset position planning. Summary of the Invention

[0005] This invention provides a cruise control method, device, and electronic device for a PTZ camera, which solves the problem of low cruise efficiency of PTZ cameras in the prior art.

[0006] This invention provides a cruise control method for a PTZ camera, comprising:

[0007] Obtain the preset position of the PTZ camera;

[0008] Within a cruise cycle, a first time consumption is defined for the horizontal gimbal motor of the gimbal camera to move from the first preset position to the second preset position between two adjacent preset positions, and a second time consumption is defined for the vertical gimbal motor of the gimbal camera to move from the first preset position to the second preset position.

[0009] With the goal of minimizing the time required to complete the cruise cycle, cruise path planning is performed based on the first time consumption characteristic and the second time consumption characteristic to obtain the target cruise path;

[0010] The gimbal of the PTZ camera is controlled based on the target cruise path.

[0011] According to the present invention, a cruise control method for a PTZ camera, wherein the goal is to minimize the time required to complete the cruise cycle, cruise path planning is performed based on a first time consumption parameter and a second time consumption parameter to obtain a target cruise path, comprising:

[0012] Based on the preset position, at least one first initial cruise path corresponding to the cruise cycle is determined;

[0013] For each of the first initial cruise paths, a target time consumption value is determined based on the first time consumption value and the second time consumption value corresponding to the first initial cruise path;

[0014] Based on the target time consumption characteristics corresponding to each of the first initial cruise paths, the first initial cruise path with the minimum time to complete the cruise cycle among the at least one first initial cruise path is determined, and the target cruise path is obtained.

[0015] According to a cruise control method for a PTZ camera provided by the present invention, the step of determining a target time consumption value based on the first time consumption value and the second time consumption value corresponding to the first initial cruise path includes:

[0016] The maximum time consumption value among the first time consumption value and the second time consumption value corresponding to the first initial cruise path is determined as the target time consumption value;

[0017] The step of determining the first initial cruise path with the shortest completion time among the at least one first initial cruise path to obtain the target cruise path, based on the target time characteristics corresponding to each of the first initial cruise paths, includes:

[0018] For each of the first initial cruise paths, the total target time is determined based on the target time characteristics corresponding to each of the first initial cruise paths;

[0019] The first initial cruise path corresponding to the minimum total time of each target is determined as the target cruise path.

[0020] According to a cruise control method for a PTZ camera provided by the present invention, the step of determining a target time consumption value based on the first time consumption value and the second time consumption value corresponding to the first initial cruise path includes:

[0021] The absolute value of the difference between the first time consumption characteristic and the second time consumption characteristic corresponding to the first initial cruise path is determined as the target time consumption characteristic.

[0022] The step of determining the first initial cruise path with the shortest completion time among the at least one first initial cruise path to obtain the target cruise path, based on the target time characteristics corresponding to each of the first initial cruise paths, includes:

[0023] For each of the first initial cruise paths, the sum of the target time representation quantities corresponding to the first initial cruise path is determined to obtain the target value;

[0024] Based on the first time consumption characteristic, the second time consumption characteristic, and the target value corresponding to each first initial cruise path, the first initial cruise path with the shortest time to complete the cruise cycle among the at least one first initial cruise path is determined, and the target cruise path is obtained.

[0025] According to a cruise control method for a PTZ camera provided by the present invention, the step of determining the first initial cruise path with the shortest time to complete the cruise cycle among the at least one first initial cruise path, based on the first time consumption characteristic, the second time consumption characteristic, and the target value corresponding to each first initial cruise path, and obtaining the target cruise path, includes:

[0026] For each first initial cruise path, determine the maximum cumulative value among the first cumulative value of each first time consumption indicator and the second cumulative value of each second time consumption indicator corresponding to the first initial cruise path;

[0027] The target cruise path is determined with the goal of minimizing the target value and the maximum cumulative value; wherein, minimizing the target value and the maximum cumulative value indicates that the cruise cycle takes the least amount of time.

[0028] According to the present invention, a cruise control method for a PTZ camera, wherein the goal is to minimize the time required to complete the cruise cycle, cruise path planning is performed based on a first time consumption parameter and a second time consumption parameter to obtain a target cruise path, comprising:

[0029] Obtain the second initial cruise path corresponding to the cruise cycle;

[0030] With the goal of minimizing the time taken to complete the cruise cycle, the target cruise path is obtained by iteratively updating the second initial cruise path using a heuristic algorithm based on the first time consumption characteristic and the second time consumption characteristic corresponding to the second initial cruise path.

[0031] The method of controlling the gimbal operation of the PTZ camera based on the target cruise path includes:

[0032] While the iterative update of the second initial cruise path is not yet complete, the gimbal operation of the PTZ camera is controlled based on the target cruise path obtained during the iterative update process.

[0033] According to a cruise control method for a PTZ camera provided by the present invention, when the operating speeds of the horizontal PTZ motor and the vertical PTZ motor are the same, the first time consumption quantity includes the first path distance of the horizontal PTZ motor from the first preset position to the second preset position, and the second time consumption quantity includes the second path distance of the vertical PTZ motor from the first preset position to the second preset position.

[0034] When the horizontal gimbal motor and the vertical gimbal motor operate at different speeds, the first time consumption quantity includes the first time consumed by the horizontal gimbal motor to move from the first preset position to the second preset position, and the second time consumption quantity includes the second time consumed by the vertical gimbal motor to move from the first preset position to the second preset position.

[0035] The present invention also provides a cruise control device for a PTZ camera, comprising:

[0036] The acquisition module is used to acquire the preset position of the PTZ camera;

[0037] The determination module is used to determine the first time consumption of the horizontal gimbal motor of the gimbal camera moving from the first preset position to the second preset position between two adjacent preset positions within a cruise cycle, and the second time consumption of the vertical gimbal motor of the gimbal camera moving from the first preset position to the second preset position.

[0038] The planning module is used to plan the cruise path based on the first time consumption and the second time consumption, with the goal of minimizing the time required to complete the cruise cycle, and to obtain the target cruise path.

[0039] The control module is used to control the operation of the PTZ camera based on the target cruise path.

[0040] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the cruise control method of any of the above-described pan-tilt cameras.

[0041] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the cruise control method for a PTZ camera as described above.

[0042] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the cruise control method of any of the above-described pan-tilt cameras.

[0043] The present invention provides a cruise control method, apparatus, and electronic device for a PTZ camera. By determining a first time consumption (STDC) measure for the horizontal PTZ motor to move from one preset position to the second preset position within a cruise cycle, and a second STDC measure for the vertical PTZ motor to move from the first preset position to the second preset position, the method aims to minimize the time required to complete the cruise cycle. Based on the first and second STDC measures, a cruise path is planned to obtain a target cruise path. Then, the PTZ operation is controlled based on this target cruise path. This allows the PTZ camera to traverse all preset positions and determine the cruise path with the shortest time within a cruise cycle. This enables the PTZ camera to move along a shorter path, effectively improving the cruise efficiency. Furthermore, the determination of the shortest cruise path comprehensively considers the operating time of both the horizontal and vertical PTZ motors, thus improving the cruise efficiency while also considering the lifespan of both motors. Attached Figure Description

[0044] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0045] Figure 1 This is a schematic diagram illustrating the principle of forming a cruise path based on the numbering order of configured preset bits in existing technology;

[0046] Figure 2 This is a flowchart illustrating the cruise control method for a PTZ camera provided in an embodiment of the present invention.

[0047] Figure 3This is one of the flowcharts illustrating the method for determining a target cruising path in an embodiment of the present invention;

[0048] Figure 4 This is a second flowchart illustrating the method for determining a target cruising path in an embodiment of the present invention;

[0049] Figure 5 This is a schematic diagram of the cruise control device for a PTZ camera provided in an embodiment of the present invention;

[0050] Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0052] It should be noted that the serial numbers assigned to the objects described in this invention, such as "first" and "second", are only used to distinguish the objects being described and do not have any sequential or technical meaning.

[0053] Preset positions are the pre-defined monitoring locations for PTZ cameras. They are associated configurations where the PTZ camera records these preset positions, allowing it to quickly rotate to the corresponding monitoring location. Preset position navigation is a crucial function of PTZ cameras. Preset positions can be pre-configured and quickly invoked during use to complete the inspection work of monitoring applications. It can replace manual, timed invocation of preset positions for inspection and monitoring. By controlling the PTZ camera to rotate to the preset position to capture images, and then rotating to the next preset position, it achieves preset position navigation and image capture.

[0054] In practical applications, PTZ cameras are configured with a large number of preset positions. For example, in substation monitoring scenarios, PTZ cameras can be configured with hundreds or even thousands of preset positions to monitor the detailed location of each substation device. A single patrol cycle requires traversing all preset positions, and this large number of preset positions results in a very long patrol cycle time. For instance, assuming it takes 5 seconds for the PTZ to rotate to a preset position to focus and capture an image, then completing a patrol cycle of 1000 preset positions would take 5000 seconds. This means that a single preset position polling cycle takes 5000 seconds, and images of the monitored object cannot be acquired in a timely manner. Therefore, planning the preset position patrol path is crucial for improving the efficiency of patrol monitoring.

[0055] In related technologies, such as Figure 1 As shown, the pan-tilt camera can be used to perform cruise capture by forming a cruise path according to the user-configured preset position numbers A to G. Each preset position is represented by coordinates formed by the horizontal and vertical pan-tilt motors of the pan-tilt camera, and the center of the camera's image moves according to the coordinates of the preset position. Figure 1 It is evident that when the PTZ cameras move in numerical order A to G, the camera swing amplitude is large, the movement distance within one cruise cycle is long, the time interval for capturing images at the same position is long, and the cruise efficiency is low.

[0056] Furthermore, since the pan-tilt camera's rotation is achieved by using horizontal and vertical pan-tilt motors to drive belts and monitor azimuth changes, frequent scheduling and patrolling will accelerate the wear of the motor belts or gears. The pan-tilt camera's preset position patrolling traverses each preset position only once per patrol cycle, eventually returning to the initial preset position. This satisfies the conditions of the Traveling Salesman Problem (TSP), allowing the preset positions to be converted into nodes of the TSP. The minimum time-consuming path can be calculated by traversing the preset positions. However, the calculated minimum time-consuming path may show that the travel distance of the pan-tilt motor in one direction is much longer than that in another direction within a patrol cycle. For example, the travel distance of the horizontal pan-tilt motor may be much longer than that of the vertical pan-tilt motor. This can lead to premature damage to the pan-tilt motor in one direction when the pan-tilt camera repeatedly performs the same preset position patrolling, as the wear and tear on the pan-tilt motor in that direction may be significantly greater than that in another direction.

[0057] Based on this, embodiments of the present invention provide a cruise control method for a PTZ camera, aiming to minimize the time required to complete a cruise cycle. The method plans the cruise path of the PTZ camera based on the time taken for the horizontal and vertical PTZ motors of the PTZ camera to move from the first preset position to the second preset position of two adjacent preset positions. When the PTZ camera performs cruise capture according to the planned cruise path, the efficiency of cruise capture can be improved, while also taking into account the service life of the horizontal and vertical PTZ motors.

[0058] The following is combined Figures 2-4 The cruise control method for a PTZ camera of the present invention is described. This cruise control method for a PTZ camera can be applied to electronic devices such as PTZ cameras, terminal devices, or servers. The terminal device may include mobile phones, computers, tablets, wearable devices, etc.; the server may include a standalone server, a cluster server, or a cloud server, etc. This cruise control method for a PTZ camera can also be applied to a cruise control device for a PTZ camera installed in electronic devices such as PTZ cameras, terminal devices, or servers. This cruise control device for a PTZ camera can be implemented through software, hardware, or a combination of both.

[0059] Figure 2 An exemplary flowchart of the cruise control method for a PTZ camera provided in an embodiment of the present invention is shown below. Figure 2 As shown, the cruise control method of the PTZ camera may include the following steps 210 to 240.

[0060] Step 210: Obtain the preset position of the PTZ camera.

[0061] Before conducting preset position patrol and capture, users can configure the preset positions to be monitored, completing the patrol configuration. Electronic devices can obtain the preset positions of the PTZ camera based on the user's patrol configuration. The PTZ camera can be a PTZ camera using a wide-angle fixed-focus lens, or it can be a network camera (IPC) mounted on a PTZ unit.

[0062] For example, the electronic device can determine the coordinates of each configured preset position based on the user's cruise configuration operation and store the coordinates in a cache queue. Alternatively, the electronic device can determine the coordinates of each configured preset position based on the user's cruise configuration operation, analyze the coordinate offset generated by the intersection of each pair of preset position coordinates, store the coordinate offset in a cache queue, and use the coordinate offset to determine each preset position.

[0063] Step 220: Determine the first time taken for the horizontal gimbal motor of the gimbal camera to move from the first preset position to the second preset position within a cruise cycle, and the second time taken for the vertical gimbal motor of the gimbal camera to move from the first preset position to the second preset position.

[0064] A pan-tilt camera can include a horizontal pan-tilt motor and a vertical pan-tilt motor. The horizontal pan-tilt motor drives the camera to rotate horizontally, and the vertical pan-tilt motor drives the camera to rotate vertically. By using the horizontal and vertical pan-tilt motors to drive a belt, the camera's monitoring position can be changed.

[0065] A cruise cycle will traverse all the preset positions configured for the PTZ camera. For any two preset positions, the PTZ needs to rotate from one preset position to another, requiring the horizontal PTZ motor and the vertical PTZ motor to operate in both the horizontal and vertical directions, forming their respective corresponding time consumption parameters.

[0066] For example, the preset positions configured for the PTZ camera can be stored in the cache queue of the memory. The electronic device can read the preset positions from the cache queue. For two adjacent preset positions, a first time consumption value is determined for the horizontal PTZ motor to move from the first preset position to the second preset position, and a second time consumption value is determined for the vertical PTZ motor to move from the first preset position to the second preset position. The determinations are traversed sequentially, and the cruise path is planned based on the determined first and second time consumption values.

[0067] The first time consumption parameter can be used to characterize the time taken for the horizontal gimbal motor to move from the first preset position to the second preset position, and the second time consumption parameter can be used to characterize the time taken for the vertical gimbal motor to move from the first preset position to the second preset position. For example, when the horizontal and vertical gimbal motors operate at the same speed, the first time consumption parameter can be the first path distance of the horizontal gimbal motor moving from the first preset position to the second preset position, and the second time consumption parameter can be the second path distance of the vertical gimbal motor moving from the first preset position to the second preset position. When the horizontal and vertical gimbal motors operate at different speeds, the first time consumption parameter can be the first time taken for the horizontal gimbal motor to move from the first preset position to the second preset position, and the second time consumption parameter can be the second time taken for the vertical gimbal motor to move from the first preset position to the second preset position.

[0068] Step 230: With the goal of minimizing the time taken to complete the cruise cycle, cruise path planning is performed based on the first and second time-consuming metrics to obtain the target cruise path.

[0069] For example, the electronic device can generate all possible cruise paths based on the preset positions configured in the PTZ camera. For each cruise path, the total time of the cruise path can be determined based on the first and second time consumption values ​​corresponding to each of the two adjacent preset positions in the cruise path. Then, the cruise path with the minimum total time among all cruise paths is determined as the target cruise path.

[0070] For example, the electronic device can use a greedy algorithm based on preset positions configured by the PTZ camera. Starting from the initial preset position, it repeatedly seeks the nearest preset position with the smallest target time representation value to jump to, without jumping to preset positions already passed, until it jumps to the last preset position. The path formed by the jumps is determined as the target cruise path. The target time representation value can be the absolute value of the difference between the first and second time representation values, or the maximum time representation value between the first and second time representation values.

[0071] For example, an electronic device can randomly generate at least one initial cruise path based on a preset position configured in the PTZ camera, with the goal of minimizing the time required to complete a cruise cycle. Based on a first and second time consumption characteristic corresponding to each initial cruise path, a heuristic algorithm is used to iteratively update the initial cruise paths to obtain the target cruise path. The heuristic algorithm can include genetic algorithms, ant colony algorithms, or LK algorithms, etc.

[0072] For example, minimizing the time required to complete a cruise cycle may include minimizing the difference in time between the horizontal gimbal motor and the vertical gimbal motor, and minimizing the time required to complete a cruise cycle.

[0073] Step 240: Control the operation of the PTZ camera based on the target cruise path.

[0074] After obtaining the target cruise path, the operation of the horizontal and vertical gimbal motors of the gimbal camera can be controlled based on the sequence of each preset position in the target cruise path, so as to control the gimbal rotation of the gimbal camera and complete the preset position cruise capture for each cruise cycle.

[0075] The pan-tilt camera cruise control method provided in this invention determines a first time consumption for the horizontal pan-tilt motor to move from a first preset position to a second preset position within a cruise cycle, and a second time consumption for the vertical pan-tilt motor to move from the first preset position to the second preset position. With the goal of minimizing the time consumed to complete the cruise cycle, a cruise path is planned based on the first and second time consumption values ​​to obtain a target cruise path. Then, the pan-tilt operation of the camera is controlled based on the target cruise path. This method can traverse the preset positions of the pan-tilt camera to determine the cruise path with the shortest time within a cruise cycle, thereby controlling the pan-tilt to move along a shorter path and effectively improving the cruise efficiency of the pan-tilt camera. Furthermore, in determining the cruise path with the shortest time, the operating time of both the horizontal and vertical pan-tilt motors is comprehensively considered, which can improve the cruise efficiency of the pan-tilt camera while also considering the service life of the horizontal and vertical pan-tilt motors.

[0076] based on Figure 1 In one example embodiment, the cruise control method for a PTZ camera corresponding to a cruise cycle can select the path with the shortest travel time from at least one cruise path corresponding to a cruise cycle as the target cruise path. Specifically, Figure 3 An exemplary flowchart of a method for determining a target cruising path according to an embodiment of the present invention is shown below. Figure 3As shown, with the goal of minimizing the time required to complete the cruise cycle, cruise path planning is performed based on the first and second time consumption metrics to obtain the target cruise path, which may include the following steps 310 to 330.

[0077] Step 310: Based on the configured preset positions, determine at least one first initial cruise path corresponding to a cruise cycle.

[0078] A cruise cycle traverses all preset positions configured on the PTZ camera. The electronic equipment can traverse these preset positions to generate all possible cruise paths and obtain at least one first initial cruise path. Each first initial cruise path represents a traversal order of all preset positions.

[0079] Step 320: For each first initial cruise path, determine the target time consumption quantity based on the first time consumption quantity and the second time consumption quantity corresponding to the first initial cruise path.

[0080] Assuming there are n (n is an integer greater than 1) preset positions, then at most (n-1)! first initial cruise paths can be determined. For each first initial cruise path, as the gimbal traverses the preset positions along that path, rotating from the current first preset position to the adjacent second preset position, the corresponding first and second time consumption metrics can be determined. Based on these first and second time consumption metrics, the target time consumption metrics can be determined. It can be understood that for each first initial cruise path, (n-1) target time consumption metrics can be determined.

[0081] For example, for each first initial cruise path, the maximum time-consuming characteristic between the first and second time-consuming characteristics can be determined as the target time-consuming characteristic. Alternatively, the absolute value of the difference between the first and second time-consuming characteristics can be determined as the target time-consuming characteristic.

[0082] Specifically, when the horizontal and vertical gimbal motors operate at the same speed, the first time consumption metric can be the first path distance of the horizontal gimbal motor from the first preset position to the second preset position, and the second time consumption metric can be the second path distance of the vertical gimbal motor from the first preset position to the second preset position. Correspondingly, the target time consumption metric is the maximum path distance between the first and second path distances, or the absolute value of the difference between the first and second path distances. The maximum path distance characterizes the time it takes for the gimbal to complete the rotation from the first preset position to the second preset position.

[0083] When the horizontal and vertical gimbal motors operate at different speeds, the first time consumption can be the first time it takes for the horizontal gimbal motor to move from the first preset position to the second preset position, and the second time consumption can be the second time it takes for the vertical gimbal motor to move from the first preset position to the second preset position. Correspondingly, the target time consumption can be the maximum of the first and second times, or the absolute value of the difference between the first and second times.

[0084] Specifically, the first time taken for the horizontal gimbal motor to move from the first preset position to the second preset position can be determined based on the operating speed of the horizontal gimbal motor and the first path distance of the horizontal gimbal motor moving from the first preset position to the second preset position. Similarly, the second time taken for the vertical gimbal motor to move from the first preset position to the second preset position can be determined based on the operating speed of the vertical gimbal motor and the second path distance of the vertical gimbal motor moving from the first preset position to the second preset position.

[0085] Step 330: Based on the target time consumption characteristics corresponding to each first initial cruise path, determine the first initial cruise path with the minimum time to complete the cruise cycle among at least one first initial cruise path, and obtain the target cruise path.

[0086] For example, when the target time consumption is the largest of the first and second time consumption, for each first initial cruise path, the target total time corresponding to the first initial cruise path can be determined based on the target time consumption corresponding to each target time consumption. Then, the first initial cruise path corresponding to the smallest target total time among the target total times is determined as the target cruise path.

[0087] Thus, for each candidate initial cruise path, by summing the maximum time consumption of the gimbal motors in both directions when the gimbal rotates to a preset position, the total time for completing the cruise for each initial cruise path can be determined. The cruise path with the minimum total time can then be selected as the target cruise path. When the gimbal camera uses the target cruise path for capture, optimal cruise efficiency can be achieved. For the horizontal and vertical gimbal motors, since the maximum time consumption is selected during the optimal path determination process, the selection of the minimum total time ensures that the time consumption of the motor with the maximum time consumption is closer to that of the other. This minimizes the difference in time consumption between the two motors when completing a round of capture, effectively avoiding a situation where the wear and tear of the gimbal motor in one direction is much greater than that in the other direction, thereby improving the overall lifespan of the gimbal camera.

[0088] For example, when the target time consumption is the absolute value of the difference between the first time consumption and the second time consumption, for each first initial cruise path, the sum of the target time consumption corresponding to the first initial cruise path can be determined to obtain the target value; then, based on the first time consumption, the second time consumption, and the target value corresponding to each first initial cruise path, the first initial cruise path with the minimum time to complete the cruise cycle among at least one first initial cruise path can be determined to obtain the target cruise path.

[0089] For each initial cruise path, the target value represents the difference in time consumption between the horizontal and vertical gimbal motors when completing one round of cruise capture along that initial cruise path. Thus, when determining the target cruise path based on the first and second time consumption metrics and the target value corresponding to each initial cruise path, the difference in time consumption between the horizontal and vertical gimbal motors is considered, improving the cruise efficiency of the gimbal camera while also taking into account the overall lifespan of the gimbal camera.

[0090] Specifically, based on the first time consumption characteristic, the second time consumption characteristic, and the target value corresponding to each first initial cruise path, the first initial cruise path with the minimum time to complete the cruise cycle is determined among at least one first initial cruise path, and the target cruise path is obtained. This may include: for each first initial cruise path, determining the maximum cumulative value among the first cumulative value of each first time consumption characteristic and the second cumulative value of each second time consumption characteristic corresponding to the first initial cruise path; determining the target cruise path with the minimum target value and the minimum maximum cumulative value as the objective; wherein, the minimum target value and the minimum maximum cumulative value represent the minimum time consumption of the cruise cycle.

[0091] based on Figure 3 The corresponding embodiment of the pan-tilt camera's cruise control method, taking an example of n preset positions in one cruise cycle, where the coordinates of each preset position can be denoted as P. i (x i y i The distance between two adjacent preset positions in the cruise path is denoted as S. i (px i py i The path length of the cruise path is denoted as σ, which represents the time taken to complete the cruise path. Here, i is a positive integer representing the i-th preset bit; px i This represents the path distance of the horizontal gimbal motor from the (i-1)th preset position to the ith preset position; py i This represents the path distance of the vertical gimbal motor from the (i-1)th preset position to the ith preset position. The movement from the (i-1)th preset position to the ith preset position is also described above as moving from the first preset position to the second preset position.

[0092] When the horizontal and vertical gimbal motors operate at the same speed, the maximum time taken for the gimbal to rotate from the (i-1)th preset position to the ith preset position is determined by the path distance with the largest distance between the two gimbal motors. Therefore, in a cruise cycle, the cruise path with the smallest sum of the maximum path distances between the horizontal and vertical gimbal motors controlled by each preset position is the optimal cruise path for the gimbal camera. The fastest speed is achieved by completing one cruise cycle according to this optimal cruise path.

[0093] Specifically, the path length σ1 of all feasible cruise paths formed by n preset positions can be determined according to the following formula (1), and the cruise path with the smallest path length is determined as the optimal target cruise path, that is, the cruise path with the shortest time.

[0094]

[0095] Among them, px i >py i ? px i :py i This means taking the pixel value. i and py i The maximum value in the range is used as the target time consumption indicator.

[0096] Based on formula (1), the path length σ1 can be determined by converting it into the absolute value of the path distance difference |px| between the horizontal gimbal motor and the vertical gimbal motor rotating from the (i-1)th preset position to the ith preset position in the cruise path. i -py i The sum of σ2 and σ2, and the maximum value δ1 of the sum of the path distances of the horizontal gimbal motors and the vertical gimbal motors to complete the cruise path, where σ2 is the determined target value. Specifically, it can be expressed as the following formulas (2) and (3):

[0097]

[0098]

[0099] Wherein, formula (3) represents taking and The maximum value in.

[0100] Based on formulas (2) and (3), the cruise path with the minimum σ2 and δ1 among all feasible cruise paths can be determined as the target cruise path, thus obtaining the optimal cruise path, which is also the cruise path with the minimum time to complete a cruise cycle. Among them, minimizing σ2 can minimize the difference in losses between the horizontal and vertical gimbal motors, thereby improving cruise efficiency and extending the overall lifespan of the gimbal camera.

[0101] When the horizontal and vertical gimbal motors operate at different speeds, the first time taken by the horizontal gimbal motor to rotate from the (i-1)th preset position to the ith preset position can be defined as: The second time consumed by the vertical gimbal motor is Among them, K x K represents the operating speed of the horizontal gimbal motor. y Let be the operating speed of the vertical gimbal motor. Then, the path length σ1 for determining the cruise path can be converted to the following formula (4):

[0102]

[0103] Based on formula (4), determining the path length σ1 can be converted into determining the absolute value of the time difference between the horizontal gimbal motor and the vertical gimbal motor rotating from the (i-1)th preset position to the ith preset position in the cruise path. The sum of σ3 and σ2, and the maximum value of the total time taken by the horizontal gimbal motor and the total time taken by the vertical gimbal motor to complete the cruise path, where σ3 is the determined target value. Specifically, it can be expressed as the following formulas (5) and (6):

[0104]

[0105]

[0106] Wherein, formula (6) represents taking and The maximum value in.

[0107] Based on formulas (5) and (6), the cruise path with the minimum σ3 and δ2 can be determined as the target cruise path from all feasible cruise paths, thus obtaining the optimal cruise path, which is the cruise path with the minimum time to complete a cruise cycle. Among them, minimizing σ3 can minimize the difference in losses between the horizontal and vertical gimbal motors, thereby improving cruise efficiency and extending the overall lifespan of the gimbal camera.

[0108] based on Figure 1In one example embodiment of the cruise control method for the PTZ camera corresponding to the embodiment, a greedy algorithm can be used based on the preset position configured for the PTZ camera, starting from the initial preset position, to search for (|px) each time. i -py i |) Jump to the smallest nearest preset bit, when |px exists i -py i When there are multiple equal, skippable preset bits, θ can be selected from these preset bits. i The smallest preset position is skipped, and preset positions that have already been passed are not skipped again, until the last preset position is reached. The path formed by the skips can be used as the target's cruising path. Where θ i The maximum path distance between the horizontal gimbal motor and the vertical gimbal motor when they move from the current preset position to the i-th preset position can be expressed as the following formula (7).

[0109] θ i =px i >py i ? px i :py i (7)

[0110] based on Figure 1 In one example embodiment, the cruise control method for a PTZ camera, based on a preset position configured in the PTZ camera, can randomly generate at least one initial cruise path. With the goal of minimizing the time required to complete the cruise cycle, a heuristic algorithm is used to iteratively update this initial cruise path to obtain the target cruise path. Specifically, Figure 4 This is an exemplary flowchart of a method for determining a target cruising path according to an embodiment of the present invention, with reference to... Figure 4 As shown, with the goal of minimizing the time required to complete the cruise cycle, cruise path planning is performed based on the first and second time consumption metrics to obtain the target cruise path, which may include the following steps 410 to 420.

[0111] Step 410: Obtain the second initial cruise path corresponding to the cruise cycle.

[0112] Suppose that a cruise cycle will traverse n preset positions. At least one second initial cruise path can be randomly generated based on these n preset positions. Each second initial cruise path represents a feasible traversal order of the n preset positions.

[0113] Step 420: With the goal of minimizing the time taken to complete the cruise cycle, the second initial cruise path is iteratively updated using a heuristic algorithm based on the first and second time consumption characteristics corresponding to the second initial cruise path to obtain the target cruise path.

[0114] The navigation path planning of a PTZ camera can be viewed as a symmetric TSP (Tracking Strategy Problem), which is a non-deterministic polynomial hard (NP-hard) problem. NP-hard means that all NP problems can be generalized within polynomial time complexity. Heuristic algorithms can be used to solve such problems by iteratively improving and optimizing the initial random solution to obtain the optimal solution. These heuristic algorithms can include genetic algorithms, ant colony optimization, or the LK algorithm, among others.

[0115] Taking the LK algorithm as an example, the core of the LK algorithm is the variable λ-opt algorithm, where λ represents the number of segments. This algorithm changes the value of λ during execution, and the value of λ needs to be determined in each iteration. The algorithm starts with λ = 2 and increases the value; the larger the value, the greater the probability of obtaining the optimal solution. Generally, 2 to 4 is sufficient. The first run of the LK algorithm randomly generates a second initial cruise path. Assuming T is the current cruise path, each iteration attempts to find two sets of links X = (X1, X2, ..., X...) with the same number of links in T. k ) and Y = (Y1, Y2, ..., Y k ), where X and Y represent a unit path consisting of two preset bits. This unit path can be regarded as a set of sequences, and k represents the number of unit paths. When the sequence exchange judgment condition is passed, the X set links in T are replaced with the Y set links, and a better cruise path solution can be obtained. The exchange behavior of the two links is called a λ-opt change.

[0116] Based on this, the sequence swapping judgment condition can be defined as follows: That is, a swap occurs when G > 0, and a better solution is obtained through the swap. If G = 0, a solution can be obtained that satisfies... Exchanges also occur at times.

[0117] Among them, C(pX) i )=|px i -py i | represents the path distance px of the horizontal gimbal motor corresponding to the i-th group of cell path sequences in set X. i The path distance py between the vertical gimbal motor and the vertical gimbal motor i The absolute value of the difference; C(pYi) i )=|px i -py i | represents the path distance (px) of the horizontal gimbal motor corresponding to the path sequence of the i-th unit in set Y. i The path distance py between the vertical gimbal motor and the vertical gimbal motor i The absolute value of the difference; G represents the sum of the absolute values ​​of the path distance differences corresponding to set X minus the sum of the absolute values ​​of the path distance differences corresponding to set Y; D(pXi ) = px i >py i ? px i :py i , representing the px corresponding to the i-th group of cell path sequences in set X. i and py i The maximum value; similarly, D(pY) i ) represents the px corresponding to the path sequence of the i-th unit in set Y. i and py i The maximum value; E>0 means that when the sum of the maximum path distances of the path sequences of each unit corresponding to set X minus the sum of the maximum path distances of the path sequences of each unit corresponding to set Y is greater than 0, X i With Y i An exchange occurs.

[0118] Thus, after the λ-opt transformation, the optimal cruise path, i.e. the target cruise path, can be obtained.

[0119] based on Figure 4 In one example embodiment, controlling the gimbal operation of a PTZ camera based on a target cruise path, corresponding to the method of the corresponding embodiment, may include: controlling the gimbal operation of the PTZ camera based on the target cruise path obtained during the iterative update process while the iterative update of the second initial cruise path is not yet completed; and controlling the gimbal operation of the PTZ camera based on the target cruise path finally obtained during the iterative update after the iterative update is completed.

[0120] The cruise path optimization process based on heuristic algorithms is an iterative optimization process. This allows for the recording of the currently obtained optimal solution during the iterative optimization process. Each cruise cycle begins, and the cruise path is executed using the known optimal solution obtained from the current path optimization, until the final optimal solution is obtained. In subsequent cruise cycles, the PTZ camera will perform cruise capture based on the final optimal solution. This avoids the long waiting state of the PTZ camera after cruise initiation due to the time-consuming calculation of optimal cruise paths with multiple preset positions, enabling the PTZ camera to perform cruise capture immediately after initiation.

[0121] The pan-tilt camera cruise control method provided in this invention treats the pan-tilt camera cruise path planning as solving a symmetric TSP problem. In the process of traversing the cruise path or iteratively optimizing the cruise path, it can find the optimal cruise path with similar operating times for the horizontal and vertical pan-tilt motors and the shortest time to complete one round of cruise. Using this optimal cruise path to control the pan-tilt camera for cruise capture, it can achieve a fast preset position linkage capture effect that takes into account the pan-tilt life.

[0122] The pan-tilt camera cruise control method provided in this invention can plan the cruise path before each cruise cycle of the pan-tilt camera. After each reconfiguration of preset positions, the optimal cruise path can be replanned. Since calculating the optimal cruise path for multiple preset positions takes a long time, the currently calculated optimal cruise path can be used each time cruise is started, until the cruise path planning is completed and the final optimal cruise path is obtained. Then, the final optimal cruise path is used for cruise capture.

[0123] The pan-tilt camera cruise control method provided in this invention allows the algorithm for calculating the optimal cruise path to be run on computing units such as computers, thereby improving the calculation efficiency of the optimal cruise path.

[0124] The cruise control device for a PTZ camera provided by the present invention will be described below. The cruise control device for a PTZ camera described below can be referred to in correspondence with the cruise control method for a PTZ camera described above.

[0125] Figure 5 An exemplary schematic diagram of the cruise control device for a PTZ camera provided in an embodiment of the present invention is shown, with reference to... Figure 5 As shown, the cruise control device for a PTZ camera may include: an acquisition module 510 for acquiring preset positions of the PTZ camera; a determination module 520 for determining a first time consumption indicator of the horizontal PTZ motor of the PTZ camera moving from a first preset position to a second preset position between two adjacent preset positions within a cruise cycle, and a second time consumption indicator of the vertical PTZ motor of the PTZ camera moving from the first preset position to the second preset position; a planning module 530 for planning a cruise path based on the first and second time consumption indicators with the goal of minimizing the time required to complete the cruise cycle, thereby obtaining a target cruise path; and a control module 540 for controlling the PTZ operation of the PTZ camera based on the target cruise path.

[0126] In one example embodiment, the planning module 530 may include: a first determining unit, configured to determine at least one first initial cruise path corresponding to the cruise cycle based on a preset position; a second determining unit, configured to determine a target time consumption value for each first initial cruise path based on a first time consumption value and a second time consumption value corresponding to the first initial cruise path; and a third determining unit, configured to determine the first initial cruise path with the minimum time consumption to complete the cruise cycle among the at least one first initial cruise path based on each target time consumption value corresponding to each first initial cruise path, thereby obtaining a target cruise path.

[0127] In one example embodiment, the second determining unit is specifically configured to determine the maximum time consumption value among the first time consumption value and the second time consumption value corresponding to the first initial cruise path as the target time consumption value. The third determining unit is specifically configured to: for each first initial cruise path, determine the target total time consumption based on each target time consumption value corresponding to the first initial cruise path; and determine the first initial cruise path corresponding to the minimum target total time consumption value among the target total times as the target cruise path.

[0128] In one example embodiment, the second determining unit is specifically configured to determine the absolute value of the difference between the first time consumption characteristic and the second time consumption characteristic corresponding to the first initial cruise path as the target time consumption characteristic. The third determining unit is specifically configured to: for each first initial cruise path, determine the sum of each target time consumption characteristic corresponding to the first initial cruise path to obtain a target value; based on the first time consumption characteristic, the second time consumption characteristic, and the target value corresponding to each first initial cruise path, determine at least one first initial cruise path with the minimum time to complete the cruise cycle to obtain the target cruise path.

[0129] In one example embodiment, the third determining unit is specifically used to: for each first initial cruise path, determine the maximum cumulative value among the first cumulative value of each first time consumption representation quantity and the second cumulative value of each second time consumption representation quantity corresponding to the first initial cruise path; determine the target cruise path with the target value being the minimum and the maximum cumulative value being the minimum; wherein, the target value being the minimum and the maximum cumulative value being the minimum represents the minimum time consumption of the cruise cycle.

[0130] In one example embodiment, the planning module 530 may include an acquisition unit and an iterative update unit. The acquisition unit may be used to acquire a second initial cruise path corresponding to the cruise cycle; the iterative update unit may be used to iteratively update the second initial cruise path using a heuristic algorithm, with the goal of minimizing the time taken to complete the cruise cycle, based on a first time consumption indicator and a second time consumption indicator corresponding to the second initial cruise path, to obtain a target cruise path. Correspondingly, the control module 540 may be specifically used to control the pan-tilt camera's pan-tilt operation based on the target cruise path obtained during the iterative update process, while the iterative update of the second initial cruise path is not yet completed.

[0131] In one example embodiment, when the horizontal gimbal motor and the vertical gimbal motor operate at the same speed, the first time consumption quantity includes the first path distance of the horizontal gimbal motor from the first preset position to the second preset position, and the second time consumption quantity includes the second path distance of the vertical gimbal motor from the first preset position to the second preset position; when the horizontal gimbal motor and the vertical gimbal motor operate at different speeds, the first time consumption quantity includes the first time of the horizontal gimbal motor from the first preset position to the second preset position, and the second time consumption quantity includes the second time of the vertical gimbal motor from the first preset position to the second preset position.

[0132] Figure 6 An example is a schematic diagram of the structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute the pan-tilt camera cruise control method provided in the above-described method embodiments. This method may include, for example, obtaining the preset position of the pan-tilt camera; determining a first time consumption indicator for the horizontal pan-tilt motor of the pan-tilt camera to move from the first preset position to the second preset position between two adjacent preset positions within a cruise cycle, and a second time consumption indicator for the vertical pan-tilt motor of the pan-tilt camera to move from the first preset position to the second preset position; planning a cruise path based on the first and second time consumption indicators with the goal of minimizing the time required to complete the cruise cycle, to obtain a target cruise path; and controlling the pan-tilt operation of the pan-tilt camera based on the target cruise path.

[0133] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0134] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the pan-tilt camera cruise control method provided in the above-described method embodiments. This method may include, for example,: obtaining the preset position of the pan-tilt camera; determining a first time consumption indicator for the horizontal pan-tilt motor of the pan-tilt camera to move from a first preset position to a second preset position between two adjacent preset positions within a cruise cycle, and a second time consumption indicator for the vertical pan-tilt motor of the pan-tilt camera to move from the first preset position to the second preset position; planning a cruise path based on the first and second time consumption indicators with the goal of minimizing the time required to complete the cruise cycle, to obtain a target cruise path; and controlling the pan-tilt operation of the pan-tilt camera based on the target cruise path.

[0135] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the cruise control method for a PTZ camera provided in the above-described method embodiments. This method may include, for example,: obtaining preset positions of the PTZ camera; determining a first time consumption indicator for the horizontal PTZ motor of the PTZ camera to move from a first preset position to a second preset position between two adjacent preset positions within a cruise cycle, and a second time consumption indicator for the vertical PTZ motor of the PTZ camera to move from the first preset position to the second preset position; planning a cruise path based on the first and second time consumption indicators, with the goal of minimizing the time required to complete the cruise cycle, to obtain a target cruise path; and controlling the PTZ operation of the PTZ camera based on the target cruise path.

[0136] For example, computer-readable storage media include non-transitory computer-readable storage media.

[0137] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0138] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of cruise control for a pan-tilt camera, the method comprising: include: Obtain the preset position of the PTZ camera; Within a cruise cycle, a first time consumption is defined for the horizontal gimbal motor of the gimbal camera to move from the first preset position to the second preset position between two adjacent preset positions, and a second time consumption is defined for the vertical gimbal motor of the gimbal camera to move from the first preset position to the second preset position. With the goal of minimizing the time required to complete the cruise cycle, cruise path planning is performed based on the first time consumption characteristic and the second time consumption characteristic to obtain the target cruise path; The gimbal operation of the PTZ camera is controlled based on the target cruise path; The goal is to minimize the time required to complete the cruise cycle. Based on the first and second time consumption metrics, cruise path planning is performed to obtain the target cruise path, including: Based on the preset position, at least one first initial cruise path corresponding to the cruise cycle is determined; For each of the first initial cruise paths, a target time consumption value is determined based on the first time consumption value and the second time consumption value corresponding to the first initial cruise path; Based on the target time consumption characteristics corresponding to each of the first initial cruise paths, the first initial cruise path with the minimum time to complete the cruise cycle among the at least one first initial cruise path is determined, and the target cruise path is obtained. The step of determining the target time representation based on the first time representation and the second time representation corresponding to the first initial cruise path includes: The absolute value of the difference between the first time consumption characteristic and the second time consumption characteristic corresponding to the first initial cruise path is determined as the target time consumption characteristic. The step of determining the first initial cruise path with the shortest completion time among the at least one first initial cruise path to obtain the target cruise path, based on the target time characteristics corresponding to each of the first initial cruise paths, includes: For each of the first initial cruise paths, the sum of the target time representation quantities corresponding to the first initial cruise path is determined to obtain the target value; Based on the first time consumption characteristic, the second time consumption characteristic, and the target value corresponding to each first initial cruise path, the first initial cruise path with the shortest time to complete the cruise cycle among the at least one first initial cruise path is determined, and the target cruise path is obtained.

2. The method of claim 1, wherein, The step of determining the first initial cruise path with the shortest time to complete the cruise cycle among the at least one first initial cruise path, based on the first time consumption characteristic, the second time consumption characteristic, and the target value corresponding to each first initial cruise path, and obtaining the target cruise path, includes: For each first initial cruise path, determine the maximum cumulative value among the first cumulative value of each first time consumption indicator and the second cumulative value of each second time consumption indicator corresponding to the first initial cruise path; The target cruise path is determined with the goal of minimizing the target value and the maximum cumulative value; wherein, minimizing the target value and the maximum cumulative value indicates that the cruise cycle takes the least amount of time.

3. The method of claim 1 or 2, wherein, When the horizontal gimbal motor and the vertical gimbal motor operate at the same speed, the first time consumption quantity includes the first path distance of the horizontal gimbal motor from the first preset position to the second preset position, and the second time consumption quantity includes the second path distance of the vertical gimbal motor from the first preset position to the second preset position. When the horizontal gimbal motor and the vertical gimbal motor operate at different speeds, the first time consumption quantity includes the first time consumed by the horizontal gimbal motor to move from the first preset position to the second preset position, and the second time consumption quantity includes the second time consumed by the vertical gimbal motor to move from the first preset position to the second preset position.

4. A cruise control device for a pan-tilt camera, characterized by, include: The acquisition module is used to acquire the preset position of the PTZ camera; The determination module is used to determine the first time consumption of the horizontal gimbal motor of the gimbal camera moving from the first preset position to the second preset position between two adjacent preset positions within a cruise cycle, and the second time consumption of the vertical gimbal motor of the gimbal camera moving from the first preset position to the second preset position. The planning module is used to plan the cruise path based on the first time consumption and the second time consumption, with the goal of minimizing the time required to complete the cruise cycle, and to obtain the target cruise path. The control module is used to control the operation of the PTZ camera based on the target cruise path; The planning module specifically includes: a first determining unit, used to determine at least one first initial cruise path corresponding to the cruise cycle based on a preset position; a second determining unit, used to determine a target time consumption value for each first initial cruise path based on a first time consumption value and a second time consumption value corresponding to the first initial cruise path; and a third determining unit, used to determine the first initial cruise path with the minimum time consumption to complete the cruise cycle among at least one first initial cruise path based on each target time consumption value corresponding to each first initial cruise path, thereby obtaining the target cruise path. The second determining unit is specifically used to determine the absolute value of the difference between the first time consumption characteristic and the second time consumption characteristic corresponding to the first initial cruise path as the target time consumption characteristic; the third determining unit is specifically used to: for each first initial cruise path, determine the sum of each target time consumption characteristic corresponding to the first initial cruise path to obtain the target value; based on the first time consumption characteristic, the second time consumption characteristic and the target value corresponding to each first initial cruise path, determine at least one first initial cruise path with the minimum time to complete the cruise cycle to obtain the target cruise path.

5. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the cruise control method for the PTZ camera as described in any one of claims 1 to 3.

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