A method, device and computer equipment for dynamically switching coding channels

By dynamically switching the encoding mode and based on the channel level and weight, it ensures that high-priority channels or applications use high encoding quality, which solves the problems of blurred video information and waste of resources caused by inflexible switching of encoding channels in the existing technology, and realizes the encoding of video information. HD encoding and efficient use of resources.

CN118524219BActive Publication Date: 2024-10-18ZHEJIANG DAHUA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410989555.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-18
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Existing technology cannot flexibly switch encoding channels, resulting in blurring of key video information or waste of resources.

Method used

By determining the first channel and the second channel in the current time period, and dynamically switching the encoding mode according to the channel's level, criticality weight and priority weight, it ensures that high-priority channels or application triggers use high-coding quality mode, and non-high-priority channels Use low encoding quality mode when prioritizing to avoid wasting resources.

Benefits of technology

It achieves high-definition encoding clarity of key video information, avoids waste of resources, and solves the problems of blurred video information and waste of resources caused by the inability to flexibly switch encoding channels in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118524219B_ABST
    Figure CN118524219B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device and computer equipment for dynamically switching coding channels. The method comprises: determining a first channel and a second channel in a current time period, wherein the level of the first channel is greater than the level of the second channel; determining a target channel in the second channel that meets a first preset condition, wherein the first preset condition comprises that an application in a high-priority channel is triggered and / or a high-priority application is triggered; switching the first channel that meets the second preset condition to a first coding mode, and switching the target channel to a second coding mode, wherein the second preset condition comprises that the first channel using the second coding mode does not trigger an application or the level of the first channel using the second coding mode is lower than a preset level; the coding quality of the first coding mode is lower than the coding quality of the second coding mode. The use of this method can solve the problem of fuzzy key video information or waste of resources in the prior art due to the inability to flexibly switch coding channels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of video coding, and in particular to a method, device and computer equipment for dynamically switching coding channels. Background Art

[0002] With the development of electronic technology, the application of hard disk storage recorders has gradually attracted attention. However, due to the limited capacity of the hard disk storage recorder itself, it can usually only open a rated number of high-definition encoding channels. The rated number of high-definition encoding channels often cannot be switched flexibly, resulting in blurred key video information or waste of resources.

[0003] The existing technology mainly adopts a time-divided coding channel switching method, specifically switching the coding channel according to a preset time period. This coding channel switching method cannot flexibly switch the coding channel according to specific needs, and there are still problems such as blurred key video information or waste of resources.

[0004] There is no effective solution to the problem that the existing technology cannot flexibly switch encoding channels, resulting in blurred key video information or waste of resources. Summary of the invention

[0005] Based on this, it is necessary to provide a method, device and computer equipment for dynamically switching coding channels to address the above technical problems.

[0006] In a first aspect, the present application provides a method for dynamically switching a coding channel. The method comprises the following steps:

[0007] Determine a first channel and a second channel within a current time period, wherein a level of the first channel is greater than a level of the second channel;

[0008] Determine a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered;

[0009] The first channel that meets the second preset condition is switched to the first encoding mode, and the target channel is switched to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger an application or the level of the first channel using the second encoding mode is lower than a preset level; and the encoding quality of the first encoding mode is lower than the encoding quality of the second encoding mode.

[0010] In one embodiment, determining the first channel and the second channel in the current time period comprises the following steps:

[0011] Determining the level of each channel in the current time period based on the criticality weight of the channel in the current time period and the priority weight of the channel;

[0012] The first channel and the second channel in the current time period are determined based on the levels of the respective channels in the current time period.

[0013] In one embodiment, before determining the level of each channel in the current time period based on the critical weight of the channel in the current time period and the priority weight of the channel, the following steps are included:

[0014] The criticality weight of the channel in the current time period and the priority weight of the channel are determined based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period.

[0015] In one embodiment, the determining the critical weight of the channel in the current time period and the priority weight of the channel based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period comprises the following steps:

[0016] Determining a priority weight of the application based on the weight of the application, the search frequency of the application in the current time period, and the weight of the application search;

[0017] Determine the critical weight of the channel in the current time period based on the priority weight of each application in the channel and the number of times each application in the channel is triggered in the current time period;

[0018] The priority weight of the channel is determined according to the weight of the channel and the search frequency of the channel in the current time period.

[0019] In one embodiment, before determining the critical weight of the channel in the current time period and the priority weight of the channel based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period, the method includes:

[0020] According to the classification of the application and the classification of the channel, the weight of the application and the weight of the channel are determined.

[0021] In one embodiment, the method for dynamically switching the coding channel further includes the following steps:

[0022] According to a preset time period, updating the weight of the channel and the weight of the application to obtain an updated weight of the channel and an updated weight of the application;

[0023] Determine the criticality weight of the channel and the priority weight of the channel in the updated time period based on the updated weight of the application, the updated weight of the channel, the search frequency of the application in the updated time period, and the search frequency of the channel in the updated time period;

[0024] Based on the criticality weight of the channel in the updated time period and the priority weight of the channel, a first channel and a second channel in the updated time period are determined.

[0025] In one embodiment, the determining of the high priority channel and the high priority application in the second channel comprises the following steps:

[0026] Determine a channel in the second channel that meets a third preset condition as the high priority channel in the second channel; the third preset condition is that the priority weight of the channel meets the first preset weight condition;

[0027] An application in the second channel that meets a fourth preset condition is determined as the high-priority application in the second channel; the fourth preset condition is that the priority weight of the application meets a second preset weight condition.

[0028] In one embodiment, the method for dynamically switching encoding channels further includes:

[0029] The channel in the second channel that meets the fifth preset condition is switched to the first encoding mode; the fifth preset condition includes that the channel does not belong to the high priority channel or the high priority application does not exist.

[0030] In a second aspect, the present application also provides a device for dynamically switching coding channels. The device comprises:

[0031] A first determining module, configured to determine a first channel and a second channel within a current time period, wherein the level of the first channel is greater than the level of the second channel;

[0032] A second determining module, configured to determine a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered;

[0033] And a switching module, used to switch the first channel that meets the second preset condition to the first encoding mode, and switch the target channel to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger an application or the level of the first channel using the second encoding mode is lower than a preset level; the encoding quality of the first encoding mode is lower than the encoding quality of the second encoding mode.

[0034] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method for dynamically switching encoding channels described in the first aspect is implemented.

[0035] The above-mentioned method, device and computer equipment for dynamically switching coding channels, by determining the first channel and the second channel in the current time period, determine the target channel in the second channel that meets the first preset condition, wherein the first preset condition includes that the application in the high-priority channel is triggered and / or the high-priority application is triggered, and then, the first channel that meets the second preset condition is switched to the first coding mode, and the target channel is switched to the second coding mode, wherein the second preset condition includes that the first channel using the second coding mode does not trigger the application or the level of the first channel using the second coding mode is lower than the preset level. In this way, firstly determine the first channel with a high level and the second channel with a low level in the current time period, and filter out the target channel in the second channel that meets the conditions that the application in the high-priority channel is triggered and / or the high-priority application is triggered, and then switch the coding mode of the first channel to the first coding mode, and switch the target channel to the second coding mode when the first channel using the second coding mode does not trigger the application or the level of the first channel using the second coding mode is lower than the preset level. That is, by determining the target channel that needs to be high-definition encoded in the low-level second channel, the channel that does not temporarily need to be high-definition encoded in the high-level first channel is switched to the first encoding mode with lower encoding quality, and the target channel is switched to the second encoding mode with higher encoding quality to ensure the encoding clarity of key video information, avoid waste of resources, and solve the problem of blurred key video information or waste of resources in the prior art due to the inability to flexibly switch encoding channels.

[0036] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0038] Figure 1 A hardware structure block diagram of a terminal for a method for dynamically switching coding channels provided in an embodiment of the present application;

[0039] Figure 2 A flowchart of a method for dynamically switching encoding channels provided in an embodiment of the present application;

[0040] Figure 3 A flowchart of a method for dynamically switching encoding channels provided in a preferred embodiment of the present application;

[0041] Figure 4 This is a structural block diagram of a device for dynamically switching encoding channels provided in one embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0043] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0044] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 FIG. 1 is a hardware structure diagram of a terminal of the method for dynamically switching coding channels of this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0045] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the dynamic switching method of the coding channel in the present embodiment, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to realize the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0046] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0047] In this embodiment, a method for dynamically switching encoding channels is provided. Figure 2 is a flow chart of the method for dynamically switching the encoding channel of this embodiment, such as Figure 2 As shown, the process includes the following steps:

[0048] Step S210, determining a first channel and a second channel in a current time period, wherein the level of the first channel is higher than the level of the second channel.

[0049] The level of the above-mentioned channel may be the level of importance of the channel in the current time period. The level of the channel in the current time period may be calculated by the critical weight of each channel in the current time period and the priority weight of the channel. The level of the channel may be used to characterize the priority of the video information in the channel for high-definition encoding. The higher the level of the channel, the higher the priority of the video information in the channel for high-definition encoding, and the lower the level of the channel, the lower the priority of the video information in the channel for high-definition encoding. The above-mentioned determination of the first channel and the second channel in the current time period may be to use the preset number of channels with the highest level of the channel in the current time period as the first channel. All channels except the first channel in the current time period are used as the second channel. The above-mentioned preset number may be specifically set according to the specific situation. It should be noted that, in this embodiment, by dividing the channel into the first channel and the second channel, the purpose is to switch the first encoding mode and the second encoding mode for each channel based on the division result of the first channel and the second channel. Generally, after determining the first channel in the current time period, the video information of the first channel is encoded using the second encoding mode with higher encoding quality. Because the number of channels that can adopt the second coding mode is limited, the preset number of first channels can be set to be less than or equal to the rated number of channels of the second coding mode that can be simultaneously enabled by the current electronic device.

[0050] Step S220, determining a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered.

[0051] In this step, the above-mentioned high priority channel may be a channel whose priority weight satisfies the first preset weight condition. Among them, the above-mentioned first preset weight condition may be specifically set according to specific needs. The above-mentioned high priority application may be an application whose priority weight satisfies the second preset weight condition. Among them, the above-mentioned second preset weight condition may be specifically set according to specific needs. The above-mentioned application may be an application involved in the use of the device, or may be a special processing of the video captured by the camera. For example, intelligent applications such as face recognition and face detection. Face detection may be face detection of the video information captured by the camera. Face recognition may be face recognition of the video information captured by the camera. In this step, when the channel in the second channel satisfies the application in the high priority channel being triggered and / or the high priority application being triggered, this channel is determined as the target channel. By determining the target channel, it is convenient to switch the encoding mode of the target channel to the second encoding mode with higher encoding quality in the subsequent process, so as to realize high-definition encoding of the video information in the target channel to ensure the encoding clarity of the key video information.

[0052] Step S230, switching the first channel that meets the second preset condition to the first encoding mode, and switching the target channel to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger the application or the level of the first channel using the second encoding mode is lower than the preset level; the encoding quality of the first encoding mode is lower than the encoding quality of the second encoding mode.

[0053] The first encoding mode may be non-5M encoding, specifically, an encoding mode with a quality lower than 5M encoding. The second encoding mode may be 5M encoding. The 5M encoding is an encoding mode with a video resolution of 5MP (500,000 pixels). The encoding quality may be reflected in the resolution and clarity of the video. The higher the encoding quality, the higher the resolution of the video and the clearer the video. The lower the encoding quality, the lower the resolution of the video and the blurrier the video. The preset level may be set specifically according to the specific situation. For example, the lowest level of all first channels in the current time period may be used as the preset level. In this step, individual channels (first channels that meet the second preset condition) in the first channel that are not temporarily required to be encoded using the second encoding mode are switched to the first encoding mode for encoding, so that the channels in the second encoding mode can be freed up, and the target channel is switched to the second encoding mode, so that high-definition encoding of the video information in the target channel can be achieved to ensure the clarity of the encoding of the key video information.

[0054] Preferably, the first channel that meets the second preset condition can be stopped from encoding in the second encoding mode, and then the target channel can be switched to the second encoding mode. When the encoding of key video information in the target channel is completed or the key application trigger is completed, the target channel is switched to the first encoding mode, and the first channel that stopped the second encoding mode is switched back to the second encoding mode.

[0055] In the above steps S210 to S230, by determining the first channel and the second channel in the current time period, the target channel in the second channel that meets the first preset condition is determined, wherein the first preset condition includes that the application in the high-priority channel is triggered and / or the high-priority application is triggered, and then the first channel that meets the second preset condition is switched to the first coding mode, and the target channel is switched to the second coding mode, wherein the second preset condition includes that the first channel using the second coding mode does not trigger the application or the level of the first channel using the second coding mode is lower than the preset level. In this way, firstly determine the first channel with a high level and the second channel with a low level in the current time period, and filter out the target channel in the second channel that meets the conditions that the application in the high-priority channel is triggered and / or the high-priority application is triggered, and then switch the coding mode of the first channel to the first coding mode, and switch the target channel to the second coding mode when the first channel using the second coding mode does not trigger the application or the level of the first channel using the second coding mode is lower than the preset level. That is, by determining the target channel that needs to be high-definition encoded in the low-level second channel, the channel that does not temporarily need to be high-definition encoded in the high-level first channel is switched to the first encoding mode with lower encoding quality, and the target channel is switched to the second encoding mode with higher encoding quality to ensure the encoding clarity of key video information, avoid waste of resources, and solve the problem of blurred key video information or waste of resources in the prior art due to the inability to flexibly switch encoding channels.

[0056] In one embodiment, step S210, determining the first channel and the second channel in the current time period, includes the following steps:

[0057] Step S212, determining the level of each channel in the current time period based on the criticality weight of the channel in the current time period and the priority weight of the channel.

[0058] In this step, the critical weight of the above-mentioned channel in the current time period can be an indicator used to indicate the criticality of the channel in the current time period. The greater the critical weight of the channel in the current time period, the higher the criticality of the video information of the channel in the current time period, and the smaller the critical weight of the channel in the current time period, the lower the criticality of the video information of the channel in the current time period. In addition, the critical weight of the channel in the current time period can be calculated by the priority weight of the application triggered by the channel in the current time and the number of times each application of the channel is triggered in the current time period.

[0059] The calculation formula for determining the level of each channel in the current time period based on the criticality weight of the channel in the current time period and the priority weight of the channel is as follows:

[0060] ;

[0061] Among them, rank chn is the level of the current channel, pri_chn is the priority weight of the current channel, key chn is the critical weight of the current channel in the current time period, pri_chn total is the sum of the priority weights of all channels, .

[0062] Step S214: determining the first channel and the second channel in the current time period based on the levels of the channels in the current time period.

[0063] In the above steps S212 to S214, the level of each channel in the current time period is determined based on the critical weight of the channel in the current time period and the priority weight of the channel, and a preset number of channels with the highest level in the current time period are used as the first channel, and all channels except the first channel in the current time period are used as the second channel. By dividing the channels in the current time period into the first channel and the second channel, it is convenient to subsequently allocate and switch the first coding mode and the second coding mode to each channel according to the division result of the first channel and the second channel.

[0064] Furthermore, in one embodiment, before step S212, the following steps are included:

[0065] Step S211, based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period, determine the critical weight of the channel in the current time period and the priority weight of the channel.

[0066] Among them, the weight of the above-mentioned application can be used to characterize the user's attention to the application in the current scenario. The larger the weight of the application, the more likely the current application is to be paid attention to by the user in the current scenario; the smaller the weight of the application, the less likely the current application is to be paid attention to by the user in the current scenario. The weight of the above-mentioned channel can be used to characterize the user's attention to the channel in the current scenario. The larger the weight of the channel, the more likely the current channel is to be paid attention to by the user in the current scenario; the smaller the weight of the channel, the less likely the current channel is to be paid attention to by the user in the current scenario. The search frequency of the above-mentioned application can be the number of applications searched in the current time period. The search frequency of the above-mentioned channel can be the number of channels searched in the current time period.

[0067] In one embodiment, step S211, based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period, determines the critical weight of the channel in the current time period and the priority weight of the channel, including the following steps:

[0068] Step S2112, determining the priority weight of the application based on the weight of the application, the search frequency of the application in the current time period, and the weight of the application search.

[0069] In this step, the priority weight of the application is determined based on the weight of the application, the search frequency of the application in the current time period, and the weight of the application search. Specifically, the weight of the application search can be determined based on the weight of the application and the weight of the application search; the priority weight of the application is determined based on the weight of the application search and the search frequency of the application in the current time period. Specifically, application search can be divided into two categories: precise application search and fuzzy application search. Therefore, the weight of the application search can include the weight of the precise application search and the weight of the fuzzy application search. The weight of the application search can also include the weight of the precise application search and the weight of the module application search. The frequency of the application search can also include the frequency of the precise application search and the frequency of the fuzzy application search. The weight of the above-mentioned application search can be the proportion of the current application search to the weight of the current application. For example, the weight of the precise application search can be , that is, the weight of precise application search is the weight of the application , the weight of fuzzy application search can be , that is, the weight of the fuzzy application search is the weight of the application The weight of the above application search may indicate the probability of the application being searched. The larger the weight of the application search, the greater the probability of the application being searched. The smaller the weight of the application search, the smaller the probability of the application being searched.

[0070] The above-mentioned weight based on the application weight and the weight of the application search determines the weight of the application search. The specific calculation process is as follows:

[0071] ;

[0072] Among them, x acc is the weight of precise application search, M is the weight of precise application search, x intelli is the weight of the application.

[0073] ;

[0074] Among them, x vag is the weight of fuzzy application search, and N is the weight of fuzzy application search.

[0075] The calculation process of determining the priority weight of the application based on the weight of the application search and the search frequency of the application in the current time period is as follows:

[0076] ;

[0077] Among them, f acc is the frequency of accurate application search in the current time period, f vag is the frequency of fuzzy application search in the current time period, and pri_intelli is the priority weight of the application.

[0078] Preferably, if the current application has not been searched in the current time period, that is, the search frequency of the current application in the current time period is 0, the priority weight of the current application can be pre-set to half of the minimum value of the priority weights of all applications. That is, if the priority weights of all applications are calculated through step S2112, and then the minimum priority weight among the priority weights of all applications is determined, the minimum priority weight is set to half of the minimum value of the priority weight of all applications. , as the priority weight of the current application.

[0079] Step S2114, based on the priority weights of the various applications in the channel and the number of times each application in the channel is triggered in the current time period, determine the critical weight of the channel in the current time period.

[0080] Specifically, based on the priority weight of each application in the channel and the number of times each application in the channel is triggered in the current time period, the calculation process of determining the critical weight of the channel in the current time period is as follows:

[0081] ;

[0082] Among them, pri_intelli1 represents the priority weight of the first application in the channel, pri_intelli2 represents the priority weight of the second application in the channel, and pri_intelli n Indicates the priority weight of the nth application in the channel, where n indicates that there are n applications in the channel. fre1 is the number of times the first application in the channel is triggered in the current time period, and fre2 is the number of times the second application in the channel is triggered in the current time period. n The number of times the nth application in the channel is triggered in the current time period, pri_intelli total Indicates the sum of the priority weights of all applications in the channel, pri_intelli total The calculation process is as follows:

[0083] ;

[0084] Step S2116, determining the priority weight of the channel according to the weight of the channel and the search frequency of the channel in the current time period.

[0085] The search frequency of the channel in the current time period may be the sum of the search frequencies of all channel-related search contents in the current time period.

[0086] The calculation process of determining the priority weight of the channel based on the weight of the channel and the search frequency of the channel in the current time period is as follows:

[0087] ;

[0088] Where pri_chn is the priority weight of the channel, x is the weight of the channel, and f is the search frequency of the channel in the current time period.

[0089] Preferably, if the current channel has not been searched in the current time period, that is, the search frequency of the current channel in the current time period is 0, the priority weight of the current channel can be pre-set to half of the minimum value of the priority weights of all channels. That is, if the priority weights of all channels are calculated through step S2116, and then the minimum priority weight among the priority weights of all channels is determined, the minimum priority weight is set to half of the minimum value of the priority weight of all channels. , as the priority weight of the current channel.

[0090] In the above steps S2112 to S2116, the priority weight of the application is determined by the weight of the application, the search frequency of the application in the current time period, and the weight of the application search, and then the critical weight of the channel in the current time period is determined by the priority weight of each application in the channel and the number of triggers of each application in the channel in the current time period. Finally, the priority weight of the channel is determined according to the weight of the channel and the search frequency of the channel in the current time period. By calculating the critical weight of the channel in the current time period and the priority weight of the channel, the level of each channel in the current time period can be determined according to the critical weight of the channel in the current time period and the priority weight of the channel.

[0091] Furthermore, in one embodiment, before step S211, the following steps are included:

[0092] Step S209: Determine the weight of the application and the weight of the channel according to the classification of the application and the classification of the channel.

[0093] The above-mentioned classification of applications can be divided into two categories according to the complexity of the applications, namely, complex applications and simple applications. The functions implemented by complex applications are more complex than those implemented by simple applications. For example, face recognition is a complex application, and face detection is a simple application. Furthermore, different weights are set for different types of applications. Generally, complex applications have a higher priority than simple applications, that is, the weight of complex applications is greater than that of simple applications. For example, the weight of complex applications can be set to x intelli1 , the weight of the simple application is set to x intelli2 , we need to ensure x intelli1 Greater than x intelli2 It should be noted that the weights of complex applications and simple applications can be set according to specific circumstances, as long as x intelli1 Greater than x intelli2 That's it.

[0094] The above-mentioned channel classification can be to divide the channels into static scene channels and dynamic scene channels according to the specific application scenarios in which the channels are applied. In general, static scene channels are required to have higher priority than dynamic scene channels, that is, the weight of static scene channels is greater than the weight of dynamic scene channels. For example, a channel with the application scenario of a hall is required to have a higher priority than a channel with the application scenario of a street. For example, the weight of the static scene channel can be set to x1, and the weight of the dynamic scene channel can be set to x2, and it is necessary to ensure that x1 is greater than x2. It should be noted that the weight of the static scene channel and the weight of the dynamic scene channel can be specifically set according to the specific situation, as long as x1 is greater than x2.

[0095] In addition, in one embodiment, based on step S209, the following steps are also included:

[0096] Step S2092: updating the channel weight and the application weight according to a preset time period to obtain the updated channel weight and the updated application weight.

[0097] The above-mentioned preset time period can be specifically set according to specific needs. It should be noted that in order to ensure that the dynamic switching of the coding channel can adapt to the current application scenario in time, the preset time period can be set to a shorter time length. If the scenario in which the coding channel is applied does not change much, the preset time period can be set to a longer time length. The above-mentioned update of the channel weight and the application weight can be based on the priority weight of the application and the priority weight of the channel corresponding to the current time period to obtain the updated channel weight and the updated application weight. Specifically, it can be based on the priority weight of the application corresponding to the current time period to obtain the updated application weight, and based on the priority weight of the channel corresponding to the current time period to obtain the updated channel weight. The above-mentioned process of obtaining the updated application weight according to the priority weight of the application corresponding to the current time period is as follows:

[0098] ;

[0099] Among them, x intelli2 is the weight of the updated application, pri_intelli is the priority weight of the current application, pri_intelli total is the sum of the priority weights of all applications, x max1 is the preset application threshold.

[0100] In this step, a preset application threshold is set to avoid the situation where the weight of the updated application is too large, so as to avoid the over-coupling phenomenon caused by iteration. The above preset application threshold can be set according to the specific situation. For example, the preset application threshold can be set to 0.5.

[0101] The above process of obtaining the updated channel weight according to the priority weight of the channel corresponding to the current time period is as follows:

[0102] ;

[0103] Among them, x intelli3 is the updated channel weight, pri is the priority weight of the current channel, pri total is the sum of the priority weights of all channels, x max2 is the preset channel threshold.

[0104] In this step, a preset channel threshold is set to avoid the situation where the weight of the updated channel is too large, so as to avoid over-coupling caused by iteration. The above preset channel threshold can be set according to the specific situation. For example, the preset channel threshold can be set to 0.5.

[0105] Step S2094, based on the updated application weight, the updated channel weight, the application search frequency in the updated time period, and the channel search frequency in the updated time period, determine the channel's critical weight and channel priority weight in the updated time period.

[0106] Step S2096: Determine the first channel and the second channel in the updated time period based on the criticality weight of the channel in the updated time period and the priority weight of the channel.

[0107] In the above steps S2092 to S2096, the channel weights and the application weights are updated according to a preset time period to obtain updated channel weights and updated application weights, and then, according to the search frequency of the application in the updated time period and the search frequency of the channel in the updated time period, the critical weight of the channel in the updated time period and the priority weight of the channel are updated, and then the first channel and the second channel are updated, and then by determining the target channel that needs to be high-definition encoded in the low-level second channel, the channel that does not need to be high-definition encoded temporarily in the high-level first channel is switched to the first encoding mode with lower encoding quality, and the target channel is switched to the second encoding mode with higher encoding quality to ensure the encoding clarity of the key video information, avoid waste of resources, and solve the problem of fuzzy key video information or waste of resources in the prior art due to the inability to flexibly switch encoding channels.

[0108] In one embodiment, determining a high priority channel and a high priority application in the second channel comprises the following steps:

[0109] Step S222: Determine the channel in the second channel that meets the third preset condition as a high priority channel in the second channel; the third preset condition is that the priority weight of the channel meets the first preset weight condition.

[0110] In this step, the first preset weight condition may be the priority weight corresponding to the channel with the largest priority weight among the priority weights of all channels, or may be the priority weight corresponding to the channel with a priority weight much greater than other priority weights. Specifically, the channel in the second channel that meets the third preset condition is determined as follows:

[0111] ;

[0112] Among them, PRI_CHN ext is the high priority channel in the second channel, PRI_CHN is the set of priority weights of all channels in the second channel, m1 is the number of all channels in the second channel, pri_chn total is the sum of the priority weights of all channels in the second channel.

[0113] Step S224, determining the application in the second channel that meets the fourth preset condition as a high priority application in the second channel; the fourth preset condition is that the priority weight of the application meets the second preset weight condition.

[0114] In this step, the second preset weight condition may be the priority weight of the application with the largest priority weight among all the priority weights of the applications, or may be the priority weight corresponding to the application with a priority weight much greater than the other priority weights. Specifically, the channel in the second channel that meets the fourth preset condition is determined as follows:

[0115] ;

[0116] Among them, PRI_INTELLI ext is the high priority application in the second channel, PRI_INTELLI is the set of priority weights of all applications in the second channel, m2 is the number of all applications in the second channel, pri_intelli total is the sum of the priority weights of all applications in the second channel.

[0117] In the above steps S222 to S224, the high priority channel and the high priority application in the second channel are determined by setting the preset conditions. By determining the high priority channel in the second channel, when the application of the high priority channel is triggered and the first channel that meets the second preset condition switches to the first coding mode, the high priority channel of the triggered application is switched to the second coding mode. By determining the high priority application in the second channel, when the high priority application is triggered and the first channel that meets the second preset condition switches to the first coding mode, the channel where the triggered high priority application is located is switched to the second coding mode. It ensures the clarity of the coding of the key video information by flexibly switching the coding mode of the channel that transmits the key video information, avoids the waste of resources, and solves the problem of fuzzy key video information or waste of resources in the prior art due to the inability to flexibly switch the coding channel.

[0118] In one embodiment, the above-mentioned method for dynamically switching encoding channels further includes the following steps:

[0119] The channel in the second channel that meets the fifth preset condition is switched to the first encoding mode; the fifth preset condition includes that it is not a high priority channel or there is no high priority application.

[0120] This step ensures that when the second coding mode is not needed, it is switched to the first coding mode in a timely manner to avoid waste of resources by timely switching the channels in the second channel that are not high-priority channels or do not have high-priority applications to the first coding mode.

[0121] The present embodiment is described and illustrated below through preferred embodiments.

[0122] Figure 3 FIG. 1 is a flow chart of a method for dynamically switching coding channels provided by a preferred embodiment of the present application. Figure 3 As shown, the method for dynamically switching the coding channel includes the following steps:

[0123] Step S310, determining the weight of the application and the weight of the channel according to the classification of the application and the classification of the channel;

[0124] Step S320, determining the criticality weight of the channel in the current time period and the priority weight of the channel based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period;

[0125] Step S330, determining the level of each channel in the current time period based on the criticality weight of the channel in the current time period and the priority weight of the channel;

[0126] Step S340, determining a first channel and a second channel in the current time period based on the levels of each channel in the current time period;

[0127] Step S350, determining a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered;

[0128] Step S360, switching the first channel that meets the second preset condition to the first encoding mode, and switching the target channel to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger the application or the level of the first channel using the second encoding mode is lower than the preset level.

[0129] In the above steps S310 to S360, by determining the first channel and the second channel in the current time period, a target channel in the second channel that meets the first preset condition is determined, wherein the first preset condition includes that an application in a high-priority channel is triggered and / or a high-priority application is triggered, and then the first channel that meets the second preset condition is switched to the first coding mode, and the target channel is switched to the second coding mode, wherein the second preset condition includes that the first channel using the second coding mode does not trigger an application or the level of the first channel using the second coding mode is lower than a preset level. In this way, firstly determine the first channel with a high level and the second channel with a low level in the current time period, and filter out the target channel in the second channel that meets the conditions that an application in a high-priority channel is triggered and / or a high-priority application is triggered, and then switch the coding mode of the first channel to the first coding mode, and switch the target channel to the second coding mode when the first channel using the second coding mode does not trigger an application or the level of the first channel using the second coding mode is lower than a preset level. That is, by determining the target channel that needs to be high-definition encoded in the low-level second channel, the channel that does not temporarily need to be high-definition encoded in the high-level first channel is switched to the first encoding mode with lower encoding quality, and the target channel is switched to the second encoding mode with higher encoding quality to ensure the encoding clarity of key video information, avoid waste of resources, and solve the problem of blurred key video information or waste of resources in the prior art due to the inability to flexibly switch encoding channels.

[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, a dynamic switching device for coding channels is also provided in the present embodiment, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. The terms "module", "unit", "subunit" and the like used below can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware is also possible and conceived.

[0132] In one embodiment, Figure 4 is a structural block diagram of a dynamic switching device for coding channels provided in an embodiment of the present application, such as Figure 4 As shown, the dynamic switching device of the encoding channel includes:

[0133] A first determining module 42, configured to determine a first channel and a second channel within a current time period, wherein the level of the first channel is higher than the level of the second channel;

[0134] A second determination module 44 is used to determine a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered;

[0135] And a switching module 46, used to switch the first channel that meets the second preset condition to the first encoding mode, and switch the target channel to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger the application or the level of the first channel using the second encoding mode is lower than the preset level; the encoding quality of the first encoding mode is lower than the encoding quality of the second encoding mode.

[0136] The above-mentioned dynamic switching device of the coding channel determines the target channel in the second channel that meets the first preset condition by determining the first channel and the second channel in the current time period, wherein the first preset condition includes that the application in the high-priority channel is triggered and / or the high-priority application is triggered, and then the first channel that meets the second preset condition is switched to the first coding mode, and the target channel is switched to the second coding mode, wherein the second preset condition includes that the first channel using the second coding mode does not trigger the application or the level of the first channel using the second coding mode is lower than the preset level. In this way, firstly determine the first channel with a high level and the second channel with a low level in the current time period, and filter out the target channel in the second channel that meets the conditions that the application in the high-priority channel is triggered and / or the high-priority application is triggered, and then switch the coding mode of the first channel to the first coding mode, and switch the target channel to the second coding mode when the first channel using the second coding mode does not trigger the application or the level of the first channel using the second coding mode is lower than the preset level. That is, by determining the target channel that needs to be high-definition encoded in the low-level second channel, the channel that does not temporarily need to be high-definition encoded in the high-level first channel is switched to the first encoding mode with lower encoding quality, and the target channel is switched to the second encoding mode with higher encoding quality to ensure the encoding clarity of key video information, avoid waste of resources, and solve the problem of blurred key video information or waste of resources in the prior art due to the inability to flexibly switch encoding channels.

[0137] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0138] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, any one of the methods for dynamically switching encoding channels in the above embodiments is implemented.

[0139] 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.

[0140] Those skilled 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 this application can include at least one of non-volatile 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), magnetoresistive 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, etc., but are not limited to this.

[0141] 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 specification.

[0142] 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 dynamically switching coding channels, characterized in that: The method comprises: Based on the critical weight of the channel in the current time period and the priority weight of the channel, the level of each channel in the current time period is determined; based on the level of each channel in the current time period, the first channel and the second channel in the current time period are determined, wherein the level of the first channel is higher than the level of the second channel; the level of the channel is used to characterize the priority of the video information in the channel that needs to be encoded in high definition; Determine a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered; The first channel that meets the second preset condition is switched to the first encoding mode, and the target channel is switched to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger an application or the level of the first channel using the second encoding mode is lower than a preset level; and the encoding quality of the first encoding mode is lower than the encoding quality of the second encoding mode.

2. The method for dynamically switching encoding channels according to claim 1, characterized in that: Before determining the level of each channel in the current time period based on the criticality weight of the channel in the current time period and the priority weight of the channel, the method includes: The criticality weight of the channel in the current time period and the priority weight of the channel are determined based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period.

3. The method for dynamically switching encoding channels according to claim 2, characterized in that: The determining the critical weight of the channel in the current time period and the priority weight of the channel based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period includes: Determining a priority weight of the application based on the weight of the application, the search frequency of the application in the current time period, and the weight of the application search; Determine the critical weight of the channel in the current time period based on the priority weight of each application in the channel and the number of times each application in the channel is triggered in the current time period; The priority weight of the channel is determined according to the weight of the channel and the search frequency of the channel in the current time period.

4. The method for dynamically switching encoding channels according to claim 2, characterized in that: Before determining the critical weight of the channel in the current time period and the priority weight of the channel based on the weight of the application, the weight of the channel, the search frequency of the application in the current time period, and the search frequency of the channel in the current time period, the method includes: According to the classification of the application and the classification of the channel, the weight of the application and the weight of the channel are determined.

5. The method for dynamically switching encoding channels according to claim 4, characterized in that: Also includes: According to a preset time period, updating the weight of the channel and the weight of the application to obtain an updated weight of the channel and an updated weight of the application; Determine the criticality weight of the channel and the priority weight of the channel in the updated time period based on the updated weight of the application, the updated weight of the channel, the search frequency of the application in the updated time period, and the search frequency of the channel in the updated time period; Based on the criticality weight of the channel in the updated time period and the priority weight of the channel, a first channel and a second channel in the updated time period are determined.

6. The method for dynamically switching encoding channels according to claim 1, characterized in that: The determining of a high priority channel and a high priority application in the second channel comprises: Determine a channel in the second channel that meets a third preset condition as the high priority channel in the second channel; the third preset condition is that the priority weight of the channel meets the first preset weight condition; An application in the second channel that meets a fourth preset condition is determined as the high-priority application in the second channel; the fourth preset condition is that the priority weight of the application meets a second preset weight condition.

7. The method for dynamically switching encoding channels according to any one of claims 1 to 6, characterized in that: Also includes: Switching the channels in the second channels that meet the fifth preset condition to the first encoding mode; The fifth preset condition includes not belonging to the high priority channel or not having the high priority application.

8. A dynamic switching device for coding channels, characterized in that: The device comprises: A first determination module is used to determine the level of each channel in the current time period based on the critical weight of the channel and the priority weight of the channel in the current time period; based on the level of each channel in the current time period, determine the first channel and the second channel in the current time period, wherein the level of the first channel is higher than the level of the second channel; the level of the channel is used to characterize the priority of the video information in the channel that needs to be encoded in high definition; A second determining module, configured to determine a target channel in the second channel that meets a first preset condition, wherein the first preset condition includes that an application in a high priority channel is triggered and / or a high priority application is triggered; And a switching module, used to switch the first channel that meets the second preset condition to the first encoding mode, and switch the target channel to the second encoding mode, wherein the second preset condition includes that the first channel using the second encoding mode does not trigger an application or the level of the first channel using the second encoding mode is lower than a preset level; the encoding quality of the first encoding mode is lower than the encoding quality of the second encoding mode.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for dynamically switching encoding channels according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Video coding method and device, shooting equipment and storage medium

    CN113891019A

  • Video code stream generation method and device, electronic equipment and medium

    CN116506664A