Disclosure of Invention
In order to solve the technical problems of unbalanced load calling among services, low fault tolerance among platforms and overlong time consumption for network re-access in the prior art, the invention provides a scheduling method and a scheduling system for a video monitoring platform, which are used for solving the technical problems.
According to one aspect of the present invention, a scheduling method for a video monitoring platform is provided, which includes:
receiving a video preview request of a client, acquiring a first service from a scheduling center based on a center management service of a spring frame, and pushing a stream to the client;
and responding to the scheduling exception of the first business service of the scheduling center, and providing the corresponding business service to the client by utilizing a second business service based on a registry in the IceGrid architecture.
In some particular embodiments, the first business service and the second business service each include one or more of a forwarding service, a gateway service, a storage service, and a national standard service.
In some specific embodiments, pushing the stream to the client specifically includes:
the method comprises the steps that a center management service creates a video preview request, obtains a first forwarding service from a scheduling center, and returns forwarding information to a client;
the client sends a stream fetching instruction to the first forwarding service, and pushes the stream to the client in response to the first forwarding service receiving the stream fetching instruction.
In some specific embodiments, the method further includes the step that the first forwarding service returns forwarding information to the central management service, and the central management service sends a stream fetching instruction to the third-party device through the first gateway service and pushes a stream to the client through the first forwarding service.
In some specific embodiments, the dispatch center selects the first business service with the optimal health value.
In some particular embodiments, the health value is characterized by at least one service attribute option and a corresponding attribute specific gravity value.
In some embodiments, the second attendant service is deployed in a node service cluster of a registry in the IceGrid architecture.
In some specific embodiments, the first business service is preferentially scheduled based on the network domain attribution, the binding relationship, the IP address and the priority relationship of the client and the central management service.
According to a second aspect of the invention, a computer-readable storage medium is proposed, on which one or more computer programs are stored, which when executed by a computer processor implement the method of any of the above.
According to a third aspect of the present invention, there is provided a scheduling system for a video surveillance platform, the system comprising:
a scheduling unit: the method comprises the steps that a video preview request for receiving a client is configured, a first business service is obtained from a scheduling center based on a center management service of a spring frame, and the flow is pushed to the client;
an exception scheduling unit: and the configuration is used for responding to the scheduling exception of the first business service of the scheduling center, and providing the corresponding business service to the client by utilizing the second business service based on the registry in the IceGrid architecture.
The scheduling method and system for the video monitoring platform provided by the invention solve the problems of load balance of calling among various services, CPU (central processing unit), network bandwidth, uplink rate, downlink rate, registration amount, watching amount, disk utilization rate and the like. Avoiding the service becoming a bottleneck of the system due to the over-high load. The fault tolerance of the platform service is improved, and the abnormal switching to the normal service is supported immediately. For example, if the media access service is abnormal, the media access service with a high health value is switched to, so that the user can not sense the media access service and the video preview process can be normally executed. The storage service is abnormally switched to the storage service with a high normal health value, and the time for cutting off the storage of the video is reduced. And (4) configuring the key video monitoring, and automatically removing other video channels with low priority when a core administrator checks the key video related services to fully guarantee. The automatic starting service of the icegrid is started, the time period that the video cannot be previewed is shortened, the time consumed by the equipment for re-accessing the network is shortened, and the user experience is improved. And the flexible capacity expansion of the service is supported, single-point faults are avoided, the scheduling of large-scale equipment access and storage is supported, the load balance of the service is realized, multiple users preview videos simultaneously, and the network bandwidth cannot be excessively high.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows a flowchart of a scheduling method for a video surveillance platform according to an embodiment of the present application. As shown in fig. 1, the method includes:
s201: receiving a video preview request of a client, acquiring a first service from a scheduling center by a center management service based on a spring frame, and pushing a stream to the client. Wherein the first business service comprises one or more of a forwarding service, a gateway service, a storage service and a national standard service.
In a specific embodiment, the center management service creates a video preview request, acquires a first forwarding service from the scheduling center, and returns forwarding information to the client; the client sends a stream fetching instruction to the first forwarding service, and pushes the stream to the client in response to the first forwarding service receiving the stream fetching instruction. Specifically, referring to fig. 2, a flowchart of video preview according to a first specific embodiment of the present application is shown, as shown in fig. 2, a platform client requests a central management service to open a channel media stream (ChnID), the central management service requests a media forwarding service to open the media stream (ChnID), the media forwarding service queries that Chn has created and forwarded and then returns forwarding information (including a forwarding ID, a token, a forwarding IP port, and whether the forwarding information exists), the central management service returns the forwarding information to the platform client, the platform client requests a media forwarding service to play a video (through the forwarding ID and the token), requests to send a media stream (through TCP) to the platform client through the back media forwarding service, and the platform client and the media forwarding service regularly send a media stream state to each other.
In another specific embodiment, the first forwarding service returns forwarding information to the central management service, and the central management service sends a stream fetching instruction to the third-party device through the first gateway service and pushes a stream to the client through the first forwarding service. Referring specifically to fig. 3, which shows a flowchart of video preview according to a second specific embodiment of the present application, as shown in fig. 3, a platform client requests a central management service to open a channel media stream (ChnID), the central management service requests a media forwarding service to open a media stream (ChnID), the media forwarding service queries that Chn has created forwarding and then returns forwarding information (including forwarding ID, passsd, forwarding IP, port, and whether created), the central management service sends a request gateway push code stream (including ChnID, forwarding ID, passsd, and forwarding IP port) to a media access gateway, the central management service returns forwarding information to the platform client in response to a response from the media access gateway, and the media access gateway requests a push code stream (according to ChnID and forwarding ID) to the media forwarding service, the media access gateway sends a media stream (through TCP) to the media forwarding service after the media forwarding service passes the request, and the media forwarding service and the media access gateway mutually transmit the media stream state at regular time, wherein the code stream is a result returned by the request of the media access gateway to the third party. The platform client requests the media forwarding service to play the video (through forwarding ID and passsd), requests the media forwarding service to send the media stream to the platform client (through TCP) after passing, and the platform client and the media forwarding service send the media stream state to each other at regular time.
In a particular embodiment, the dispatch center selects a first business service having an optimal health value characterized by at least one service attribute option and a corresponding attribute specific gravity value. The health value calculation mode may be specifically expressed as: according to the service attribute option attribute specific value, as an example, for a certain service, the service attribute option and the corresponding attribute specific value are as follows:
service ordering policy attribute weight value (allow customization, greater weight greater larger)
The serving uplink rate is 15%,
the serving downlink rate is 15%,
the current memory is served by 10%,
the service currently stores 10% of the data,
servicing the current CPU for 10%,
the current health value of the service is 10%,
the number of current registrations served is 10% higher,
the number of current views of the service is 10% higher,
the service current service liability rate is 10%,
the maximum access limit is served and,
the largest registered device is served and,
serving the largest registered platform.
The data corresponding to each attribute option may be multiplied by the attribute specific gravity value and summed to obtain the health value. It should be noted that the method for determining a health value shown in the above example is only an example, and all numerical values representing the current state of the service may be used as the health value, and the embodiment of the present application is not particularly limited. The realization mode determines the health value through the attribute specific gravity value corresponding to at least one service attribute option respectively, and can relate to the state of equipment providing services more comprehensively, so that the health value is more objective and accurate.
In a specific embodiment, the scheduling policy includes: preferential allocation (same domain definition, binding priority, same IP address priority, performance health priority, user/resource priority allocation); load balancing (resource balancing, common monitoring, high-definition monitoring, panorama ball); performance balance (CPU utilization, memory utilization, disk utilization).
S202: and responding to the scheduling exception of the first business service of the scheduling center, and providing the corresponding business service to the client by utilizing a second business service based on a registry in the IceGrid architecture. An IceGrid field is made up of a Registry (Registry) and any number of nodes (nodes). Together, the registry and the nodes cooperate to manage some information and service processes including some applications (applications). Each application is assigned to a server of a particular node. This registry maintains this information, the records of information in the registry being persisted to the database, and the nodes being responsible for starting and monitoring their designated server processes.
The service scheduling method realizes the service scheduling of video preview based on the Zeroc IceGrid and Spring, supports the configuration of a user-defined service scheduling strategy, allows the scheduling strategy to be user-defined, and automatically starts corresponding services according to the IceGrid configuration when all started service scheduling is abnormal. The load balance of calling among all services, CPU, network bandwidth, uplink rate, downlink rate, registration amount, watching amount, disk utilization rate and the like are solved. The method avoids the bottleneck that the service becomes a system due to overhigh load, improves the fault tolerance of platform services, and supports the instant switching of part of abnormal services to normal services. For example, if the media access service is abnormal, the media access service with a high health value is switched to, so that the user can not sense and the video preview process can be normally executed. The storage service is abnormally switched to the storage service with a high normal health value, and the time for cutting off the storage of the video is reduced. And (4) configuring the key video monitoring, and automatically removing other video channels with low priority when a core administrator checks the key video related services to fully guarantee. The automatic starting service of the icegrid is started, the time period that the video cannot be previewed is shortened, the time consumed by the equipment for re-accessing the network is shortened, and the user experience is improved. And the flexible capacity expansion of the service is supported, single-point faults are avoided, the scheduling of large-scale equipment access and storage is supported, the load balance of the service is realized, multiple users preview videos simultaneously, and the network bandwidth cannot be excessively high.
Fig. 4 is a flowchart illustrating a scheduling method for a video monitoring platform according to a specific embodiment of the present application, where, as shown in fig. 4, scheduling is requested during video preview, and it is first determined whether a channel binds a forwarding service, if so, the bound forwarding service is preferentially obtained, and when the forwarding service is online, scheduling of a gateway/storage service is performed, where the scheduling of the gateway/storage service is performed according to rules of IP priority, same partition priority, and health value priority, and the scheduling of the gateway/storage service is completed when the gateway/storage service is online, so as to perform video preview. In the above process, if there is no binding forwarding service or the binding forwarding service is not online (the SDK device or the GB device clears the current binding relationship), the gateway service is entered: and the SDK equipment inquires the network access gateway, the GB equipment inquires the health gateway, if a scheduling gateway exists and the scheduling gateway is online, scheduling is carried out according to rules of IP priority, same partition priority and health value priority, and video preview is carried out. If the dispatching gateway does not exist, or the dispatching gateway is not on-line or the gateway/storage service is not on-line, starting the corresponding service according to a service starting strategy configured by the management page, if the service is failed to be started, giving an alarm through a short message or a mail, and starting the corresponding service by using the IceGrid Admin after the service is successfully started.
In a specific embodiment, the media access service software (MGW) is mainly used for accessing devices such as a front-end encoder (DVR/DVS/IP Camera/NVR, etc.), an alarm host, etc., and simultaneously supports accessing and managing the devices according to the ONVIF standard. National Standard signalling service (GBFU/GBFD): the national standard signaling is connected through the national standard signaling service, and the national standard media data is connected through the media access gateway. The national standard signaling service simultaneously supports the docking of national standard superior and inferior platforms, and realizes the platform cascade of VMS 2000. The media forwarding service (MDS) mainly provides functions of copying and forwarding a monitoring real-time video stream, applies for a video from a front-end device, and forwards the video to a plurality of media requesters (including a video client, a storage service, a video intelligent analysis service, and the like). The video storage service (MRS) requests media data from the forwarding service and stores the media data in a certain format in a large-capacity storage device such as an IP SAN, a cloud storage, or the like. And simultaneously provides video retrieval, video playback and download services. The video monitoring client side achieves the functions of resource catalog display, video preview, video playback, holder control, electronic map and the like of the platform, and meets the video monitoring requirements of users.
In a specific embodiment, a policy of service scheduling and a service to be started in abnormal scheduling are configured in a web management background, wherein the normal scheduling configuration of the service scheduling is to configure the proportion occupied by option scheduling of each server in a user-defined manner (including the uplink rate of the server, the downlink rate of the server, the current memory, the current storage, the cpu running condition, the equipment registration amount, the disk utilization rate and the like); the configuration of the scheduling exception failure comprises that the scheduling exception starts a brand new corresponding service, for example, the forwarding service cannot be scheduled, the forwarding service is started, and other services adopt the same means.
With continued reference to FIG. 5, FIG. 5 illustrates a block diagram of a scheduling system for a video surveillance platform according to one embodiment of the present application. The system specifically includes a scheduling unit 501 and an exception scheduling unit 502. The scheduling unit 501 is configured to receive a video preview request of a client, acquire a first service from a scheduling center based on a spring frame center management service, and push a stream to the client; the exception scheduling unit 502 is configured to, in response to a scheduling exception of a first business service of the scheduling center, provide a corresponding business service to the client by using a second business service based on a registry in the IceGrid architecture.
With continuing reference to fig. 6, fig. 6 shows a framework diagram of a scheduling system for a video surveillance platform according to a specific embodiment of the present application, as shown in fig. 6, a management backend 601, a video client 602, and a third party interface 603 respectively access to a central management service 604 of a spring service, where the central management service 604 includes a web service 6041 and an intelligent scheduling center 6042, the management backend 601, the video client 602, and the third party interface 603 are connected through the web service 6041, the web service 6041 includes an interface, a basic service, and a business service, where the business service cooperates with the intelligent scheduling center 6042, the intelligent scheduling center 6042 includes a custom configuration load policy (server options), a configuration scheduling exception enables a corresponding service, a scheduling exception, a server-used exception, and an alarm policy, and cooperates with a Zeroc Ice Grid service 605, specifically, the intelligent scheduling center 6042 establishes a service query relationship with a master registry 6051 in the Zeroc Grid service 605, the combination with the Ice node service cluster 6053 realizes that the intelligent scheduling center 6042 is provided with corresponding services such as gateway service, forwarding service, storage service, national standard lower GBFD, national standard upper GBFU and the like. The frame structure can reduce the time period that videos cannot be previewed, reduce the time consumed by the equipment to access the network again under the abnormal scheduling condition, and improve the user experience.
Referring now to FIG. 7, shown is a block diagram of a computer system 700 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, the computer system 700 includes a Central Processing Unit (CPU)701, which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
The following components are connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Liquid Crystal Display (LCD) and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by a Central Processing Unit (CPU)701, performs the above-described functions defined in the method of the present application. It should be noted that the computer readable storage medium of the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable storage medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware.
As another aspect, the present application also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable storage medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: the method comprises the steps of receiving a video preview request of a client, acquiring a first service from a scheduling center by a center management service based on a spring frame, and pushing a stream to the client; and responding to the scheduling exception of the first business service of the scheduling center, and providing the corresponding business service to the client by utilizing a second business service based on a registry in the IceGrid architecture.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.