Multi-monitoring picture playback method and apparatus based on MAF plug-in framework, and medium
By obtaining the maximum number of monitoring screens and plug-in programs in the host program, mounting the monitoring screens on multiple target plug-in programs, and starting the keep-alive service, the problems of excessive load and playback abnormalities caused by multi-process communication in the existing technology are solved, and more efficient resource use and stable multi-screen playback are achieved.
Patent Information
- Application Number
- PCT/CN2024/126121
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-10-24
- Filing Date
- 2024-10-21
- Publication Date
- 2025-05-01
AI Technical Summary
In the prior art, multi-process communication methods are used to play camera monitoring images, resulting in process isolation problems but the inability to automatically restore screen playback. The use of a single subprocess on a single screen leads to opening more processes, resulting in excessive load on monitoring applications, affecting the playback stability and performance consumption of real-time screens of multiple cameras monitoring.
By obtaining the number of monitoring screens selected by the user and the maximum number of plug-in programs selected by the user when the host program is started, mount each monitoring screen on multiple target plug-in programs, and starting the keep-alive service to keep-alive monitoring of the target plug-in program and the monitor screen, and timely restore playback exceptions.
It effectively reduces the resource use of host programs, ensures that each target plug-in program load is reasonable, improves operation efficiency, and quickly recovers abnormalities through dual monitoring, improves the stability of multi-screen continuous long-term playback, and improves user experience.
Smart Images

Figure CN2024126121_01052025_PF_FP_ABST
Abstract
Description
Multi-monitoring screen playback method, device and medium based on MAF plug-in framework Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a multi-monitoring screen playback method, device, and medium based on a MAF plug-in framework. Background Art
[0002] When users use desktop-type monitoring tools to view real-time monitoring images of multiple cameras, unknown anomalies in the real-time monitoring images of the cameras will inevitably occur, causing the monitoring application to crash and flash back, and then causing the real-time images to be interrupted and unable to be restored.
[0003] The existing official MAF plug-in framework is suitable for multi-process communication management, and when the plug-in crashes, it will not affect the host program. Although using multi-process communication to play camera monitoring images solves the process isolation problem, it cannot automatically restore the image playback. Moreover, using a single child process for a single image will also lead to the opening of multiple processes, which in turn leads to excessive load on the monitoring application, affecting the overall playback stability and performance of the real-time monitoring images from multiple cameras.
[0004] Summary of the Invention
[0005] The purpose of this application is to solve at least one of the above-mentioned technical defects, especially the technical defects in the prior art of using multi-process communication to play camera monitoring images, and using a single sub-process for a single image will also lead to the opening of more processes, resulting in excessive load on the monitoring application, thereby affecting the overall playback stability and performance consumption of multiple camera monitoring real-time images.
[0006] The present application provides a multi-monitoring screen playback method based on the MAF plug-in framework, the method comprising:
[0007] When the host program is started, the number of monitoring screens selected by the user in the host program and the maximum number of monitoring screens that can be mounted and the maximum number of started plug-in programs hosted in the host program are obtained;
[0008] Mounting each monitoring screen on a plurality of target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups;
[0009] When the monitoring screen is played through each target plug-in program, the keep-alive service is started to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen, and when an abnormality is detected, the playback of the corresponding monitoring screen is restored.
[0010] Optionally, mounting each monitoring screen on multiple target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups includes:
[0011] Acquire a corresponding number of target plug-in programs according to the maximum startup number;
[0012] Based on the maximum number of mounted monitoring screens, and according to the number of monitoring screens and the maximum number of startups, each monitoring screen is evenly divided into each target plug-in program, and then it is determined whether there are any remaining undivided monitoring screens;
[0013] If it exists, then after updating the number of monitoring screens, return to execute the steps based on the maximum number of monitoring screen mounts and subsequent steps;
[0014] If it does not exist, each monitoring screen is mounted on multiple target plug-in programs according to the division result.
[0015] Optionally, before mounting each monitoring screen on multiple target plug-in programs, the method further includes:
[0016] For each target plug-in program, detecting whether the process of the target plug-in program is valid, whether the startup is completed, and whether the communication channel between the target plug-in program and the host program is activated;
[0017] If all the tests are passed, a communication channel is established between the target plug-in program and the host program;
[0018] If at least one of the tests fails, a new target plug-in program is restarted to replace the target plug-in program, and a communication channel is established between the new target plug-in program and the host program.
[0019] Optionally, when an abnormality is detected during monitoring, the playback of the corresponding monitoring image is restored, including:
[0020] When it is monitored that the number of startups of the target plug-in program does not match the maximum startup number, each monitoring screen is re-mounted on a plurality of new target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum startup number;
[0021] After the playback status and video playback address of the associated monitoring screen are retrieved through each new target plug-in program, the playback of the associated monitoring screen is restored according to the playback status and the video playback address.
[0022] Optionally, when an abnormality is detected during monitoring, the playback of the corresponding monitoring image is restored, including:
[0023] When it is monitored that the process of any target plug-in program is invalid, a new target plug-in program is started, and a monitoring screen associated with the target plug-in program with the invalid process is mounted on the new target plug-in program;
[0024] After the playback status and video playback address of the associated monitoring screen are retrieved through the new target plug-in program, the playback of the associated monitoring screen is restored according to the playback status and the video playback address.
[0025] Optionally, when an abnormality is detected during monitoring, the playback of the corresponding monitoring image is restored, including:
[0026] When any monitoring screen is detected to have abnormal playback, the keep-alive service is triggered to detect the disconnection of the communication channel between the target plug-in program associated with the abnormally playing monitoring screen and the host program;
[0027] If an abnormality is detected in the disconnection, the process of the associated target plug-in program is forcibly terminated through the keep-alive service, and the disconnected communication pipe information in the data set recorded in the memory is cleared, and the playback of the abnormal monitoring screen is restored.
[0028] Optionally, the triggering of the keep-alive service to detect a disconnection of a communication channel between a target plug-in program associated with the abnormally played monitoring image and the host program includes:
[0029] Triggering the keep-alive service to traverse a data set in memory and search for communication channel information between a target plug-in program and the host program associated with the abnormally played monitoring image in the data set; wherein the data set stores the communication channel information between the target plug-in program and the host program that was successfully established during initialization;
[0030] The disconnection of the communication channel between the associated target plug-in program and the host program is detected according to the found communication channel information, wherein the found communication channel information includes no communication channel information found and the communication channel information is set to NULL value.
[0031] This application also provides a multi-monitoring screen playback device based on the MAF plug-in framework, including:
[0032] A data acquisition module is used to acquire, when a host program is started, the number of monitoring screens selected by a user in the host program, as well as the maximum number of monitoring screens that can be mounted and the maximum number of startups of plug-in programs hosted in the host program;
[0033] A plug-in program determination module is used to mount each monitoring screen on multiple target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups;
[0034] The keep-alive service module is used to start the keep-alive service to monitor each target plug-in program and the corresponding monitoring screen when the monitoring screen is played through each target plug-in program, and to resume playing the corresponding monitoring screen when an abnormality is detected.
[0035] The present application also provides a storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-monitoring screen playback method based on the MAF plug-in framework as described in any of the above embodiments.
[0036] The present application also provides a computer device, comprising: one or more processors, and a memory;
[0037] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the multi-monitoring screen playback method based on the MAF plug-in framework as described in any one of the above embodiments are performed.
[0038] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0039] The present application provides a multi-monitoring screen playback method, device, and medium based on the MAF plug-in framework. When the host program is started, the number of monitoring screens selected by the user in the host program, as well as the maximum number of monitoring screen mounts and the maximum number of startups of plug-in programs hosted in the host program can be obtained; then, based on the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups, each monitoring screen is mounted on multiple target plug-in programs; and when the monitoring screen is played through each target plug-in program, a keep-alive service is started to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen, and when an abnormality is detected in the monitoring, the playback of the corresponding monitoring screen is restored. This application pre-sets the optimal performance allocation for the maximum number of monitoring screen mounts supported by the host program to achieve the best resource performance utilization, and this application pre-sets the maximum number of plug-in startups to avoid unlimited growth in the number of plug-in startups that occupy system resources; in this way, multiple monitoring screens are mounted on multiple target plug-in programs, which can not only reduce the resource usage of the host program, but also make the load of each target plug-in program run reasonably and improve the operating efficiency; in addition, this application starts the keep-alive service when playing the monitoring screen through each target plug-in program, and can perform multi-dimensional keep-alive monitoring of the target plug-in program and the corresponding monitoring screen. Unlike directly keeping the screen data alive, this application performs dual monitoring of the target plug-in program and the monitoring screen, so that no matter what level of abnormality occurs, it can be quickly kept alive and restored, thereby effectively improving the stability of long-term playback of multiple screens, and automatically restoring the screen improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0041] FIG1 is a flow chart of a method for playing multiple monitoring images based on the MAF plug-in framework according to an embodiment of the present application;
[0042] FIG2 is a timing diagram of the association between multiple monitoring screens and plug-in program mounting according to an embodiment of the present application;
[0043] FIG3 is a flow chart of a keep-alive mechanism for multiple monitoring screens and plug-in programs provided in an embodiment of the present application;
[0044] FIG4 is a schematic diagram of the structure of a multi-monitoring screen playback device based on the MAF plug-in framework provided in an embodiment of the present application;
[0045] FIG5 is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0047] The existing official MAF plug-in framework is suitable for multi-process communication management, and when the plug-in crashes, it will not affect the host program. Although using multi-process communication to play camera monitoring images solves the process isolation problem, it cannot automatically restore the image playback. Moreover, using a single child process for a single image will also lead to the opening of multiple processes, causing excessive load on the monitoring application, thus affecting the overall playback stability and performance of the real-time monitoring images from multiple cameras.
[0048] Based on this, this application proposes the following technical solutions, please refer to the following for details:
[0049] In one embodiment, as shown in FIG1 , FIG1 is a flow chart of a multi-monitoring screen playback method based on the MAF plug-in framework provided by an embodiment of the present application; the present application provides a multi-monitoring screen playback method based on the MAF plug-in framework, and the method may include:
[0050] S110: When the host program is started, the number of monitoring screens selected by the user in the host program and the maximum number of monitoring screens that can be mounted and the maximum number of started plug-in programs hosted in the host program are obtained.
[0051] In this step, when the host program is started, the number of multi-screen monitoring used by the user can be captured to obtain the number of monitoring screens selected by the user in the host program. In addition, the present application can also obtain the preset maximum number of monitoring screens that can be mounted and the maximum number of startups for the plug-in program hosted in the host program. In this way, the number of plug-in programs to be launched can be constrained by the maximum number of monitoring screens that can be mounted and the maximum number of startups, so as to avoid the situation where unlimited plug-in programs are started and cause excessive system resource usage.
[0052] It can be understood that in order to avoid the situation in the prior art where a single screen uses a single sub-process, which leads to the opening of more processes and thus causes the monitoring application to be overloaded, the present application can pre-set the optimal performance allocation for the maximum number of monitoring screen mounts supported by the host program. Generally, a plug-in program is set to mount no more than 4 real-time monitoring screens to achieve the best resource performance utilization, but the number of monitoring screens mounted by each plug-in program can still be flexibly set. The specific setting can be made according to the actual situation and is not restricted here.
[0053] Furthermore, this application can also set the maximum number of plug-in programs to be launched based on the system resources of the host program, etc. The specific setting can be based on actual conditions and is not limited here. After setting the maximum number of launches, after obtaining the number of monitoring screens, the monitoring screens can be reasonably allocated based on the maximum number of launches and the maximum number of monitoring screens to be mounted. In this way, the monitoring screens can be played through a certain number of plug-in programs while avoiding excessive system resource usage.
[0054] In addition, this application uses the MAF plug-in framework for multi-monitoring screen playback. The MAF plug-in framework is a plug-in programming framework integrated under the .NET platform. It has two major functions. One is decoupling. The plug-in program and the host program are composed of 7 pipelines, and there are adapter pipelines on both sides. This can minimize the coupling between the plug-in and the host; the other is physical isolation, which can have program domain isolation and process isolation, so that if the plug-in program crashes, it will not cause the host program to crash or flash back.
[0055] S120: Mounting each monitoring screen on a plurality of target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screens that can be mounted, and the maximum number of startups.
[0056] In this step, after obtaining the number of monitoring screens and the pre-set maximum number of monitoring screen mounts and maximum number of startups of the plug-in program through step S110, the present application can allocate corresponding target plug-in programs to each monitoring screen according to the number of monitoring screens, the maximum number of monitoring screen mounts and the maximum number of startups, and mount each monitoring screen on the corresponding target plug-in program.
[0057] Specifically, after obtaining the number of monitoring screens and the maximum number of monitoring screen mounts and the maximum number of startups of the pre-set plug-in program, the present application can allocate each monitoring screen to the corresponding plug-in program in accordance with the pre-set plug-in program allocation rules, and taking into account the number of monitoring screens and the maximum number of monitoring screen mounts and the maximum number of startups of the pre-set plug-in program, and use the plug-in program to which the monitoring screen is allocated as the target plug-in program, so that each monitoring screen can be mounted on the target plug-in program.
[0058] It can be understood that there are multiple plug-in programs hosted in the host program of the present application. When it is necessary to allocate plug-in programs for each monitoring screen, the corresponding number of plug-in programs can be obtained according to the maximum startup number, and then each monitoring screen can be allocated to the acquired plug-in program according to a certain allocation strategy and taking into account the maximum number of monitoring screen mounts of the plug-in program. In this way, the target plug-in program associated with each monitoring screen can be determined.
[0059] Furthermore, before mounting each monitoring screen to multiple target plug-in programs, the present application can also perform communication detection on each target plug-in program, such as detecting the running status of each target plug-in program and the establishment of the communication channel between the target plug-in program and the host program. This can ensure that each monitoring screen can be mounted to the corresponding target plug-in program and the monitoring screen can be played through the target plug-in program.
[0060] S130: When the monitoring images are played through each target plug-in program, the keep-alive service is started to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring images, and when an abnormality is detected, the playback of the corresponding monitoring images is restored.
[0061] In this step, when each monitoring screen is mounted to the corresponding target plug-in program and the monitoring screen is played through each target plug-in program, this application can also start the keep-alive service to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen, and when an abnormality is monitored, use the keep-alive service to restore the playback of the corresponding monitoring screen.
[0062] In a specific embodiment, the present application can pre-register a keepalive service and, when playing multiple monitoring screens, activate the keepalive service to perform keepalive monitoring on each target plug-in program and the corresponding monitoring screen. It is understood that when an abnormality occurs in the playback of a monitoring screen, it will affect the communication channel between the target plug-in program and the host program. Furthermore, when the running status or playback status of the target plug-in program does not reach the preset state, the playback effect of the monitoring screen will also be affected.
[0063] Based on this, the keep-alive service in this application can monitor whether the monitoring screen is abnormal, and when a monitoring screen is monitored to be abnormal, it indicates that the communication pipeline between the target plug-in program associated with the abnormal monitoring screen and the host program is passively disconnected. At this time, the keep-alive service can detect the disconnection of the communication pipeline and take certain keep-alive measures to restore the playback of the abnormal monitoring screen based on the detection results; the keep-alive service of this application can also perform periodic detection in the background, and the objects of periodic detection include but are not limited to the process of the target plug-in program and the cache quantity of the target plug-in program. When it is detected that the process of the target plug-in program or the cache quantity of the target plug-in program is inconsistent with the pre-agreed situation, the pre-set solution in the keep-alive service can be started to restore the playback of the corresponding monitoring screen.
[0064] In addition, the keep-alive service of this application can not only improve the stability and resource utilization performance of multi-monitoring screen playback, but also can be applied to different multi-to-multi-function usage scenarios. It only needs to replace the plug-in program mount object and implement the recovery logic of the mount object to immediately realize the isolated operation and recovery management of different functions; and, in different industries or usage scenarios, the use of the plug-in program keep-alive service can quickly restore the plug-in service without causing dependence on the host program.
[0065] In the above embodiment, when the host program is started, the number of monitoring screens selected by the user in the host program and the maximum number of monitoring screen mounts and the maximum number of startups of the plug-in program hosted in the host program can be obtained; then, based on the number of monitoring screens, the maximum number of monitoring screen mounts and the maximum number of startups, each monitoring screen is mounted on multiple target plug-in programs; and when the monitoring screen is played through each target plug-in program, the keep-alive service is started to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen, and when an abnormality is detected, the playback of the corresponding monitoring screen is restored. This application pre-sets the optimal performance allocation for the maximum number of monitoring screen mounts supported by the host program to achieve the best resource performance utilization, and this application pre-sets the maximum number of plug-in startups to avoid unlimited growth in plug-in startups that occupy system resources; in this way, multiple monitoring screens are mounted on multiple target plug-in programs, which can not only reduce the resource usage of the host program, but also make the load of each target plug-in program run reasonably and improve the operating efficiency; in addition, this application starts the keep-alive service when playing the monitoring screen through each target plug-in program, and can perform multi-dimensional keep-alive monitoring of the target plug-in program and the corresponding monitoring screen. Unlike directly keeping the screen data alive, this application performs dual monitoring of the target plug-in program and the monitoring screen, so that no matter what level of abnormality occurs, it can be quickly kept alive and restored, thereby effectively improving the stability of long-term playback of multiple screens, and automatically restoring the screen improves the user experience.
[0066] In one embodiment, in S120, mounting each monitoring screen on multiple target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups may include:
[0067] S121: Acquire a corresponding number of target plug-in programs according to the maximum startup number.
[0068] S122: Based on the maximum number of mounted monitoring screens, and according to the number of monitoring screens and the maximum number of startups, each monitoring screen is evenly divided into each target plug-in program, and then it is determined whether there are any remaining undivided monitoring screens; if so, execute S123; if not, execute S124.
[0069] S123: After the number of monitoring screens is updated, the process returns to execute the steps based on the maximum number of monitoring screens to be mounted and subsequent steps.
[0070] S124: Mounting each monitoring screen on multiple target plug-in programs according to the division result.
[0071] In this embodiment, when mounting each monitoring screen on multiple target plug-in programs, the present application can first obtain the corresponding number of target plug-in programs based on the maximum number of startup plug-in programs, and then distribute each monitoring screen evenly to each target plug-in program based on the maximum number of monitoring screen mounts, and then determine whether there are any remaining monitoring screens. If there are any remaining monitoring screens, then the remaining monitoring screens can be evenly distributed to each target plug-in program again based on the number of remaining monitoring screens. In this way, each monitoring screen can be divided, and then the present application can mount each monitoring screen on the corresponding target plug-in program based on the division results.
[0072] It is understandable that this application is a method for playing multiple monitoring screens, specifically for the playback of multiple monitoring screens. Therefore, the number of monitoring screens in this application is greater than the maximum number of pre-set plug-in programs to be started. Thus, after obtaining the corresponding target plug-in programs according to the maximum number of startups, the monitoring screens can be played separately through multiple target plug-in programs, thereby improving operational efficiency and reducing excessive use of system resources. Furthermore, when this application evenly distributes the remaining monitoring screens, if the number of target plug-in programs is even and the number of remaining monitoring screens is odd, the remaining monitoring screens can be allocated to each target plug-in program in sequence according to the number of remaining monitoring screens. In this case, there is no need to ensure the consistency of the number of monitoring screens associated with each target plug-in program.
[0073] In one embodiment, as shown in FIG2 , FIG2 is a timing diagram of the association between multiple monitoring screens and plug-in program mounting provided by an embodiment of the present application; before mounting each monitoring screen on multiple target plug-in programs in S120 or S124, the following steps may also be included:
[0074] S101: For each target plug-in program, detecting whether the process of the target plug-in program is valid, whether the startup is completed, and whether the communication channel between the target plug-in program and the host program is activated.
[0075] S102: If both tests pass, a communication channel is established between the target plug-in program and the host program.
[0076] S103: If at least one of the tests fails, restarting a new target plug-in program to replace the target plug-in program, and establishing a communication channel between the new target plug-in program and the host program.
[0077] In this embodiment, before mounting each monitoring screen to multiple target plug-in programs, communication detection can also be performed on each target plug-in program, such as detecting the running status of each target plug-in program and the establishment of the communication channel between the target plug-in program and the host program. This can ensure that each monitoring screen can be mounted to the corresponding target plug-in program and the monitoring screen can be played through the target plug-in program.
[0078] Specifically, when performing communication detection on each target plug-in program, the present application can detect whether the process of the target plug-in program is valid, whether it has completed startup, and whether the communication channel between the host program and the host program is activated. In this way, it can be determined based on the detection results whether to establish a communication channel between the host program and the target plug-in program, and mount the monitoring screen on the target plug-in program.
[0079] It is understandable that when the present application detects whether the process of the target plug-in is valid, it can detect the ProcessId of the target plug-in. ProcessId is the unique ID identifier of the plug-in process, and a unique process object can be obtained through this ID identifier. Therefore, when it is detected that the process corresponding to the ID identifier is invalid, it means that the target plug-in process has exited; when the target plug-in process exits, the process is invalid, and the corresponding mounted monitoring screen cannot continue to play. At this time, a keep-alive service is required to restore process communication. Similarly, when it is detected that the target plug-in has not completed startup, or the communication channel with the host program has not been activated, the keep-alive service can also be used to restore process communication.
[0080] Furthermore, when the present application restores process communication through the keep-alive service, the process communication can be restored by restarting a new target plug-in to replace the target plug-in and establishing a communication pipe between the new target plug-in and the host program. Of course, other methods can also be used, such as detecting the status of an unstarted target plug-in, and if it can be started, waiting for the target plug-in to start before establishing communication, or detecting the status of an unactivated communication pipe, and if it can be activated, waiting until it is activated to establish a communication pipe with the host program. The specific settings can be made according to actual conditions and are not limited here.
[0081] In one embodiment, as shown in FIG3 , FIG3 is a flowchart of a keep-alive mechanism for multiple monitoring screens and plug-in programs provided in an embodiment of the present application; in S130 , when an abnormality is detected in monitoring, playback of the corresponding monitoring screen is restored, which may include:
[0082] S131: When it is monitored that the number of startup target plug-in programs does not match the maximum startup number, each monitoring screen is mounted again on multiple new target plug-in programs according to the number of monitoring screens, the maximum monitoring screen mounting number and the maximum startup number.
[0083] S132: After retrieving the playback status and video playback address of the associated monitoring screen through each new target plug-in program, playback of the associated monitoring screen is restored according to the playback status and the video playback address.
[0084] In this embodiment, when the keep-alive service is started to monitor the target plug-in program, the cache quantity of the target plug-in program, that is, the startup quantity, can be monitored regularly. If it is detected that the startup quantity of the target plug-in program does not match the preset maximum startup quantity, the new target plug-in program can be restarted and the communication channel with the host program can be re-established. After the communication channel is successfully established, the free multi-monitoring screen object is mounted and managed. When the monitoring screen is mounted to the new target plug-in program again, the target plug-in program will retrieve the playback status of the mounted monitoring screen, and re-acquire the video playback address based on the free multi-monitoring screen object, and actively resume the monitoring screen playback.
[0085] Specifically, when the present application monitors that the number of target plug-in programs started does not match the maximum number of startups, it can obtain the corresponding number of target plug-in programs based on the maximum number of plug-in programs started, and then use the maximum number of monitoring screen mounts as a benchmark to evenly distribute each monitoring screen to each target plug-in program, and then determine whether there are any remaining monitoring screens. If there are any remaining monitoring screens, they can be evenly distributed to each target plug-in program again based on the number of remaining monitoring screens. In this way, each monitoring screen can be divided, and each monitoring screen can be mounted on multiple new target plug-in programs again according to the division results. The new target plug-in program can also retrieve the playback status of the mounted monitoring screen and obtain the video playback address of the mounted monitoring screen. In this way, the monitoring screen can be actively restored based on the video playback address and playback status. The content played by the restored monitoring screen is the latest monitoring screen at the current moment.
[0086] It can be understood that each monitoring screen object of the present application records a PlayStateType (playback state type). Therefore, the new target plug-in program can detect the PlayStateType of the monitoring screen object it mounts. When PlayStateType = None (initialized empty state) is detected, the playback address of the monitoring screen can be retrieved to resume playback.
[0087] In one embodiment, when an abnormality is detected in monitoring in S130, playing back the corresponding monitoring image may include:
[0088] S133: When it is monitored that the process of any target plug-in program is invalid, a new target plug-in program is started, and a monitoring screen associated with the target plug-in program with the invalid process is mounted on the new target plug-in program.
[0089] S134: After retrieving the playback status and video playback address of the associated monitoring screen through the new target plug-in program, playback of the associated monitoring screen is resumed according to the playback status and the video playback address.
[0090] In this embodiment, as shown in FIG3 , when the keep-alive service is started to monitor the target plug-in program, the process of the target plug-in program can be monitored regularly. If it is detected that the process of any target plug-in program is invalid, a new target plug-in program is started, and the monitoring screen associated with the target plug-in program with the invalid process is mounted on the new target plug-in program. After the playback status and video playback address of the associated monitoring screen are retrieved through the new target plug-in program, the playback of the associated monitoring screen is restored according to the playback status and video playback address.
[0091] In a specific embodiment, the keep-alive service of the present application traverses the currently running processes of the system at a listening interval of 100ms to judge the validity of the ProcessId in the cache objects of each target plug-in program, mainly to judge whether there is a recorded ProcessId, or to judge whether the ProcessId is equal to -1. -1 indicates that the process has been destroyed or does not exist. If there is no recorded ProcessId, or the ProcessId is equal to -1, it means that an abnormality has occurred in the target plug-in program process, indicating that an abnormality has occurred in the playback of the multi-monitoring screen mounted on the target plug-in program. At this time, the object identifier can be used to identify an invalid process, and a new target plug-in program can be started to mount the original multi-monitoring screen data object, and re-establish a communication pipeline connection with the host program. After the communication pipeline is successfully established, the new target plug-in program will re-obtain the video playback address according to the multi-monitoring screen object, and the target plug-in program will automatically resume the playback operation.
[0092] In one embodiment, when an abnormality is detected in monitoring in S130, playing back the corresponding monitoring image may include:
[0093] S135: When any monitoring screen is detected to have a playback abnormality, the keep-alive service is triggered to detect a disconnection of a communication channel between a target plug-in program associated with the abnormally playing monitoring screen and the host program.
[0094] S136: If an abnormality is detected in the disconnection, the process of the associated target plug-in program is forcibly terminated through the keep-alive service, and the disconnected communication pipe information in the data set recorded in the memory is cleared, and the playback of the abnormal monitoring screen is restored.
[0095] In this embodiment, as shown in FIG3 , when the keep-alive service is started to monitor the target plug-in program, each monitoring screen can be monitored regularly for abnormalities. If an abnormality is detected in a monitoring screen, it indicates that the communication pipeline between the target plug-in program associated with the monitoring screen and the host program has been disconnected. At this time, the keep-alive service can be passively triggered to detect the disconnection of the communication pipeline between the target plug-in program associated with the abnormally played monitoring screen and the host program. If an abnormal disconnection is detected, the keep-alive service can be used to forcibly terminate the process of the associated target plug-in program, and after clearing the disconnected communication pipeline information in the data set recorded in the memory, the playback of the abnormally played monitoring screen can be restored.
[0096] It is understandable that when an exception occurs in the pipe communication object between the target plug-in program and the host program, the process identifier of the target plug-in program may still exist, so it is necessary to actively destroy it, such as forcibly ending the process of the target plug-in program and clearing the disconnected communication pipe information in the data set recorded in the memory.
[0097] Furthermore, after forcibly terminating the process of the associated target plug-in program and clearing the disconnected communication pipe information in the data set recorded in the memory, the present application can restart the new target plug-in program when restoring the playback of the abnormal monitoring screen, re-establish the communication pipe with the host program, and after the communication pipe is successfully established, the free multi-monitoring screen object is mounted and managed. When the monitoring screen is mounted to the new target plug-in program again, the target plug-in program will retrieve the playback status of the mounted monitoring screen, and re-obtain the video playback address based on the free multi-monitoring screen object, and actively restore the monitoring screen playback.
[0098] In one embodiment, triggering the keep-alive service in S135 to detect a disconnection of a communication channel between a target plug-in program associated with the abnormally played monitoring image and the host program may include:
[0099] S1351: Trigger the keep-alive service to traverse the data set in the memory, and search for the communication pipeline information between the target plug-in program associated with the abnormal monitoring screen played in the data set and the host program; wherein, the data set stores the communication pipeline information between the target plug-in program and the host program that are successfully established during initialization.
[0100] S1352: Detecting a disconnection of the communication channel between the associated target plug-in program and the host program based on the found communication channel information, wherein the found communication channel information includes no communication channel information found and the communication channel information is set to a NULL value.
[0101] In this embodiment, when the keepalive service is triggered to detect a disconnection in the communication channel between the target plug-in program associated with the abnormally played monitoring screen and the host program, the keepalive service may traverse the data set in memory and search for communication channel information between the target plug-in program associated with the abnormally played monitoring screen and the host program recorded in the data set. The service then detects a disconnection in the communication channel between the associated target plug-in program and the host program based on the found communication channel information. For example, if the communication channel information is not found or is set to a NULL value, it indicates that an abnormal disconnection in the communication channel between the target plug-in program and the host program has occurred. If the communication channel information is found and is not set to a NULL value, it indicates that the disconnection in the communication channel between the target plug-in program and the host program has not occurred.
[0102] It can be understood that the present application records the context pipe communication object information successfully established during initialization as a data set in the memory, so that when an abnormality occurs in the playback of the monitoring screen, the data set can be traversed in the memory to check for the object that is abnormally disconnected.
[0103] The following describes a multi-monitoring screen playback device based on the MAF plug-in framework provided in an embodiment of the present application. The multi-monitoring screen playback device based on the MAF plug-in framework described below and the multi-monitoring screen playback method based on the MAF plug-in framework described above can be referenced to each other.
[0104] In one embodiment, as shown in FIG4 , FIG4 is a schematic diagram of the structure of a multi-monitoring screen playback device based on the MAF plug-in framework provided by an embodiment of the present application. The present application also provides a multi-monitoring screen playback device based on the MAF plug-in framework, which may include a data acquisition module 210, a plug-in program determination module 220, and a keep-alive service module 230, specifically including the following:
[0105] The data acquisition module 210 is used to acquire the number of monitoring screens selected by the user in the host program and the maximum number of monitoring screens that can be mounted and the maximum number of startups of the plug-in programs hosted in the host program when the host program is started.
[0106] The plug-in program determining module 220 is configured to mount each monitoring screen on a plurality of target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups.
[0107] The keep-alive service module 230 is used to start the keep-alive service to monitor each target plug-in program and the corresponding monitoring screen when the monitoring screen is played through each target plug-in program, and to resume playing the corresponding monitoring screen when an abnormality is detected.
[0108] In the above embodiment, when the host program is started, the number of monitoring screens selected by the user in the host program and the maximum number of monitoring screen mounts and the maximum number of startups of the plug-in program hosted in the host program can be obtained; then, based on the number of monitoring screens, the maximum number of monitoring screen mounts and the maximum number of startups, each monitoring screen is mounted on multiple target plug-in programs; and when the monitoring screen is played through each target plug-in program, the keep-alive service is started to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen, and when an abnormality is detected, the playback of the corresponding monitoring screen is restored. This application pre-sets the optimal performance allocation for the maximum number of monitoring screen mounts supported by the host program to achieve the best resource performance utilization, and this application pre-sets the maximum number of plug-in startups to avoid unlimited growth in the number of plug-in startups that occupy system resources; in this way, multiple monitoring screens are mounted on multiple target plug-in programs, which can not only reduce the resource usage of the host program, but also make the load of each target plug-in program run reasonably and improve the operating efficiency; in addition, this application starts the keep-alive service when playing the monitoring screen through each target plug-in program, and can perform multi-dimensional keep-alive monitoring of the target plug-in program and the corresponding monitoring screen. Unlike directly keeping the screen data alive, this application performs dual monitoring of the target plug-in program and the monitoring screen, so that no matter what level of abnormality occurs, it can be quickly kept alive and restored, thereby effectively improving the stability of long-term playback of multiple screens, and automatically restoring the screen improves the user experience.
[0109] In one embodiment, the present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-monitoring screen playback method based on the MAF plug-in framework as described in any of the above embodiments.
[0110] In one embodiment, the present application further provides a computer device, including: one or more processors, and a memory.
[0111] The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the multi-monitoring screen playback method based on the MAF plug-in framework as described in any one of the above embodiments are performed.
[0112] Schematically, as shown in Figure 5, Figure 5 is a schematic diagram of the internal structure of a computer device provided in an embodiment of the present application, and the computer device 300 can be provided as a server. Referring to Figure 5, the computer device 300 includes a processing component 302, which further includes one or more processors, and a memory resource represented by a memory 301 for storing instructions that can be executed by the processing component 302, such as an application. The application stored in the memory 301 may include one or more modules, each of which corresponds to a set of instructions. In addition, the processing component 302 is configured to execute instructions to execute the multi-monitoring screen playback method based on the MAF plug-in framework of any of the above embodiments.
[0113] The computer device 300 may further include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate based on an operating system stored in the memory 301, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or the like.
[0114] Those skilled in the art will understand that the structure shown in FIG5 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0115] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0116] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.
[0117] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A multi-monitoring screen playback method based on the MAF plug-in framework, characterized in that: The method comprises: When the host program is started, the number of monitoring screens selected by the user in the host program and the maximum number of monitoring screens that can be mounted and the maximum number of startups of the plug-in programs hosted in the host program are obtained; Mounting each monitoring screen on a plurality of target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups; When the monitoring screen is played through each target plug-in program, the keep-alive service is started to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen, and when an abnormality is monitored, the corresponding monitoring screen is played back.
2. The multi-monitoring screen playback method based on the MAF plug-in framework according to claim 1 is characterized in that: The step of mounting each monitoring screen on a plurality of target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts, and the maximum number of startups includes: Acquire a corresponding number of target plug-in programs according to the maximum startup number; Based on the maximum number of monitoring screens to be mounted, and according to the number of monitoring screens and the maximum number of startups, each monitoring screen is equally divided into each target plug-in program, and then it is determined whether there are any remaining undivided monitoring screens; If it exists, after updating the number of monitoring screens, return to execute the steps based on the maximum number of monitoring screens mounted and its subsequent steps; If it does not exist, each monitoring screen is mounted on multiple target plug-in programs according to the division result.
3. The multi-monitoring screen playback method based on the MAF plug-in framework according to claim 1 or 2, characterized in that: Before mounting each monitoring screen on multiple target plug-in programs, the method further includes: For each target plug-in program, detecting whether the process of the target plug-in program is valid, whether the startup is completed, and whether the communication channel with the host program is activated; If all the detections are passed, a communication channel is established between the target plug-in program and the host program; If at least one of the tests fails, a new target plug-in program is restarted to replace the target plug-in program, and a communication channel is established between the new target plug-in program and the host program.
4. The multi-monitoring screen playback method based on the MAF plug-in framework according to claim 1 is characterized in that: When an abnormality is detected in monitoring, the corresponding monitoring screen is played back and restored, including: When it is monitored that the number of startups of the target plug-in program does not match the maximum startup number, the monitoring screens are mounted again on multiple new target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts and the maximum startup number; After retrieving the playback status and video playback address of the associated monitoring screen through each new target plug-in program, the playback of the associated monitoring screen is restored according to the playback status and the video playback address.
5. The multi-monitoring screen playback method based on the MAF plug-in framework according to claim 1 is characterized in that: When an abnormality is detected in monitoring, the corresponding monitoring screen is played back and restored, including: When it is monitored that the process of any target plug-in program is invalid, a new target plug-in program is started, and a monitoring screen associated with the target plug-in program with the invalid process is mounted on the new target plug-in program; After retrieving the playback status and video playback address of the associated monitoring screen through the new target plug-in program, the playback of the associated monitoring screen is restored according to the playback status and the video playback address.
6. The multi-monitoring screen playback method based on the MAF plug-in framework according to claim 1 is characterized in that: When an abnormality is detected in monitoring, the corresponding monitoring screen is played back and restored, including: When any monitoring screen is monitored to have abnormal playback, the keep-alive service is triggered to detect the disconnection of the communication channel between the target plug-in program associated with the abnormally played monitoring screen and the host program; If an abnormality is detected in the disconnection, the process of the associated target plug-in program is forcibly terminated through the keep-alive service, and after the disconnected communication pipe information in the data set recorded in the memory is cleared, the monitoring screen with abnormal playback is resumed.
7. The multi-monitoring screen playback method based on the MAF plug-in framework according to claim 6 is characterized in that: The triggering of the keep-alive service to detect the disconnection of the communication channel between the target plug-in program associated with the abnormally played monitoring screen and the host program includes: Triggering the keep-alive service to traverse the data set in the memory, and searching for the communication pipeline information between the target plug-in program and the host program associated with the abnormally played monitoring screen in the data set; wherein the communication pipeline information between the target plug-in program and the host program successfully established during initialization is stored in the data set; The disconnection of the communication pipeline between the associated target plug-in program and the host program is detected according to the found communication pipeline information, wherein the found communication pipeline information includes no communication pipeline information found and the communication pipeline information is set to a NULL value.
8. A multi-monitoring screen playback device based on the MAF plug-in framework, characterized in that: include: A data acquisition module, used for acquiring, when a host program is started, the number of monitoring screens selected by a user in the host program, and the maximum number of monitoring screens that can be mounted and the maximum number of startups of plug-in programs hosted in the host program; A plug-in program determination module, used for mounting each monitoring screen on multiple target plug-in programs according to the number of monitoring screens, the maximum number of monitoring screen mounts and the maximum number of startups; The keep-alive service module is used to start the keep-alive service to perform keep-alive monitoring on each target plug-in program and the corresponding monitoring screen when the monitoring screen is played through each target plug-in program, and to resume playing the corresponding monitoring screen when an abnormality is detected.
9. A storage medium, characterized in that: The storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the multi-monitoring screen playback method based on the MAF plug-in framework as described in any one of claims 1 to 7.
10. A computer device, characterized in that: include: one or more processors, and memory; The memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the multi-monitoring screen playback method based on the MAF plug-in framework as described in any one of claims 1 to 7 are executed.
Citation Information
Patent Citations
Method for playing video monitoring client terminal and system
CN101583022A
Keep-alive monitoring method and device and electronic equipment
CN110032487A
Web playing monitoring video method and system for hosting C / S host program
CN114710708A
Process memory early warning method and device for on-demand fine-grained monitoring and medium
CN115858300A
WebRTC-based method capable of previewing real-time videos in various browsers
CN116032903A