Video surveillance multi-angle cruise optimization method and system based on Redis

By adopting Redis-based multi-angle cruise optimization method in the video surveillance system, using Redis's atomic operation and distributed locking mechanism, the shortcomings in the video surveillance system in the prior art are solved, and a more efficient, reliable and flexible video surveillance effect is achieved.

CN119402626BActive Publication Date: 2025-03-28HANGZHOU ARTECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510000594.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-03-28
Estimated Expiration
2045-01-02

AI Technical Summary

Technical Problem

The existing video surveillance platform has significant shortcomings in reliability, accuracy and scalability, and cannot effectively adapt to dynamically changing monitoring scenarios, resulting in missing areas that need to be monitored or unnecessarily continuously monitoring unnecessary areas, affecting the reliability and accuracy of the system. At the same time, it is difficult to expand cruise services, limiting the scalability of the system.

Method used

The multi-angle cruise optimization method based on Redis is adopted, and the atomic operation characteristics, distributed locking mechanism and efficient data cache of Redis are used to ensure the uniqueness and accuracy of the cruise path, realize timed detection and update of the cruise path, support cache capacity expansion, and improve the reliability, accuracy and scalability of the system.

Benefits of technology

It significantly improves the reliability and accuracy of the video surveillance system, can respond to changes in monitoring scenarios in a timely manner, prevent repeated execution of cruise paths, enhances the scalability and flexibility of the system, adapts to the needs of complex monitoring environments, and provides more efficient, reliable and intelligent video surveillance solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402626B_ABST
    Figure CN119402626B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of video surveillance technology, and specifically relates to a video surveillance multi-angle cruise optimization method and system based on Redis. First, the cruise path is set and stored, the cruise service interacts with the database and Redis, the path is recorded and the expiration time is set, and the relevant parameters are initialized and the cruise operation is performed according to the path, including rotating preset points, monitoring the stay time and switching preset points, etc., and the expiration time is extended and the execution status is detected regularly to ensure stable operation. The present invention uses a distributed lock mechanism to prevent repeated execution, and improves scalability by relying on efficient data caching and distributed architecture, effectively overcomes the defects of the prior art, and significantly improves the reliability, accuracy and scalability of video surveillance multi-angle cruise. It can be widely used in urban security, industrial production, transportation hubs and many other scenes. Video surveillance needs promote the efficient application and development of video surveillance technology in complex environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of video surveillance, and in particular relates to a Redis-based video surveillance multi-angle cruise optimization method and system. Background Art

[0002] In many fields of modern society, video surveillance technology has become an indispensable and important component, and is widely used in scenarios such as urban security, industrial automation, and traffic control. It plays a vital role in ensuring public safety, improving production efficiency, and optimizing management decisions.

[0003] In the video surveillance platform, the ball camera is a popular type of camera. It has the ability to rotate in all directions and has high-definition imaging effects. It can effectively cover a wider range of monitoring areas and provide clear image details, so it is widely used in various complex monitoring environments. Among them, the preset point cruise function is one of the key means for the ball camera to achieve efficient monitoring. The basic principle is to use the platform to pre-set a series of specific positions on the camera as preset points, and at the same time determine the cruise order of these preset points and the stay time of each preset point, so as to build a complete cruise path. Subsequently, the cruise service accurately controls the camera to perform periodic cyclic monitoring between each preset point in a predetermined order and time according to the pre-set cruise path, so as to achieve continuous attention to multiple key areas or target scenes.

[0004] However, the actual application scenarios of video surveillance are complex and diverse. The camera is limited by its fixed installation angle, and the field of view that can be covered by a single perspective is very limited, which makes it difficult to meet the needs of comprehensive monitoring. In order to overcome this limitation and achieve effective monitoring of a wider area and more angles, it has become an inevitable choice to set a cruise path so that the camera can switch perspectives between different preset points. In the existing technical solutions, the realization of preset point cruise mainly follows the following process:

[0005] The system operator first conducts a detailed analysis of the specific scenes to be monitored based on the monitoring requirements, and then selects the appropriate location within the coverage of the camera to set the preset points. The selection of these preset points is usually based on the consideration of important elements such as key targets, channels, entrances and exits in the monitoring area to ensure that valuable information can be fully captured. After the preset points are selected, they are added to the cruise path one by one according to the predetermined monitoring logic and sequence. In this process, it is very important to set an appropriate dwell time for each preset point. The dwell time needs to be determined comprehensively based on factors such as the importance of the monitoring scene and the frequency of target activities. It directly determines the length of time the camera stays at each preset point for effective monitoring. After completing the above configuration, the cruise path containing key data such as the detailed information of the preset points (such as location, number, etc.), cruise sequence, and cruise time is completely saved in the database.

[0006] When the cruise service is started, it will actively connect to the database to query and obtain the pre-set cruise path and all preset point information related to it, including the precise rotation order and preset stay time of each preset point. Then, the cruise service will save the queried information locally for use in subsequent cruise operations. Finally, the cruise service strictly sends control instructions to the camera based on the cruise path information obtained, drives the camera to rotate to each preset point in turn, and monitors according to the set stay time, thereby realizing the entire cruise monitoring process.

[0007] Although existing technologies have met the basic needs of video surveillance services to a certain extent, with the continuous expansion of surveillance scenarios and increasingly stringent surveillance requirements, they have gradually exposed a series of problems that are difficult to ignore.

[0008] In terms of reliability, the cruise service mechanism adopted by the existing technology has obvious defects. The cruise service only queries the cruise path once during the startup phase. In the subsequent long operation process, if the cruise service fails to receive the notification message of the cruise path change due to network fluctuations, communication link failures, system abnormalities or other unforeseen factors, serious consequences will occur. For example, when the monitoring scene changes and some areas need to be newly monitored or cancelled, if the cruise path cannot be updated in time, the camera will continue to perform the monitoring task according to the original cruise path, which may cause the areas that need to be monitored to be missed, causing safety hazards; on the contrary, for areas that no longer need to be monitored, the camera continues to perform cruise monitoring, which not only wastes system resources, but also may cause unnecessary privacy issues, seriously affecting the reliability of cruise monitoring, making the entire monitoring system unable to effectively adapt to the dynamic changes of the actual monitoring scene.

[0009] In terms of accuracy, since the cruise service stores the cruise path in memory and operates in an independently managed manner, this model lacks effective external constraints and synchronization mechanisms. When the system encounters abnormal situations (such as sudden power failure and restart, software failure causing partial data loss, etc.) or is in a complex multi-threaded / multi-process concurrent environment, the problem of repeated execution of the cruise path is very likely to occur. For example, the camera may stop at a preset point multiple times, or repeat the same cruise path after completing a round of cruise, which will lead to repeated collection of monitoring data, not only reducing monitoring efficiency, but also may cause monitoring personnel to misjudge the actual situation, seriously affecting the accuracy of cruise monitoring, and unable to provide accurate and reliable basis for subsequent data analysis and decision-making.

[0010] In terms of scalability, the architectural design of existing technologies has greatly restricted the scalability of the system. When the development of monitoring business requires the addition of new cruise paths, since it relies on independent cache to store and manage cruise path related information, it is often necessary to expand and upgrade the cruise service on a large scale to improve its processing power and cache capacity. This process not only involves complex technical transformation and system adjustments, which increases development costs and implementation difficulties, but may also cause the system to become unstable during the upgrade process, affecting normal monitoring business. Moreover, as the scale of monitoring continues to expand, frequent expansion of cruise services will make the system architecture increasingly complex and bloated, making it difficult to flexibly respond to changing business needs, ultimately limiting the scalability and sustainable development capabilities of the entire video surveillance system.

[0011] In summary, the multi-angle cruise monitoring technology in the existing video surveillance platform has significant deficiencies in key aspects such as reliability, accuracy and scalability. An innovative technical solution is urgently needed to solve these problems in order to adapt to the needs of the ever-evolving video surveillance field and improve the overall performance and service quality of the monitoring system. Summary of the invention

[0012] In view of the shortcomings of the current related existing technologies, the present invention provides a video surveillance multi-angle cruise optimization method based on Redis, which ensures the uniqueness of cruise path execution by making full use of Redis's atomic operation characteristics, uses its distributed lock mechanism to prevent repeated execution, and conveniently expands cache capacity with its efficient data cache and distributed architecture, solving the reliability problems caused by the inability to respond to cruise path changes in time in the existing technology, the accuracy problems caused by the easy repeated execution of cruise paths due to independent memory management, and the scalability problems caused by the difficulty in expanding cruise services. The performance and quality of cruise monitoring are comprehensively improved to meet the strict requirements for reliability, accuracy and scalability in modern complex monitoring environments, and provide more efficient, reliable and intelligent video surveillance solutions for various industries.

[0013] To achieve the above object, the technical solution adopted by the present invention is: a video surveillance multi-angle cruise optimization method based on Redis, comprising the following steps:

[0014] S1. The system sets preset points according to monitoring needs, selects preset points and builds a cruise path in a preset order, and the database table saves the cruise path, which includes preset points, cruise order and cruise time;

[0015] S2. After the cruise service is started, the cruise service queries the cruise path in the database, records it in Redis and sets an expiration time;

[0016] S3. After the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, the cruise service saves the cruise path and queries the preset points, cruise sequence and cruise time contained in the cruise path from the database; the cruise sequence indicates the order of rotating the preset points, and the cruise time indicates the stay time of the preset points;

[0017] S4, the cruise service starts to execute the cruise, sends a command to the ball camera to rotate to the first preset point according to the set cruise path, records the execution time, and updates the cruise path information in Redis;

[0018] S5. After waiting for the dwell time at the preset point to end, move to the preset point of the next cruise sequence, record the execution time, and update the cruise path in Redis;

[0019] S6, after turning to the last preset point of the cruise path, restart from the first preset point and repeat the above cruise steps;

[0020] S7, during the cruise execution period, regularly extending the expiration time of the cruise path;

[0021] S8. Regularly detect the execution status of the cruise path to ensure that it is executed according to the predetermined cruise path and duration.

[0022] Furthermore, in step S3, the following implementation steps are also included:

[0023] S31, after the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, when the cruise service saves the cruise path, the processing state is set to the start state, the current cruise preset point is set to the first preset point, the preset point rotation request time is 0, the number of cruise preset points is 0, and the cruise execution is ready to start processing;

[0024] S32, after the cruise service enters the cruise start state, a request is sent to the database according to the cruise path to query the preset points of the cruise path, including the preset point number, the preset point cruise sequence number, and the preset point cruise stay time, and the preset point information is saved with the preset point cruise sequence number as the key value, and the processing state is updated to the execution cruise state.

[0025] Furthermore, in step S4, the following implementation steps are also included:

[0026] S41. When the cruise service is in the cruise state, the expiration time of the cruise path in Redis is periodically extended to ensure that the data in Redis remains up to date;

[0027] S42, the cruise service performs a cruise operation, searches for the current cruise preset point in the cruise preset point information, and if the current preset point exists and the preset point rotation request time is 0, records the current time as the preset point rotation request time, sends a command to rotate the ball camera to the first preset point, and increases the number of cruise preset points by 1.

[0028] Furthermore, in step S5, the following implementation steps are also included:

[0029] S51, if the current preset point exists in the cruise preset point information of the cruise service, compare the current time with the preset point rotation request time to determine whether the current preset point cruise stay time has been exceeded; if the preset point cruise stay time has been exceeded, update the current cruise preset point to the next preset point, and set the preset point rotation request time to 0;

[0030] S52: If the current preset point does not exist in the cruise preset point information of the cruise service, and the number of preset points that have been cruised has reached the total number of preset points configured for the cruise path, the current cruise preset point is set to the first preset point, and the number of preset points that have been cruised is set to 0;

[0031] S53: If the current preset point does not exist in the cruise preset point information of the cruise service, but the number of cruise preset points does not reach the total number of preset points configured for the cruise path, the current cruise preset point is updated to the next preset point.

[0032] The second aspect of the present invention provides a system for implementing the above method, comprising at least:

[0033] The preset point setting module is used to set multiple preset points according to monitoring requirements, combine them into a cruise path in a predetermined order, set the cruise time of each preset point, and save the cruise path to the database;

[0034] The cruise service module is used to query the cruise path from the database after startup, interact with Redis to record, update and manage the status, send control instructions to the ball machine to implement the cruise operation, and regularly detect the execution status of the cruise path;

[0035] Redis storage module, used to store cruise paths and related information, provides atomic operations, distributed locks, and data cache functions, and supports cache capacity expansion;

[0036] The database module is used to store the cruise path and preset point details set by the system for the cruise service module to query and obtain data.

[0037] The present invention adopts the above technical solution, which has at least the following beneficial effects:

[0038] 1. Significantly improve reliability: The present invention can obtain the actual execution status of the cruise path in real time or regularly by regularly detecting the execution status of the cruise path. During the operation of the system, if the cruise path changes due to various unforeseen factors (such as network failures, equipment abnormalities, etc.), the present invention can detect these changes in time and quickly adjust the cruise path of the camera. For example, when the area to be monitored changes, the new area needs to be included in the monitoring range or the original area no longer needs to be monitored, the system can respond quickly to ensure that the camera is monitored according to the latest configuration. This mechanism effectively avoids the problem in the prior art that the scenes that need to be monitored are not monitored or the scenes that do not need to be monitored are still being monitored due to the inability to receive the cruise path change message in time, greatly improves the reliability of cruise monitoring, enables the monitoring system to always maintain a high degree of consistency with actual needs, and provides stable and reliable video data support for security monitoring and management decisions.

[0039] 2. Effectively guarantee accuracy: By utilizing the atomic operation characteristics and distributed lock mechanism of Redis, the present invention ensures the uniqueness and accuracy of the cruise path execution. In a multi-threaded or distributed environment, atomic operations ensure that the operations on the cruise path related data are either all successful or all failed, effectively preventing the problem of repeated execution of the cruise path caused by concurrent operations. At the same time, the distributed lock mechanism further limits only one thread or process to be able to operate the cruise path at the same time, avoiding the situation where multiple execution entities modify or execute the same cruise path at the same time. In addition, by reasonably setting the expiration time of the cruise path in Redis, the timeliness of the data is guaranteed, so that the camera's residence time and rotation order at each preset point can be strictly in accordance with the preset configuration. This series of measures effectively improves the accuracy of monitoring data, reduces the risk of misjudgment and missed judgment that may be caused by inaccurate monitoring data, and provides accurate data basis for subsequent data analysis, event detection and processing.

[0040] 3. Greatly enhanced scalability: With the help of Redis's efficient data caching and distributed architecture, the present invention has significant advantages in system scalability. When the development of the monitoring business requires the addition of new cruise paths, there is no need to carry out large-scale transformation and expansion of the cruise service. The distributed architecture of Redis allows the cache capacity to be easily expanded. Simply add nodes or adjust configuration parameters to meet the system's needs for storage and management of more cruise paths. This approach avoids the complex development and high cost problems caused by the need to frequently expand cruise services due to reliance on independent caches in the prior art. The system can respond more flexibly to changing monitoring business needs. For example, in the case of the expansion of large-scale urban monitoring networks and the increase in monitoring needs for complex industrial scenarios, it can quickly adapt and maintain efficient and stable performance, reducing the difficulty of system maintenance and upgrades, and improving the scalability and sustainable development capabilities of the system.

[0041] 4. Optimize system performance and resource utilization: By recording the cruise path information to Redis and managing its expiration time reasonably, the frequent query operations on the database are reduced, and the load pressure on the database is reduced. At the same time, the memory storage characteristics of Redis make data reading and writing faster, and can quickly respond to various operation requests of the cruise service, improving the response speed and operation efficiency of the entire system. In addition, accurate cruise path execution and reasonable resource allocation (such as precise control of the dwell time of preset points) avoid invalid monitoring of cameras at unnecessary locations or times, optimize the utilization efficiency of system resources, reduce the energy consumption and operating costs of the system, and make the video surveillance system more economical and environmentally friendly while achieving efficient monitoring.

[0042] 5. Widely applicable to complex monitoring scenarios: The multi-angle cruise monitoring optimization method of the present invention is applicable to various complex monitoring scenarios, such as industrial parks, transportation hubs, large squares, etc. In these scenarios, the monitoring requirements are diverse and complex, and continuous, efficient and accurate monitoring of multiple areas is required. The present invention can flexibly set preset points, adjust cruise paths and stay times according to actual needs, and meet the monitoring requirements of different angles and different areas in different scenarios. It effectively improves the adaptability and monitoring effect of the monitoring system to complex scenarios, and provides strong technical support for ensuring public safety, improving production management efficiency, and optimizing traffic operations. It has broad application prospects and social value. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 The video monitoring multi-angle cruise optimization method of the present invention is as follows: Figure 1 .

[0045] Figure 2 It is a schematic diagram of the cruising path of the present invention.

[0046] Figure 3 The video monitoring multi-angle cruise optimization method of the present invention is as follows: Figure 2 .

[0047] Figure 4 It is a flow chart of a specific implementation method of the video surveillance multi-angle cruise optimization method of the present invention. DETAILED DESCRIPTION

[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0049] Embodiment 1

[0050] See also Figure 1 This embodiment provides a video surveillance multi-angle cruise optimization method based on Redis, including the following steps:

[0051] S1. The system sets preset points according to monitoring needs, selects preset points and builds a cruise path in a preset order, and the database table saves the cruise path, such as Figure 2 As shown, the cruise path includes preset points, cruise sequence and cruise time;

[0052] S2. After the cruise service is started, the cruise service queries the cruise path in the database, records it in Redis and sets an expiration time;

[0053] S3. After the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, the cruise service saves the cruise path and queries the preset points, cruise sequence and cruise time contained in the cruise path from the database; the cruise sequence indicates the order of rotating the preset points, and the cruise time indicates the stay time of the preset points;

[0054] S4, the cruise service starts to execute the cruise, sends a command to the ball camera to rotate to the first preset point according to the set cruise path, records the execution time, and updates the cruise path information in Redis;

[0055] S5. After waiting for the dwell time at the preset point to end, move to the preset point of the next cruise sequence, record the execution time, and update the cruise path in Redis;

[0056] S6, after turning to the last preset point of the cruise path, restart from the first preset point and repeat the above cruise steps;

[0057] S7, during the cruise execution period, regularly extending the expiration time of the cruise path;

[0058] S8. Regularly detect the execution status of the cruise path to ensure that it is executed according to the predetermined cruise path and duration.

[0059] Furthermore, in step S3, the following implementation steps are also included:

[0060] S31, after the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, when the cruise service saves the cruise path, the processing state is set to the start state, the current cruise preset point is set to the first preset point, the preset point rotation request time is 0, the number of cruise preset points is 0, and the cruise execution is ready to start processing;

[0061] S32, after the cruise service enters the cruise start state, a request is sent to the database according to the cruise path to query the preset points of the cruise path, including the preset point number, the preset point cruise sequence number, and the preset point cruise stay time, and the preset point information is saved with the preset point cruise sequence number as the key value, and the processing state is updated to the execution cruise state.

[0062] Furthermore, in step S4, the following implementation steps are also included:

[0063] S41. When the cruise service is in the cruise state, the expiration time of the cruise path in Redis is periodically extended to ensure that the data in Redis remains up to date;

[0064] S42, the cruise service performs a cruise operation, searches for the current cruise preset point in the cruise preset point information, and if the current preset point exists and the preset point rotation request time is 0, records the current time as the preset point rotation request time, sends a command to rotate the ball camera to the first preset point, and increases the number of cruise preset points by 1.

[0065] Furthermore, in step S5, the following implementation steps are also included:

[0066] S51, if the current preset point exists in the cruise preset point information of the cruise service, compare the current time with the preset point rotation request time to determine whether the current preset point cruise stay time has been exceeded; if the preset point cruise stay time has been exceeded, update the current cruise preset point to the next preset point, and set the preset point rotation request time to 0;

[0067] S52: If the current preset point does not exist in the cruise preset point information of the cruise service, and the number of preset points that have been cruised has reached the total number of preset points configured for the cruise path, the current cruise preset point is set to the first preset point, and the number of preset points that have been cruised is set to 0;

[0068] S53: If the current preset point does not exist in the cruise preset point information of the cruise service, but the number of cruise preset points does not reach the total number of preset points configured for the cruise path, the current cruise preset point is updated to the next preset point.

[0069] The second aspect of the present invention provides a system for implementing the above method, comprising at least:

[0070] The preset point setting module is used to set multiple preset points according to monitoring requirements, combine them into a cruise path in a predetermined order, set the cruise time of each preset point, and save the cruise path to the database;

[0071] The cruise service module is used to query the cruise path from the database after startup, interact with Redis to record, update and manage the status, send control instructions to the ball machine to implement the cruise operation, and regularly detect the execution status of the cruise path;

[0072] Redis storage module, used to store cruise paths and related information, provides atomic operations, distributed locks, and data cache functions, and supports cache capacity expansion;

[0073] The database module is used to store the cruise path and preset point details set by the system for the cruise service module to query and obtain data.

[0074] Embodiment 2

[0075] like Figure 3 As shown, this embodiment provides a video surveillance multi-angle cruise optimization method based on Redis, including the following steps:

[0076] The overall idea of ​​the solution is that the cruise service records the cruise path execution information to Redis and periodically detects the execution status of the cruise path.

[0077] The specific plan is as follows:

[0078] 1. Set preset points in the system as needed, select preset points to set the cruise path, and save the cruise path in the database table. The cruise path includes preset points, cruise sequence, and cruise time;

[0079] 2. The cruise service queries the cruise path in the database, records it in Redis, and sets an expiration time;

[0080] 3. After the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, the cruise service saves the cruise path and queries the preset points, cruise sequence, and cruise time contained in the cruise path from the database. The cruise sequence indicates the order of rotating the preset points, and the cruise time indicates the stay time at the preset points;

[0081] 3.1 After the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, the cruise service saves the cruise path, sets the processing status to the start status, sets the current cruise preset point to the first preset point, sets the preset point rotation request time to 0, and sets the number of cruise preset points to 0, and prepares to start processing and executing the cruise;

[0082] 3.2 When the cruise service is in the cruise start state, it sends a request to the database to query the preset points of this cruise path according to the cruise path, including the preset point number, the preset point cruise sequence number, and the preset point cruise stop time. The preset point information is saved with the preset point cruise sequence number as the key value, and the processing state is set to the cruise execution state;

[0083] 4. The cruise service starts to execute the cruise, and moves to the first preset point according to the set cruise path, saves the execution time, and updates the Redis cruise path;

[0084] 4.1 When the cruise service is in the cruise state, it will periodically extend the expiration time of the cruise path in Redis to ensure that the data in Redis remains up to date;

[0085] 4.2 The cruise service executes the cruise, searches for the current cruise preset point in the cruise preset point information, if the current preset point exists and the preset point rotation request time is 0, records the preset point rotation request time as the current time, sends a request to the ball machine to rotate to the first preset point, and the number of cruise preset points increases by 1;

[0086] 5. Wait for the dwell time of the preset point, move to the preset point of the next cruise sequence, save the execution time, and update the Redis cruise path;

[0087] 5.1 If there is a current preset point in the cruise preset point information of the cruise service, compare the current time with the preset point rotation request time to determine whether the cruise stay time of the current preset point has been exceeded. If the cruise stay time of the preset point has been exceeded, the current cruise preset point is set to the next preset point, and the preset point rotation request time is set to 0;

[0088] 5.2 If there is no current preset point in the cruise preset point information of the cruise service, and the number of preset points that have been cruised has reached the total number of preset points configured for the cruise path, the current cruise preset point is set to the first preset point, and the number of preset points that have been cruised is set to 0;

[0089] 5.3 If there is no current preset point in the cruise preset point information of the cruise service, but the number of cruise preset points has not reached the total number of preset points configured for the cruise path, the current cruise preset point is set to the next preset point;

[0090] 6. After turning to the last preset point of the cruise path, start from the first preset point and repeat the cruise steps;

[0091] 7. During the cruise execution, the expiration time of the cruise path is regularly extended;

[0092] 8. Timing detection ensures that the cruise path is executed according to the set cruise path.

[0093] Embodiment 3

[0094] like Figure 4 As shown, this implementation provides a specific implementation method of a multi-angle cruise optimization method for video surveillance based on Redis:

[0095] Cruise path 1 has been set in the system database. Cruise path 1 contains 6 preset points (such as preset point 1, preset point 2, preset point 3, preset point 4, preset point 5, preset point 6), and the cruise sequence number starts from 1 (such as: preset point 1 cruise sequence number is 1, preset point 2 cruise sequence number is 2, preset point 3 cruise sequence number is 3, preset point 4 cruise sequence number is 4, preset point 5 cruise sequence number is 5, preset point 6 cruise sequence number is 6), and the preset point cruise stay time is 20 seconds.

[0096] After the cruise service 1 is started, the cruise path 1 is queried from the database and recorded in Redis in the form of a key-value pair. The cruise path 1 is the key and the corresponding value is the cruise service 1. The expiration time of the key is set to 15 seconds.

[0097] After the cruise path 1 is successfully saved in Redis, the cruise service 1 saves the cruise path 1, sets the processing status to the start status, sets the current preset point cruise sequence number to 1, i.e. the first preset point, sets the preset point rotation request time to 0, and sets the number of preset points that have been cruised to 0, and prepares to start processing and executing the cruise;

[0098] After cruise path 1 is successfully saved in Redis, cruise service 1 queries the preset point information of cruise path 1 from the database, including the preset point number, preset point cruise sequence number, and preset point cruise stop time, that is, preset point 1->preset point 2->preset point 3->preset point 4->preset point 5->preset point 6, and uses the preset point cruise sequence number as the key value to save the preset point information, that is, 0-5 saves the information of preset points 1-6 respectively, and the cruise service processing status is set to the execution cruise status;

[0099] When the cruise service 1 is in the cruise state, the expiration time of the cruise path 1 is set to 15 seconds every 10 seconds to ensure that the cruise path 1 in Redis remains up to date. In this way, the existence of the cruise path 1 in Redis indicates that the cruise path 1 is executing the cruise.

[0100] Cruise service 1 executes cruise path 1, searches for the preset point with cruise sequence number 1 in the preset point information of cruise path 1, finds the preset point with cruise sequence number 1, and the preset point rotation request time is 0 at this time. The preset point rotation request time is recorded as the current time, and a request is sent to the ball machine to rotate to preset point 1. The number of preset points that have been cruised is increased by 1, that is, the number of preset points that have been cruised is 1, and the preset point cruise stay time is 20 seconds.

[0101] After the preset point cruise stay time is 20 seconds, the current preset point cruise sequence number is set to the next preset point, that is, the preset point cruise sequence number is set to 2, and the preset point rotation request time is set to 0;

[0102] Repeat steps 6 and 7, and request to rotate preset point 1->preset point 2->preset point 3->preset point 4->preset point 5->preset point 6 in sequence. The number of cruise preset points is 6.

[0103] When the preset point cruises to the 6th preset point of cruise path 1, that is, the last preset point of cruise path 1, after waiting for the preset point cruise stay time of 20 seconds, the current preset point cruise sequence number is set to the next preset point, that is, the preset point cruise sequence number is set to 7, and the preset point rotation request time is set to 0;

[0104] Cruise service 1 searches for the preset point with a cruise sequence number of 7 in the preset point information of cruise path 1. At this time, the preset point with a cruise sequence number of 7 cannot be found. At this time, the number of cruised preset points 6 reaches the number of preset points 6 configured for cruise path 1. The current preset point cruise sequence number is set to 1, that is, the first preset point. The number of cruised preset points is 0. Cruise is performed starting from the first preset point of cruise path 1. Steps 6 and 7 are repeated to realize preset point cruise monitoring.

[0105] like Figure 4 As shown, this embodiment provides a specific implementation of a video surveillance multi-angle cruise optimization method based on Redis:

[0106] A path called Cruise Path 1 has been pre-set in the system database. This path contains six preset points (for example: Preset 1, Preset 2, Preset 3, Preset 4, Preset 5, Preset 6). The cruise sequence numbers of these preset points are arranged in sequence from 1 (for example: the cruise sequence number of Preset 1 is 1, the cruise sequence number of Preset 2 is 2, and so on until the cruise sequence number of Preset 6 is 6). The cruise stay time of each preset point is uniformly set to 20 seconds.

[0107] When Cruise Service 1 is started, the relevant information of Cruise Path 1 is queried from the database and recorded in Redis in the form of a key-value pair. Here, Cruise Path 1 is used as the key, and the corresponding value is Cruise Service 1. At the same time, in order to ensure the timeliness of the data, the key is set with an expiration time of 15 seconds;

[0108] Once the cruise path 1 is successfully saved in Redis, the cruise service 1 will save this path and set the processing status to the start state. At this time, the cruise sequence number of the current preset point is set to 1, which points to the first preset point. The preset point rotation request time is initialized to 0, and the number of preset points that have been cruised is also set to 0, so as to prepare to start the cruise task;

[0109] After cruise path 1 is successfully saved to Redis, cruise service 1 will query the preset point information of cruise path 1 from the database, which includes the preset point number, preset point cruise sequence number and preset point cruise stay time. Specifically, it is arranged in the order of preset point 1->preset point 2->preset point 3->preset point 4->preset point 5->preset point 6. Then, the preset point cruise sequence number is used as the key value to save the information of these preset points, that is, the key values ​​0 to 5 correspond to the information of preset points 1 to preset points 6 respectively. The cruise service processing status is now set to the cruise execution status;

[0110] When cruise service 1 is in the cruise execution state, the expiration time of cruise path 1 is reset to 15 seconds every 10 seconds to ensure that cruise path 1 saved in Redis is always the latest state. In this way, as long as the information of cruise path 1 exists in Redis, it means that cruise path 1 is executing the cruise task;

[0111] Cruise service 1 starts to execute the task of cruise path 1, and searches for the preset point with cruise sequence number 1 in the preset point information of cruise path 1. Once found, the preset point rotation request time is 0, the system will record the current time as the preset point rotation request time, and send a request to the ball camera to rotate to the position of preset point 1. Then, the number of preset points that have been cruised is increased by 1, that is, the number of preset points that have been cruised is 1, and then the system will wait for 20 seconds of preset point cruise stay time;

[0112] When the preset point cruise stay time of 20 seconds ends, the system will set the cruise sequence number of the current preset point to the next preset point, that is, change from 1 to 2, and reset the preset point rotation request time to 0;

[0113] The system will repeat the operations of step 6 and step 7, and request the ball camera to move to preset point 1, preset point 2, preset point 3, preset point 4, preset point 5, and preset point 6 in sequence, until the number of preset points reached 6;

[0114] When the preset point cruises to the 6th preset point of cruise path 1, that is, the last preset point of cruise path 1, after the preset point cruise stay time is 20 seconds, the current preset point cruise sequence number is set to the next preset point, that is, the preset point cruise sequence number is set to 7, and the preset point rotation request time is set to 0;

[0115] Cruise service 1 will search for the preset point with cruise sequence number 7 in the preset point information of cruise path 1. At this time, the preset point with cruise sequence number 7 cannot be found. At this time, the number of cruised preset points 6 reaches the number of preset points 6 configured for cruise path 1. The cruise sequence number of the current preset point is set to 1, that is, the first preset point, and the number of cruised preset points is 0. Cruise starts from the first preset point of cruise path 1, and repeats steps 6 and 7 to realize preset point cruise monitoring.

[0116] The above embodiments have at least the following advantages: First, the Redis distributed lock is used to facilitate the expansion of cache capacity while ensuring the accuracy of cruise monitoring; second, the cruise service is allowed to periodically detect the execution status of the cruise path so that it is strictly executed according to the set path, thereby improving reliability; third, the cruise path is recorded in Redis, and the problem of repeated execution is avoided with the help of atomic operations, and an expiration time is set to ensure that the path information is up to date, thereby ensuring accuracy; fourth, the Redis data cache is used to enhance the cruise service capabilities, enhance its scalability, and overall improve the performance and quality of multi-angle cruise monitoring of video surveillance.

[0117] Although the embodiments of the present invention have been shown and described above, it will be appreciated that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, substitute and vary the above embodiments within the scope of the present invention.

Claims

1. A video surveillance multi-angle cruise optimization method based on Redis, characterized by: The steps include: S1. The system sets preset points according to monitoring needs, selects preset points and constructs a cruise path in a preset order, and the first database saves the cruise path, which includes preset points, cruise order and cruise time; S2. After the cruise service is started, the cruise service queries the cruise path in the first database, records it in Redis and sets an expiration time; S3. After the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, the cruise service saves the cruise path and queries the preset points, cruise sequence and cruise time included in the cruise path from the first database; the cruise sequence indicates the order of rotating the preset points, and the cruise time indicates the stay time of the preset points; S4, the cruise service starts to execute the cruise, sends a command to the ball camera to rotate to the first preset point according to the set cruise path, records the execution time, and updates the cruise path information in Redis; S5. After waiting for the dwell time at the preset point to end, move to the preset point of the next cruise sequence, record the execution time, and update the cruise path in Redis; S6, after turning to the last preset point of the cruise path, restart from the first preset point and repeat the above cruise steps; S7, during the cruise execution period, regularly extending the expiration time of the cruise path; S8. Regularly detect the execution status of the cruise path to ensure that it is executed according to the predetermined cruise path and duration.

2. The method according to claim 1, characterized in that: In step S3, the following implementation steps are also included: S31, after the corresponding relationship between the cruise path and the cruise service is successfully recorded in Redis, when the cruise service saves the cruise path, the processing state is set to the start state, the current cruise preset point is set to the first preset point, the preset point rotation request time is 0, the number of cruise preset points is 0, and the cruise execution is ready to start processing; S32, after the cruise service enters the cruise start state, a request is sent to the first database to query the preset points of the cruise path according to the cruise path, including the preset point number, the preset point cruise sequence number, and the preset point cruise stay time, and the preset point information is saved with the preset point cruise sequence number as the key value, and the processing state is updated to the execution cruise state.

3. The method according to claim 2, characterized in that: In step S4, the following implementation steps are also included: S41. When the cruise service is in the cruise state, the expiration time of the cruise path in Redis is periodically extended to ensure that the data in Redis remains up to date; S42, the cruise service performs a cruise operation, searches for the current cruise preset point in the cruise preset point information, and if the current preset point exists and the preset point rotation request time is 0, records the current time as the preset point rotation request time, sends a command to rotate the ball camera to the first preset point, and increases the number of cruise preset points by 1.

4. The method according to claim 3, characterized in that: In step S5, the following implementation steps are also included: S51, if the current preset point exists in the cruise preset point information of the cruise service, compare the current time with the preset point rotation request time to determine whether the current preset point cruise stay time has been exceeded; if the preset point cruise stay time has been exceeded, update the current cruise preset point to the next preset point, and set the preset point rotation request time to 0; S52: If the current preset point does not exist in the cruise preset point information of the cruise service, and the number of preset points that have been cruised has reached the total number of preset points configured for the cruise path, the current cruise preset point is set to the first preset point, and the number of preset points that have been cruised is set to 0; S53: If the current preset point does not exist in the cruise preset point information of the cruise service, but the number of cruise preset points does not reach the total number of preset points configured for the cruise path, the current cruise preset point is updated to the next preset point.

5. The video surveillance multi-angle cruise optimization system based on Redis is characterized by: The system is used to implement the method described in any one of claims 1 to 4, and at least comprises: A preset point setting module, used to set a plurality of preset points according to monitoring requirements, and combine them into a cruise path in a predetermined order, set the cruise time of each preset point, and save the cruise path to the first database; The cruise service module is used to query the cruise path from the first database after startup, interact with Redis to record, update and manage the status, send control instructions to the ball camera to implement the cruise operation, and regularly detect the execution status of the cruise path; Redis storage module, used to store cruise paths and related information, provides atomic operations, distributed locks, and data cache functions, and supports cache capacity expansion; The first database is used to store the cruise path and preset point detailed information set by the system for the cruise service module to query and obtain data.

Citation Information

Patent Citations

  • Method and system for realizing automatic cruise of pan-tilts

    CN102866712A

  • Shield TBM big data platform system based on Hadoop cluster architecture and construction method

    CN111126873A