Equipment resource multiplexing method and device, equipment and computer readable storage medium
By dividing the processing time in the pending business scenario into multiple service processing sub-periods, and determining the target service processing sub-periods based on the video task attributes and business processing volume, the problem of large memory occupancy and low device resource utilization is solved, and server performance is improved and resource utilization is efficient.
Patent Information
- Application Number
- CN202510077178.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-09
AI Technical Summary
In the prior art, video intelligent analysis occupies a large amount of memory, affects server performance, and has low utilization of equipment resources, resulting in problems of resource waste and performance redundancy.
By dividing the processing time in the pending business scenario into multiple service processing sub-time periods, the target service processing sub-time period of the pending video task is determined based on the video task attributes and the service processing amount of the current service processing sub-time period, thereby achieving reasonable allocation and multiplexing of equipment resources.
It avoids the problems of resource waste and performance redundancy in different time periods of the server, and improves the performance and resource utilization of the server.
Smart Images

Figure CN119967256A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, device and computer-readable storage medium for multiplexing device resources. Background Art
[0002] With the increasing application of intelligent algorithms in the audio and video field, the processing capabilities of media content and user experience have been greatly improved. In the field of video analysis, intelligent algorithm application servers in various industries are widely used. With the continuous evolution of technology and the increasing user needs, there are more and more scenarios where audio and video technology is combined with intelligent analysis to solve problems and meet business needs.
[0003] Due to business requirements and framework complexity, large-scale backend intelligent storage network servers generally support multiple video intelligent analyses at the same time, and support multiple channels to open the same or different video intelligent analyses. The related technology lacks a method that can improve server performance. Summary of the invention
[0004] Based on this, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium and computer program product for multiplexing device resources that can improve server performance in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for multiplexing device resources, comprising:
[0006] Acquire the current business processing sub-period and the to-be-processed video task in the to-be-processed business scenario; the current business processing sub-period is any one of the multiple business processing sub-periods of the to-be-processed business scenario; and the business processing volume of each business processing sub-period is different;
[0007] Determining a video task attribute of the video task to be processed;
[0008] A target service processing sub-period of the to-be-processed video task is determined according to the video task attribute and the service processing amount of the current service processing sub-period.
[0009] In one embodiment, the method for determining the plurality of service processing sub-periods includes:
[0010] Obtaining a business processing period for the business scenario to be processed;
[0011] The business processing time period is divided according to the business processing volume of the business scenario to be processed to obtain multiple business processing sub-time periods of the business scenario to be processed.
[0012] In one of the embodiments, the business processing period is divided according to the business processing volume of the business scenario to be processed to obtain multiple business processing sub-periods of the business scenario to be processed, including:
[0013] Determine the distribution data of the business processing volume of the to-be-processed business scenario in the business processing period;
[0014] Dividing the service processing period according to the distribution data to obtain a first service processing sub-period and a second service processing sub-period;
[0015] The service processing volume of the first service processing sub-period is greater than the service processing volume of the second service processing sub-period.
[0016] In one embodiment, determining the target service processing sub-period of the to-be-processed video task according to the video task attribute and the service processing amount of the current service processing sub-period includes:
[0017] If the attribute of the video task is a real-time task and the business processing amount of the current business processing sub-period is a preset business processing amount, the current business processing sub-period is determined as the target business processing sub-period of the video task to be processed;
[0018] The to-be-processed video task is executed in the current service processing sub-period.
[0019] In one embodiment, the method further comprises:
[0020] When the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, the bitstream corresponding to the video task to be processed is marked with a business tag to obtain the bitstream carrying the business tag, and the bitstream is stored in a designated storage location.
[0021] In one embodiment, determining the target service processing sub-period of the to-be-processed video task according to the video task attribute and the service processing amount of the current service processing sub-period includes:
[0022] When the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, a candidate business processing sub-period whose business processing volume is less than the business processing volume of the current business processing sub-period is determined as a target business processing sub-period;
[0023] The candidate service processing sub-period is determined from other service processing sub-periods in the plurality of service processing sub-periods except the current service processing sub-period;
[0024] The to-be-processed video task is executed in the target service processing sub-period.
[0025] In one of the embodiments, executing the to-be-processed video task in the target service processing sub-period includes:
[0026] In the target service processing sub-period, if a triggering video task is detected, the triggering video task is executed and then the to-be-processed video task;
[0027] If no triggering video task is detected, the to-be-processed video task is executed.
[0028] In one embodiment, the executing the triggering video task and then the to-be-processed video task includes:
[0029] The code stream corresponding to the triggered video task is marked with a business tag to obtain the code stream carrying the business tag, and the code stream is stored in a designated storage location to execute the video task to be processed.
[0030] In one of the embodiments, executing the to-be-processed video task in the target service processing sub-period includes:
[0031] In the target service processing sub-period, reading a to-be-processed code stream corresponding to the to-be-processed video task from the designated storage location;
[0032] According to the service tag carried by the code stream to be processed, video task processing corresponding to the service tag is performed.
[0033] In a second aspect, the present application further provides a device for time-division multiplexing of equipment resources, the device comprising:
[0034] A data acquisition module, used to acquire the current business processing sub-period and the video task to be processed in the business scenario to be processed; the current business processing sub-period is any one of the multiple business processing sub-periods of the business scenario to be processed; the business processing volume of each business processing sub-period is different;
[0035] A task attribute determination module, used to determine the video task attribute of the video task to be processed;
[0036] The task allocation module is used to determine the target business processing sub-period of the to-be-processed video task according to the video task attribute and the business processing amount of the current business processing sub-period.
[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0038] Acquire the current business processing sub-period and the to-be-processed video task in the to-be-processed business scenario; the current business processing sub-period is any one of the multiple business processing sub-periods of the to-be-processed business scenario; and the business processing volume of each business processing sub-period is different;
[0039] Determining a video task attribute of the video task to be processed;
[0040] A target service processing sub-period of the to-be-processed video task is determined according to the video task attribute and the service processing amount of the current service processing sub-period.
[0041] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0042] Acquire the current business processing sub-period and the to-be-processed video task in the to-be-processed business scenario; the current business processing sub-period is any one of the multiple business processing sub-periods of the to-be-processed business scenario; and the business processing volume of each business processing sub-period is different;
[0043] Determining a video task attribute of the video task to be processed;
[0044] A target service processing sub-period of the to-be-processed video task is determined according to the video task attribute and the service processing amount of the current service processing sub-period.
[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0046] Acquire the current business processing sub-period and the to-be-processed video task in the to-be-processed business scenario; the current business processing sub-period is any one of the multiple business processing sub-periods of the to-be-processed business scenario; and the business processing volume of each business processing sub-period is different;
[0047] Determining a video task attribute of the video task to be processed;
[0048] A target service processing sub-period of the to-be-processed video task is determined according to the video task attribute and the service processing amount of the current service processing sub-period.
[0049] The above-mentioned device resource reuse method, apparatus, computer equipment, computer-readable storage medium and computer program product divide the processing time in the business scenario to be processed into multiple processing sub-periods, and for the video task processing in each business scenario to be processed and the current processing task sub-period, by determining the business processing volume of the current business processing sub-period and the video task attributes of the video task to be processed, a matching target business processing sub-period is determined from the multiple business processing sub-periods of the business scenario to be processed. That is to say, the requirements of the video task to be processed and the business scenario to be processed can be decoupled to avoid the simultaneous execution of all the video tasks to be processed, and the device resources of the server are reasonably allocated, thereby avoiding the problems of resource waste and performance redundancy in different time periods of the server and improving the performance of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A schematic diagram of business analysis of an energy business video analysis server in one embodiment;
[0052] Figure 2 An application environment diagram of a method for reusing device resources in one embodiment;
[0053] Figure 3 A schematic diagram of a flow chart of a method for reusing device resources in one embodiment;
[0054] Figure 4 A schematic diagram of the distribution of device resources in one embodiment;
[0055] Figure 5 is a schematic diagram of a flow chart of step 306 in one embodiment;
[0056] Figure 6 A schematic diagram of a flow chart of a method for reusing device resources in another embodiment;
[0057] Figure 7 A schematic diagram of a flow chart of a method for reusing device resources in another embodiment;
[0058] Figure 8 is a structural block diagram of a device resource multiplexing apparatus in one embodiment;
[0059] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In recent years, the application of intelligent algorithms in the field of audio and video has become increasingly widespread, greatly improving the processing capabilities of media content and user experience. In the field of video analysis, face, perimeter, structured detection and intelligent algorithm application servers in various industries are widely used. With the continuous evolution of technology and the increasing user needs, there are more and more scenarios where audio and video technology is combined with intelligent analysis to solve problems and meet business needs. Business scenarios can be but are not limited to energy business scenarios. For example, in energy business scenarios, traditional security technology uses front-end camera monitoring to collect abnormal images and code streams, and the platform layer analyzes in real time whether they meet work standards or dangerous behaviors. Now, combined with the back-end server audio and video encoding and decoding and intelligent analysis technology, it automatically identifies images and video scenes, and then performs business analysis based on needs, which has greatly improved efficiency, security, resource utilization, user experience and many other aspects.
[0062] like Figure 1 As shown, it is a business analysis schematic diagram of the energy business video analysis server. The scenario includes a substation and a regional layer. The substation is deployed with an edge node and a collection device. The regional layer is deployed with a regional patrol host and an intelligent analysis host. The regional patrol host will set tasks according to the scenario requirements and send them to the edge node. The edge node calls the front-end device based on the task area, that is, the collection device performs image collection, and uploads the collected data as patrol data to the regional patrol host via the edge node. The regional patrol host generates an intelligent analysis instruction, and the intelligent analysis host responds to the instruction, encodes and decodes the patrol data, integrates business image analysis, video code stream analysis, intelligent algorithm inspection, and performs other business-related functions, and returns the analysis results to the regional patrol host.
[0063] However, in the energy scenario, due to the business needs of the scenario, the backend server needs to enable the image stream detection function all day long, support the platform to continuously patrol and send detection images, and the device supports local dynamic video polling intelligent analysis and other services, but these services have high requirements for server image and video analysis performance. However, this solution has defects: when the number of device chips is limited, it is easy to be limited in performance, and the number of intelligent video analysis channels that can be opened is small; video intelligent analysis occupies a large amount of memory, affecting server performance; the resource utilization rate allocated to certain video tasks is low, such as the video triggering intelligent alarm is rare, and the resident resources are wasted; when there are many business modules and redundant processing resources, the performance of a single computing power card of the server cannot be fully utilized. For example, during the day, image patrols are very frequent, and the encoding and decoding processing pressure is high, but the video intelligent analysis alarm scenes are mostly encoding and storage businesses. Originally, a single card can open 8 channels of intelligent video analysis, but due to the pressure of image streams, only 4 channels of intelligent video analysis can be opened; at night, the platform sends fewer images for patrol, and there are fewer video intelligent analysis detection and alarm scenes, and the server performance is greatly redundant, which leads to the waste of chip intelligence-related resources.
[0064] Aiming at the technical problem of low server performance in video intelligent analysis, a device resource reuse method is proposed to obtain the current business processing sub-period and the video task to be processed in the business scenario to be processed; determine the video task attributes of the video task to be processed; and determine the target business processing sub-period of the video task to be processed based on the video task attributes and the business processing volume of the current business processing sub-period.
[0065] The device resource reuse method provided in the embodiment of the present application can be applied to Figure 2 In the application environment shown. Among them, the acquisition terminal 202 communicates with the server 204 through the network. The data storage system can store the data that the server 204 needs to process. The data storage system can be integrated on the server 204, or it can be placed on the cloud or other network servers. The server 204 obtains the image data collected by the acquisition terminal 202. The image data can be a video, the current business processing sub-period and the video task to be processed in the business scenario to be processed; the current business processing sub-period is any one of the multiple business processing sub-periods of the business scenario to be processed; the business processing volume of each business processing sub-period is different; determine the video task attribute of the video task to be processed; determine the target business processing sub-period of the video task to be processed according to the video task attribute and the business processing volume of the current business processing sub-period. Among them, the terminal 202 can be but is not limited to various image acquisition devices. The server 204 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server providing cloud computing services.
[0066] In an exemplary embodiment, Figure 3As shown, a method for reusing device resources is provided, and the method is applied to Figure 1 Taking the server in as an example, the method includes the following steps 302 to 306.
[0067] in:
[0068] Step 302, obtaining the current business processing sub-period and the to-be-processed video task in the to-be-processed business scenario; the current business processing sub-period is any one of the multiple business processing sub-periods of the to-be-processed business scenario; and the business processing volume of each business processing sub-period is different.
[0069] Among them, the business scenario to be processed may be an intelligent scenario that requires intelligent video analysis. The intelligent video analysis supported by the intelligent scenario includes multiple types, and intelligent video analysis may include video detection, video encoding and decoding, and video processing. It should be noted that in some business scenarios, video detection is always turned on in real time and in all channels, while video encoding and decoding and video processing may be turned on in non-real time and in all channels. That is to say, in actual business scenarios, video tasks can be divided into real-time tasks and non-real-time tasks, and video tasks can also be defined as fixed tasks and non-fixed tasks. Fixed tasks may need to be turned on all the time.
[0070] Furthermore, video detection can include multiple business fusion image streams, intelligent motion detection, perimeter, fireworks detection, wearable detection, instrument detection, etc. Video processing can be encoding and decoding or other business processing (such as face detection and comparison, alarm frame encoding large picture, small picture encoding, extraction of facial and human body feature attributes, etc.). The fused image stream can be understood as a single-frame static analysis. The business needs to be opened in real time and all channels are enabled. It supports multiple image detection fusion scenarios such as defects, instruments, QR codes, and comparisons, and performs specified business analysis on the images. In other words, the fused image stream includes video processing in addition to detection. The perimeter can be understood as video dynamic analysis. According to the rules of accompanying lines, regional intrusions, etc., for scenes where people and animals move in the picture, intelligent alarms are triggered when people or animals invade.
[0071] Fireworks detection can be understood as video dynamic analysis, which is applicable to scenes with smoke and fire, and alarms are issued for abnormal situations where fireworks appear in the picture. Wear detection can be understood as video dynamic analysis, which detects whether the clothes (clothes, hats, masks) of people appearing in the picture meet the specifications, and is applicable to scenes such as personnel detection in the workshop. Instrument detection can be understood as video dynamic analysis, which is applicable to scenes with complex working devices (knife switches, pointer meters, respirators, etc.) in energy environments, and alarms are issued for abnormal information detected according to specified states or readings, and proportion intervals.
[0072] The number of video tasks to be processed may be one or more, and the video tasks to be processed may be one or more of video detection, video encoding and decoding, and video processing. The business processing volumes of the business processing sub-periods are different, and the business processing busyness of the corresponding business processing sub-periods is reflected by the business processing volumes. For example, if the business processing volume is greater than the preset business processing volume, the business processing sub-period corresponding to the business processing volume is determined as the business busy time period.
[0073] Exemplarily, a business scenario to be processed is determined, and the business requirements of the business scenario to be processed are obtained according to the scenario label of the business scenario to be processed, and the business processing sub-period of the business scenario to be processed can be determined according to the business requirements. When the business scenario to be processed is processed, the current business processing sub-period and the video task to be processed under the business scenario to be processed are determined. The business processing sub-period can be divided according to the business requirements, or according to the historical business processing data under the business scenario.
[0074] Step 304: Determine the video task attribute of the video task to be processed.
[0075] Among them, the video task attribute can be one of real-time tasks, non-real-time tasks and triggered tasks. Real-time tasks can be video detection tasks, non-real-time tasks can be tasks such as encoding and decoding and feature extraction, and triggered tasks can be Smart Motion Detection (SMD) is a technology that uses advanced algorithms to identify and analyze dynamic targets in videos. It can distinguish the shapes of target objects (such as people, vehicles, etc.) in the scene and send an alarm only when the target object is detected.
[0076] Step 306: Determine a target service processing sub-period for the video task to be processed according to the video task attribute and the service processing volume of the current service processing sub-period.
[0077] It is understandable that different time periods may cause resource waste and performance redundancy, such as Figure 4 As shown in the figure, during the busy service period, the shortage of equipment resources is mainly concentrated in the fusion image service analysis and encoding and decoding and transmission process (i.e. fusion service image analysis), as well as other video detection (i.e. video intelligent detection) and video processing (i.e. video intelligent service). There is a shortage of resources during the busy service period. During the non-busy service period, fusion service image analysis, video intelligent detection and video intelligent service only occupy part of the equipment resources, resulting in surplus equipment resources. The performance of video processing and video encoding and decoding in this period is not utilized, and there is a waste of resources during the non-busy service period.
[0078] It should be noted that the device resources may be the CPU resources and memory resources of the server. The computing power card in the CPU resources may be one or more. In this example, the computing power card is described as a single card.
[0079] Then, in view of this situation, when obtaining the current business processing sub-period and the video task to be processed in the business scenario to be processed, in order to avoid the above situation and meet the needs of the corresponding business scenario at the same time, according to the video task attributes and the business processing volume of the current business processing sub-period, the target business processing sub-period of the video task to be processed is determined from multiple business processing sub-periods. For example, the necessary functions and some businesses can be decoupled, such as placing video detection in the current business processing sub-period for processing, and placing video encoding and decoding in other sub-periods with a business processing volume less than that of the current business processing sub-period.
[0080] Exemplarily, whether to process the video task to be processed in the current business processing sub-period is determined based on whether the video task attribute is a real-time task and whether the business processing volume of the current business processing sub-period is greater than the preset business processing volume. Further, if the video task attribute is a real-time task and the business processing volume of the current business processing sub-period is the preset business processing volume, the video task to be processed is executed in the current business processing sub-period; if the video task attribute is a non-real-time task and the business processing volume of the current business processing sub-period is the preset business processing volume, the video task to be processed is executed in other business processing sub-periods to avoid equipment resource shortage in the current business processing sub-period.
[0081] In the above-mentioned device resource reuse method, the processing time under the pending business scenario is divided into multiple processing sub-periods. For the video task processing under each pending business scenario and the current processing task sub-period, the business processing volume of the current business processing sub-period and the video task attributes of the pending video task are determined, and the matching target business processing sub-period is determined from the multiple business processing sub-periods of the pending business scenario. In other words, the pending video task and the needs of the pending business scenario can be decoupled to avoid the simultaneous execution of all pending video tasks, and the device resources of the server are reasonably allocated, thereby avoiding the problems of resource waste and performance redundancy of the server in different time periods and improving the performance of the server.
[0082] In order to improve the performance of the server, it is necessary to reasonably arrange the video tasks in the business scenario to improve the performance of the server. Then, the determination of the business processing sub-period is a prerequisite for achieving this effect. In an exemplary embodiment, a method for determining the business processing sub-period is provided, which specifically includes:
[0083] Obtain a business processing period for the business scenario to be processed; divide the business processing period according to the business processing volume of the business scenario to be processed to obtain multiple business processing sub-periods for the business scenario to be processed.
[0084] Exemplarily, the business processing time period is divided according to the distribution of the business processing volume of the business scenario to be processed in the entire business processing time period, and multiple business processing sub-periods of the business scenario to be processed are obtained. The data related to the business processing volume may include actual business needs (for example, requiring certain businesses to be executed in a specified time period) and / or historical business processing conditions. Furthermore, the business processing cycle can be understood as a business processing cycle under the business scenario. This way of dividing the business processing time period can determine the distribution of business processing under the business scenario, can determine the optimal business processing sub-period for the video task to be processed, and can alleviate the situation of low utilization under resource constraints and resource redundancy.
[0085] Furthermore, the business processing period is divided according to the business processing volume of the business scenario to be processed, and multiple business processing sub-periods of the business scenario to be processed are obtained, including:
[0086] Determine the distribution data of the business processing volume of the business scenario to be processed in the business processing period; divide the business processing period according to the distribution data to obtain a first business processing sub-period and a second business processing sub-period; wherein the business processing volume of the first business processing sub-period is greater than the business processing volume of the second business processing sub-period. The first business processing sub-period can be understood as a business busy period, and the second business processing sub-period can be understood as a business non-busy period.
[0087] In an exemplary embodiment, Figure 5 As shown, step 306 includes steps 502 to 506 .
[0088] in:
[0089] Step 502: when the attribute of the video task is a real-time task and the business processing amount of the current business processing sub-period is greater than the preset business processing amount, the current business processing sub-period is determined as the target business processing sub-period of the video task to be processed.
[0090] Step 504: Execute the video task to be processed in the current business processing sub-period.
[0091] Exemplarily, when the attribute of the video task is a real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, such as the video task to be processed is video detection (such as only tripwires and area intrusion detection at the perimeter), the video task to be processed can be executed in the current business processing sub-period.
[0092] Furthermore, when the video task attribute is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, the code stream corresponding to the video task to be processed is marked as a business, a code stream carrying the business mark is obtained, and the code stream is stored in a designated storage location. For example, when performing video detection, if a video processing or video encoding and decoding service such as alarm, encoding, feature extraction, etc. is required, the corresponding code stream is marked, a mark bit is added to the code stream, and this code stream is saved in a designated storage location.
[0093] Step 506, when the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, a candidate business processing sub-period with a business processing volume less than the business processing volume of the current business processing sub-period is determined as a target business processing sub-period, and the video task to be processed is executed in the target business processing sub-period.
[0094] The candidate business processing sub-period is determined from other business processing sub-periods except the current business processing sub-period in the multiple business processing sub-periods. It can be understood that, in the case where the business processing period is divided into the first business processing sub-period and the second business processing sub-period, the current business processing sub-period can be the first business processing sub-period, and accordingly, the candidate business processing sub-period is the second business processing sub-period.
[0095] Exemplarily, when the business processing volume of the current business processing sub-period is greater than the preset business processing volume, if the video task attribute is a non-real-time task, such as video encoding and decoding or video processing, the to-be-processed code stream corresponding to the to-be-processed video task can be read from the designated storage location; according to the business tag carried by the to-be-processed code stream, the video task processing corresponding to the business tag is executed.
[0096] For example, during the current business processing sub-period, fixed business functions (such as fusion business picture stream detection) are executed, local video intelligence is turned on, but only code stream transmission detection functions (such as perimeter functions, only trip wire, regional intrusion, etc.) are executed. When encountering services such as alarm, encoding, feature extraction, etc., video processing or video encoding and decoding, the corresponding code stream is marked, a marker is added to the code stream, and this segment of the code stream is saved in the specified storage location. In the target business processing sub-period, the marked code stream is taken out from the storage code stream position, and different services are processed according to the type of mark, such as encoding the alarm large picture, cutting out the detection target small picture and then encoding, detecting frame feature attribute extraction, feature comparison, etc.
[0097] In an exemplary embodiment, executing a to-be-processed video task in a target service processing sub-period includes: reading a to-be-processed code stream corresponding to the to-be-processed video task from a designated storage location in the target service processing sub-period; and executing video task processing corresponding to the service tag according to the service tag carried by the to-be-processed code stream. The to-be-processed video task may be one or more, and the code stream with the tag may be taken out from the storage code stream location, and different services may be processed according to the tag type, such as encoding a large alarm image, re-encoding a small image of the detection target, extracting detection frame feature attributes, feature comparison, etc.
[0098] In the above embodiment, real-time tasks are processed in sub-periods with large business processing volume, and the code streams corresponding to non-real-time tasks are marked with business tags to obtain code streams carrying business tags, and the code streams are stored in a designated storage location, and are processed in appropriate sub-periods with small business processing volumes such as resource redundancy. This can alleviate the problem of resource shortage when the business processing volume is large and avoid the waste of redundant resources.
[0099] Optionally, in an exemplary embodiment, in the target business processing sub-period, if a triggering video task is detected, the triggering video task is executed and then the video task to be processed; if no triggering video task is detected, the video task to be processed is executed.
[0100] It is understandable that the triggered video task can be intelligent motion detection. When the candidate business processing sub-period is the target business processing sub-period, if the video intelligent detection is turned on when a motion detection event is triggered in the candidate business processing sub-period, it is necessary to perform intelligent motion detection first. After completing the intelligent motion detection, if there are video tasks such as alarm, encoding, feature extraction, etc., the corresponding bitstream can be marked with a business tag to obtain a bitstream carrying the business tag, and the bitstream is stored in a designated storage location, and then the video tasks to be processed in the period, such as video processing, are executed. This method can ensure the needs of the needs. It should be noted that during periods of high business volume or busy business, intelligent motion detection can be turned off or on.
[0101] In another exemplary embodiment, the service processing period is divided into a first service processing sub-period and a second service processing sub-period as an example, the first service processing sub-period is a service busy period, and the second service processing sub-period is a service non-busy period. Figure 6 As shown, a method for reusing device resources is provided, including:
[0102] Step 602 , dividing the business processing period of the business scenario to be processed according to the business processing volume of the business scenario to be processed, to obtain a plurality of business processing sub-periods of the business scenario to be processed.
[0103] Step 604: Obtain the current business processing sub-period and the video task to be processed in the business scenario to be processed.
[0104] Step 606: Determine the video task attributes and the service processing volume of the current service processing sub-period.
[0105] Exemplarily, the target service processing sub-period of the video task to be processed is determined according to the video task attribute and the service processing volume of the current service processing sub-period.
[0106] Step 608, when the video task attribute is a real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, the current business processing sub-period is determined as the target business processing sub-period for the video task to be processed, and the video task to be processed is executed in the current business processing sub-period.
[0107] Step 610, when the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, a business mark is added to the bitstream corresponding to the video task to be processed in the current business processing sub-period, a bitstream carrying the business mark is obtained, and the bitstream is stored in a designated storage location, and step 612 is executed.
[0108] Step 612, when the video task attribute is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, a candidate business processing sub-period with a business processing volume less than the business processing volume of the current business processing sub-period is determined as a target business processing sub-period, and the video task to be processed is executed in the target business processing sub-period.
[0109] Step 614, in the target service processing sub-period, if a triggering video task is detected, the triggering video task is executed and then the video task to be processed is executed; if no triggering video task is detected, the video task to be processed is executed.
[0110] It can be understood that the specific implementation of this embodiment can be achieved in the manner defined in the above embodiments, which will not be elaborated here.
[0111] In the above embodiment, the processing time in the pending business scenario is divided into multiple processing sub-periods. For the video task processing in each pending business scenario and the current processing task sub-period, the business processing volume of the current business processing sub-period and the video task attributes of the pending video task are determined, and the matching target business processing sub-period is determined from the multiple business processing sub-periods of the pending business scenario. That is to say, the decoupling of necessary functions and part of the business is achieved, so that the performance of a single chip is fully utilized to meet the user's multi-channel intelligent detection requirements. That is to say, through the time-sharing multiplexing strategy, the chip performance is maximized, thereby improving the single-card intelligent path limit; and through the dynamic detection technology, it is identified whether to switch the intelligent detection function during the non-busy period to ensure that resource reuse is not wasted and functional integrity is guaranteed, that is, full utilization of equipment resources and no waste of redundant resources.
[0112] In an exemplary embodiment, Figure 7 As shown, a flowchart of a method for reusing device resources is provided in combination with an application scenario, including:
[0113] Step 1: Divide the business processing time periods of business processing scenarios into time periods.
[0114] Set time T as the busy time period, that is, the first business processing sub-period. T can be configured by the user and can be set in multiple sections; such as the default time period 6:00-18:00 (daytime); the remaining time period T′ is the non-busy time, that is, the second business processing sub-period.
[0115] Step 2: Busy period detection, that is, determining the period when the business processing volume of the current business processing sub-period is greater than the preset business processing volume
[0116] Within the T time, execute fixed business functions (such as real-time tasks: integrated business picture stream detection), turn on local video intelligence, but only execute stream transmission detection functions (such as perimeter functions, only perform tripwire, area intrusion and other detections), mark the corresponding stream when encountering video encoding and decoding and video processing services, such as when alarm, encoding, feature extraction and other services are required, add a marker bit to the stream and save this stream segment to the specified storage location.
[0117] Among them, the total server resources are Δ(S+M), S is the total CPU resources, and M is the total memory resources;
[0118] The resources required for full performance of a single card and single intelligence (such as perimeter) are Δ(S 算法 +M 算法 ), the number of paths is N = Δ(S+M) / Δ(S 算法 +M 算法 ), where S 算法 Represents the CPU resources required to execute the intelligent algorithm corresponding to the video task, M 算法Represents the memory resources required to execute the intelligent algorithm corresponding to the video task;
[0119] In the related art, the available resources of a single card and a single smart card are Δ(S 余 +M 余 ), only supports N paths r =Δ(S 余 +M 余 ) / Δ((S 算法 +S 业务 )+(M 算法 +M 业务 ));
[0120] In this embodiment, the available resources of a single card and a single intelligence are Δ(S 余 +M 余 ), supports N number of channels n =Δ(S 余 +M 余 ) / Δ(S 算法 +M 算法 )>>N r ;
[0121] According to the upper layer's required storage time of the alarm code stream, the marked alarm code stream segment is controlled, and the business storage code stream position is reused, which will not cause a waste of storage space.
[0122] Step 3: Off-peak SMD intelligent analysis
[0123] During the T′ time, SMD intelligence is turned on and video motion detection analysis is performed on each channel. When a motion detection event is triggered, video intelligent detection is turned on, and the processing method is similar to busy period detection. During the period when there is no motion detection trigger, video intelligent analysis is performed.
[0124] It is understandable that smd consumes very little device resources and can be basically ignored;
[0125] The total resources of the original solution during the non-busy period are Δ(S+M), and the redundant resources are Δ(S 冗 +M 冗 ), resource utilization rate X = 1-Δ(S 冗 +M 冗 ) / Δ(S+M);
[0126] After the implementation of this solution, the redundant resources are Δ((S 冗 -S 业务 )+(M 冗 -M 业务 ), resource utilization rate X x =(1-Δ((S 冗 -S 业务 )+(M 冗 -M 业务 )) / Δ(S+M))>>X;
[0127] Step 4: Intelligent service processing, i.e. video detection
[0128] Take out the marked code stream from the storage code stream location, and process different services according to the type of mark, such as encoding the alarm large image, cutting out the detection target small image and then encoding it, extracting the detection frame feature attributes, feature comparison, etc.
[0129] In the above embodiment, video detection is processed during the busy period of business processing, and for services that require alarm, encoding, feature extraction, etc., a mark bit is added to the corresponding code stream and stored in a specified location. During the non-busy period, intelligent motion detection is turned on, and video motion detection analysis is performed in different channels. When a motion detection event is triggered, video intelligent detection is turned on, and video intelligent analysis is performed during the period without motion detection trigger. In this way, by dividing the business processing period into busy and non-busy periods, the necessary functions and some services are decoupled, so that the performance of a single chip is fully utilized to meet the user's multi-channel intelligent detection requirements. In other words, through the time-sharing multiplexing strategy, the chip performance is maximized, thereby increasing the single-card intelligent channel limit; and through the motion detection technology, it is identified whether to switch the intelligent detection function during the non-busy period to ensure that resource reuse is not wasted and functional integrity is guaranteed, that is, to make full use of equipment resources and not waste redundant resources.
[0130] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0131] Based on the same inventive concept, the embodiment of the present application also provides a device resource reuse apparatus for implementing the device resource reuse method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the multiplexing apparatus for one or more device resources provided below can refer to the limitations of the device resource reuse method above, and will not be repeated here.
[0132] In an exemplary embodiment, Figure 8As shown, a device resource multiplexing apparatus is provided, including: a data acquisition module 802, a task attribute determination module 804 and a time-sharing multiplexing module 806, wherein:
[0133] The data acquisition module 802 is used to acquire the current business processing sub-period and the video task to be processed in the business scenario to be processed; the current business processing sub-period is any one of the multiple business processing sub-periods of the business scenario to be processed; and the business processing volume of each business processing sub-period is different.
[0134] The task attribute determination module 804 is used to determine the video attribute of the video task to be processed.
[0135] The time-division multiplexing module 806 is used to determine a target service processing sub-period for the video task to be processed according to the video task attribute and the service processing amount of the current service processing sub-period.
[0136] The above-mentioned device resource multiplexing device divides the processing time under the pending business scenario into multiple processing sub-periods. For the video task processing under each pending business scenario and the current processing task sub-period, by determining the business processing volume of the current business processing sub-period and the video task attributes of the pending video task, a matching target business processing sub-period is determined from the multiple business processing sub-periods of the pending business scenario. In other words, the pending video task and the needs of the pending business scenario can be decoupled to avoid the simultaneous execution of all pending video tasks, and the device resources of the server are reasonably allocated, thereby avoiding the problems of resource waste and performance redundancy in different time periods of the server and improving the performance of the server.
[0137] In an exemplary embodiment, the device resource multiplexing apparatus further includes a division module, the division module being used to obtain a service processing period of a service scenario to be processed;
[0138] The business processing period is divided according to the business processing volume of the business scenario to be processed, so as to obtain a plurality of business processing sub-periods of the business scenario to be processed.
[0139] In an exemplary embodiment, the partitioning module is further used to determine distribution data of the business processing volume of the business scenario to be processed in the business processing period;
[0140] Dividing the service processing period according to the distribution data to obtain a first service processing sub-period and a second service processing sub-period;
[0141] The service processing volume of the first service processing sub-period is greater than the service processing volume of the second service processing sub-period.
[0142] In an exemplary embodiment, the time-division multiplexing module 806 is further configured to determine the current business processing sub-period as the target business processing sub-period of the video task to be processed when the attribute of the video task is a real-time task and the business processing amount of the current business processing sub-period is greater than the preset business processing amount;
[0143] Execute the pending video tasks in the current business processing sub-period.
[0144] In an exemplary embodiment, the time-division multiplexing module 806 is also used to, when the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, mark the bitstream corresponding to the video task to be processed with a business tag, obtain the bitstream carrying the business tag, and store the bitstream in a designated storage location.
[0145] In an exemplary embodiment, the time-division multiplexing module 806 is further configured to, when the attribute of the video task is a non-real-time task and the service processing amount of the current service processing sub-period is greater than the preset service processing amount, determine the candidate service processing sub-period whose service processing amount is less than the service processing amount of the current service processing sub-period as the target service processing sub-period;
[0146] The candidate business processing sub-period is determined from other business processing sub-periods except the current business processing sub-period among the multiple business processing sub-periods;
[0147] The video tasks to be processed are executed in the target business processing sub-period.
[0148] In an exemplary embodiment, the time-division multiplexing module 806 is further configured to execute the to-be-processed video task after the triggered video task if a triggered video task is detected during the target service processing sub-period;
[0149] If no triggering video task is detected, the pending video task is executed.
[0150] In an exemplary embodiment, the time-division multiplexing module 806 is also used to mark the bitstream corresponding to the triggered video task with a business tag, obtain the bitstream carrying the business tag, store the bitstream in a designated storage location, and execute the video task to be processed.
[0151] In an exemplary embodiment, the time-division multiplexing module 806 is further configured to read a to-be-processed bitstream corresponding to the to-be-processed video task from a designated storage location during the target service processing sub-period;
[0152] According to the service tag carried by the code stream to be processed, the video task processing corresponding to the service tag is executed.
[0153] Each module in the device resource reuse apparatus can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0154] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data associated with video tasks. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for multiplexing device resources is implemented.
[0155] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0156] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0157] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0158] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0159] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0160] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0161] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0162] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for multiplexing device resources, characterized in that: The method comprises: Acquire the current business processing sub-period and the to-be-processed video task in the to-be-processed business scenario; the current business processing sub-period is any one of the multiple business processing sub-periods of the to-be-processed business scenario; and the business processing volume of each business processing sub-period is different; Determining a video task attribute of the video task to be processed; A target service processing sub-period of the to-be-processed video task is determined according to the video task attribute and the service processing amount of the current service processing sub-period.
2. The method according to claim 1, characterized in that The method for determining the multiple service processing sub-periods includes: Obtaining a business processing period for the business scenario to be processed; The business processing time period is divided according to the business processing volume of the business scenario to be processed to obtain multiple business processing sub-time periods of the business scenario to be processed.
3. The method according to claim 2, characterized in that The business processing time period is divided according to the business processing volume of the business scenario to be processed to obtain multiple business processing sub-time periods of the business scenario to be processed, including: Determine the distribution data of the business processing volume of the to-be-processed business scenario in the business processing period; Dividing the service processing period according to the distribution data to obtain a first service processing sub-period and a second service processing sub-period; The service processing volume of the first service processing sub-period is greater than the service processing volume of the second service processing sub-period.
4. The method according to any one of claims 1 to 3, characterized in that: The determining, according to the video task attribute and the business processing amount of the current business processing sub-period, of the target business processing sub-period of the to-be-processed video task comprises: If the attribute of the video task is a real-time task and the business processing amount of the current business processing sub-period is greater than the preset business processing amount, the current business processing sub-period is determined as the target business processing sub-period of the video task to be processed; The to-be-processed video task is executed in the current service processing sub-period.
5. The method according to claim 4, characterized in that The method further comprises: When the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, the bitstream corresponding to the video task to be processed is marked with a business tag to obtain the bitstream carrying the business tag, and the bitstream is stored in a designated storage location.
6. The method according to claim 5, characterized in that The determining, according to the video task attribute and the business processing amount of the current business processing sub-period, of the target business processing sub-period of the to-be-processed video task comprises: When the attribute of the video task is a non-real-time task and the business processing volume of the current business processing sub-period is greater than the preset business processing volume, a candidate business processing sub-period whose business processing volume is less than the business processing volume of the current business processing sub-period is determined as a target business processing sub-period; The candidate service processing sub-period is determined from other service processing sub-periods in the plurality of service processing sub-periods except the current service processing sub-period; The to-be-processed video task is executed in the target service processing sub-period.
7. The method according to claim 6, characterized in that The executing the to-be-processed video task in the target service processing sub-period includes: In the target service processing sub-period, if a triggering video task is detected, the to-be-processed video task is executed after the triggering video task; If no triggering video task is detected, the to-be-processed video task is executed.
8. The method according to claim 7, characterized in that The executing of the triggering video task and then the to-be-processed video task comprises: The code stream corresponding to the triggered video task is marked with a business tag to obtain the code stream carrying the business tag, and the code stream is stored in a designated storage location to execute the video task to be processed.
9. The method according to claim 8, characterized in that The executing the to-be-processed video task in the target service processing sub-period includes: In the target service processing sub-period, reading a to-be-processed code stream corresponding to the to-be-processed video task from the designated storage location; According to the service tag carried by the code stream to be processed, video task processing corresponding to the service tag is performed.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.