Device-based platform cascading method and system
By utilizing the structure management method of free, used, and tmp lists in the public safety video surveillance system, the efficiency and security issues of the server when facing the pressure of a large number of phased camera point accesses were resolved. This enabled platform cascading of devices and improved the stability and security of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN CITMS TECH CO LTD
- Filing Date
- 2023-06-28
- Publication Date
- 2026-06-26
Smart Images

Figure CN116842083B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of server processing technology, and in particular to a device-based platform cascading method and system. Background Technology
[0002] The information security technology for public security video surveillance networks is a set of standards and specifications formulated by the Ministry of Public Security. The purpose is to establish a unified standard so that different manufacturers can access the network according to the standard protocol and manage the cameras in a unified manner.
[0003] Currently, a large number of front-end camera locations need to be connected. The sheer number of these locations, coupled with the phased construction (e.g., Phase I, Phase II), necessitates an increase in server capacity with each phase, requiring the server to withstand the mounting pressure. Therefore, improving security while maintaining efficiency has become a pressing issue.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a device-based platform cascading method and system, aiming to solve the technical problem of how to improve security while ensuring efficiency.
[0006] To achieve the above objectives, the present invention provides a device-based platform cascading method, the device-based platform cascading method comprising:
[0007] Upon receiving a task, check the free list to see if there are any free structures among the preset number of free structures.
[0008] If no free structure exists, the newly created structure is added to the used list so that the newly created structure performs the task and a used structure is obtained.
[0009] Move the used structure to the tmp list to activate it, and obtain the tmp structure and the activation time and security time corresponding to the tmp structure;
[0010] The tmp structure is moved to the free list according to the activation time and the security time to achieve platform cascading of devices.
[0011] Optionally, before the step of querying the free list for a preset number of free structures upon receiving a task, the method further includes:
[0012] A preset number of free structures are allocated based on the current network conditions;
[0013] Add the preset number of free structures to the free list.
[0014] Optionally, after the step of querying the free list for a preset number of free structures upon receiving a task, the method further includes:
[0015] If the free structure exists, the task is executed based on the free structure.
[0016] Optionally, the step of moving the tmp structure to the free list based on the activation time and the security time includes:
[0017] The task execution time corresponding to the tmp structure is determined based on the activation time.
[0018] When the task execution time coincides with the safe time, the tmp structure is moved to the free list.
[0019] Furthermore, to achieve the above objectives, the present invention also proposes a device-based platform cascading system, which includes:
[0020] The query module is used to query the free list to see if there are any free structures among a preset number of free structures when a task is received;
[0021] The determination module is used to add a newly created structure to the used list if the free structure does not exist, so that the newly created structure can perform the task and obtain a used structure;
[0022] The moving module is used to move the used structure to the tmp list for activation, and obtain the tmp structure and the activation time and security time corresponding to the tmp structure;
[0023] The moving module is further configured to move the tmp structure to the free list according to the activation time and the security time, so as to realize the platform cascading of the device.
[0024] Optionally, the device-based platform cascading system further includes an allocation module;
[0025] The allocation module is used to allocate a preset number of free structures based on the current network conditions;
[0026] The allocation module is also used to add the preset number of free structures to the free list.
[0027] Optionally, the determining module is further configured to perform a task based on the idle structure if the idle structure exists.
[0028] Optionally, the moving module is further configured to determine the task execution time corresponding to the tmp structure based on the activation time;
[0029] The moving module is further configured to move the tmp structure to the free list when the task execution time coincides with the safe time.
[0030] Furthermore, to achieve the above objectives, the present invention also proposes a device-based platform cascading device, the device comprising: a memory, a processor, and a device-based platform cascading program stored in the memory and executable on the processor, the device-based platform cascading program being configured to implement the steps of the device-based platform cascading method as described above.
[0031] Furthermore, to achieve the above objectives, the present invention also proposes a storage medium storing a device-based platform cascading program, which, when executed by a processor, implements the steps of the device-based platform cascading method described above.
[0032] This invention first checks the free list for a preset number of free structures upon receiving a task. If no free structures are found, a newly created structure is added to the used list to execute the task, resulting in a used structure. This used structure is then moved to the tmp list for activation, obtaining the tmp structure and its corresponding activation and security times. Based on these activation and security times, the tmp structure is moved back to the free list, enabling platform cascading of devices. Compared to existing technologies where server access capacity increases with the number of periods, requiring it to withstand increasing access pressure, this invention's structure design only increases, ensuring efficiency. Subsequent time-based comparisons for data recycling further enhance security. Attached Figure Description
[0033] Figure 1 This is a schematic diagram of the structure of a device-based platform cascaded device in the hardware operating environment involved in the embodiments of the present invention;
[0034] Figure 2 This is a flowchart illustrating the first embodiment of the device-based platform cascading method of the present invention;
[0035] Figure 3 This is a flowchart of the used list, tmp list, and free list of the first embodiment of the device-based platform cascading method of the present invention;
[0036] Figure 4 This is a structural design diagram of the first embodiment of the device-based platform cascading method of the present invention;
[0037] Figure 5 This is an extended action diagram of the first embodiment of the device-based platform cascading method of the present invention;
[0038] Figure 6 This is a structural block diagram of the first embodiment of the device-based platform cascading system of the present invention.
[0039] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0040] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0041] Reference Figure 1 , Figure 1 This is a schematic diagram of a device-based platform cascaded device structure in the hardware operating environment involved in the embodiments of the present invention.
[0042] like Figure 1 As shown, the device-based platform cascaded device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk storage device. The memory 1005 may also optionally be a storage system independent of the aforementioned processor 1001.
[0043] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on device-based platform cascading devices and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0044] like Figure 1As shown, the memory 1005, which serves as a storage medium, may include an operating system, a network communication module, a user interface module, and a device-based platform cascading program.
[0045] exist Figure 1 In the device-based platform cascading device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the device-based platform cascading device of the present invention can be set in the device-based platform cascading device, and the device-based platform cascading device calls the device-based platform cascading program stored in the memory 1005 through the processor 1001 and executes the device-based platform cascading method provided in the embodiment of the present invention.
[0046] This invention provides a device-based platform cascading method, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the device-based platform cascading method of the present invention.
[0047] In this embodiment, the device-based platform cascading method includes the following steps:
[0048] Step S10: Upon receiving a task, query the free list to see if there are any free structures among the preset number of free structures.
[0049] It is easy to understand that the execution subject of this embodiment can be a device-based platform cascaded device with functions such as data processing, network communication and program execution, or other computer devices with similar functions. This embodiment does not limit it.
[0050] Furthermore, before the step of checking the free list for a predetermined number of free structures to see if there are any free structures, a predetermined number of free structures are allocated based on the current network conditions, and these predetermined number of free structures are added to the free list. The free list allocates multiple contiguous structures at once, thus avoiding memory fragmentation.
[0051] In this embodiment, a thread pool technique is used to ensure efficiency. A thread pool starts N threads at a time. The task of each thread is to continuously retrieve tasks from the task queue. If there are no tasks, it will enter a waiting state and wait to be woken up.
[0052] It's also worth noting that, since it's a thread pool, a single structure might be operated on by multiple threads simultaneously. The cost of garbage collection for this structure is extremely high. Currently, directly addressing this problem is difficult because the time cycles and business logic involved in calling different methods during program execution are very complex. Forcing a solution would introduce an infinite loop. Therefore, this embodiment designs the structure representing the camera to only increase and never decrease, and manages it using a list. This ensures efficiency and avoids forced garbage collection. Since the memory is persistent, garbage collection is not an issue.
[0053] In the specific implementation, a certain number of free structures are first allocated. This is dynamically configured and the number is allocated based on the initial actual situation of the existing network. Then, when a task is received, i.e. a new device is connected, the system checks the free list to see if there are any free structures among the preset number of free structures. If there are free structures, the free structures are used for task execution (memory reuse), etc.
[0054] Step S20: If the free structure does not exist, the newly created structure is added to the used list so that the newly created structure can perform the task and obtain the used structure.
[0055] In this embodiment, if no free structure exists, a new one is created and added to the used list. Then, the newly created structure is used to run a task to obtain the used structure.
[0056] It should also be noted that if an idle structure exists, the task will be run directly on the idle structure.
[0057] Step S30: Move the used structure to the tmp list for activation, and obtain the tmp structure and the activation time and security time corresponding to the tmp structure.
[0058] In the specific implementation, the used structure is moved to the tmp list for activation, resulting in a tmp structure based on the time parameter.
[0059] In this embodiment, the structure is moved from used to tmp and activated. The structure in tmp (tmp structure) then has two time parameters: activation time and security time.
[0060] It should also be noted that the safety time is the runtime of the task within the tmp structure. This safety time is a user-defined setting and is not limited in this embodiment.
[0061] Step S40: Move the tmp structure to the free list according to the activation time and the security time to realize platform cascading of devices.
[0062] Furthermore, the process of moving the tmp structure to the free list based on the activation time and the security time to achieve platform cascading of devices involves determining the task execution time corresponding to the tmp structure based on the activation time; when the task execution time is consistent with the security time, the tmp structure is moved to the free list to achieve platform cascading of devices.
[0063] refer to Figure 3 , Figure 3 This is a flowchart of the used list, tmp list, and free list of the first embodiment of the device-based platform cascading method of the present invention. In the diagram, when the connector enters tmp, it means that no new events can be received, and only tasks running in the thread pool can be processed.
[0064] refer to Figure 4 , Figure 4 This is a structural design diagram of the first embodiment of the device-based platform cascading method of the present invention. Each camera has its own structural element, requiring pre-registration of many sessions. (Reference) Figure 5 , Figure 5 This is an action extension diagram of the first embodiment of the device-based platform cascading method of the present invention. After pre-registration, the protocol stack is parsed, and action 2 is found. Action 2 can be directly called to view it.
[0065] It should also be noted that the decoder wall is generated based on video. When action 2 is triggered, action 3 is dynamically registered. The same operating principle can support action 3 and action 4, etc. This method conforms to the open / closed principle, which is closed to modification and open to extension.
[0066] In this embodiment, upon receiving a task, the system first checks the free list for a preset number of free structures to see if any are available. If no free structures are found, a newly created structure is added to the used list so that it executes the task, resulting in a used structure. This used structure is then moved to the tmp list for activation, obtaining the tmp structure and its corresponding activation and security times. Finally, based on the activation and security times, the tmp structure is moved back to the free list, enabling platform cascading of devices. Compared to existing technologies where server access capacity increases with the number of periods, requiring it to withstand increasing access pressure, this embodiment designs structures that only increase and never decrease, ensuring efficiency. Subsequent time-based comparisons for recycling further enhance security.
[0067] Reference Figure 6 , Figure 6 This is a structural block diagram of the first embodiment of the device-based platform cascading system of the present invention.
[0068] like Figure 6 As shown, the device-based platform cascading system proposed in this embodiment of the invention includes:
[0069] The query module 6001 is used to query the free list to see if there are any free structures among a preset number of free structures when a task is received.
[0070] Furthermore, before the step of checking the free list for a predetermined number of free structures to see if there are any free structures, a predetermined number of free structures are allocated based on the current network conditions, and these predetermined number of free structures are added to the free list. The free list allocates multiple contiguous structures at once, thus avoiding memory fragmentation.
[0071] In this embodiment, a thread pool technique is used to ensure efficiency. A thread pool starts N threads at a time. The task of each thread is to continuously retrieve tasks from the task queue. If there are no tasks, it will enter a waiting state and wait to be woken up.
[0072] It's also worth noting that, since it's a thread pool, a single structure might be operated on by multiple threads simultaneously. The cost of garbage collection for this structure is extremely high. Currently, directly addressing this problem is difficult because the time cycles and business logic involved in calling different methods during program execution are very complex. Forcing a solution would introduce an infinite loop. Therefore, this embodiment designs the structure representing the camera to only increase and never decrease, and manages it using a list. This ensures efficiency and avoids forced garbage collection. Since the memory is persistent, garbage collection is not an issue.
[0073] In the specific implementation, a certain number of free structures are first allocated. This is dynamically configured and the number is allocated based on the initial actual situation of the existing network. Then, when a task is received, i.e. a new device is connected, the system checks the free list to see if there are any free structures among the preset number of free structures. If there are free structures, the free structures are used for task execution (memory reuse), etc.
[0074] The determination module 6002 is used to add the newly created structure to the used list if the free structure does not exist, so that the newly created structure can perform the task and obtain the used structure.
[0075] In this embodiment, if no free structure exists, a new one is created and added to the used list. Then, the newly created structure is used to run a task to obtain the used structure.
[0076] It should also be noted that if an idle structure exists, the task will be run directly on the idle structure.
[0077] The moving module 6003 is used to move the used structure to the tmp list for activation, and obtain the tmp structure and the activation time and security time corresponding to the tmp structure.
[0078] In the specific implementation, the used structure is moved to the tmp list for activation, resulting in a tmp structure based on the time parameter.
[0079] In this embodiment, the structure is moved from used to tmp and activated. The structure in tmp (tmp structure) then has two time parameters: activation time and security time.
[0080] It should also be noted that the safety time is the runtime of the task within the tmp structure. This safety time is a user-defined setting and is not limited in this embodiment.
[0081] The mobile module 6003 is further configured to move the tmp structure to the free list according to the activation time and the security time, so as to realize the platform cascading of the device.
[0082] Furthermore, the process of moving the tmp structure to the free list based on the activation time and the security time to achieve platform cascading of devices involves determining the task execution time corresponding to the tmp structure based on the activation time; when the task execution time is consistent with the security time, the tmp structure is moved to the free list to achieve platform cascading of devices.
[0083] refer to Figure 3 , Figure 3 This is a flowchart of the used list, tmp list, and free list of the first embodiment of the device-based platform cascading method of the present invention. In the diagram, when the connector enters tmp, it means that no new events can be received, and only tasks running in the thread pool can be processed.
[0084] refer to Figure 4 , Figure 4 This is a structural design diagram of the first embodiment of the device-based platform cascading method of the present invention. Each camera has its own structural element, requiring pre-registration of many sessions. (Reference) Figure 5 , Figure 5 This is an action extension diagram of the first embodiment of the device-based platform cascading method of the present invention. After pre-registration, the protocol stack is parsed, and action 2 is found. Action 2 can be directly called to view it.
[0085] It should also be noted that the decoder wall is generated based on video. When action 2 is triggered, action 3 is dynamically registered. The same operating principle can support action 3 and action 4, etc. This method conforms to the open / closed principle, which is closed to modification and open to extension.
[0086] In this embodiment, upon receiving a task, the system first checks the free list for a preset number of free structures to see if any are available. If no free structures are found, a newly created structure is added to the used list so that it executes the task, resulting in a used structure. This used structure is then moved to the tmp list for activation, obtaining the tmp structure and its corresponding activation and security times. Finally, based on the activation and security times, the tmp structure is moved back to the free list, enabling platform cascading of devices. Compared to existing technologies where server access capacity increases with the number of periods, requiring it to withstand increasing access pressure, this embodiment designs structures that only increase and never decrease, ensuring efficiency. Subsequent time-based comparisons for recycling further enhance security.
[0087] Other embodiments or specific implementations of the device-based platform cascading system of the present invention can be found in the above-described method embodiments, and will not be repeated here.
[0088] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0089] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0090] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0091] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A device-based platform cascading method, characterized in that, The device-based platform cascading method includes the following steps: Based on the current network conditions, a preset number of free structures are allocated and added to the free list. The free structures in the free list are multiple block-shaped structures allocated at one time. The free structures represent the front-end camera devices and the structures only increase and never decrease during their life cycle. When receiving the access cascading task from the front-end camera device, check the free list to see if there are any free structures among the preset number of free structures. If no free structure exists, the newly created structure is added to the used list so that the newly created structure performs the task and a used structure is obtained. Move the used structure to the tmp list to activate it, and obtain the tmp structure and the activation time and security time corresponding to the tmp structure; The tmp structure is moved to the free list according to the activation time and the security time to achieve platform cascading of devices; The step of moving the tmp structure to the free list according to the activation time and the security time includes: The task execution time corresponding to the tmp structure is determined based on the activation time. When the task execution time coincides with the safe time, the tmp structure is moved to the free list.
2. The method as described in claim 1, characterized in that, After the step of querying the free list for a preset number of free structures upon receiving a task, the method further includes: If the free structure exists, the task is executed based on the free structure.
3. A device-based platform cascading system, characterized in that, The device-based platform cascading system includes: The query module is used to query the free list to see if there are any free structures among a preset number of free structures when receiving the access cascading task from the front-end camera device. The determination module is used to add a newly created structure to the used list if the free structure does not exist, so that the newly created structure can perform the task and obtain a used structure; The moving module is used to move the used structure to the tmp list for activation, and obtain the tmp structure and the activation time and security time corresponding to the tmp structure; The moving module is also used to move the tmp structure to the free list according to the activation time and the security time, so as to realize the platform cascading of the device; The device-based platform cascading system also includes an allocation module; The allocation module is used to allocate a preset number of free structures based on the current network situation, and add the preset number of free structures to the free list. The free structures in the free list are multiple block-shaped structures allocated at one time. The free structures represent the front-end camera devices, and the structures only increase and never decrease during their life cycle. The moving module is further configured to determine the task execution time corresponding to the tmp structure based on the activation time, and move the tmp structure to the free list when the task execution time is consistent with the safe time.
4. The system as described in claim 3, characterized in that, The determining module is further configured to perform a task based on the idle structure if the idle structure exists.