Method and device for scheduling multi-channel data coding and multi-core coding system

By adopting batch processing and dynamic priority allocation methods in the multi-core encoding system, the problem of low scheduling efficiency of multi-channel data encoding is solved, and more efficient resource utilization and scheduling efficiency is achieved.

CN119172448AActive Publication Date: 2024-12-20ALLWINNER TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310731705.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-19
Publication Date
2024-12-20
Estimated Expiration
2043-06-19

AI Technical Summary

Technical Problem

The existing multi-channel data encoding scheduling scheme has frequent software and hardware interactions, resulting in low video encoding scheduling efficiency. How to improve the multi-channel encoding scheduling efficiency has become an important issue.

Method used

Using a multi-core encoding system, the hardware side contains multiple independent encoding computing units, each unit has a unique encoding channel group, batch processing is performed by preloading the register configuration parameters, and the software side dynamically calculates priority and computing power, and reasonably allocates encoding tasks. , reduce software and hardware interaction.

Benefits of technology

The efficiency of multi-channel encoding scheduling is improved, the frequency of software and hardware interaction is reduced, and more reasonable resource allocation and computing unit utilization is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172448A_ABST
    Figure CN119172448A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for scheduling multi-channel data coding and a multi-core coding system.The method comprises the steps that when a coding task sent by a software end is received, a coding calculation unit, namely a hardware end, sequentially executes a corresponding coding task on each coding channel based on loaded register configuration data; according to the multi-channel coding scheduling method, the coding task is processed by adopting a software and hardware cooperation mode and a batch processing mode, the advantages of a software end and a hardware end are fully utilized, the scheduling of the multi-channel coding is more reasonable and efficient, the interaction frequency of software and hardware is reduced, and the efficiency of the multi-channel coding scheduling is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method and device for scheduling multi-channel data encoding, and a multi-core encoding system. Background Art

[0002] With the rapid development of integrated circuit technology and multimedia audio and video technology, video images have become an important and indispensable information transmission medium in people's daily life and work. Electronic products with functions such as video image acquisition, compression, transmission, decompression, and display have been widely used in various industries, such as driving recorders, sports DVs, security building monitoring, Internet TV set-top boxes, tablet computers, etc.

[0003] Since the compression and decompression algorithms of video images are relatively complex and require a large amount of computing resources, dedicated video encoding digital integrated circuits are generally used to process image encoding and decoding. For vehicle-mounted central control and security monitoring scenarios, there are generally more than 6 encoding channel tasks; while there are generally only 1 or 2 encoding hardware computing units, how to evenly allocate the resources of 1 or 2 computing units to the encoding processing of each channel has become a technical problem that must be faced and solved.

[0004] In order to solve the above technical problems, the existing multi-channel data encoding scheduling scheme in the industry is: on the software side, the priority of each encoding channel is set in advance, the task requirements of each channel are polled, and the target computing power of each channel is calculated to achieve the scheduling of the encoding hardware computing unit; or, on the hardware side, a two-dimensional array priority mapping method is used to achieve the scheduling of the encoding hardware computing unit.

[0005] However, practice has found that the existing commonly used multi-channel data encoding scheduling scheme requires a complete hardware-software interaction every time the hardware processes an encoding calculation task. The high frequency and time-consuming hardware-software interaction result in low video encoding scheduling efficiency. Therefore, it is particularly important to propose a technical solution to improve the efficiency of multi-channel encoding scheduling. Summary of the invention

[0006] The technical problem to be solved by the present invention is to provide a method and device for scheduling multi-channel data encoding, and a multi-core encoding system, which can improve the efficiency of multi-channel encoding scheduling.

[0007] In order to solve the above technical problems, the first aspect of the embodiment of the present invention discloses a method for scheduling multi-channel data encoding, the method is applied in a multi-core encoding system, the multi-core encoding system includes a hardware end, the hardware end includes a plurality of encoding calculation units, each of the encoding calculation units is independent of each other, and each of the encoding calculation units has a corresponding encoding channel group, the encoding channel groups corresponding to each of the encoding calculation units are different from each other, and each of the encoding channel groups is composed of register configuration parameters of each of the encoding channels in the plurality of encoding channels;

[0008] For any of the encoding calculation units, the method comprises:

[0009] When receiving the target encoding task sent by the software end, the encoding calculation unit loads the register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from the storage unit to the internal cache of the register in a predetermined parameter loading mode according to the target encoding task, wherein the storage unit is used to store the register configuration parameters of all initial encoding channels written by the software end, and all the initial encoding channels include the encoding channels corresponding to all the encoding calculation units;

[0010] The encoding calculation unit executes the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group, until all the encoding channels in the encoding channel group have completed the target encoding task.

[0011] As an optional implementation, in the first aspect of the embodiment of the present invention, the encoding calculation unit executes the target encoding task for each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group until all the encoding channels in the encoding channel group have completed the target encoding task, including:

[0012] The encoding calculation unit determines the data source address of the target data to be encoded by each encoding channel in turn according to the register configuration parameters loaded into the encoding channel group, and obtains the target data corresponding to each encoding channel according to the data source address corresponding to the encoding channel;

[0013] The encoding calculation unit sequentially performs the target encoding task on the target data corresponding to each encoding channel in the encoding channel group until all the encoding channels in the encoding channel group have completed the target encoding task.

[0014] As an optional implementation, in the first aspect of the embodiment of the present invention, the parameter loading method is used to indicate that a preset number of register configuration parameters of all the encoding channels in the encoding channel group corresponding to the encoding calculation unit are loaded from the storage unit at one time into the internal cache of the register, wherein the preset number is greater than 1 and less than the number of all encoding channel groups in the encoding channel group, or only the register configuration parameters of one encoding channel are loaded into the internal cache of the register each time, and when the target encoding task is executed by the encoding channel, the register configuration parameters of the next encoding channel are continuously loaded into the internal cache of the register to execute the corresponding target encoding task.

[0015] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the multi-core encoding system further includes the software end, and the method further includes:

[0016] The software end creates a corresponding parameter calculation thread for each of the encoding channels in all the encoding channels that need to perform encoding tasks;

[0017] For any of the encoding channels, the software end obtains the scene parameters of the encoding channel from the application layer of the software end based on the parameter calculation thread corresponding to the encoding channel, calculates the obtained scene parameters based on the parameter calculation thread to obtain the register configuration parameters of the encoding channel, and sets the calculated register configuration parameters to the pre-created parameter management thread;

[0018] The software end manages the acquired register configuration parameters of all the encoding channels in a predetermined queue manner based on the parameter management thread, so that the register configuration parameters of all the encoding channels are stored in a predetermined storage container;

[0019] The software end obtains the register configuration parameters of all the encoding channels from the storage container based on the pre-created computing unit scheduling thread, and uses the computing unit scheduling thread to dynamically calculate the priority of each encoding channel based on the obtained register configuration parameters of each encoding channel;

[0020] The software end obtains the remaining computing power of each of the encoding computing units based on the computing unit scheduling thread, and uses the computing unit scheduling thread to assign encoding tasks to each of the encoding computing units based on the priorities of all the encoding channels and the remaining computing power of each of the encoding computing units, and all the encoding tasks include the target encoding task.

[0021] As an optional implementation, in the first aspect of the embodiment of the present invention, the software end uses the computing unit to schedule threads, and dynamically calculates the priority of each of the encoding channels based on the acquired register configuration parameters of each of the encoding channels, including:

[0022] The software end uses the computing unit to schedule the thread, and obtains the resource status parameters of each encoding channel based on the obtained register configuration parameters of the encoding channel, wherein the resource status parameters of each encoding channel include one or more of the data cache status, data frame rate, and interval time from the last encoding of the encoding channel, and the data cache status of each encoding channel is used to indicate the amount of data to be processed in the encoding channel;

[0023] The software end uses the computing unit to schedule threads, dynamically calculates the acquired resource status parameters of each encoding channel, and obtains the priority of each encoding channel.

[0024] As an optional implementation manner, in the first aspect of the embodiment of the present invention, the method further includes:

[0025] The software end uses the parameter management thread to calculate the computing power of the scene parameters of each encoding channel to obtain the target computing power required by the encoding channel, wherein the larger the value of the scene parameter of the encoding channel, the more data needs to be processed, and the larger the target computing power required;

[0026] The software end uses the computing unit scheduling thread to obtain the target computing power required for each encoding channel from the parameter management thread;

[0027] The software end uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all the encoding channels and the remaining computing power of each encoding computing unit, including:

[0028] The software end compares the target computing power required for each encoding channel with the remaining computing power of all the encoding computing units based on the computing unit scheduling thread to obtain a comparison result, and uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priority of all the encoding channels and the comparison result.

[0029] As an optional implementation, in the first aspect of the embodiment of the present invention, the software end uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all the encoding channels and the comparison results, including:

[0030] When the analysis result is used to indicate that the sum of the target computing power required by all the encoding channels is less than or equal to the sum of the remaining computing power of all the encoding computing units, the software end uses the computing unit scheduling thread to evenly distribute the corresponding encoding tasks to each encoding computing unit according to the priority of all the encoding channels, the sum of the target computing power required by all the encoding channels, and the load of each encoding computing unit;

[0031] When the analysis result is used to indicate that the target computing power of all the encoding channels is greater than the sum of the remaining computing power of all the encoding calculation units, the software end uses the calculation unit scheduling thread to assign corresponding encoding tasks to each encoding calculation unit according to the priority of each encoding channel.

[0032] As an optional implementation manner, in the first aspect of the embodiment of the present invention, after all the encoding channels in the encoding channel group have completed the encoding task, the method further includes:

[0033] The encoding calculation unit generates an interrupt signal, and sends the generated interrupt signal to the software end, so as to trigger the software end to respond to the interrupt signal based on a pre-created interrupt monitoring thread, and distribute the target interrupt signal to a target processing thread, so that the target processing thread updates its own state;

[0034] The target processing thread includes one or more of the parameter calculation thread, the parameter management thread and the computing unit scheduling thread.

[0035] A second aspect of an embodiment of the present invention discloses a device for scheduling multi-channel data encoding, wherein the device is applied in a multi-core encoding system, wherein the multi-core encoding system includes a hardware end, wherein the hardware end includes a plurality of encoding calculation units, each of the encoding calculation units is independent of each other, and each of the encoding calculation units has a corresponding encoding channel group, and each encoding channel group corresponding to each encoding calculation unit is different from each other, and each encoding channel group is composed of register configuration parameters of each encoding channel in a plurality of encoding channels;

[0036] For any of the encoding calculation units, the encoding calculation unit includes:

[0037] A loading module, which is used to load the register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from the storage unit to the internal cache of the register in a predetermined parameter loading mode according to the target encoding task when receiving the target encoding task sent by the software end, wherein the storage unit is used to store the register configuration parameters of all initial encoding channels written by the software end, and all the initial encoding channels include the encoding channels corresponding to all the encoding calculation units;

[0038] The encoding module is used to execute the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group, until all the encoding channels in the encoding channel group have completed the target encoding task.

[0039] As an optional implementation, in the second aspect of the embodiment of the present invention, the encoding module executes the target encoding task for each encoding channel in the encoding channel group in turn according to the register configuration parameters of the encoding channel group loaded thereto, until all the encoding channels in the encoding channel group have completed the target encoding task. The specific manner includes:

[0040] The encoding calculation unit determines the data source address of the target data to be encoded by each encoding channel in turn according to the register configuration parameters loaded into the encoding channel group, and obtains the target data corresponding to each encoding channel according to the data source address corresponding to the encoding channel;

[0041] The encoding calculation unit sequentially performs the target encoding task on the target data corresponding to each encoding channel in the encoding channel group until all the encoding channels in the encoding channel group have completed the target encoding task.

[0042] As an optional implementation, in the second aspect of the embodiment of the present invention, the parameter loading method is used to indicate that a preset number of register configuration parameters of all the encoding channels in the encoding channel group corresponding to the encoding calculation unit are loaded from the storage unit at one time into the internal cache of the register, wherein the preset number is greater than 1 and less than the number of all encoding channel groups in the encoding channel group, or only the register configuration parameters of one encoding channel are loaded into the internal cache of the register each time, and when the encoding channel has completed the target encoding task, the register configuration parameters of the next encoding channel are continued to be loaded into the internal cache of the register to execute the corresponding target encoding task.

[0043] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the multi-core encoding system further includes the software end, and the software end includes:

[0044] A thread creation module, used for creating a corresponding parameter calculation thread for each of the encoding channels in all the encoding channels that need to perform the encoding task, for any of the encoding channels, based on the parameter calculation thread corresponding to the encoding channel, obtaining the scene parameters of the encoding channel from the application layer of the software end, and calculating the obtained scene parameters based on the parameter calculation thread to obtain the register configuration parameters of the encoding channel, and setting the calculated register configuration parameters to the pre-created parameter management thread;

[0045] A scheduling main thread module, used for managing the acquired register configuration parameters of all the encoding channels in a predetermined queue manner based on the parameter management thread, so that the register configuration parameters of all the encoding channels are stored in a predetermined storage container;

[0046] A priority calculation module, used to obtain the register configuration parameters of all the encoding channels from the storage container based on a pre-created computing unit scheduling thread, and use the computing unit scheduling thread to dynamically calculate the priority of each encoding channel based on the obtained register configuration parameters of each encoding channel;

[0047] A computing power calculation module, used for obtaining the remaining computing power of each encoding computing unit based on the computing unit scheduling thread;

[0048] A computing unit scheduling module is used to use the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all the encoding channels and the remaining computing power of each encoding computing unit, and all the encoding tasks include the target encoding task.

[0049] As an optional implementation, in the second aspect of the embodiment of the present invention, the priority calculation module uses the computing unit to schedule threads, and based on the acquired register configuration parameters of each of the encoding channels, the specific manner in which the priority of each of the encoding channels is dynamically calculated includes:

[0050] Using the computing unit to schedule the thread, based on the acquired register configuration parameters of each encoding channel, obtaining resource status parameters of the encoding channel, wherein the resource status parameters of each encoding channel include one or more of a data cache state, a data frame rate, and an interval time from the last encoding of the encoding channel, and the data cache state of each encoding channel is used to indicate the amount of data to be processed in the encoding channel;

[0051] The computing unit is used to schedule threads, and the resource status parameters of each of the encoding channels are dynamically calculated to obtain the priority of each of the encoding channels.

[0052] As an optional implementation, in the second aspect of the embodiment of the present invention, the computing power calculation module is further used to use the parameter management thread to perform computing power calculation on the scene parameter of each encoding channel to obtain the target computing power required by the encoding channel, wherein the larger the value of the scene parameter of the encoding channel, the more data needs to be processed, and the larger the target computing power required;

[0053] The computing power calculation module is further used to use the computing unit scheduling thread to obtain the target computing power required by each encoding channel from the parameter management thread;

[0054] The specific manner in which the computing unit scheduling module uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all the encoding channels and the remaining computing power of each encoding computing unit includes:

[0055] Based on the computing unit scheduling thread, the target computing power required for each encoding channel is compared with the remaining computing power of all the encoding computing units to obtain a comparison result, and the computing unit scheduling thread is used to allocate encoding tasks to each encoding computing unit based on the priority of all the encoding channels and the comparison result.

[0056] As an optional implementation, in the second aspect of the embodiment of the present invention, the specific manner in which the computing unit scheduling module uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all the encoding channels and the comparison results includes:

[0057] When the analysis result is used to indicate that the sum of the target computing power required by all the encoding channels is less than or equal to the sum of the remaining computing power of all the encoding computing units, the computing unit scheduling thread is used to evenly allocate the corresponding encoding tasks to each encoding computing unit according to the priority of all the encoding channels, the sum of the target computing power required by all the encoding channels, and the load of each encoding computing unit;

[0058] When the analysis result is used to indicate that the target computing power of all the encoding channels is greater than the sum of the remaining computing power of all the encoding computing units, the computing unit scheduling thread is used to allocate corresponding encoding tasks to each encoding computing unit according to the priority of each encoding channel.

[0059] As an optional implementation manner, in the second aspect of the embodiment of the present invention, the encoding calculation unit further includes:

[0060] A signal processing module, used for generating an interrupt signal after all the encoding channels in the encoding channel group have completed the encoding task, and sending the generated interrupt signal to the software end, so as to trigger the software end to respond to the interrupt signal based on a pre-created interrupt monitoring thread, and distribute the target interrupt signal to a target processing thread, so that the target processing thread updates its own state;

[0061] The target processing thread includes one or more of the parameter calculation thread, the parameter management thread and the computing unit scheduling thread.

[0062] A third aspect of the present invention discloses another device for scheduling multi-channel data encoding, wherein the device is applied in a multi-core encoding system, wherein the multi-core encoding system includes a hardware end, wherein the hardware end includes a plurality of encoding calculation units, and for any of the encoding calculation units, the encoding calculation unit includes:

[0063] A memory storing executable program code;

[0064] a processor coupled to the memory;

[0065] The processor calls the executable program code stored in the memory to execute the method for scheduling multi-channel data encoding disclosed in the first aspect of the present invention.

[0066] A fourth aspect of the present invention discloses a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for scheduling multi-channel data encoding disclosed in the first aspect of the present invention.

[0067] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0068] In an embodiment of the present invention, a method and device for scheduling multi-channel data encoding and a multi-core encoding system are disclosed. The method is applied to a multi-core encoding system. The multi-core encoding system includes a hardware end, the hardware end includes a plurality of encoding calculation units, each encoding calculation unit is independent of each other, and each encoding calculation unit has a corresponding encoding channel group, the encoding channel groups corresponding to each encoding calculation unit are different from each other, and each encoding channel group is composed of register configuration parameters of each encoding channel in a plurality of encoding channels; for any encoding calculation unit, the method includes: when receiving a target encoding task sent by a software end, the encoding calculation unit loads the register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from a storage unit to an internal register cache in a predetermined parameter loading mode according to the target encoding task, wherein the storage unit is used to store the register configuration parameters of all initial encoding channels written by the software end, all initial encoding channels include the encoding channels corresponding to all encoding calculation units, and according to the register configuration parameters of the loaded encoding channel group, the target encoding task is executed for each encoding channel in the encoding channel group in turn until all encoding channels in the encoding channel group have completed the target encoding task. It can be seen that when the embodiment of the present invention receives the encoding task sent by the software end, the encoding calculation unit, that is, the hardware end, executes the corresponding encoding task for each encoding channel in turn based on the loaded register configuration data, that is, the encoding task is processed in a batch manner in a collaborative manner of software and hardware, and the advantages of the software end and the hardware end are fully utilized, so that the scheduling of multi-channel encoding is more reasonable and efficient, the interaction frequency of software and hardware is reduced, and the efficiency of multi-channel encoding scheduling is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0070] Figure 1 It is a flowchart of a method for scheduling multi-channel data encoding disclosed in an embodiment of the present invention;

[0071] Figure 2 It is a structural schematic diagram of a device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention;

[0072] Figure 3 It is a structural schematic diagram of another device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention;

[0073] Figure 4It is a structural schematic diagram of another device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention;

[0074] Figure 5 It is a structural schematic diagram of another device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention;

[0075] Figure 6 It is a schematic diagram of the structure of a multi-core encoding computing unit disclosed in an embodiment of the present invention;

[0076] Figure 7 It is a schematic diagram of the principle of a hardware-side batch encoding task for scheduling multi-channel data encoding disclosed in an embodiment of the present invention;

[0077] Figure 8 It is a schematic diagram of the architecture of software-side encoding scheduling corresponding to multi-channel encoded data disclosed in an embodiment of the present invention;

[0078] Fig. 9 It is a multi-threaded design principle diagram of multi-channel encoding task scheduling disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0079] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0080] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or equipment that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or equipment.

[0081] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0082] The present invention discloses a method and device for scheduling multi-channel data encoding, and a multi-core encoding system. When receiving an encoding task sent by a software end, an encoding calculation unit, i.e., a hardware end, sequentially executes the corresponding encoding task for each encoding channel based on the loaded register configuration data, i.e., a batch processing method is adopted to process encoding tasks in a collaborative manner between software and hardware, which fully utilizes the advantages of the software end and the hardware end, makes the scheduling of multi-channel encoding more reasonable and efficient, reduces the interaction frequency between software and hardware, and improves the efficiency of multi-channel encoding scheduling. The following are detailed descriptions.

[0083] Embodiment 1

[0084] See also Figure 1 , Figure 1 It is a flow chart of a method for scheduling multi-channel data encoding disclosed in an embodiment of the present invention, wherein the method can be applied to in-vehicle multimedia devices, building security monitoring central control devices, network set-top devices and other devices that need to perform multi-channel encoding and are equipped with a multi-core encoding system, wherein the multi-core encoding system can be any one of Android, Linux, and IOS systems, and the multi-core encoding system includes a hardware end, which includes multiple encoding calculation units, each encoding calculation unit is independent of each other, and each encoding calculation unit has a corresponding encoding channel group, each encoding calculation unit corresponds to a different encoding channel group, and each encoding channel group is composed of register configuration parameters of each encoding channel in multiple encoding channels; for any encoding calculation unit, such as Figure 1 As shown, the method for scheduling multi-channel data encoding may include the following operations:

[0085] 101. When receiving a target encoding task sent by the software end, the encoding calculation unit loads register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from the storage unit to the internal cache of the register in accordance with the target encoding task and in a predetermined parameter loading method.

[0086] In the embodiment of the present invention, the multiple encoding calculation units included in the hardware end of the multi-core encoding system can be as follows: Figure 6 As shown, Figure 6 is a schematic diagram of the structure of a multi-core encoding computing unit disclosed in an embodiment of the present invention, such as Figure 6 As shown, the hardware end is composed of encoding calculation unit 1, encoding calculation unit 2...encoding calculation unit n.

[0087] In the embodiment of the present invention, the storage unit (such as DDR) is used to store register configuration parameters of all initial encoding channels written by the software end, and all initial encoding channels include encoding channels corresponding to all encoding calculation units.

[0088] 102. According to the register configuration parameters of the loaded encoding channel group, execute the target encoding task on each encoding channel in the encoding channel group in turn until all encoding channels in the encoding channel group have completed the target encoding task.

[0089] In an embodiment of the present invention, the parameter loading method is used to indicate that a preset number (such as 3) of register configuration parameters of all coding channels in the coding channel group corresponding to the coding calculation unit are loaded from the storage unit at one time into the internal cache of the register, wherein the preset number is greater than 1 and less than the number of all coding channel groups in the coding channel group, or only the register configuration parameters of one coding channel are loaded into the internal cache of the register each time, and when the target coding task is executed for the coding channel, the register configuration parameters of the next coding channel are continuously loaded into the internal cache of the register to execute the corresponding target coding task.

[0090] In an embodiment of the present invention, the software end (specifically, the software driver end) combines the register configuration parameters of multiple initial encoding channels into multiple encoding channel groups. The number of encoding channels included in each encoding channel group can be flexibly configured by the software end, and each encoding channel group has a corresponding maximum allowed number of encoding channels, such as 32 encoding channels.

[0091] In an embodiment of the present invention, optionally, when multiple encoding calculation units receive a target encoding task, each encoding calculation unit can concurrently process the corresponding target encoding task, which can provide sufficiently high computing power for the scheduling of multi-channel encoding and improve the flexibility of computing resource allocation.

[0092] It can be seen that implementation Figure 1 The described method is that when receiving the encoding task sent by the software end, the encoding calculation unit, that is, the hardware end, executes the corresponding encoding task for each encoding channel in turn based on the loaded register configuration data, that is, the encoding task is processed in a batch processing manner in a collaborative manner of software and hardware, and the advantages of the software end and the hardware end are fully utilized, so that the scheduling of multi-channel encoding is more reasonable and efficient, the interaction frequency of software and hardware is reduced, and the efficiency of multi-channel encoding scheduling is improved.

[0093] In an optional embodiment, optionally, the encoding calculation unit sequentially executes the target encoding task for each encoding channel in the encoding channel group according to the register configuration parameters loaded into the encoding channel group until all encoding channels in the encoding channel group have completed the target encoding task, including:

[0094] According to the register configuration parameters loaded into the encoding channel group, the data source address of the target data to be encoded by each encoding channel is determined in turn, and according to the data source address corresponding to each encoding channel, the target data corresponding to the encoding channel is obtained;

[0095] The target encoding task is executed on the target data corresponding to each encoding channel in the encoding channel group in turn until all encoding channels in the encoding channel group have completed the target encoding task.

[0096] like Figure 7 As shown, Figure 7 is a schematic diagram of the principle of a hardware-side batch encoding task for scheduling multi-channel data encoding disclosed in an embodiment of the present invention, such as Figure 7 As shown, the encoding channel group group includes the register configuration parameters of three encoding channels reg0, reg1, and reg2, and each encoding channel reg0, reg1, and reg2 has corresponding data frame0, frame1, and frame2. The encoding parameter set control module loads the register configuration parameters of the corresponding encoding channel into the internal cache of the register and passes it to the computing unit. The computing unit obtains the data frame of the encoding channel according to the data source address in the register configuration parameters for encoding processing, and forms a data stream stream for storage. Among them, after processing the encoding of reg0, i.e. the 0th path, the encoding of reg1, the 1st path, is immediately loaded and processed, followed by the encoding of reg2, the 2nd path. Among them, there is almost no time gap between the encoding calculation unit processing reg0, reg1, and reg2, which improves the utilization rate of the encoding calculation unit, and there is no need to interact with the software end, thereby improving the scheduling efficiency of multiple encoding channels. Among them, the register configuration parameters of the three encoding channels reg0, reg1, and reg2 can be loaded into the internal cache of the register at one time, and then the encoding processing is performed on the data of each encoding channel in the three encoding channels reg0, reg1, and reg2 in turn based on the register configuration parameters of the encoding channel. Alternatively, the register configuration parameters of only one encoding channel (such as in the order of reg0, reg1, and reg2) can be loaded into the internal cache of the register at a time, and after the encoding task is performed on the data of the encoding channel based on the register configuration parameters of the encoding channel, the register configuration parameters of the next encoding channel are loaded into the internal cache of the register, and the encoding task is performed until the encoding tasks of the three encoding channels reg0, reg1, and reg2 are all processed.

[0097] It can be seen that this optional embodiment determines the corresponding data source address in turn by loading the register configuration parameters of each encoding channel, obtains the corresponding data and then executes the encoding task, realizes batch encoding tasks, improves encoding efficiency, and thus improves the efficiency of multi-channel encoding scheduling.

[0098] In another optional embodiment, the multi-core encoding system further includes a software end, and the method may further include the following steps:

[0099] The software end creates a corresponding parameter calculation thread for each encoding channel in all encoding channels that need to perform encoding tasks;

[0100] For any encoding channel, the software end obtains the scene parameters of the encoding channel from the application layer of the software end based on the parameter calculation thread corresponding to the encoding channel, calculates the obtained scene parameters based on the parameter calculation thread, obtains the register configuration parameters of the encoding channel, and sets the calculated register configuration parameters to the pre-created parameter management thread;

[0101] The software end manages the acquired register configuration parameters of the encoding channel in a predetermined queue manner based on the parameter management thread, so that the register configuration parameters of all encoding channels are stored in a predetermined storage container;

[0102] The software side obtains the register configuration parameters of all encoding channels from the storage container based on the pre-created computing unit scheduling thread, and uses the computing unit scheduling thread to dynamically calculate the priority of each encoding channel based on the obtained register configuration parameters of each encoding channel;

[0103] The software side obtains the remaining computing power of each encoding computing unit based on the computing unit scheduling thread, and uses the computing unit scheduling thread to assign encoding tasks to each encoding computing unit based on the priority of all encoding channels and the remaining computing power of each encoding computing unit. All encoding tasks include the target encoding task.

[0104] In this optional embodiment, the scene parameters of each encoding channel include but are not limited to one or more of resolution, frame rate, bit rate, etc.

[0105] In this optional embodiment, after the encoding task is allocated, the computing unit scheduling thread is set to a dormant state to wait for the encoding computing unit on the hardware side to generate an interrupt signal.

[0106] In this optional embodiment, if Figure 8 As shown, Figure 8 is a schematic diagram of the architecture of software-side encoding scheduling corresponding to multi-channel encoded data disclosed in an embodiment of the present invention, such as Figure 8As shown, the software end includes an application layer, a driver layer, and a hardware layer, wherein the main logic is implemented in the driver layer. The driver layer of the software end creates a corresponding parameter calculation thread for each encoding channel in all encoding channels that need to perform encoding tasks, wherein the parameter calculation thread is responsible for interacting with the application layer on parameters, states, and data flows. For example, the software end obtains the scene parameters of the encoding channel from the application layer of the software end based on the parameter calculation thread corresponding to the encoding channel, and calculates the obtained scene parameters based on the parameter calculation thread to obtain the register configuration parameters of the encoding channel, and sets the calculated register configuration parameters to the pre-created parameter management thread (also called the scheduling main processing thread), so that the parameter management thread manages the register configuration parameters of each encoding path in a queue manner, and manages the priority calculation modules and computing power in an orderly manner. A computing module and a computing unit scheduling module, wherein the priority computing module obtains the register configuration parameters of all encoding channels from the storage container based on a pre-created computing unit scheduling thread, and uses the computing unit scheduling thread to dynamically calculate the priority of each encoding channel based on the obtained register configuration parameters of each encoding channel, the computing power computing module obtains the remaining computing power of each encoding computing unit based on the computing unit scheduling thread, and the computing unit scheduling module uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all encoding channels and the remaining computing power of each encoding computing unit, wherein the computing unit scheduling module interacts with the encoding computing unit on the hardware side through the virtual encoding computing unit (0 and 1) of the hardware layer, and the virtual encoding computing unit (0 and 1) corresponds to the encoding computing unit on the hardware side.

[0107] In this optional embodiment, the queue mode is used to indicate that the register configuration parameters are stored in the storage container on a first-come, first-served basis, and when a new register configuration parameter is received, the received new register configuration parameter is stored at the end of the queue, that is, the end of the storage container.

[0108] In this optional embodiment, the priority is determined based on the amount of data cached and to be processed by the coding channel, the resolution, the frame rate, and the interval between the current moment and the last coding moment, wherein the more data cached and to be processed by the coding channel, the higher the priority of the coding channel; the higher the resolution of the coding channel, the higher the priority of the coding channel; the higher the frame rate of the coding channel (such as 60fps), the higher the priority of the coding channel; the longer the interval between the current moment and the last coding moment of the coding channel, the higher the priority of the coding channel.

[0109] It can be seen that this optional embodiment determines the register configuration parameters for the parameter calculation thread created for each coding channel and sets them to the parameter management thread for orderly management in a queue manner, which can improve the management accuracy and orderliness of the register configuration parameters, and uses the computing unit scheduling thread to dynamically calculate the priority of the coding channel in real time according to the resource status of each coding channel, without relying on the upper-level application to set the priority of each coding channel, thereby improving the calculation accuracy of the priority of each coding channel; and allocates coding tasks based on the calculated accurate priority, which can achieve the accuracy and reliability of the allocation of coding tasks, thereby improving the accuracy and timeliness of scheduling; and performs multi-threaded processing based on the parameter calculation thread, the parameter management thread and the computing unit scheduling thread, thereby improving the real-time performance of scheduling.

[0110] In another optional embodiment, the software side uses the computing unit to schedule threads and dynamically calculates the priority of each encoding channel based on the acquired register configuration parameters of each encoding channel, including:

[0111] The software end uses the computing unit to schedule the thread, and obtains the resource status parameters of each encoding channel based on the obtained register configuration parameters of the encoding channel, wherein the resource status parameters of each encoding channel include one or more of the data cache status, data frame rate, and interval time from the last encoding of the encoding channel, and the data cache status of each encoding channel is used to indicate the amount of data to be processed in the encoding channel;

[0112] The software uses the computing unit to schedule threads, dynamically calculates the resource status parameters of each encoding channel, and obtains the priority of each encoding channel.

[0113] It can be seen that this optional embodiment uses the computing unit scheduling thread to obtain the resource status parameters from the register configuration parameters of the encoding channel to perform priority calculation, thereby improving the calculation accuracy and reliability of the priority of the encoding channel, which is beneficial to improving the accuracy of the allocation of encoding tasks, and further beneficial to improving the scheduling accuracy of multiple encoding channels.

[0114] In yet another optional embodiment, the method may further include the following steps:

[0115] The software uses the parameter management thread to calculate the computing power of the scene parameters of each encoding channel to obtain the target computing power required by the encoding channel. The larger the value of the scene parameter of the encoding channel, the more data needs to be processed and the greater the target computing power required.

[0116] The software uses the computing unit scheduling thread to obtain the target computing power required for each encoding channel from the parameter management thread;

[0117] The software uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priority of all encoding channels and the remaining computing power of each encoding computing unit, including:

[0118] The software side compares the target computing power required for each encoding channel with the remaining computing power of all encoding computing units based on the computing unit scheduling thread to obtain the comparison result, and uses the computing unit scheduling thread to assign encoding tasks to each encoding computing unit based on the priority and comparison results of all encoding channels.

[0119] In this optional embodiment, optionally, the software end uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities and comparison results of all encoding channels, including:

[0120] When the analysis result indicates that the sum of the target computing power required by all encoding channels is less than or equal to the sum of the remaining computing power of all encoding computing units, the software uses the computing unit scheduling thread to evenly distribute the corresponding encoding tasks to each encoding computing unit according to the priority of all encoding channels, the sum of the target computing power required by all encoding channels, and the load of each encoding computing unit;

[0121] When the analysis result is used to indicate that the target computing power of all encoding channels is greater than the sum of the remaining computing power of all encoding computing units, the software uses the computing unit scheduling thread to assign corresponding encoding tasks to each encoding computing unit according to the priority of each encoding channel.

[0122] It can be seen that this optional embodiment allocates corresponding encoding tasks to the encoding calculation units based on the computing power required by the encoding channel, the priority and the remaining computing power of the encoding calculation unit, which can improve the accuracy of encoding task allocation; and according to the size between the sum of the computing power required by all encoding channels and the sum of the remaining computing power of all encoding calculation units, the corresponding encoding task allocation method is selected to balance the encoding tasks. While improving the accuracy and reliability of encoding task allocation, it can improve the utilization rate of each encoding calculation unit, further improving the scheduling accuracy of multi-channel encoding.

[0123] In yet another optional embodiment, after all encoding channels in the encoding channel group have completed the encoding task, the method may further include the following steps:

[0124] The encoding calculation unit generates an interrupt signal and sends the generated interrupt signal to the software end to trigger the software end to respond to the interrupt signal based on a pre-created interrupt monitoring thread, and distribute the target interrupt signal to the target processing thread so that the target processing thread updates its own state;

[0125] The target processing thread includes one or more of a parameter calculation thread, a parameter management thread, and a computing unit scheduling thread. When the target processing thread is a parameter calculation thread, its own state is used to represent the software state of the encoding channel.

[0126] It can be seen that in this optional embodiment, after the encoding task is processed, the software side updates the status of each thread based on the interrupt signal sent by the hardware side, so that the register configuration parameters of each encoding channel can be updated, thereby allocating subsequent encoding tasks. That is, the interaction of encoding tasks is carried out by real-time settings and interrupt callbacks, which replaces the traversal polling method, thereby improving the real-time performance of encoding task processing and scheduling.

[0127] In order to enable those skilled in the art to more intuitively and clearly understand the technical solution of the present invention, the following Fig. 9 A multi-threaded design principle diagram of multi-channel encoding task scheduling is disclosed to illustrate the technical solution: Fig. 9 As shown, taking 2-channel encoding channels as an example, the software side will create 5 processing threads, namely: parameter calculation thread 0, parameter calculation thread 1, parameter management thread, computing unit scheduling thread, and interrupt monitoring thread. Among them, parameter calculation threads 0 and 1: are responsible for calculating the register configuration parameters of their respective encoding channels, and setting the register configuration parameters to the parameter management thread, and then waiting for the interrupt signal sent by the encoding calculation unit after completing the encoding task, and updating the register configuration parameters according to the interrupt signal; parameter management thread: uses a queue to uniformly manage the register configuration parameters of each encoding channel. When a new register configuration parameter is received, the register configuration parameter is stored at the end of the queue, and the target computing power of all encoding channels waiting to be processed is recalculated; computing unit scheduling thread: is responsible for calculating the priority of all encoding channels in the register configuration parameter queue, obtaining the remaining computing power of each current encoding calculation unit, and arbitrarily scheduling the computing power according to the priority. The high and low, the remaining computing power of the encoding calculation unit and the target computing power required by the encoding channel, the encoding task is assigned to each encoding calculation unit, and then the thread is put into sleep state, waiting for the encoding calculation unit to generate an interrupt signal; interrupt monitoring thread: responsible for real-time monitoring of whether the encoding calculation unit has generated an interrupt signal (when the encoding calculation unit batches a group of register configuration parameters, an interrupt signal will be generated immediately). When an interrupt signal is monitored, the interrupt signal is immediately distributed to the parameter calculation thread, parameter management thread and computing unit scheduling thread. When the parameter calculation thread, parameter management thread and computing unit scheduling thread receive the interrupt signal, they update the status of their respective threads to realize multi-threaded processing, thereby improving the real-time and efficiency of encoding scheduling.

[0128] Embodiment 2

[0129] See also Figure 2 , Figure 2It is a structural schematic diagram of a device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention, wherein the device can be applied to in-vehicle multimedia devices, building security monitoring central control devices, network set-top devices and other devices that need to perform multi-channel encoding and are equipped with a multi-core encoding system, wherein the multi-core encoding system can be any one of Android, Linux, and IOS systems, and the multi-core encoding system includes a hardware end, which includes multiple encoding calculation units, each encoding calculation unit is independent of each other, and each encoding calculation unit has a corresponding encoding channel group, each encoding calculation unit corresponds to a different encoding channel group, and each encoding channel group is composed of register configuration parameters of each encoding channel in multiple encoding channels. Figure 2 As shown, for any encoding calculation unit, the encoding calculation unit may include:

[0130] The loading module 201 is used for, when receiving the target encoding task sent by the software end, the encoding calculation unit loads the register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from the storage unit to the internal cache of the register in a predetermined parameter loading mode according to the target encoding task, wherein the storage unit (such as DDR) is used to store the register configuration parameters of all initial encoding channels written by the software end, and all initial encoding channels include the encoding channels corresponding to all encoding calculation units;

[0131] The encoding module 202 is used to execute the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group, until all encoding channels in the encoding channel group have completed the target encoding task.

[0132] In an embodiment of the present invention, the parameter loading method is used to indicate that a preset number of register configuration parameters of all coding channels in a coding channel group corresponding to a coding calculation unit are loaded from a storage unit at one time into an internal cache of a register, wherein the preset number is greater than 1 and less than the number of all coding channel groups in the coding channel group, or only the register configuration parameters of one coding channel are loaded into the internal cache of the register each time, and when the target coding task is executed for the coding channel, the register configuration parameters of the next coding channel are continuously loaded into the internal cache of the register to execute the corresponding target coding task.

[0133] It can be seen that implementation Figure 2When the described device for scheduling multi-channel data encoding receives an encoding task sent by the software end, the encoding calculation unit, i.e., the hardware end, executes the corresponding encoding task for each encoding channel in turn based on the loaded register configuration data, that is, the encoding tasks are processed in a batch manner in a collaborative manner between software and hardware, which makes full use of the advantages of the software end and the hardware end, makes the scheduling of multi-channel encoding more reasonable and efficient, reduces the frequency of interaction between software and hardware, and improves the efficiency of multi-channel encoding scheduling.

[0134] In an optional implementation, the encoding module 202 performs the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters of the encoding channel group loaded therein, until all encoding channels in the encoding channel group have completed the target encoding task. The specific manner includes:

[0135] According to the register configuration parameters loaded into the encoding channel group, the data source address of the target data to be encoded by each encoding channel is determined in turn, and according to the data source address corresponding to each encoding channel, the target data corresponding to the encoding channel is obtained;

[0136] The target encoding task is executed on the target data corresponding to each encoding channel in the encoding channel group in turn until all encoding channels in the encoding channel group have completed the target encoding task.

[0137] It can be seen that this optional implementation method determines the corresponding data source address in turn by loading the register configuration parameters of each encoding channel, obtains the corresponding data and then executes the encoding task, realizes batch encoding tasks, improves encoding efficiency, and thus improves the efficiency of multi-channel encoding scheduling.

[0138] In another optional embodiment, Figure 3 As shown, the multi-core encoding system also includes a software end, which includes:

[0139] The thread creation module 203 is used to create a corresponding parameter calculation thread for each encoding channel of all encoding channels that need to perform encoding tasks. For any encoding channel, based on the parameter calculation thread corresponding to the encoding channel, the scene parameters of the encoding channel are obtained from the application layer of the software end, and the obtained scene parameters are calculated based on the parameter calculation thread to obtain the register configuration parameters of the encoding channel, and the calculated register configuration parameters are set to the pre-created parameter management thread;

[0140] The scheduling main thread module 204 is used to manage the acquired register configuration parameters of the encoding channels in a predetermined queue manner based on the parameter management thread, so that the register configuration parameters of all encoding channels are stored in a predetermined storage container;

[0141] The priority calculation module 205 is used to obtain the register configuration parameters of all encoding channels from the storage container based on the pre-created computing unit scheduling thread, and use the computing unit scheduling thread to dynamically calculate the priority of each encoding channel based on the obtained register configuration parameters of each encoding channel;

[0142] A computing power calculation module 206, configured to obtain the remaining computing power of each encoding computing unit based on the computing unit scheduling thread;

[0143] The computing unit scheduling module 207 is used to use the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all encoding channels and the remaining computing power of each encoding computing unit. All encoding tasks include the target encoding task.

[0144] It can be seen that this optional implementation method can improve the management accuracy and orderliness of the register configuration parameters by determining the register configuration parameters for the parameter calculation thread created for each coding channel and setting them to the parameter management thread for orderly management in a queue manner, and use the computing unit scheduling thread to dynamically calculate the priority of the coding channel in real time according to the resource status of each coding channel, without relying on the upper-level application to set the priority of each coding channel, thereby improving the calculation accuracy of the priority of each coding channel; and based on the accurate priority calculated, the coding task is allocated, which can achieve the accuracy and reliability of the allocation of coding tasks, thereby improving the accuracy and timeliness of scheduling; and multi-threaded processing is performed based on the parameter calculation thread, the parameter management thread and the computing unit scheduling thread, thereby improving the real-time performance of scheduling.

[0145] In another optional embodiment, the priority calculation module 205 uses the computing unit to schedule threads, and based on the acquired register configuration parameters of each encoding channel, the specific manner of dynamically calculating the priority of each encoding channel includes:

[0146] Using a computing unit to schedule a thread, based on the acquired register configuration parameters of each encoding channel, obtaining a resource status parameter of the encoding channel, wherein the resource status parameter of each encoding channel includes one or more of a data cache status, a data frame rate, and an interval time from the last encoding of the encoding channel, and the data cache status of each encoding channel is used to indicate the amount of data to be processed in the encoding channel;

[0147] The computing unit is used to schedule threads, and the resource status parameters of each encoding channel are dynamically calculated to obtain the priority of each encoding channel.

[0148] It can be seen that implementation Figure 3The described device for scheduling multi-channel data encoding uses a computing unit to schedule threads, obtains resource status parameters from register configuration parameters of the encoding channel to perform priority calculations, thereby improving the calculation accuracy and reliability of the priority of the encoding channel, which is beneficial to improving the accuracy of allocating encoding tasks, and further beneficial to improving the scheduling accuracy of multiple encoding channels.

[0149] In yet another optional embodiment, Figure 3 As shown, the computing power calculation module 206 is further used to use the parameter management thread to perform computing power calculation on the scene parameters of each encoding channel to obtain the target computing power required by the encoding channel, wherein the larger the value of the scene parameter of the encoding channel, the more data needs to be processed, and the larger the target computing power required;

[0150] The computing power calculation module 206 is further used to use the computing unit scheduling thread to obtain the target computing power required for each encoding channel from the parameter management thread;

[0151] The specific manner in which the computing unit scheduling thread of the computing unit scheduling module 207 allocates encoding tasks to each encoding computing unit based on the priorities of all encoding channels and the remaining computing power of each encoding computing unit includes:

[0152] Based on the computing unit scheduling thread, the target computing power required for each encoding channel is compared with the remaining computing power of all encoding computing units to obtain the comparison result, and the computing unit scheduling thread is used to allocate encoding tasks to each encoding computing unit based on the priority and comparison results of all encoding channels.

[0153] In this optional embodiment, the specific manner in which the computing unit scheduling module 207 uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities and comparison results of all encoding channels includes:

[0154] When the analysis result indicates that the sum of the target computing power required by all encoding channels is less than or equal to the sum of the remaining computing power of all encoding computing units, the software uses the computing unit scheduling thread to evenly distribute the corresponding encoding tasks to each encoding computing unit according to the priority of all encoding channels, the sum of the target computing power required by all encoding channels, and the load of each encoding computing unit;

[0155] When the analysis result is used to indicate that the target computing power of all encoding channels is greater than the sum of the remaining computing power of all encoding computing units, the software uses the computing unit scheduling thread to assign corresponding encoding tasks to each encoding computing unit according to the priority of each encoding channel.

[0156] It can be seen that implementation Figure 3The described device for scheduling multi-channel data encoding allocates corresponding encoding tasks to encoding calculation units based on the computing power required by the encoding channels, the priority level and the remaining computing power of the encoding calculation units, thereby improving the accuracy of encoding task allocation; and according to the size between the sum of the computing power required by all encoding channels and the sum of the remaining computing power of all encoding calculation units, selects the corresponding encoding task allocation method to evenly allocate encoding tasks, thereby improving the accuracy and reliability of encoding task allocation and improving the utilization rate of each encoding calculation unit, further improving the scheduling accuracy of multi-channel encoding.

[0157] In yet another optional embodiment, Figure 3 As shown, the encoding calculation unit also includes:

[0158] The signal processing module 208 is used to generate an interrupt signal after all encoding channels in the encoding channel group have completed the encoding task, and send the generated interrupt signal to the software end to trigger the software end to respond to the interrupt signal based on the pre-created interrupt monitoring thread, and distribute the target interrupt signal to the target processing thread, so that the target processing thread updates its own state;

[0159] The target processing thread includes one or more of a parameter calculation thread, a parameter management thread, and a computing unit scheduling thread. When the target processing thread is a parameter calculation thread, its own state is used to represent the software state of the encoding channel.

[0160] In this optional embodiment, when the encoding module 202 completes the above-mentioned operation of executing the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group, until all the encoding channels in the encoding channel group have completed the operation of the target encoding task, the signal processing module 208 can be triggered to perform the above-mentioned operation of generating an interrupt signal after all the encoding channels in the encoding channel group have completed the encoding task, and sending the generated interrupt signal to the software end.

[0161] It can be seen that implementation Figure 3 The described device for scheduling multi-channel data encoding, when the encoding task is completed, the software end updates the status of each thread based on the interrupt signal sent by the hardware end, so that the register configuration parameters of each encoding channel can be updated, thereby allocating subsequent encoding tasks, that is, the interaction of encoding tasks is carried out by real-time setting and interrupt callback, replacing the traversal polling method, thereby improving the real-time performance of encoding task processing and scheduling.

[0162] Embodiment 3

[0163] See also Figure 4 , Figure 4This is a schematic diagram of the structure of another device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention, wherein the device can be applied to in-vehicle multimedia equipment, building security monitoring central control equipment, network set-top equipment and other equipment that need to perform multi-channel encoding and are equipped with a multi-core encoding system, wherein the multi-core encoding system can be any one of Android, Linux, and IOS systems, and the multi-core encoding system includes a hardware end, and the hardware end includes multiple encoding calculation units. Figure 4 As shown, the multiple encoding calculation units may include:

[0164] A memory 301 storing executable program codes;

[0165] a processor 302 coupled to the memory 301;

[0166] Furthermore, it may also include an input interface 303 and an output interface 304 coupled to the processor 302;

[0167] The processor 302 calls the executable program code stored in the memory 301 to execute the steps performed by the encoding calculation unit in the method for scheduling multi-channel data encoding described in the first embodiment.

[0168] Embodiment 4

[0169] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of another device for scheduling multi-channel data encoding disclosed in an embodiment of the present invention, wherein the device can be applied to in-vehicle multimedia equipment, building security monitoring central control equipment, network set-top equipment and other equipment that need to perform multi-channel encoding and are equipped with a multi-core encoding system, wherein the multi-core encoding system can be any one of Android, Linux, and IOS systems, and the multi-core encoding system includes a hardware end, and the hardware end includes multiple encoding calculation units. Figure 5 As shown, the multiple encoding calculation units may include:

[0170] A memory 401 storing executable program codes;

[0171] a processor 402 coupled to the memory 401;

[0172] Furthermore, it may also include an input interface 403 and an output interface 404 coupled to the processor 402;

[0173] The processor 402 calls the executable program code stored in the memory 401 to execute the steps executed by the software side in the method for scheduling multi-channel data encoding described in the first embodiment.

[0174] Embodiment 5

[0175] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps performed by a coding calculation unit in the method for scheduling multi-channel data coding described in the first embodiment.

[0176] Embodiment 6

[0177] An embodiment of the present invention discloses a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute the steps executed by the software end in the method for scheduling multi-channel data encoding described in the first embodiment.

[0178] Embodiment 7

[0179] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps performed by the encoding calculation unit in the method for scheduling multi-channel data encoding described in embodiment 1.

[0180] Embodiment 8

[0181] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps executed by the software side in the method for scheduling multi-channel data encoding described in Example 1.

[0182] Embodiment 9

[0183] An embodiment of the present invention discloses a multi-core encoding system, wherein the multi-core encoding system is used to execute the steps executed by the hardware end and the software end in the method for scheduling multi-channel data encoding described in the first embodiment.

[0184] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0185] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0186] Finally, it should be noted that the method and device for scheduling multi-channel data encoding and the multi-core encoding system disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, which are only used to illustrate the technical scheme of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical schemes described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical schemes from the spirit and scope of the technical schemes of the embodiments of the present invention.

Claims

1. A method for scheduling multi-channel data encoding, characterized in that: The method is applied in a multi-core encoding system, the multi-core encoding system includes a hardware end, the hardware end includes a plurality of encoding calculation units, each of the encoding calculation units is independent of each other, and each of the encoding calculation units has a corresponding encoding channel group, the encoding channel groups corresponding to each of the encoding calculation units are different from each other, and each of the encoding channel groups is composed of register configuration parameters of each of the encoding channels in the plurality of encoding channels; For any of the encoding calculation units, the method comprises: When receiving the target encoding task sent by the software end, the encoding calculation unit loads the register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from the storage unit to the internal cache of the register in a predetermined parameter loading mode according to the target encoding task, wherein the storage unit is used to store the register configuration parameters of all initial encoding channels written by the software end, and all the initial encoding channels include the encoding channels corresponding to all the encoding calculation units; The encoding calculation unit executes the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group, until all the encoding channels in the encoding channel group have completed the target encoding task.

2. The method for scheduling multi-channel data encoding according to claim 1, characterized in that: The encoding calculation unit sequentially executes the target encoding task for each encoding channel in the encoding channel group according to the register configuration parameters loaded into the encoding channel group until all the encoding channels in the encoding channel group have completed the target encoding task, including: The encoding calculation unit determines the data source address of the target data to be encoded by each encoding channel in turn according to the register configuration parameters loaded into the encoding channel group, and obtains the target data corresponding to each encoding channel according to the data source address corresponding to the encoding channel; The encoding calculation unit sequentially performs the target encoding task on the target data corresponding to each encoding channel in the encoding channel group until all the encoding channels in the encoding channel group have completed the target encoding task.

3. The method for scheduling multi-channel data encoding according to claim 2, characterized in that: The parameter loading method is used to indicate that a preset number of register configuration parameters of all the encoding channels in the encoding channel group corresponding to the encoding calculation unit are loaded from the storage unit at one time into the internal cache of the register, wherein the preset number is greater than 1 and less than the number of all encoding channel groups in the encoding channel group, or only the register configuration parameters of one encoding channel are loaded into the internal cache of the register each time, and when the encoding channel has completed the target encoding task, the register configuration parameters of the next encoding channel are continuously loaded into the internal cache of the register to execute the corresponding target encoding task.

4. The method for scheduling multi-channel data encoding according to any one of claims 1 to 3, characterized in that: The multi-core encoding system also includes the software end, and the method also includes: The software end creates a corresponding parameter calculation thread for each of the encoding channels in all the encoding channels that need to perform encoding tasks; For any of the encoding channels, the software end obtains the scene parameters of the encoding channel from the application layer of the software end based on the parameter calculation thread corresponding to the encoding channel, calculates the obtained scene parameters based on the parameter calculation thread to obtain the register configuration parameters of the encoding channel, and sets the calculated register configuration parameters to the pre-created parameter management thread; The software end manages the acquired register configuration parameters of all the encoding channels in a predetermined queue manner based on the parameter management thread, so that the register configuration parameters of all the encoding channels are stored in a predetermined storage container; The software end obtains the register configuration parameters of all the encoding channels from the storage container based on the pre-created computing unit scheduling thread, and uses the computing unit scheduling thread to dynamically calculate the priority of each encoding channel based on the obtained register configuration parameters of each encoding channel; The software end obtains the remaining computing power of each of the encoding computing units based on the computing unit scheduling thread, and uses the computing unit scheduling thread to assign encoding tasks to each of the encoding computing units based on the priorities of all the encoding channels and the remaining computing power of each of the encoding computing units, and all the encoding tasks include the target encoding task.

5. The method for scheduling multi-channel data encoding according to claim 4, characterized in that: The software end uses the computing unit to schedule threads, and dynamically calculates the priority of each encoding channel based on the acquired register configuration parameters of each encoding channel, including: The software end uses the computing unit to schedule the thread, and obtains the resource status parameters of each encoding channel based on the obtained register configuration parameters of the encoding channel, wherein the resource status parameters of each encoding channel include one or more of the data cache status, data frame rate, and interval time from the last encoding of the encoding channel, and the data cache status of each encoding channel is used to indicate the amount of data to be processed in the encoding channel; The software end uses the computing unit to schedule threads, dynamically calculates the acquired resource status parameters of each encoding channel, and obtains the priority of each encoding channel.

6. The method for scheduling multi-channel data encoding according to claim 4, characterized in that: The method further comprises: The software end uses the parameter management thread to calculate the computing power of the scene parameters of each encoding channel to obtain the target computing power required by the encoding channel, wherein the larger the value of the scene parameter of the encoding channel, the more data needs to be processed, and the larger the target computing power required; The software end uses the computing unit scheduling thread to obtain the target computing power required for each encoding channel from the parameter management thread; The software end uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priorities of all the encoding channels and the remaining computing power of each encoding computing unit, including: The software end compares the target computing power required for each encoding channel with the remaining computing power of all the encoding computing units based on the computing unit scheduling thread to obtain a comparison result, and uses the computing unit scheduling thread to allocate encoding tasks to each encoding computing unit based on the priority of all the encoding channels and the comparison result.

7. The method for scheduling multi-channel data encoding according to claim 6, characterized in that: The software end uses the computing unit scheduling thread to allocate a coding task to each of the coding computing units based on the priorities of all the coding channels and the comparison results, including: When the analysis result is used to indicate that the sum of the target computing power required by all the encoding channels is less than or equal to the sum of the remaining computing power of all the encoding computing units, the software end uses the computing unit scheduling thread to evenly distribute the corresponding encoding tasks to each encoding computing unit according to the priority of all the encoding channels, the sum of the target computing power required by all the encoding channels, and the load of each encoding computing unit; When the analysis result is used to indicate that the target computing power of all the encoding channels is greater than the sum of the remaining computing power of all the encoding calculation units, the software end uses the calculation unit scheduling thread to assign corresponding encoding tasks to each encoding calculation unit according to the priority of each encoding channel.

8. The method for scheduling multi-channel data encoding according to claim 1, 2, 3, 5, 6 or 7, characterized in that: After all the encoding channels in the encoding channel group have completed the encoding task, the method further includes: The encoding calculation unit generates an interrupt signal, and sends the generated interrupt signal to the software end, so as to trigger the software end to respond to the interrupt signal based on a pre-created interrupt monitoring thread, and distribute the target interrupt signal to a target processing thread, so that the target processing thread updates its own state; The target processing thread includes one or more of the parameter calculation thread, the parameter management thread and the computing unit scheduling thread.

9. A device for scheduling multi-channel data encoding, characterized in that: The device is applied in a multi-core encoding system, the multi-core encoding system includes a hardware end, the hardware end includes a plurality of encoding calculation units, each of the encoding calculation units is independent of each other, and each of the encoding calculation units has a corresponding encoding channel group, the encoding channel groups corresponding to each of the encoding calculation units are different from each other, and each of the encoding channel groups is composed of register configuration parameters of each of the encoding channels in the plurality of encoding channels; For any of the encoding calculation units, the encoding calculation unit includes: A loading module, which is used to load the register configuration parameters of the encoding channel group corresponding to the encoding calculation unit from the storage unit to the internal cache of the register in a predetermined parameter loading mode according to the target encoding task when receiving the target encoding task sent by the software end, wherein the storage unit is used to store the register configuration parameters of all initial encoding channels written by the software end, and all the initial encoding channels include the encoding channels corresponding to all the encoding calculation units; The encoding module is used to execute the target encoding task on each encoding channel in the encoding channel group in turn according to the register configuration parameters loaded into the encoding channel group, until all the encoding channels in the encoding channel group have completed the target encoding task.

10. A multi-core encoding system, characterized in that: The multi-core encoding system is used to execute the method for scheduling multi-channel data encoding as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Device and method for generating a multi-channel signal or a parameter data set

    CN101014999A

  • Image coding method and device, computer equipment and storage medium

    CN113066140A

  • Constraint-modified selection of video encoding configurations

    US11582462B1