CN116634208A - Service algorithm scheduling method, system, device, terminal and storage medium - Google Patents

Service algorithm scheduling method, system, device, terminal and storage medium Download PDF

Info

Publication number
CN116634208A
CN116634208A CN202310921777.0A CN202310921777A CN116634208A CN 116634208 A CN116634208 A CN 116634208A CN 202310921777 A CN202310921777 A CN 202310921777A CN 116634208 A CN116634208 A CN 116634208A
Authority
CN
China
Prior art keywords
algorithm
service
management component
configuration information
shared
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310921777.0A
Other languages
Chinese (zh)
Inventor
王隐之
吴罕
祝克帅
吴佳乐
纪晓龙
杨再初
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Yingtelinda Information Technology Co ltd
Hefei Intelingda Information Technology Co ltd
Original Assignee
Beijing Yingtelinda Information Technology Co ltd
Hefei Intelingda Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Yingtelinda Information Technology Co ltd, Hefei Intelingda Information Technology Co ltd filed Critical Beijing Yingtelinda Information Technology Co ltd
Priority to CN202310921777.0A priority Critical patent/CN116634208A/en
Publication of CN116634208A publication Critical patent/CN116634208A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/422Input-only peripherals, i.e. input devices connected to specially adapted client devices, e.g. global positioning system [GPS]
    • H04N21/4223Cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/441Acquiring end-user identification, e.g. using personal code sent by the remote control or by inserting a card
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/466Learning process for intelligent management, e.g. learning user preferences for recommending movies
    • H04N21/4662Learning process for intelligent management, e.g. learning user preferences for recommending movies characterized by learning algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4882Data services, e.g. news ticker for displaying messages, e.g. warnings, reminders

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a service algorithm scheduling method, a system, a device, a terminal and a storage medium, and relates to the technical field of data processing. The service algorithm scheduling method comprises the following steps: obtaining a video stream to be processed, which is acquired by a camera; determining a service algorithm for realizing each service deployed by the terminal based on the configuration information; generating an algorithm scheduling topological sequence shared by all the services based on the shared algorithm and the non-shared algorithm in the determined service algorithm; and sequentially calling algorithm objects of each service algorithm according to the algorithm scheduling topology sequence to process the video stream, so as to obtain a processing result aiming at each service. The scheme provided by the embodiment of the invention can realize algorithm scheduling aiming at multiple services.

Description

Service algorithm scheduling method, system, device, terminal and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a service algorithm scheduling method, system, device, terminal, and storage medium.
Background
With the popularization of intelligent cameras, a service algorithm is deployed in the intelligent cameras to process video streams collected by the intelligent cameras according to service requirements.
In a practical scenario, the intelligent camera generally needs to support multiple services, so a service algorithm needs to be deployed for each service, and in view of the above situation, a service algorithm scheduling scheme needs to be provided.
Disclosure of Invention
The embodiment of the invention aims to provide a service algorithm scheduling method, a system, a device, a terminal and a storage medium, so as to realize algorithm scheduling for multiple services. The specific technical scheme is as follows:
according to a first aspect of an embodiment of the present invention, there is provided a service algorithm scheduling method applied to a terminal configured with a camera, the method including:
obtaining a video stream to be processed, which is acquired by the camera;
determining a service algorithm for realizing each service deployed by the terminal based on the configuration information;
generating an algorithm scheduling topological sequence shared by all the services based on the shared algorithm and the non-shared algorithm in the determined service algorithm;
and sequentially calling algorithm objects of each service algorithm according to the algorithm scheduling topology sequence to process the video stream, so as to obtain a processing result aiming at each service.
Optionally, the algorithm object of the business algorithm is generated by:
obtaining an implementation function of the service algorithm;
Based on the implementation function, creating an algorithm unit registration class with an interface consistent with a preset algorithm unit registration base class interface, and determining a registration identifier of the algorithm object;
generating a registration object corresponding to the algorithm unit registration class;
creating an algorithm unit class which comprises the registration object and has an interface consistent with an interface of a preset algorithm unit base class;
and generating an algorithm object corresponding to the algorithm unit class as the algorithm object of the business algorithm.
Optionally, the method further comprises:
responding to a configuration information updating instruction aiming at a target service, and updating information aiming at the target service in the configuration information;
and updating the algorithm scheduling topological sequence according to the updated information of the target service recorded in the configuration information.
Optionally, the determining, based on the configuration information, a service algorithm for implementing each service deployed by the terminal includes:
determining a first service algorithm for realizing each service deployed by the terminal according to the configuration information;
determining a second service algorithm in an available state according to the switch identification of each first service algorithm recorded in the configuration information;
The algorithm scheduling topological sequence shared by all the businesses is generated based on the shared algorithm and the non-shared algorithm of the determined business algorithm, and the algorithm scheduling topological sequence comprises the following steps:
and generating an algorithm scheduling topological sequence shared by each service according to the execution sequence of the second service algorithm aiming at each service recorded in the configuration information based on the determined shared algorithm and the non-shared algorithm in the second service algorithm.
According to a second aspect of an embodiment of the present invention, there is provided a service algorithm scheduling system, the system including: a stream taking component, a configuration management component and a task management component, wherein,
the stream taking component is used for obtaining a video stream to be processed, which is acquired by the camera;
the configuration management component is used for determining a service algorithm for realizing each service deployed by the terminal based on the configuration information and notifying the task management component;
the task management component is used for generating an algorithm scheduling topological sequence shared by all services based on the shared algorithm and the non-shared algorithm of the service algorithm notified by the configuration management component;
the task management component is further configured to call algorithm objects of each service algorithm in turn according to the algorithm scheduling topology sequence to process the video stream obtained by the stream taking component, so as to obtain a processing result for each service.
Optionally, the configuration management component is further configured to update information for the target service in the configuration information in response to a configuration information update instruction for the target service, and notify the task management component of the information for the target service in the updated configuration information;
and the task management component is also used for updating the algorithm scheduling topological sequence according to the information of the target service recorded in the updated configuration information notified by the configuration management component.
Optionally, the configuration management component is specifically configured to determine, according to configuration information, a first service algorithm for implementing each service deployed by the terminal; determining a second service algorithm in an available state according to the switch identification of each first service algorithm recorded in the configuration information, and notifying the determined second service algorithm to the task management component;
the task management component is specifically configured to generate an algorithm scheduling topology sequence shared by each service according to the execution sequence of the second service algorithm recorded in the configuration information for each service based on the shared algorithm and the non-shared algorithm in the determined second service algorithm notified by the configuration management component.
Optionally, the system further comprises: the algorithm management component(s),
the configuration management component is further used for notifying the algorithm management component of the configuration information;
the task management component is further used for notifying the algorithm scheduling topological sequence to the algorithm management component;
the algorithm management component is used for initializing the algorithm object of each business algorithm according to the configuration information notified by the configuration management component, and providing computing power resources for the algorithm object of each invoked business algorithm according to the algorithm scheduling topology sequence notified by the task management component.
Optionally, the system further comprises: an alarm assembly for providing an alarm to the user,
the task management component is further used for notifying the alarm component of the processing results of the services;
the alarm component is used for generating alarm information according to the processing results of the tasks, which are notified by the task management component, and sending the alarm information to the alarm information receiving end.
According to a third aspect of an embodiment of the present invention, there is provided a service algorithm scheduling apparatus, the apparatus including:
the video stream obtaining module is used for obtaining a video stream to be processed, which is collected by the camera;
The service algorithm determining module is used for determining a service algorithm for realizing each service deployed by the terminal based on the configuration information;
the algorithm scheduling topological sequence generation module is used for generating an algorithm scheduling topological sequence shared by all services based on the shared algorithm and the non-shared algorithm in the determined service algorithm;
and the video stream processing module is used for sequentially calling algorithm objects of each service algorithm to process the video stream according to the algorithm scheduling topological sequence to obtain a processing result aiming at each service.
Optionally, the algorithm object of the business algorithm is generated by:
obtaining an implementation function of the service algorithm;
based on the implementation function, creating an algorithm unit registration class with an interface consistent with a preset algorithm unit registration base class interface, and determining a registration identifier of the algorithm object;
generating a registration object corresponding to the algorithm unit registration class;
creating an algorithm unit class which comprises the registration object and has an interface consistent with an interface of a preset algorithm unit base class;
and generating an algorithm object corresponding to the algorithm unit class as the algorithm object of the business algorithm.
Optionally, the apparatus further includes:
A configuration information updating module, configured to respond to a configuration information updating instruction for a target service, and update information for the target service in the configuration information;
and the algorithm scheduling topology sequence updating module is used for updating the algorithm scheduling topology sequence according to the information of the target service recorded in the updated configuration information.
Optionally, the service algorithm determining module includes:
the first business algorithm determining unit is used for determining a first business algorithm for realizing each business deployed by the terminal according to the configuration information;
the second business algorithm determining unit is used for determining the second business algorithm in the available state according to the switch identification of each first business algorithm recorded in the configuration information;
the algorithm scheduling topological sequence generation module is specifically used for generating an algorithm scheduling topological sequence shared by each service according to the execution sequence of the second service algorithm recorded in the configuration information aiming at each service based on the determined shared algorithm and the determined non-shared algorithm in the second service algorithm.
According to a fourth aspect of the embodiment of the invention, there is provided a terminal, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, the memory and the camera complete communication with each other through the communication bus;
The camera is used for collecting video streams;
a memory for storing a computer program;
and the processor is used for realizing the business algorithm scheduling method in the first aspect when executing the program stored in the memory.
According to a fifth aspect of an embodiment of the present invention, there is provided a computer readable storage medium, in which a computer program is stored, the computer program implementing the business algorithm scheduling method according to the first aspect, when the computer program is executed by a processor.
The embodiment of the invention has the beneficial effects that:
the service algorithm scheduling scheme provided by the embodiment of the invention can determine the common algorithm and the non-common algorithm in the service algorithms for realizing the service deployed by the terminal based on the configuration information, and determine the algorithm scheduling topological sequence according to the common algorithm and the non-common algorithm, so that the algorithm object of each service algorithm is called according to the determined algorithm scheduling topological sequence to process the video stream acquired by the camera, and the processing result of each service is obtained. Therefore, algorithm objects of each service algorithm are called based on the algorithm scheduling topological sequence, and algorithm scheduling can be realized for multiple services.
Because the common algorithm and the non-common algorithm exist in the service algorithm of each service, the determined algorithm scheduling topological sequence can combine the common algorithm and the non-common algorithm, so that the common algorithm can meet the requirements of each service only by being called once, and the common algorithm is not required to be repeatedly called for different services. Therefore, the service algorithm scheduling is performed, the calling times of the common algorithm are reduced, and the consumption of computational resources when the algorithm is executed is reduced. Therefore, the service algorithm scheduling method provided by the embodiment of the invention can reduce resource consumption under the condition of multiple services.
Of course, it is not necessary for any one product or method of practicing the invention to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the invention, and other embodiments may be obtained according to these drawings to those skilled in the art.
Fig. 1 is a flow chart of a first service algorithm scheduling method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an algorithm scheduling topology sequence provided in an embodiment of the present invention;
FIG. 3 is a schematic flow chart of an algorithm object for generating a business algorithm according to an embodiment of the present invention;
fig. 4 is a flow chart of a second service algorithm scheduling method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a service algorithm scheduling system according to an embodiment of the present invention;
fig. 6a is a schematic diagram of alarm information of an unworn mask according to an embodiment of the present invention;
fig. 6b is a schematic diagram of alarm information of an unnormalized mask according to an embodiment of the present invention;
Fig. 7 is a schematic structural diagram of an overall system for scheduling a service algorithm according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an alarm service system according to an embodiment of the present application;
FIG. 9a is a first packaged deployment catalog provided by an embodiment of the application;
FIG. 9b is a second packaged deployment catalog provided by an embodiment of the application;
fig. 10a is a schematic diagram of a mask alarm service configuration interface according to an embodiment of the present application;
FIG. 10b is a schematic diagram of a two-in-one alarm service configuration interface for a reflective garment of a helmet according to an embodiment of the present application;
FIG. 11a is a diagram showing a first two-in-one warning message for a reflective garment of a helmet according to an embodiment of the present application;
FIG. 11b is a diagram showing a second type of two-in-one warning message for a reflective coat of a helmet according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a service algorithm scheduling device according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
With the popularization of terminals such as intelligent cameras, a mode of deploying a service algorithm in the terminals configured with the cameras to realize services such as content identification, classification, alarm and the like on images or videos acquired by the cameras has been widely used.
In a practical scenario, the terminal may need to support multiple services, and therefore, a service algorithm needs to be deployed for each service, and in view of the above situation, a service algorithm scheduling scheme needs to be provided.
The execution body of the embodiment of the present invention is described below.
The execution main body of the embodiment of the invention is a terminal provided with a camera. For example, the camera may be a smart camera, a mobile phone equipped with a camera, or the like. The embodiment of the present invention is not limited thereto.
The service algorithm scheduling method provided by the embodiment of the invention is explained by a specific embodiment.
Referring to fig. 1, a flow chart of a first service algorithm scheduling method is provided, which includes the following steps S101-S104.
Step S101: and obtaining the video stream to be processed, which is acquired by the camera.
The camera is a camera configured by a terminal, the video stream may be a video stream collected by the camera in real time, or may be a video stream collected by the camera in a historical time period, which is not limited in the embodiment of the present invention.
Step S102: based on the configuration information, a service algorithm for implementing each service deployed by the terminal is determined.
The configuration information records related information for determining each service deployed by the terminal, and specifically, the configuration information may include service version information, alarm service related information, and related information of a service algorithm for implementing each service. The relevant information of the alarm service can comprise an alarm service identifier, an alarm information category and the like; the related information of the service algorithm for implementing each service may include a parameter value range of the service algorithm, model file information corresponding to the service algorithm, and the like.
The configuration information can be pre-stored in the terminal, and the configuration information sent by other terminals can also be received.
Each service deployed by the terminal can be realized by one service algorithm or a combination of a plurality of service algorithms.
The manner in which the service algorithms for implementing the services deployed by the terminal are determined will be described below.
In one implementation, relevant information of service algorithms corresponding to the services is recorded in the configuration information, and in the implementation, the terminal can determine the service algorithm for implementing the deployed services based on the configuration information.
In another implementation manner, the configuration information is recorded with service identifiers of services provided by the terminal, and the corresponding relation between the service identifiers and the service algorithms can be pre-stored in the terminal, so that the terminal can determine the service algorithm for realizing the deployed services according to the service identifiers recorded in the configuration information.
In one case, all business algorithms deployed in the terminal are executed. In another case, only a part of service algorithms deployed in the terminal will be executed, and at this time, the service algorithm of the service actually provided by the terminal needs to be determined according to the configuration information. Specifically, the embodiment corresponding to fig. 4 will be further described later, and will not be described in detail here.
Step S103: and generating an algorithm scheduling topological sequence shared by all the services based on the shared algorithm and the non-shared algorithm in the determined service algorithm.
As described in step S102, each service deployed by the terminal may be implemented by one service algorithm, or may be implemented by a combination of multiple service algorithms. The same business algorithm may exist for different businesses. For example, for both mask detection service and helmet detection service, it is necessary to identify a person or a head in a video stream, and this is accomplished by the same service algorithm, which is a common algorithm for both services. The algorithm for realizing only a certain service is a non-common algorithm, for example, for a mask detection service, a mask detection algorithm is required to detect a mask, and for a helmet detection service, a helmet detection algorithm is required to detect a helmet, and the mask detection algorithm and the helmet detection algorithm are non-common algorithms.
Specifically, for the service algorithm corresponding to each service, the terminal may determine, according to the determined service algorithms, whether the service algorithm identical to the service algorithm exists in the service algorithms of other services. If the service algorithm exists, the service algorithm is a common algorithm; if not, the business algorithm is a non-shared algorithm.
When generating the algorithm scheduling sequence, a common algorithm and/or a non-common algorithm of a position before each common algorithm and a common algorithm and/or a plurality of non-common algorithms of a position after each common algorithm can be determined, so that the algorithm scheduling topological sequence shared by each service is generated based on the determined common algorithm and non-common algorithm of the service algorithm. This will be described below with specific examples.
For example, assuming that the terminal provides mask detection service, the corresponding service algorithms include a face recognition algorithm, a face quality classification algorithm and a mask detection algorithm; the terminal also provides a safety helmet detection service, and the corresponding service algorithms comprise a face recognition algorithm, a face quality classification algorithm and a safety helmet detection algorithm. It can be seen that the face recognition algorithm and the face quality classification algorithm are common algorithms, and the mask detection algorithm and the safety helmet detection algorithm are non-common algorithms.
The terminal can determine that the face recognition algorithm is the algorithm with the forefront position in the algorithm scheduling topological sequence, one position behind the face recognition algorithm is the face quality classification algorithm, and one position behind the face quality classification algorithm is the mask detection algorithm and the safety helmet detection algorithm. Specifically, referring to fig. 2, a schematic diagram of an algorithmic scheduling topology sequence is provided. It can be seen that the generated algorithm scheduling topological sequence is a face recognition algorithm to a face quality classification algorithm, and is respectively connected to a mask detection algorithm and a helmet detection algorithm.
Step S104: and according to the algorithm scheduling topological sequence, sequentially calling algorithm objects of each service algorithm to process the video stream, and obtaining a processing result aiming at each service.
The service algorithm is stored in the terminal in the form of an algorithm object, and when the terminal performs service algorithm scheduling, the algorithm object of the service algorithm needs to be called.
The algorithm object may be generated according to a preset base class, and specifically, a process of generating the algorithm object will be further described in the embodiment corresponding to fig. 3, which will not be described in detail herein.
As described above for step S103, it is still assumed that the terminal provides the mask detection service and the helmet detection service, and the generated algorithm scheduling topology sequence is shown in fig. 2. At this time, the terminal will firstly call the algorithm object of the face recognition algorithm, process the video stream, get the face recognition result; the algorithm object of the face quality classification algorithm is called, and the obtained face recognition result is processed to obtain the face quality classification result; and then, respectively processing the face quality classification results by calling an algorithm object of the mask detection algorithm and an algorithm object of the safety helmet detection algorithm to obtain mask detection results corresponding to mask detection service and safety helmet detection results corresponding to the safety helmet detection service.
By applying the embodiment, the algorithm scheduling topology sequence for realizing the service deployed by the terminal can be determined based on the configuration information, so that the video stream is processed according to the determined algorithm scheduling topology sequence, and the processing result for each service is obtained. Therefore, algorithm objects of each service algorithm are called based on the algorithm scheduling topological sequence, and algorithm scheduling can be realized for multiple services.
Because the common algorithm and the non-common algorithm exist in the service algorithm of each service, the determined algorithm scheduling topological sequence can only call the common algorithm once, and the requirements of each service can be met without repeatedly calling the common algorithm for different services. Therefore, the service algorithm scheduling is performed, the calling times of the common algorithm are reduced, and the consumption of computational resources when the algorithm is executed is reduced. Therefore, the service algorithm scheduling method provided by the embodiment of the invention can reduce resource consumption under the condition of multiple services.
In addition, each business algorithm is called only corresponding to part of the business flow, and because common algorithms possibly exist among business algorithms for different businesses, the same business algorithm can be simultaneously used for realizing different businesses, so that when a developer develops the business algorithm, the developer does not need to develop the complete algorithm corresponding to each business, only needs to develop the part of the business flow, the developer resource is saved, and the utilization rate of human resources and the development efficiency of the business algorithm are improved. In addition, the developed business algorithm can be used for realizing a plurality of businesses, and the business algorithm with the same function does not need to be repeatedly developed for each business, so that the reliability of the developed business algorithm is improved.
As described above with respect to step S104, in one embodiment of the present invention, the algorithm object may be generated according to a preset base class. Referring to fig. 3, a flow diagram of an algorithm object for generating a business algorithm is provided. The method of generating the algorithm object of the business algorithm includes the following steps S301 to S305.
Step S301: obtaining the realization function of the business algorithm.
The implementation function may be a parametric function or a non-parametric function according to different service requirements, which is not limited in the embodiment of the present invention.
In one case, the existing function can be obtained as an implementation function of the business algorithm; in another case, a function of the external input may be received as an implementation function of the business algorithm.
Step S302: based on the implementation function, creating an algorithm unit registration class with an interface consistent with a preset algorithm unit registration base class interface, and determining a registration identifier of an algorithm object.
The interfaces of the preset algorithm unit registration base class comprise interfaces for identifying the generated algorithm object by the terminal, interfaces related to the input and output parameters when the algorithm object is called, and the like.
The algorithm unit registration class is a derivative class of a preset algorithm unit registration base class, so that the interface of the algorithm unit registration class is consistent with the interface of the preset algorithm unit registration base class. The algorithm unit registration class includes the implementation function obtained in step S301.
The registration identifier is used for identifying the algorithm object of the generated service algorithm by the terminal, so as to determine the callable algorithm object.
Step S303: generating a registration object corresponding to the algorithm unit registration class.
The registration object is a static object corresponding to the algorithm unit registration class.
Step S304: creating an algorithm unit class which comprises a registration object and has an interface consistent with an interface of a preset algorithm unit base class.
The interfaces of the preset algorithm unit base class comprise interfaces for configuring related data of the algorithm object, interfaces for providing computing power resources for the algorithm object and the like. Similar to the previous description of step S302, the algorithm unit class is a derivative of the predetermined algorithm unit base class, and thus, the algorithm unit class is consistent with the interface of the predetermined algorithm unit base class.
Step S305: and generating an algorithm object corresponding to the algorithm unit class as an algorithm object of the business algorithm.
In this way, the derived classes of the preset algorithm unit base class and the algorithm unit registration base class can be utilized to generate the algorithm object, and each interface of the generated algorithm object is determined by the preset algorithm unit base class and the algorithm unit registration base class. The algorithm object is generated only by paying attention to the realization effect of the algorithm object and not paying attention to the relation between the algorithm object and other algorithm objects, so that the separation of the generation of the algorithm object and the service development is realized, the independence of the generation of the algorithm object is improved, and the generation efficiency of the algorithm object is also improved.
In addition, different services can be developed according to the realization effect of each generated algorithm object, the generation of specific algorithm objects is not required to be focused, and the service development efficiency is improved.
As described above for step S102, in one case, only a part of the service algorithms deployed in the terminal will be executed, and at this time, it is necessary to determine the executable service algorithm provided by the terminal and generate a corresponding algorithm scheduling topology sequence. Referring to fig. 4, a flow chart of a second service algorithm scheduling method is provided, and in this embodiment, the above step S102 may be completed by the following steps S102A-S102B.
Step S102A: and determining a first service algorithm for realizing each service deployed by the terminal according to the configuration information.
The first service algorithm is all service algorithms in the terminal.
Step S102B: and determining a second service algorithm in an available state according to the switch identification of each first service algorithm recorded in the configuration information.
The switch identification is used to indicate whether the first business algorithm is available. Specifically, when the switch identifier of a certain first service algorithm is true (yes), the first service algorithm is available; when the switch is identified as false (no), the first business algorithm is not available.
In this way, the terminal may determine that the first service algorithm identified by the switch as true is the second service algorithm in the available state.
In this embodiment, step S103 may be completed by step S103A.
Step S103A: and generating an algorithm scheduling topological sequence shared by each service according to the execution sequence of the second service algorithm aiming at each service recorded in the configuration information based on the determined shared algorithm and the non-shared algorithm in the second service algorithm.
The manner in which the algorithm scheduling topology sequence common to each service is generated is similar to the description of step S103, and will not be described in detail here.
The second service algorithm of the available state is determined and an algorithm scheduling topology sequence is generated based on the switch identification of each first service algorithm recorded in the configuration information, and the service provided by the terminal can be adjusted by adjusting the mode of the service algorithm available in the terminal. Therefore, the service provided by the terminal can be adjusted according to the actual scene, so that the terminal can not realize the flow of the service which is not needed in the current scene, and the corresponding service algorithm is not called, thereby reducing the call of the service algorithm and reducing the resource consumption.
Specifically, the terminal may provide a configuration interface, and the user may change the switch identifier of each first service algorithm by changing the configuration on the configuration interface.
The service developer can also conveniently complete the combination and collocation of the service algorithm by setting the switch identification of the service algorithm, so that the service development can be completed aiming at different scenes under the condition of being separated from the algorithm development, and the service development efficiency is improved.
In one embodiment of the invention, the algorithm scheduling topology sequence may also be updated.
In one implementation, the terminal may update the algorithm scheduling topology sequence according to the updated configuration information, and specifically, may be completed by the following steps a-B.
Step A: and updating the information aiming at the target service in the configuration information in response to the configuration information updating instruction aiming at the target service.
And the updated service in the target service configuration information. Specifically, the target service may be an existing service or a newly added service.
The configuration information update instruction may be an instruction triggered when the terminal receives updated configuration information, or may be an instruction sent by the user terminal. The embodiment of the present invention is not limited thereto.
The information of the target service may include service version information of the target service, and related information of a service algorithm for implementing each service. The related information of the service algorithm for implementing each service may include a parameter value range of the service algorithm, model file information corresponding to the service algorithm, and the like. When the target service is an alarm service, the information of the target service may further include an alarm service identifier, an alarm information category, and the like. And updating the information of the target service, and changing the information, adding information or deleting information.
When the target service is a new service, the service version, service alarm information, alarm information category, service algorithm corresponding to each service, related information related to each service algorithm and other information of the target service need to be newly added in the configuration information. When the target service is an existing service and the updated terminal no longer provides the target service, the information of the target service needs to be deleted in the configuration information. When the target service is an existing service and the updated target service is adjusted, the corresponding information in the configuration information needs to be changed according to the adjustment content of the target service, for example, the service algorithm corresponding to the target service is adjusted, and the information of the service algorithm corresponding to the target service in the configuration information needs to be changed.
Specifically, when receiving the configuration information updating instruction, the terminal needs to restart, and updates information aiming at the target service in the configuration information after restarting.
And (B) step (B): and updating the algorithm scheduling topology sequence according to the information of the target service recorded in the updated configuration information.
As described in step a, in the updated configuration information, the service algorithm corresponding to the target service may be changed. At this point, an update algorithm is needed to schedule the topology sequence.
Specifically, the terminal can update the shared algorithm and the non-shared algorithm in the service algorithm according to the information of the target service recorded in the updated configuration information, so that the topology sequence is scheduled according to the updated shared algorithm and the non-shared algorithm.
By applying the embodiment, the configuration information can be updated in response to the configuration information updating instruction for the target service, so that the algorithm scheduling topology sequence is updated. Therefore, the configuration information can be updated according to the actual scene and the transformation of the service requirement, so that the service provided by the terminal is adjusted, the service provided by the terminal can meet the actual service requirement, the terminal can not provide unnecessary service, and the resource consumption is reduced.
In another implementation, the terminal may receive the new algorithmic scheduling topology sequence as an updated algorithmic scheduling topology sequence.
Corresponding to the service algorithm scheduling method, the embodiment of the invention also provides a service algorithm scheduling system.
Referring to fig. 5, a schematic structural diagram of a service algorithm scheduling system is provided. The system comprises: a streaming component 501, a configuration management component 502, and a task management component 503.
The streaming component 501 is configured to obtain a video stream to be processed acquired by a camera.
A configuration management component 502 for determining a service algorithm for implementing each service deployed by the terminal based on the configuration information, and notifying the task management component 503.
The task management component 503 is configured to generate an algorithm scheduling topology sequence shared by each service based on the shared algorithm and the non-shared algorithm of the service algorithms notified by the configuration management component 502.
The task management component 503 is further configured to call the algorithm objects of each service algorithm in turn according to the algorithm scheduling topology sequence to process the video stream obtained by the stream taking component 501, so as to obtain a processing result for each service.
By applying the embodiment, the algorithm scheduling topology sequence for realizing the service deployed by the terminal can be determined based on the configuration information, so that the video stream is processed according to the determined algorithm scheduling topology sequence, and the processing result for each service is obtained. Therefore, algorithm objects of each service algorithm are called based on the algorithm scheduling topological sequence, and algorithm scheduling can be realized for multiple services.
Because the common algorithm and the non-common algorithm exist in the service algorithm of each service, the determined algorithm scheduling topological sequence can only call the common algorithm once, and the requirements of each service can be met without repeatedly calling the common algorithm for different services. Therefore, the service algorithm scheduling is performed, the calling times of the common algorithm are reduced, and the consumption of computational resources when the algorithm is executed is reduced. Therefore, the service algorithm scheduling method provided by the embodiment of the invention can reduce resource consumption under the condition of multiple services.
In one embodiment of the present invention, the configuration management component 502 is further configured to update information for the target service in the configuration information in response to a configuration information update instruction for the target service, and notify the task management component 503 of the updated information for the target service in the configuration information.
The task management component 503 is further configured to configure the information of the target service recorded in the updated configuration information notified by the management component 502, and update the algorithm scheduling topology sequence.
By applying the embodiment, the configuration information can be updated in response to the configuration information updating instruction for the target service, so that the algorithm scheduling topology sequence is updated. Therefore, the configuration information can be updated according to the actual scene and the transformation of the service requirement, so that the service provided by the terminal is adjusted, the service provided by the terminal can meet the actual service requirement, the terminal can not provide unnecessary service, and the resource consumption is reduced.
In one embodiment of the present invention, the configuration management component 502 is specifically configured to determine, according to the configuration information, a first service algorithm for implementing each service deployed by the terminal; and determining a second service algorithm in an available state according to the switch identification of each first service algorithm recorded in the configuration information, and notifying the task management component 503 of the determined second service algorithm.
The task management component 503 is specifically configured to generate an algorithm scheduling topology sequence shared by each service according to the execution sequence of the second service algorithm recorded in the configuration information for each service based on the shared algorithm and the non-shared algorithm in the determined second service algorithm notified by the configuration management component 502.
The second service algorithm of the available state is determined and an algorithm scheduling topology sequence is generated based on the switch identification of each first service algorithm recorded in the configuration information, and the service provided by the terminal can be adjusted by adjusting the mode of the service algorithm available in the terminal. Therefore, the service provided by the terminal can be adjusted according to the actual scene, so that the terminal can not realize the flow of the service which is not needed in the current scene, and the corresponding service algorithm is not called, thereby reducing the call of the service algorithm and reducing the resource consumption.
In one embodiment of the invention, the system further comprises: an algorithm management component.
In this embodiment, the configuration management component 502 is further configured to notify the algorithm management component of the configuration information.
A task management component 503, further configured to notify the algorithm management component of the algorithm scheduling topology sequence;
and the algorithm management component is used for initializing the algorithm object of each business algorithm according to the configuration information notified by the configuration management component 502, and providing computing power resources for the algorithm object of each invoked business algorithm according to the algorithm scheduling topology sequence notified by the task management component 503.
As described above for step S303, the registration identifier of the algorithm object needs to be determined when the algorithm object is generated. The algorithm management component may determine each of the algorithm objects callable within the terminal according to the registration identification of the algorithm objects, thereby determining algorithm objects of each business algorithm from among the callable algorithm objects according to the configuration information, initializing the algorithm objects, and providing computing power resources to the algorithm objects of each business algorithm called.
Therefore, the algorithm management component can initialize the algorithm object according to the configuration information and provide the algorithm object with the computational power resource, so that the algorithm object of each business algorithm can be normally called, and the terminal can normally provide business services of each business.
In one embodiment of the invention, the system further comprises: an alert component.
In this embodiment, the task management component 503 is further configured to notify the alarm component of the processing result for each service;
and the alarm component is used for generating alarm information according to the processing results of the services, which are notified by the task management component 503, and sending the alarm information to the alarm information receiving end.
When the service provided by the terminal is an alarm service, alarm information needs to be generated, and the generated alarm information is sent to an alarm information receiving end. The generated warning information may be text information or image information, for example, for a mask warning service, as shown in fig. 6a and 6b, fig. 6a provides a warning information schematic diagram of an unworn mask, and fig. 6b provides a warning information schematic diagram of an unworn mask.
The left side of fig. 6a is a snap shot picture, a snap shot alarm is indicated on the picture, the upper left corner in the picture is snap shot time, the lower left corner in the picture is alarm sequence number, and the face of a person who does not wear the mask is marked by a square frame in the picture. The right side is related information of mask alarm service, specifically, alarm_type ii wear mask alarm img represents alarm category, mask alarm is performed, alarm time is represented by alarm_time 2023-03-23:14:13:22, alarm service is represented by algo_type iWeiarmask, and mask alarm service is performed.
Fig. 6b is similar to fig. 6a and also shows the snapshot alarm and marks the snapshot time, alarm number, alarm category, alarm time and alarm service. The face of the person not wearing the mask is marked with a box in the left picture of fig. 6 b.
In practical applications, the box without the mask and the box without the mask can be distinguished by different colors, for example, the red box is used for identifying the face of the person without the mask, and the yellow box is used for identifying the face of the person without the mask.
The alarm information receiving end may be a terminal configured with a camera, or may be an own cloud platform or a third party platform, which is not limited in the embodiment of the present invention.
Therefore, the alarm information is generated and sent through the alarm component, the alarm can be timely given out aiming at the alarm service, and the terminal can be ensured to normally provide the alarm service.
The relationship between each component inside the terminal and each component and external resources will be described below.
Referring to fig. 7, a schematic diagram of the architecture of the overall system for business algorithm scheduling is provided. Wherein the solid line boxes represent components within the terminal and the dashed line boxes represent non-component parts.
It can be seen that the streaming component obtains the captured video stream and sends the video stream to the task management component.
The configuration management component provides a configuration interface for the user terminal, receives configuration information sent by the user terminal and sends the configuration information to the task management component. In addition, the configuration management component also informs the algorithm management component to initialize the algorithm objects of the business algorithms.
The task management component determines an algorithm scheduling topology sequence based on the configuration information sent by the configuration management component, informs the algorithm management component, provides computing power resources for an algorithm object to be called, processes the video stream, and sends a processing result related to the alarm service to the alarm component.
The algorithm management component may schedule the topology sequence according to the determined algorithm of the task management component, providing terminal computing power resources to each algorithm object.
And the alarm component can send alarm information to the terminal, the self-owned cloud platform and/or the third party platform according to the processing result sent by the task management component. If the sent alarm information is picture information, the alarm component can obtain a video stream from the stream taking component, and process the obtained video stream according to the processing result of the task management component to generate picture alarm information.
In addition, a common definition component is also arranged in the terminal and is used for determining common definitions of data structures, error codes, tools and the like of the components in the terminal.
Referring to fig. 8, a schematic diagram of the structure of an alert service system is provided. It can be seen that the terminal equipped with the camera is connected with the user terminal, the own cloud platform and the third party platform. And the terminal provided with the camera provides a configuration interface for the user terminal and provides alarm information for the self cloud platform and the third party platform.
The deployment of specific services on a terminal is illustrated below.
Taking the deployment mask alarm service as an example, service configuration files, algorithm configuration files, model files, authorization files, script files, executable files and the like can be packaged into a deployment catalog, see fig. 9a, which is a first packaged deployment catalog diagram.
The service configuration file may include version information, category alarm information, service alarm information, algorithm assembly list and other information of mask alarm service; the algorithm configuration file can comprise configuration information related to algorithms such as mask detection algorithms, face quality classification algorithms and the like related to mask alarm services. For example, for a mask detection algorithm, the algorithm configuration file may include a mask detection algorithm configuration model file, a target filtering threshold, an alarm box for detecting a target, and the like; for the face quality classification algorithm, the algorithm configuration file may include a face quality classification algorithm configuration model file, a preprocessing mode, a threshold value, an input/output category ID (identification number), and the like.
When the deployed services are different, the deployment catalog may also be different. For example, when the two-in-one alarm service of the helmet reflective garment is deployed, referring to fig. 9b, a second type of packaged deployment catalog is shown.
Then, the deployment catalog can be packed into an installation package based on the operating system of the terminal provided with the camera and sent to the terminal for installation. For example, when the terminal is a Linux system, rpmbuild may be used to package the deployment catalog into an installation package and send the installation package to the terminal, where the installation is performed according to an rpm command.
After the installation is completed, the terminal configured with the camera can provide a configuration interface for the user terminal, and referring to fig. 10a, a mask alarm service configuration interface schematic diagram is provided.
It can be seen that the upper left corner of the configuration interface displays the configuration algorithm, configures the mask detection algorithm, and the middle of the left side is an image acquired by the camera, and the acquisition time is marked in the image. The right side is a common configuration column, the uppermost part of the right side is provided with a button for refreshing pictures, the left side pictures can be refreshed after clicking, and the pictures to be displayed can be selected by clicking a pull-down arrow beside the button.
The common configuration column comprises four parts, namely algorithm configuration parameters, alarm receiving parameters, a detection area and a shielding area. The algorithm configuration parameters comprise a service range, algorithm sensitivity, alarm interval time (seconds), alarm video length (seconds), whether voice alarm and algorithm version are started or not.
Specifically, the service range is displayed as mask detection, represents the currently configured service, and can be selected by clicking a left drop-down arrow; the algorithm sensitivity is displayed as high, and can be selected by clicking the left drop-down arrow; the alarm time interval represents the shortest time between two alarms; the alarm video length represents the minimum duration in which the behavior to be alarmed exists in the image required for sending the alarm.
The alarm receiving parameters comprise whether the access platform and the docking platform URL (Uniform Resource Locator ) are included, and when the access platform is yes, the terminal provided with the camera is connected with the platform corresponding to the docking platform URL.
In addition, a detection area and a shielding area can be created on the configuration interface, and by creating the detection area and the shielding area, a part of the area in the left image can be detected or shielded in a targeted manner. The specific creation method is given below the left image. Taking the creation of the detection area as an example, clicking a creation button on the right side of the detection area column, clicking a left mouse button in the drawing area to add coordinate points, clicking a right mouse button to finish drawing, and accordingly determining an area surrounded by all the coordinate points as the detection area. At least three coordinate points are required for the detection area.
The creation of the shielding area is similar to that of the detection area, after a creation button on the right side of a shielding area column is clicked, a left mouse button is clicked in a drawing area to add coordinate points, and the right mouse button is clicked to finish drawing, so that an area surrounded by all the coordinate points is determined to be the shielding area. At least three coordinate points are required for the mask area.
After the configuration is completed, the configured content is saved by clicking a save configuration button in the lower left corner.
For another example, referring to fig. 10b, a schematic diagram of a configuration interface of the two-in-one alert service for the reflective jacket of the helmet is provided. The configuration interface is similar to the mask alarm service configuration interface described above. There are also left image areas and right common configuration bars. The difference is that the name of the terminal provided with the camera, which obtains the image, is marked in the upper right corner of the image, namely a base 203_battery car gas tank_bst.
The alarm information generated by the two-in-one alarm service of the helmet reflective clothing is shown in fig. 11a and 11b, wherein fig. 11a provides a schematic diagram of the first two-in-one alarm information of the helmet reflective clothing, and fig. 11b provides a schematic diagram of the second two-in-one alarm information of the helmet reflective clothing. The alarm information in fig. 11a and 11b is similar to that in fig. 6a and 6b, taking fig. 11a as an example, a snap alarm is noted on a picture, the upper left corner of the picture is the snap time, and the person who does not wear the reflective clothing is marked by a box in the picture. The right side is related information of a two-in-one warning service of the helmet reflective clothing, specifically, alarm_type ii helmet vest alarm img represents a warning category, the two-in-one warning service of the helmet reflective clothing is provided, alarm_time 2023-03-23:15:18:59 represents warning time, algo_type iHelmetVest represents a warning service, and the two-in-one warning service of the helmet reflective clothing is provided. Fig. 11b is similar to fig. 11 a.
The alarm information in fig. 11a and 11b is different from that in fig. 6a and 6b in that the name of the terminal provided with the camera, which obtains the image, is marked in the upper right corner of the image, and is the base 203_battery car gas tank_bst.
Corresponding to the service algorithm scheduling method, the embodiment of the invention also provides a service algorithm scheduling device.
Referring to fig. 12, there is provided a schematic structural diagram of a service algorithm scheduling apparatus, the apparatus including:
a video stream obtaining module 1201, configured to obtain a video stream to be processed collected by the camera;
a service algorithm determining module 1202, configured to determine a service algorithm for implementing each service deployed by the terminal based on the configuration information;
the algorithm scheduling topology sequence generating module 1203 is configured to generate an algorithm scheduling topology sequence shared by each service based on the determined common algorithm and the non-common algorithm in the service algorithm;
and the video stream processing module 1204 is used for sequentially calling algorithm objects of each service algorithm to process the video stream according to the algorithm scheduling topology sequence to obtain a processing result for each service.
By applying the embodiment, the algorithm scheduling topology sequence for realizing the service deployed by the terminal can be determined based on the configuration information, so that the video stream is processed according to the determined algorithm scheduling topology sequence, and the processing result for each service is obtained. Therefore, algorithm objects of each service algorithm are called based on the algorithm scheduling topological sequence, and algorithm scheduling can be realized for multiple services.
Because the common algorithm and the non-common algorithm exist in the service algorithm of each service, the determined algorithm scheduling topological sequence can only call the common algorithm once, and the requirements of each service can be met without repeatedly calling the common algorithm for different services. Therefore, the service algorithm scheduling is performed, the calling times of the common algorithm are reduced, and the consumption of computational resources when the algorithm is executed is reduced. Therefore, the service algorithm scheduling method provided by the embodiment of the invention can reduce resource consumption under the condition of multiple services.
In one embodiment of the present invention, the algorithm object of the business algorithm is generated by:
obtaining an implementation function of the service algorithm;
based on the implementation function, creating an algorithm unit registration class with an interface consistent with a preset algorithm unit registration base class interface, and determining a registration identifier of the algorithm object;
generating a registration object corresponding to the algorithm unit registration class;
creating an algorithm unit class which comprises the registration object and has an interface consistent with an interface of a preset algorithm unit base class;
and generating an algorithm object corresponding to the algorithm unit class as the algorithm object of the business algorithm.
In this way, the derived classes of the preset algorithm unit base class and the algorithm unit registration base class can be utilized to generate the algorithm object, and each interface of the generated algorithm object is determined by the preset algorithm unit base class and the algorithm unit registration base class. The algorithm object is generated only by paying attention to the realization effect of the algorithm object and not paying attention to the relation between the algorithm object and other algorithm objects, so that the separation of the generation of the algorithm object and the service development is realized, the independence of the generation of the algorithm object is improved, and the generation efficiency of the algorithm object is also improved.
In one embodiment of the invention, the apparatus further comprises:
a configuration information updating module, configured to respond to a configuration information updating instruction for a target service, and update information for the target service in the configuration information;
and the algorithm scheduling topology sequence updating module is used for updating the algorithm scheduling topology sequence according to the information of the target service recorded in the updated configuration information.
By applying the embodiment, the configuration information can be updated in response to the configuration information updating instruction for the target service, so that the algorithm scheduling topology sequence is updated. Therefore, the configuration information can be updated according to the actual scene and the transformation of the service requirement, so that the service provided by the terminal is adjusted, the service provided by the terminal can meet the actual service requirement, the terminal can not provide unnecessary service, and the resource consumption is reduced.
In one embodiment of the present invention, the business algorithm determining module 1202 includes:
the first business algorithm determining unit is used for determining a first business algorithm for realizing each business deployed by the terminal according to the configuration information;
the second business algorithm determining unit is used for determining the second business algorithm in the available state according to the switch identification of each first business algorithm recorded in the configuration information;
the algorithm scheduling topology sequence generating module 1203 is specifically configured to generate an algorithm scheduling topology sequence shared by each service according to the execution sequence of the second service algorithm recorded in the configuration information for each service based on the determined shared algorithm and the determined non-shared algorithm in the second service algorithm.
The second service algorithm of the available state is determined and an algorithm scheduling topology sequence is generated based on the switch identification of each first service algorithm recorded in the configuration information, and the service provided by the terminal can be adjusted by adjusting the mode of the service algorithm available in the terminal. Therefore, the service provided by the terminal can be adjusted according to the actual scene, so that the terminal can not realize the flow of the service which is not needed in the current scene, and the corresponding service algorithm is not called, thereby reducing the call of the service algorithm and reducing the resource consumption.
The embodiment of the invention also provides a terminal, as shown in fig. 13, which comprises a processor 1301, a communication interface 1302, a memory 1303, a camera 1304 and a communication bus 1305, wherein the processor 1301, the communication interface 1302, the memory 1303 and the camera 1304 complete the communication with each other through the communication bus 1305,
a camera 1304 for capturing a video stream;
a memory 1303 for storing a computer program;
processor 1301 is configured to implement the service algorithm scheduling method described in the foregoing method embodiment when executing the program stored in memory 1303.
The communication bus mentioned by the above terminals may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the terminal and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a computer readable storage medium is provided, where a computer program is stored, where the computer program, when executed by a processor, implements the service algorithm scheduling method according to the foregoing method embodiment.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system, apparatus, terminal and storage medium embodiments, the description is relatively simple as it is substantially similar to the method embodiments, and reference is made to the section of the description of the method embodiments where relevant.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims (12)

1. A service algorithm scheduling method, which is applied to a terminal configured with a camera, the method comprising:
obtaining a video stream to be processed, which is acquired by the camera;
determining a service algorithm for realizing each service deployed by the terminal based on the configuration information;
generating an algorithm scheduling topological sequence shared by all the services based on the shared algorithm and the non-shared algorithm in the determined service algorithm;
and sequentially calling algorithm objects of each service algorithm according to the algorithm scheduling topology sequence to process the video stream, so as to obtain a processing result aiming at each service.
2. The method according to claim 1, characterized in that the algorithm object of the business algorithm is generated by:
obtaining an implementation function of the service algorithm;
based on the implementation function, creating an algorithm unit registration class with an interface consistent with a preset algorithm unit registration base class interface, and determining a registration identifier of the algorithm object;
Generating a registration object corresponding to the algorithm unit registration class;
creating an algorithm unit class which comprises the registration object and has an interface consistent with an interface of a preset algorithm unit base class;
and generating an algorithm object corresponding to the algorithm unit class as the algorithm object of the business algorithm.
3. The method according to claim 1, wherein the method further comprises:
responding to a configuration information updating instruction aiming at a target service, and updating information aiming at the target service in the configuration information;
and updating the algorithm scheduling topological sequence according to the updated information of the target service recorded in the configuration information.
4. A method according to any of claims 1-3, characterized in that said determining, based on configuration information, a service algorithm for implementing each service deployed by said terminal, comprises:
determining a first service algorithm for realizing each service deployed by the terminal according to the configuration information;
determining a second service algorithm in an available state according to the switch identification of each first service algorithm recorded in the configuration information;
the algorithm scheduling topological sequence shared by all the businesses is generated based on the shared algorithm and the non-shared algorithm of the determined business algorithm, and the algorithm scheduling topological sequence comprises the following steps:
And generating an algorithm scheduling topological sequence shared by each service according to the execution sequence of the second service algorithm aiming at each service recorded in the configuration information based on the determined shared algorithm and the non-shared algorithm in the second service algorithm.
5. A business algorithm scheduling system, the system comprising: a stream taking component, a configuration management component and a task management component, wherein,
the stream taking component is used for obtaining a video stream to be processed, which is acquired by the camera;
the configuration management component is used for determining a service algorithm for realizing each service deployed by the terminal based on the configuration information and notifying the task management component;
the task management component is used for generating an algorithm scheduling topological sequence shared by all services based on the shared algorithm and the non-shared algorithm of the service algorithm notified by the configuration management component;
the task management component is further configured to call algorithm objects of each service algorithm in turn according to the algorithm scheduling topology sequence to process the video stream obtained by the stream taking component, so as to obtain a processing result for each service.
6. The system of claim 5, wherein the system further comprises a controller configured to control the controller,
The configuration management component is further used for responding to a configuration information updating instruction aiming at a target service, updating information aiming at the target service in the configuration information and notifying the task management component of the information aiming at the target service in the updated configuration information;
and the task management component is also used for updating the algorithm scheduling topological sequence according to the information of the target service recorded in the updated configuration information notified by the configuration management component.
7. The system of claim 5 or 6, wherein the system comprises a plurality of sensors,
the configuration management component is specifically configured to determine a first service algorithm for implementing each service deployed by the terminal according to the configuration information; determining a second service algorithm in an available state according to the switch identification of each first service algorithm recorded in the configuration information, and notifying the determined second service algorithm to the task management component;
the task management component is specifically configured to generate an algorithm scheduling topology sequence shared by each service according to the execution sequence of the second service algorithm recorded in the configuration information for each service based on the shared algorithm and the non-shared algorithm in the determined second service algorithm notified by the configuration management component.
8. The system according to claim 5 or 6, characterized in that the system further comprises: the algorithm management component(s),
the configuration management component is further used for notifying the algorithm management component of the configuration information;
the task management component is further used for notifying the algorithm scheduling topological sequence to the algorithm management component;
the algorithm management component is used for initializing the algorithm object of each business algorithm according to the configuration information notified by the configuration management component, and providing computing power resources for the algorithm object of each invoked business algorithm according to the algorithm scheduling topology sequence notified by the task management component.
9. The system according to claim 5 or 6, characterized in that the system further comprises: an alarm assembly for providing an alarm to the user,
the task management component is further used for notifying the alarm component of the processing results of the services;
the alarm component is used for generating alarm information according to the processing results of the tasks, which are notified by the task management component, and sending the alarm information to the alarm information receiving end.
10. A traffic algorithm scheduling apparatus, the apparatus comprising:
the video stream obtaining module is used for obtaining a video stream to be processed, which is collected by the camera;
The service algorithm determining module is used for determining a service algorithm for realizing each service deployed by the terminal based on the configuration information;
the algorithm scheduling topological sequence generation module is used for generating an algorithm scheduling topological sequence shared by all services based on the shared algorithm and the non-shared algorithm in the determined service algorithm;
and the video stream processing module is used for sequentially calling algorithm objects of each service algorithm to process the video stream according to the algorithm scheduling topological sequence to obtain a processing result aiming at each service.
11. The terminal is characterized by comprising a processor, a communication interface, a memory, a camera and a communication bus, wherein the processor, the communication interface, the memory and the camera are communicated with each other through the communication bus;
the camera is used for collecting video streams;
a memory for storing a computer program;
a processor for carrying out the method steps of any one of claims 1-4 when executing a program stored on a memory.
12. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-4.
CN202310921777.0A 2023-07-26 2023-07-26 Service algorithm scheduling method, system, device, terminal and storage medium Pending CN116634208A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310921777.0A CN116634208A (en) 2023-07-26 2023-07-26 Service algorithm scheduling method, system, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310921777.0A CN116634208A (en) 2023-07-26 2023-07-26 Service algorithm scheduling method, system, device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN116634208A true CN116634208A (en) 2023-08-22

Family

ID=87597763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310921777.0A Pending CN116634208A (en) 2023-07-26 2023-07-26 Service algorithm scheduling method, system, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN116634208A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106775632A (en) * 2016-11-21 2017-05-31 中国科学院遥感与数字地球研究所 A kind of operation flow can flexible expansion high-performance geographic information processing method and system
US20180167402A1 (en) * 2015-05-05 2018-06-14 Balabit S.A. Computer-implemented method for determining computer system security threats, security operations center system and computer program product
CN111274019A (en) * 2019-12-31 2020-06-12 深圳云天励飞技术有限公司 Data processing method and device and computer readable storage medium
CN112513814A (en) * 2020-04-01 2021-03-16 华为技术有限公司 Task scheduling method and device
CN112988337A (en) * 2021-03-01 2021-06-18 创新奇智(上海)科技有限公司 Task processing system, method, device, electronic equipment and storage medium
WO2022028418A1 (en) * 2020-08-04 2022-02-10 中国移动通信有限公司研究院 Computing power processing network system, and service processing method and device
US20220058517A1 (en) * 2020-08-21 2022-02-24 Baton Simulations Method, system and apparatus for custom predictive modeling
CN114286082A (en) * 2021-12-27 2022-04-05 国能龙源电气有限公司 Power plant camera abnormity detection system, electronic equipment and storage medium
CN116225877A (en) * 2023-03-15 2023-06-06 北京百度网讯科技有限公司 Performance test method and device, electronic equipment and storage medium
CN116450347A (en) * 2023-03-28 2023-07-18 杭州海康威视数字技术股份有限公司 Video multitasking method, video analysis device, and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180167402A1 (en) * 2015-05-05 2018-06-14 Balabit S.A. Computer-implemented method for determining computer system security threats, security operations center system and computer program product
CN106775632A (en) * 2016-11-21 2017-05-31 中国科学院遥感与数字地球研究所 A kind of operation flow can flexible expansion high-performance geographic information processing method and system
CN111274019A (en) * 2019-12-31 2020-06-12 深圳云天励飞技术有限公司 Data processing method and device and computer readable storage medium
CN112513814A (en) * 2020-04-01 2021-03-16 华为技术有限公司 Task scheduling method and device
WO2022028418A1 (en) * 2020-08-04 2022-02-10 中国移动通信有限公司研究院 Computing power processing network system, and service processing method and device
US20220058517A1 (en) * 2020-08-21 2022-02-24 Baton Simulations Method, system and apparatus for custom predictive modeling
CN112988337A (en) * 2021-03-01 2021-06-18 创新奇智(上海)科技有限公司 Task processing system, method, device, electronic equipment and storage medium
CN114286082A (en) * 2021-12-27 2022-04-05 国能龙源电气有限公司 Power plant camera abnormity detection system, electronic equipment and storage medium
CN116225877A (en) * 2023-03-15 2023-06-06 北京百度网讯科技有限公司 Performance test method and device, electronic equipment and storage medium
CN116450347A (en) * 2023-03-28 2023-07-18 杭州海康威视数字技术股份有限公司 Video multitasking method, video analysis device, and storage medium

Similar Documents

Publication Publication Date Title
KR101825045B1 (en) Alarm method and device
CN110834327B (en) Robot control method and device
GB2575282A (en) Event entity monitoring network and method
CN109040690B (en) Camera distribution management method and device and electronic equipment
CN106161060A (en) Data monitoring method and device
KR20220000226A (en) A system for providing a security surveillance service based on edge computing
US11282374B2 (en) Systems and methods for building and using a false alarm predicting model to determine whether to alert a user and/or relevant authorities about an alarm signal from a security system
KR20220000172A (en) An apparatus and a system for providing a security surveillance service based on edge computing and a method for operating them
CN113763211A (en) Infringement detection method and device based on block chain and electronic equipment
CN115168031A (en) Fog calculation system, method, electronic equipment and storage medium
CN114676205A (en) Event information processing method and device
CN116634208A (en) Service algorithm scheduling method, system, device, terminal and storage medium
EP4071728A1 (en) Artificial intelligence model integration and deployment for providing a service
CN115984677A (en) Intelligent data analysis method, device and system
US11070425B2 (en) Method and system of detecting device rearrangement in manufacturing field
KR20220004399A (en) A recorded program media for providing a security surveillance service based on user involvement
KR20220000221A (en) A camera apparatus for providing a intelligent security surveillance service based on edge computing
KR20220000209A (en) Recording medium that records the operation program of the intelligent security monitoring device based on deep learning distributed processing
KR20220000424A (en) A camera system for providing a intelligent security surveillance service based on edge computing
KR102545383B1 (en) Method and apparatus for providing personal protection alarm
CN111696290A (en) Security decision method and device, computing equipment and computer storage medium
KR102286418B1 (en) An apparatus for providing a security surveillance service based on user involvement and a method for operating it
JP7212257B2 (en) Surveillance system, image licensing method, and image usage licensing program
WO2024084563A1 (en) Reporting device, system, method, and computer-readable medium
US20200273202A1 (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination