Coding method and related device, equipment and medium

By dividing the image into sub-images and attaching configuration information for parallel encoding, the problem of a single encoder being unable to handle ultra-high resolution images is solved, achieving real-time, efficient and accurate image encoding.

CN118646883BActive Publication Date: 2024-11-08ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411130607.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2024-11-08
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Existing encoders struggle to process ultra-high resolution and ultra-high pixel images in real time and efficiently, affecting the accuracy of image encoding.

Method used

The original image is divided into several sub-images, and configuration information is attached to the image data of each sub-image. Then, multiple encoders are used for parallel encoding, and the configuration information is used to assist the encoders in encoding.

Benefits of technology

It enables real-time and efficient encoding of high-resolution images, improves encoding accuracy, and avoids encoding errors caused by using different configuration information for different sub-images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646883B_ABST
    Figure CN118646883B_ABST
Patent Text Reader

Abstract

The present application discloses a coding method and related devices, equipment and media, the coding method comprising: dividing an original image into several sub-images; attaching configuration information for image coding to the image data of each sub-image, obtaining the data to be coded of each sub-image; transmitting each data to be coded to different encoders, so that different encoders can perform parallel coding; wherein the encoder encodes the image data of the sub-image in the data to be coded based on the configuration information in the data to be coded, obtaining the code stream data of the sub-image. The above scheme can complete image coding as real-time and efficiently as possible, and improve the accuracy of image coding, especially coding large-resolution images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image coding technology, and in particular to a coding method and related devices, equipment and media. Background Art

[0002] As shooting needs gradually shift toward ultra-high-definition and panoramic image presentation, more and more electronic devices are beginning to support the processing of ultra-high-definition and panoramic series images, giving rise to ultra-large resolution and ultra-high pixel images.

[0003] However, it is difficult for a single encoder to complete the encoding process of such a large-resolution image in real time and efficiently, and it may even affect the accuracy of image encoding. In view of this, how to complete image encoding as real-time and efficiently as possible and improve the accuracy of image encoding, especially encoding large-resolution images, has become an urgent problem to be solved. Summary of the invention

[0004] The main technical problem solved by the present application is to provide a coding method and related devices, equipment and media, which can complete image coding as real-time and efficiently as possible and improve the accuracy of image coding, especially encoding large-resolution images.

[0005] In order to solve the above problems, the first aspect of the present application provides an encoding method, including: dividing an original image into a number of sub-images; attaching configuration information for image encoding to the image data of each sub-image, so as to obtain the data to be encoded of each sub-image; transmitting each data to be encoded to different encoders so as to be encoded in parallel by different encoders; wherein the encoder encodes the image data of the sub-image in the data to be encoded based on the configuration information in the data to be encoded, so as to obtain the code stream data of the sub-image.

[0006] In order to solve the above problems, the second aspect of the present application provides an encoding device, including: an image division module, a configuration adding module and a data transmission module, the image division module is used to divide the original image into a number of sub-images; the configuration adding module is used to attach configuration information for image encoding to the image data of each sub-image, so as to obtain the data to be encoded of each sub-image; the data transmission module is used to transmit each data to be encoded to different encoders so as to be encoded in parallel by different encoders; wherein the encoder encodes the image data of the sub-image in the data to be encoded based on the configuration information in the data to be encoded, so as to obtain the code stream data of the sub-image.

[0007] In order to solve the above problems, the third aspect of the present application provides an electronic device, including a memory, a processor and multiple encoders, the memory and the encoders are both coupled to the processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the encoding method in the above first aspect.

[0008] In order to solve the above problem, the fourth aspect of the present application provides a computer-readable storage medium, which stores program instructions that can be executed by a processor, and the program instructions are used to implement the encoding method in the above first aspect.

[0009] In the above scheme, the original image is divided into several sub-images, and the configuration information for image coding is attached to the image data of each sub-image to obtain the data to be coded of each sub-image, and then each data to be coded is transmitted to different encoders for parallel coding by different encoders, and the encoders encode the image data of the sub-image in the data to be coded based on the configuration information in the data to be coded to obtain the code stream data of the sub-image. Therefore, compared with the coding by a single encoder alone, the parallel coding by multiple encoders can complete the image coding as real-time and efficiently as possible, especially the coding of large-resolution images. On the other hand, by attaching the configuration information for image coding to the image data of each sub-image divided from the same original image, the data to be coded is obtained to assist the encoder in coding the image data in the data to be coded by the configuration information in the data to be coded during coding, and the configuration information for coding each sub-image in the original image can be synchronized between multiple encoders, which helps to avoid the coding of different sub-images in the same original image using different configuration information as much as possible, and can improve the accuracy of image coding. Therefore, the image coding can be completed as real-time and efficiently as possible, and the accuracy of image coding can be improved, especially the coding of large-resolution images. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] Figure 1 It is a flowchart of an embodiment of the encoding method of the present application;

[0011] Figure 2 It is a process diagram of an embodiment of the encoding method of the present application;

[0012] Figure 3 It is a schematic diagram of the framework of an embodiment of the encoding device of the present application;

[0013] Figure 4 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;

[0014] Figure 5 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0015] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0016] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0017] The terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, "many" in this article means two or more than two.

[0018] See also Figure 1 , Figure 1 It is a flowchart of an embodiment of the encoding method of the present application. It should be noted that the present embodiment of the present disclosure can be executed by a processor in an electronic device, and the electronic device can also include multiple encoders, and the encoder is used for image encoding. In addition, the electronic device can include but is not limited to a camera, etc., and the specific type of the electronic device is not limited here. The specific structure of the electronic device can refer to the electronic device embodiment of the present application, which will not be repeated here. Specifically, the embodiment of the present disclosure may include the following steps:

[0019] Step S11: Divide the original image into several sub-images.

[0020] In the embodiment of the present disclosure, the original image can be obtained by sensing an image signal from a single image sensor (ie, senseor). As another possible implementation, please refer to Figure 2 , Figure 2 This is a schematic diagram of the process of an embodiment of the encoding method of the present application. Figure 2 As shown, the original image can also be obtained by fusing the image signals sensed by multiple image sensors. For example, four image sensors can be integrated in an electronic device (such as a panoramic camera can include image sensors that collect image signals from different directions), and the image acquisition resolution of each image sensor is 4K. Then, the image signals sensed by the four image sensors can be spliced ​​and fused by a processor to obtain the original image, and then divided to obtain the following Figure 2 The three sub-images shown are encoded in parallel by different encoders in the electronic device. Figure 2 The example shown is only a possible example in actual application, and does not limit the specific source of the original image, the image sensor, and the specific number of encoders.

[0021] In one implementation scenario, the original image may be equally divided to obtain a plurality of sub-images, that is, the sizes of different sub-images may be the same. For example, the original image may be equally divided into N sub-images, where N may be set to 2, 3, 4, 5, 6, etc., and the specific value of N is not limited here.

[0022] In another implementation scenario, different from the above implementation, as another possible implementation, the original image may not be equally divided to obtain a plurality of sub-images, that is, the sizes of different sub-images may be different. For example, the original image may be divided, but the division is not equally divided to obtain N sub-images. The specific value of N can refer to the above related description and will not be repeated here.

[0023] It should be noted that when the original image is divided by the above-mentioned implementation, the division direction may not be limited. For example, the original image may be divided horizontally, or vertically, or both horizontally and vertically, that is, the original image may be divided in a field shape. Of course, the above examples are only several possible examples of the division direction when dividing the original image, and the division direction of the original image is not limited thereto.

[0024] In addition, the total number of several sub-images may be the same as the total number of encoders, and the encoder is used for image encoding, such as a digital signal processor (DSP), etc., and the specific type of the encoder is not limited here. Exemplarily, in the case of N encoders, the original image can be divided into N sub-images. Of course, the total number of several sub-images may also be different from the total number of encoders. For example, the total number of several sub-images may be greater than the total number of encoders, or the total number of several sub-images may be less than the total number of encoders. The specific number of encoders is not limited here. It should be noted that although the embodiment disclosed in the present application does not limit the total number of encoders and sub-images, the embodiment disclosed in the present application performs image encoding as real-time and efficiently as possible through parallel encoding, so the total number of sub-images and the total number of encoders in the embodiment disclosed in the present application are both not less than two, such as two, three or more than three, and examples are not given one by one here.

[0025] In one implementation scenario, in order to facilitate the distinction of sub-images of different original images, in the process of dividing the original image into several sub-images, the image sequence number of the original image can be first obtained as the target sequence number, and the image sequence numbers of different original images are different. That is, when dividing any original image, the image sequence number of the original image can be first obtained as the target sequence number. It should be noted that the image sequence number can be assigned to the original image when the original image is divided. For example, the corresponding image sequence number can be generated according to the current time. Since the time for processing different original images is not the same during the encoding process of the same electronic device, it can be ensured that the image sequence numbers of different original images are different. Then, based on the target sequence number, the image sequence number of each sub-image obtained by dividing the same original image can be assigned. That is, the image sequence number of the sub-image can be determined by the image sequence number of the original image from which it comes. Exemplarily, the image sequence number of the sub-image can be consistent with the image sequence number of the original image from which it comes. On this basis, the image sequence number of the sub-image can be used to determine the code stream data of the sub-image from the same original image to synthesize the output image after the original image is encoded. For example, still taking the original image of the i-th frame as an example, for the convenience of description, the image sequence number of the original image of the i-th frame can be recorded as M (M can be any string composed of characters such as numbers and letters), and M is used as the target sequence number of the original image of the i-th frame, so that the image sequence numbers of each sub-image obtained by dividing the original image of the i-th frame can be assigned as the target sequence number M, and then when synthesizing the code stream data, if it is detected that the image sequence numbers of N sub-images are all M, it can be determined that these N sub-images are all from the original image of the i-th frame, so the output image after the original image of the i-th frame is synthesized based on the code stream data of these N sub-images. In the above method, the image sequence number is obtained by obtaining the original image as the target sequence number, and the image sequence numbers of different original images are different. Then, based on the target sequence number, the image sequence numbers of each sub-image obtained by dividing the same original image are assigned, and the image sequence numbers of the sub-images are used to determine the sub-image code stream data from the same original image to synthesize the output image after the original image is encoded, which can ensure the accuracy of the output image after the original image is encoded as much as possible.

[0026] Step S12: attaching configuration information for image coding to the image data of each sub-image respectively, to obtain the data to be coded of each sub-image.

[0027] In one implementation scenario, as a possible implementation method, in order to facilitate the user to perform encoding configuration, at least one encoder among multiple encoders can be configured with a communication interface for at least receiving configuration information externally, and an encoder configured with a communication interface can be selected as a master encoder, and the remaining encoders can be selected as slave encoders, that is, for any encoder, it is either a master encoder or a slave encoder, and there is only one master encoder at the same time. On this basis, it can be detected whether the configuration information forwarded by the master encoder is received, and in response to detecting the configuration information forwarded by the master encoder, the configuration information can be attached to the image data of each sub-image to obtain the data to be encoded of each sub-image. In the above manner, the master encoder is configured with a communication interface for at least receiving configuration information externally, and when the configuration information forwarded by the master encoder is detected, the configuration information is attached to the image data of each sub-image to obtain the data to be encoded of each sub-image. In the encoding process, only the communication interface of the master encoder can be presented externally, that is, only one communication address (such as an IP address) can be presented externally, which helps to improve the convenience of encoding configuration.

[0028] In a specific implementation scenario, the above-mentioned communication interface may be a wired communication interface or a wireless communication interface, and the specific type of the communication interface is not limited here. Exemplarily, the user can perform encoding configuration through the above-mentioned communication interface. For example, the encoding configuration can be performed before encoding, such as configuring the encoding output image resolution, etc.; or, the encoding configuration can also be performed during the encoding process, such as configuring the encoding output image frame type (such as I frame, etc.). The specific timing of the encoding configuration is not limited here. Of course, in order to facilitate the user to perform encoding configuration through the communication interface, the user's terminal device (such as a mobile phone, a tablet computer, a laptop computer, etc.) can be connected to the aforementioned communication interface for communication, so that the user can input configuration information to the main encoder through the user's terminal device. In addition, in the case where multiple encoders with the aforementioned communication interface are configured, in order to improve the accuracy of the transmission encoding configuration, the user's terminal device can also detect the encoder currently used as the main encoder among the encoders with the aforementioned communication interface in the electronic device before sending the configuration information, so as to transmit the configuration information through the communication interface of the main encoder.

[0029] In a specific implementation scenario, when there is only one encoder equipped with the above-mentioned communication interface at least for receiving configuration information, before detecting whether the configuration information forwarded by the primary encoder is received, the encoder equipped with the above-mentioned communication interface can be selected as the primary encoder, and after the primary encoder is determined from multiple encoders, it can be detected whether the configuration information forwarded by the primary encoder is received. In the above manner, when there is only one encoder equipped with a communication interface, the encoder equipped with the communication interface is directly selected as the primary encoder, and a certain encoder can be fixed as the primary encoder, which helps to improve the convenience of determining the primary encoder.

[0030] In a specific implementation scenario, different from the implementation mode, when there are multiple encoders configured with the aforementioned communication interface, before detecting whether the configuration information forwarded by the primary encoder is received, the primary encoder can be determined from the encoders configured with the aforementioned communication interface, and after the primary encoder is determined from the multiple encoders, it can be detected whether the configuration information forwarded by the primary encoder is received. That is to say, when there are multiple encoders configured with the aforementioned communication interface, the primary encoder can be dynamically determined from the encoders configured with the aforementioned communication interface. In the above manner, when there are multiple encoders configured with the communication interface, the primary encoder can be determined from the encoders configured with the communication interface, and a certain encoder can be flexibly determined as the primary encoder, which helps to improve the flexibility of determining the primary encoder.

[0031] As a possible example, in order to dynamically decide the main encoder, each encoder configured with a communication interface can be selected as a candidate encoder, and based on the parameter information of the candidate encoder, the first matching degree of the candidate encoder as the main encoder is obtained, and the parameter information includes at least one of the encoding performance of the candidate encoder and the amount of data to be encoded currently remaining in the candidate encoder. Exemplarily, the first matching degree can be positively correlated with the encoding performance and negatively correlated with the amount of data to be encoded. That is to say, for any candidate encoder, the higher its encoding performance, the less the amount of data to be encoded, and accordingly, the higher the first matching degree, and conversely, the lower its encoding performance, the more the amount of data to be encoded, and accordingly, the lower the first matching degree. On this basis, the candidate encoder can be selected as the main encoder based on the first matching degree of each candidate encoder as the main encoder. Exemplarily, the candidate encoder with the highest first matching degree can be selected as the main encoder. The above method measures the first matching degree of the main encoder according to the parameter information of each encoder configured with a communication interface, and thus determines the main encoder according to the first matching degree. It is possible to determine a candidate encoder with as much idle computing resources as possible as the main encoder among the encoders with a communication interface, thereby helping to improve the fluency of the entire encoding process.

[0032] As another possible example, in order to dynamically decide the main encoder, each encoder configured with the aforementioned communication interface can also be selected as a candidate encoder, and based on the parameter information of the candidate encoder, the predicted duration of the candidate encoder to complete the encoding of the current remaining amount of data to be encoded is obtained. Exemplarily, the predicted duration may be negatively correlated with the encoding performance and positively correlated with the amount of data to be encoded. That is to say, for any candidate encoder, the higher its encoding performance, the less the amount of data to be encoded, and accordingly, the shorter the predicted duration, and conversely, the lower the encoding performance, the more the amount of data to be encoded, and accordingly, the longer the predicted duration. On this basis, the candidate encoder can be selected as the main encoder based on the predicted durations corresponding to each candidate encoder. Exemplarily, the candidate encoder with the shortest predicted duration can be selected as the main encoder. In the above manner, by predicting the predicted duration of the current remaining amount of data to be encoded according to the parameter information of each encoder configured with a communication interface, the main encoder can be determined, and the candidate encoder that is as idle as possible can be determined as the main encoder among the encoders with a communication interface, thereby helping to improve the fluency of the entire encoding process.

[0033] It should be noted that the above examples are only several possible examples of dynamically determining the primary encoder, and other possible ways of dynamically determining the primary encoder are not limited thereto, and will not be given examples one by one here.

[0034] In a specific implementation scenario, as mentioned above, after deciding on the main encoder, it is possible to detect whether the configuration information forwarded by the main encoder is received, and when the configuration information forwarded by the main encoder is detected, it is possible to detect whether the image data of each sub-image has been transmitted to different encoders. If not, the configuration information can be directly attached to the image data of each sub-image to obtain the data to be encoded of each sub-image. If so, it is possible to wait for the next frame of the original image, and attach the configuration information to the image data of each sub-image obtained by dividing the next frame of the original image to obtain each data to be encoded. It should be noted that, taking the current original image as the i-th frame of the original image as an example, in the process of deciding on the main encoder and executing the detection of whether the configuration information forwarded by the main encoder is received, the relevant processing of the original image is also performed synchronously, that is, the two can be parallel tasks performed synchronously. Therefore, in the actual application process, it is possible that the original image of the i-th frame has been divided, but the task of deciding the main encoder and executing the detection of whether the configuration information forwarded by the main encoder has been received has not been completed. In this case, the image data of the sub-images divided by the original image of the i-th frame can be directly sent to different encoders for parallel encoding, and the i+1-th frame of the original image is waited for, and the i+1-th frame of the original image is divided. At this time, if the configuration information forwarded by the main encoder has been received, the configuration information can be attached to the image data of each sub-image divided by the original image of the i+1 frame to obtain the data to be encoded of each sub-image. Conversely, if the original image of the i-th frame has been divided and the configuration information forwarded by the main encoder has been received, the configuration information can be attached to the image data of each sub-image divided by the original image of the i-th frame to obtain the data to be encoded of each sub-image. In the above method, when the configuration information forwarded by the main encoder is detected, it is first detected whether the image data of each sub-image has been transmitted to different encoders. If not, the configuration information is directly attached to the image data of each sub-image to obtain the data to be encoded of each sub-image. Otherwise, wait for the next frame of the original image, and attach the configuration information to the image data of each sub-image obtained by dividing the next frame of the original image to obtain the data to be encoded, so that the configuration information can take effect at the first time when the configuration information forwarded by the main encoder is detected.

[0035] In another implementation scenario, different from the aforementioned implementation, as another possible implementation, the processor may also be configured with at least a communication interface for externally receiving configuration information. In this case, it is possible to directly detect whether the configuration information is received, and in response to receiving the configuration information, the configuration information may be attached to the image data of each sub-image obtained by dividing the original image, so as to obtain the data to be encoded of each sub-image. Similarly, before attaching the configuration information, it is also possible to first detect whether the image data of each sub-image has been transmitted to different encoders. If not, the configuration information may be directly attached to the image data of each sub-image, so as to obtain the data to be encoded of each sub-image. Otherwise, the next frame of the original image may be waited for, and the configuration information may be attached to the image data of each sub-image obtained by dividing the next frame of the original image, so as to obtain the data to be encoded.

[0036] Of course, in the actual application process, it is also possible that the configuration information is not received. In this case, the image data of each sub-image obtained by dividing the original image can be directly transmitted to different encoders as data to be encoded, so that different encoders can perform parallel encoding. For example, when encoding the i-th frame of the original image, the configuration information is not received, then the image data of each sub-image obtained by dividing the i-th frame of the original image can be directly transmitted to different encoders as data to be encoded. Other situations can be deduced by analogy, and examples are not given one by one here. In addition, as mentioned above, when the configuration information is detected, the configuration information can be attached to the image data of each sub-image to obtain the data to be encoded of each sub-image. Specifically, the configuration information can be located at the target position of the data to be encoded, and the target position can at least include the tail position of the data to be encoded. Of course, the target position may not be limited to the tail position, such as but not limited to the head position, etc., and the target position is not limited here.

[0037] Step S13: transmitting each to-be-encoded data to different encoders so as to be encoded in parallel by the different encoders.

[0038] In the disclosed embodiment, the encoder can encode the image data of the sub-image in the to-be-encoded data based on the configuration information in the to-be-encoded data to obtain the code stream data of the sub-image. Of course, after the parallel encoding is completed by different encoders, the output image after the original image encoding can be synthesized based on the code stream data of the sub-image from the same original image.

[0039] In one implementation scenario, each data to be encoded can be transmitted to different encoders based on a preset mapping relationship, and the preset mapping relationship represents the correspondence between the relative position of the sub-image in the original image and the encoder used to encode the data to be encoded of the sub-image. Exemplarily, taking the horizontal division of the original image into three sub-images as an example, the preset mapping relationship may include: the first encoder is used to encode the data to be encoded of the uppermost sub-image in the original image, the second encoder is used to encode the data to be encoded of the sub-image in the middle position of the original image, and the third encoder is used to encode the data to be encoded of the lowermost sub-image in the original image. Of course, the above example is only a possible example of the preset mapping relationship in the actual application process, and other situations can be deduced by analogy, and no examples are given here one by one. In the above manner, the encoder used to encode the data to be encoded is determined by the preset mapping relationship to transmit the data to be encoded to the corresponding encoder, which can reduce the complexity of determining the corresponding encoder of the data to be encoded as much as possible.

[0040] In another implementation scenario, different from the aforementioned implementation, as another possible implementation, the second matching degree between the data to be encoded and the encoder can also be obtained based on the data amount of the data to be encoded and the parameter information of the encoder. It should be noted that the parameter information may specifically include at least one of the encoding performance of the encoder and the amount of data to be encoded currently remaining in the encoder. Based on this, each data to be encoded can be transmitted to different encoders based on the second matching degree between each data to be encoded and different encoders. The above method obtains the second matching degree between the data to be encoded and the encoder through the data amount of the data to be encoded and the parameter information of the encoder, and determines the encoder used to encode the data to be encoded based on this, which can help to find the optimal encoder for each data to be encoded from the perspective of overall encoding efficiency.

[0041] In a specific implementation scenario, the second matching degree may be negatively correlated with the data amount of the data to be encoded, and when the parameter information includes the encoding performance, the second matching degree is positively correlated with the encoding performance, and when the parameter information includes the data amount to be encoded, the second matching degree is negatively correlated with the data amount to be encoded. That is to say, for any pair of data to be encoded and encoder, the larger the data amount of the data to be encoded, the lower the encoding performance of the encoder, and the larger the amount of data to be encoded currently remaining in the encoder, the lower the second matching degree between the two, and conversely, the smaller the data amount of the data to be encoded, the higher the encoding performance of the encoder, and the smaller the amount of data to be encoded currently remaining in the encoder, the higher the second matching degree between the two.

[0042] In a specific implementation scenario, after obtaining the second matching degree between any data to be encoded and each encoder, each data to be encoded can be selected in order from high to low in data volume as the current data, and the current data can be transmitted to the encoder with the highest second matching degree with the current data among the unselected encoders. In other words, the encoder with the highest second matching degree with the current data can be selected from the unselected encoders as the encoder for encoding the current data. Exemplarily, still taking the original image divided into 3 sub-images as an example, the second matching degrees between the data to be encoded of each sub-image and each encoder are calculated as shown in Table 1:

[0043] Table 1 Schematic table of an embodiment of the second matching degree between the data to be encoded and the encoder

[0044]

[0045] Among them, the first data to be encoded has the largest amount of data, followed by the second data to be encoded, and then the third data to be encoded, so the first data to be encoded can be selected as the current data first, and the encoder with the highest second matching degree is selected from the first to third encoders, that is, the third encoder, as the encoder for encoding the first data to be encoded; then the second data to be encoded is selected as the current data, and the encoder with the highest second matching degree is selected from the first and second encoders, that is, the second encoder, as the encoder for encoding the second data to be encoded; and for the third data to be encoded, since only the first encoder is left unselected, the first encoder can be directly selected as the encoder for encoding the third data to be encoded. It should be noted that the above example is only a possible example in the actual application process, and other possible situations are not limited thereto. For example, when there are multiple data to be encoded with the same data volume, the multiple data to be encoded with the same data volume can be randomly sorted during sorting; or, when there are multiple encoders with the highest second matching degree with the current data among the unselected encoders, one encoder can be randomly selected from the multiple encoders with the highest second matching degree with the current data as the encoder for encoding the current data. In the above manner, each data to be encoded is selected in order of data volume from high to low, and then the current data is transmitted to the encoder with the highest second matching degree with the current data among the unselected encoders, which can give priority to ensuring that the data to be encoded with a high data volume is encoded by a relatively more appropriate encoder, thereby ensuring the overall encoding efficiency as much as possible.

[0046] In an implementation scenario, after each piece of data to be encoded is transmitted to the corresponding encoder for encoding, the encoder may be in a state of encoding the unencoded data to be encoded. For example, the received data to be encoded may be encoded according to the first-in-first-out principle, and the processor may wait for the next frame of the original image and perform the above steps on the next frame of the original image. Of course, before this, it is also possible to first detect whether the configuration information is effective once or multiple times, and in response to the configuration information being effective multiple times, obtain the target number of frames for which the configuration information is effective in total, so that after the original images of each frame of the subsequent target frame number are divided to obtain sub-images, the configuration information is attached to the image data of the sub-image. The above method, by detecting whether the configuration information is effective once or multiple times, and in the case of being effective multiple times, obtaining the target number of frames for which the configuration information is effective in total, so that after the original images of each frame of the subsequent target frame number are divided to obtain sub-images, the configuration information is attached to the image data of the sub-image. It can help to further improve the degree of automation of the encoding configuration.

[0047] In a specific implementation scenario, when the user customizes the encoding configuration through the aforementioned communication interface, the user can specify the target number of frames for the total effective time of the configuration information together with the configuration information. For example, the user can specify the target number of frames for the total effective time by default, in which case the configuration information can be regarded as being effective once; or, the user can specify the target duration for the total effective time, and the total remaining target number of frames can be calculated based on the target duration and the frame rate. Of course, the above examples are only a few possible examples of single or multiple effective times in actual applications, and do not limit the user to other possible ways to specify single or multiple effective times.

[0048] In another specific implementation scenario, different from the aforementioned implementation, in addition to the user specifying whether the configuration information is effective once or multiple times, after receiving the configuration information, it is also possible to predict whether the configuration information is effective once or multiple times based on the specific content of the configuration information. Exemplarily, the configuration information may specifically include a target resolution, which represents the resolution of the output image after encoding. In this case, it can be predicted that the configuration information is effective multiple times, and the target number of frames for multiple times being effective is always effective; or, the configuration information may specifically include a target frame type, which represents the frame type (such as an I frame) of the output image after encoding. In this case, it can be predicted that the configuration information is effective once. Of course, the above examples are only several possible examples of predicting whether the configuration information is effective once or multiple times based on the specific content of the configuration information, and other possible situations are not limited thereto. On this basis, the user can be prompted to confirm whether the prediction information is accurate. If the user confirms, the configuration information can be attached to the image data of the sub-image after the original image of each frame of the target frame number is divided into sub-images. Conversely, if the user corrects it, the subsequent steps can be performed based on the corrected prediction information. For example, if the user changes multiple effectiveness to single effectiveness, the configuration information can be discarded after the configuration information is first effective; or if the user changes single effectiveness to multiple effectiveness, the configuration information can be attached to the image data of the sub-image after the original image of each frame of the subsequent target frame number is divided into sub-images.

[0049] In an implementation scenario, as described above, after each to-be-encoded data is transmitted to a corresponding encoder for encoding, the encoder may be in a state of encoding the unencoded to-be-encoded data, and the encoder may specifically encode the image data in the to-be-encoded data based on the configuration information in the to-be-encoded data. Of course, when the to-be-encoded data does not contain the configuration information, the encoder may use a default encoding standard for encoding. Exemplarily, the configuration information may include a target resolution. In this case, the encoding parameters such as the compression rate during encoding can be determined according to the target resolution and the original resolution of the original image, thereby ensuring that each encoder can perceive the change in the encoding output resolution during parallel encoding, so as to achieve the target resolution of the output image after encoding by the encoder; or, the configuration information may include a target frame type (e.g., I frame), and the target frame type indicates the frame type of the output image after encoding. In this case, an appropriate encoding method can be selected according to the target frame type for encoding. For example, when the target frame type is an I frame, other frames may not be referenced during encoding, thereby ensuring that each encoder can perceive the need to encode and output the same frame type during parallel encoding; or, the configuration information may include a target brightness value, and the target brightness value indicates the brightness value of the output image after encoding. In this case, the encoder can encode according to the target brightness value so that the brightness value of the output image after encoding is the target brightness value; or, the configuration information may include a target chrominance value, and the target chrominance value indicates the chrominance value of the output image after encoding. In this case, the encoder can encode according to the target chrominance value so that the chrominance value of the output image after encoding is the target chrominance value. Of course, the above examples are only several possible examples of configuration information, and the specific content of the configuration information is not limited thereto.

[0050] In one implementation scenario, taking the selection of an encoder configured with at least a communication interface for externally receiving configuration information as the main encoder as an example, the main encoder can also receive code stream data from a slave encoder, and the main encoder can also synthesize the output image after the original image is encoded based on the code stream data of the sub-image of the same original image. In the above method, the main encoder is also used to receive the code stream data from the slave encoder, and synthesize the output image after the original image is encoded based on the code stream data of the sub-image of the same original image, which can always maintain only one communication interface to the outside, which helps to improve the convenience of interaction. Of course, in the case where the processor receives configuration information externally, it can be deduced by analogy, that is, the processor can receive code stream data from different encoders, and the processor can synthesize the output image after the original image is encoded based on the code stream data of the sub-image of the same original image.

[0051] In one implementation scenario, after synthesizing the output image after the original image is encoded, the main encoder can also provide a preview of the output image after the original image is encoded through the aforementioned communication interface. Of course, when the user previews the output image after the original image is encoded, he can also download and store the preview image after the original image is encoded through the aforementioned communication interface.

[0052] In the above scheme, the original image is divided into several sub-images, and the configuration information for image coding is attached to the image data of each sub-image to obtain the data to be coded of each sub-image, and then each data to be coded is transmitted to different encoders for parallel coding by different encoders, and the encoders encode the image data of the sub-image in the data to be coded based on the configuration information in the data to be coded to obtain the code stream data of the sub-image. Therefore, compared with the coding by a single encoder alone, the parallel coding by multiple encoders can complete the image coding as real-time and efficiently as possible, especially the coding of large-resolution images. On the other hand, by attaching the configuration information for image coding to the image data of each sub-image divided from the same original image, the data to be coded is obtained to assist the encoder in coding the image data in the data to be coded by the configuration information in the data to be coded during coding, and the configuration information for coding each sub-image in the original image can be synchronized between multiple encoders, which helps to avoid the coding of different sub-images in the same original image using different configuration information as much as possible, and can improve the accuracy of image coding. Therefore, the image coding can be completed as real-time and efficiently as possible, and the accuracy of image coding can be improved, especially the coding of large-resolution images.

[0053] See also Figure 3 , Figure 3 1 is a schematic diagram of a framework of an embodiment of an encoding device 30 of the present application. The encoding device 30 includes: an image division module 31, a configuration adding module 32 and a data transmission module 33. The image division module 31 is used to divide the original image into a plurality of sub-images; the configuration adding module 32 is used to attach configuration information for image encoding to the image data of each sub-image, and obtain the data to be encoded of each sub-image; the data transmission module 33 is used to transmit each data to be encoded to different encoders, so that different encoders can perform parallel encoding; wherein the encoder encodes the image data of the sub-image in the data to be encoded based on the configuration information in the data to be encoded, and obtains the code stream data of the sub-image.

[0054] In the above scheme, the encoding device 30 divides the original image into several sub-images, and attaches configuration information for image encoding to the image data of each sub-image, obtains the data to be encoded of each sub-image, and then transmits each data to be encoded to different encoders for parallel encoding by different encoders, and the encoder encodes the image data of the sub-image in the data to be encoded based on the configuration information in the data to be encoded, and obtains the code stream data of the sub-image. Therefore, on the one hand, compared with encoding by a single encoder alone, through parallel encoding by multiple encoders, image encoding can be completed as real-time and efficiently as possible, especially encoding large-resolution images. On the other hand, by attaching configuration information for image encoding to the image data of each sub-image divided from the same original image, the data to be encoded is obtained to assist the encoder in encoding the image data in the data to be encoded by the configuration information in the data to be encoded during encoding. The configuration information for encoding each sub-image in the original image can be synchronized between multiple encoders, which helps to avoid encoding different sub-images in the same original image using different configuration information as much as possible, and can improve the accuracy of image encoding. Therefore, image encoding can be completed as real-time and efficiently as possible, and the accuracy of image encoding can be improved, especially encoding large-resolution images.

[0055] In some disclosed embodiments, the encoding device 30 also includes a receiving detection module for detecting whether configuration information forwarded by a main encoder is received; wherein the encoder is a main encoder or a slave encoder, and the main encoder is configured with at least a communication interface for externally receiving configuration information; the configuration adding module 32 is specifically used to attach the configuration information to the image data of each sub-image in response to detecting the configuration information forwarded by the main encoder, so as to obtain the data to be encoded of each sub-image.

[0056] In some disclosed embodiments, the configuration adding module 32 includes a transmission detection submodule, which is used to detect whether the image data of each sub-image has been transmitted to different encoders when the configuration information forwarded by the main encoder is detected; the configuration adding module 32 includes a first adding submodule, which is used to directly attach the configuration information to the image data of each sub-image when the image data has not yet been transmitted to different encoders, so as to obtain the data to be encoded of each sub-image; the configuration adding module 32 includes a second adding submodule, which is used to wait for the next frame of the original image when the image data has already been transmitted to different encoders, and attach the configuration information to the image data of each sub-image obtained by dividing the next frame of the original image to obtain each data to be encoded.

[0057] In some disclosed embodiments, the main encoder is further used to receive bitstream data from a slave encoder, and to synthesize an output image after encoding the original image based on bitstream data from a sub-image of the same original image; and / or, the main encoder is further used to provide a preview of the output image after encoding the original image to the outside through a communication interface.

[0058] In some disclosed embodiments, the configuration adding module 32 includes a first selection submodule for selecting an encoder configured with a communication interface as a primary encoder when there is only one encoder configured with a communication interface.

[0059] In some disclosed embodiments, the configuration adding module 32 includes a second selection submodule for determining a primary encoder from the encoders configured with the communication interface when there are multiple encoders configured with the communication interface.

[0060] In some disclosed embodiments, the second selection submodule includes a candidate selection unit for selecting each encoder configured with a communication interface as a candidate encoder; the second selection submodule includes a matching metric unit for obtaining a first matching degree of the candidate encoder as a main encoder based on parameter information of the candidate encoder; wherein the parameter information includes at least one of the encoding performance of the candidate encoder and the amount of data currently remaining to be encoded by the candidate encoder; the second selection submodule includes a target selection unit for selecting a candidate encoder as a main encoder based on the first matching degree of each candidate encoder as a main encoder.

[0061] In some disclosed embodiments, the image division module 31 includes a serial number acquisition submodule, which is used to obtain the image serial number of the original image as the target serial number; wherein different original images have different image serial numbers; the image division module 31 includes a serial number assignment submodule, which is used to assign image serial numbers of each sub-image obtained by dividing the same original image based on the target serial number; wherein the image serial number of the sub-image is used to determine the code stream data of the sub-image from the same original image, so as to synthesize the output image after the original image is encoded.

[0062] In some disclosed embodiments, the data transmission module 33 includes a first synchronization submodule, which is used to transmit each data to be encoded to different encoders based on a preset mapping relationship; wherein the preset mapping relationship represents the correspondence between the relative position of the sub-image in the original image and the encoder used to encode the data to be encoded of the sub-image.

[0063] In some disclosed embodiments, the data transmission module 33 includes a second synchronization submodule, which is used to obtain a second matching degree between the data to be encoded and the encoder based on the data amount of the data to be encoded and parameter information of the encoder, and transmit each data to be encoded to a different encoder based on the second matching degree between each data to be encoded and the different encoders; wherein the parameter information includes at least one of the encoding performance of the encoder and the amount of data to be encoded currently remaining in the encoder.

[0064] In some disclosed embodiments, the second synchronization submodule includes a data sorting unit, which is used to select each to-be-encoded data as the current data in order from high to low data volume; the second synchronization submodule includes a data transmission unit, which is used to transmit the current data to an encoder among the unselected encoders that has the highest second matching degree with the current data.

[0065] In some disclosed embodiments, the second match degree is negatively correlated with the amount of data to be encoded; and / or, when the parameter information includes encoding performance, the second match degree is positively correlated with the encoding performance; and / or, when the parameter information includes the amount of data to be encoded, the second match degree is negatively correlated with the amount of data to be encoded.

[0066] In some disclosed embodiments, the encoding device 30 also includes an effectiveness detection module for detecting whether the configuration information is effective once or multiple times; the encoding device 30 also includes a configuration effectiveness module for obtaining a target number of frames in which the configuration information is effective in total in response to the configuration information being effective multiple times, so as to attach the configuration information to the image data of the sub-image after the original image of each frame of the target number of frames is divided to obtain sub-images.

[0067] In some disclosed embodiments, the total number of sub-images is the same as the total number of encoders; and / or, the original image is obtained by fusing image signals sensed by multiple image sensors, or the original image is obtained by sensing an image signal from a single image sensor; and / or, the sizes of different sub-images are the same, or the sizes of different sub-images are different; and / or, the configuration information includes: at least one of a target resolution, a target frame type, a target brightness value, and a target chrominance value, the target resolution represents the resolution of the output image after encoding, the target frame type represents the frame type of the output image after encoding, the target brightness value represents the brightness value of the output image after encoding, and the target chrominance value represents the chrominance value of the output image after encoding; and / or, the configuration information is located at a target position of the data to be encoded, and the target position includes at least the tail position of the data to be encoded.

[0068] See also Figure 4 , Figure 4 It is a schematic diagram of the framework of an embodiment of an electronic device 40 of the present application. The electronic device 40 includes a memory 41, a processor 42 and a plurality of encoders 43. The memory 41 and the encoders 43 are coupled to the processor 42. The memory 41 stores program instructions. The processor 42 is used to execute program instructions to implement the steps in any of the above-mentioned encoding method embodiments. For details, please refer to the aforementioned disclosed embodiments, which will not be repeated here. It should be noted that the electronic device 40 may include but is not limited to: a camera, a smart phone, etc., which are not limited here. For example, in the case where the electronic device 40 is a camera, the specific type of the electronic device 40 may include but is not limited to a panoramic camera, etc., which are not limited here.

[0069] Specifically, the processor 42 may also be referred to as a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip having the ability to process signals. The processor 42 may also be a general-purpose processor, a dedicated integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. In addition, the processor 42 may be implemented by a plurality of integrated circuit chips. In addition, the encoder 43 may be implemented by components having a signal encoding function, such as a digital signal processor (DSP), which is not limited here.

[0070] In one implementation scenario, the processor 42 and the encoder 43 may be connected via an interface such as MIPI, LVDS, or the like.

[0071] In one implementation scenario, as described in the aforementioned disclosed embodiment, the multiple encoders 43 may include a master encoder 431 and a slave encoder 432, and the master encoder 431 is configured with at least a communication interface 4311 for externally receiving configuration information, the configuration information is used for image encoding, and the master encoder 431 is also electrically connected to each slave encoder 432. It should be noted that the master encoder 431 can be connected to the slave encoder 432 through an interface such as a network interface, SPI, USB, etc.

[0072] In the above scheme, the processor 42 in the electronic device 40 implements the steps in any of the above coding method embodiments. On the one hand, by attaching configuration information for image coding to the image data of each sub-image divided from the same original image, the data to be coded is obtained to assist the encoder 43 in encoding the image data in the data to be coded by using the configuration information in the data to be coded. The configuration information for encoding each sub-image in the original image can be synchronized between multiple encoders 43, which helps to avoid encoding different sub-images in the same original image with different configuration information as much as possible, and can improve the accuracy of image coding. Therefore, image coding can be completed as real-time and efficiently as possible, and the accuracy of image coding can be improved, especially for encoding large-resolution images.

[0073] See also Figure 5 , Figure 5 1 is a schematic diagram of a framework of an embodiment of a computer-readable storage medium 50 of the present application. The computer-readable storage medium 50 stores program instructions 51 executable by a processor, and the program instructions 51 can be executed to implement the steps in any of the above encoding method embodiments.

[0074] It should be noted that the computer-readable storage medium 50 can specifically be a medium that can store the program instructions 51, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or it can also be a server that stores the program instructions 51. The server can send the stored program instructions 51 to other devices for execution, or it can also execute the stored program instructions 51 by itself.

[0075] In the above scheme, the computer-readable storage medium 50 implements the steps in any of the above coding method embodiments. On the one hand, by attaching configuration information for image coding to the image data of each sub-image divided from the same original image, the data to be coded is obtained to assist the encoder in encoding the image data in the data to be coded by the configuration information in the data to be coded during coding. The configuration information for encoding each sub-image in the original image can be synchronized between multiple encoders, which helps to avoid encoding different sub-images in the same original image with different configuration information as much as possible, and can improve the accuracy of image coding. Therefore, image coding can be completed as real-time and efficiently as possible, and the accuracy of image coding can be improved, especially for encoding large-resolution images.

[0076] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0077] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0078] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0079] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

[0080] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

Claims

1. A coding method, It is characterized in that The encoding method is executed by a processor in an electronic device, and the electronic device also includes a plurality of encoders for image encoding. The method includes: dividing an original image into a plurality of sub-images, and detecting whether configuration information forwarded by a main encoder is received; wherein the encoder is the main encoder or the slave encoder, and the main encoder is configured with a communication interface at least for externally receiving the configuration information; In response to detecting the configuration information forwarded by the main encoder, attaching the configuration information for image encoding to the image data of each of the sub-images to obtain the to-be-encoded data of each of the sub-images; Transmit each of the data to be encoded to different encoders so as to be encoded in parallel by the different encoders; wherein the encoder encodes the image data of the sub-image in the data to be encoded based on the configuration information in the data to be encoded to obtain the code stream data of the sub-image.

2. The method according to claim 1, It is characterized in that When the configuration information forwarded by the main encoder is detected, the image data of each sub-image is respectively attached with the configuration information to obtain the to-be-encoded data of each sub-image, including: Detecting whether the image data of each of the sub-images has been transmitted to different encoders; If not, directly attach the configuration information to the image data of each sub-image to obtain the data to be encoded of each sub-image; If so, wait for the next frame of the original image, and attach the configuration information to the image data of each sub-image obtained by dividing the next frame of the original image to obtain each piece of data to be encoded.

3. The method according to claim 1, It is characterized in that The main encoder is further configured to receive the code stream data from the slave encoder, and synthesize the code stream data from the sub-image of the same original image to obtain the output image after the original image is encoded.

4. The method according to claim 1, It is characterized in that The main encoder is also used to provide a preview of the output image after the original image is encoded to the outside through the communication interface.

5. The method according to claim 1, It is characterized in that In the case that there is only one encoder configured with the communication interface, before detecting whether the configuration information forwarded by the main encoder is received, the method further includes: Selecting an encoder configured with the communication interface as the master encoder; Alternatively, in the case where there are multiple encoders configured with the communication interface, before detecting whether the configuration information forwarded by the main encoder is received, the method further includes: The master encoder is determined from encoders configured with the communication interface.

6. The method according to claim 5, It is characterized in that In the case that there are multiple encoders configured with the communication interface, the step of determining the master encoder from the encoders configured with the communication interface comprises: Selecting each encoder configured with the communication interface as a candidate encoder; Based on the parameter information of the candidate encoder, obtaining a first matching degree of the candidate encoder as the primary encoder; wherein the parameter information includes at least one of the encoding performance of the candidate encoder and the amount of data to be encoded currently remaining for the candidate encoder; The candidate encoder is selected as the primary encoder based on a first matching degree of each of the candidate encoders as the primary encoder.

7. The method according to claim 1, It is characterized in that The dividing the original image into a plurality of sub-images includes: Obtaining an image sequence number of the original image as a target sequence number; wherein the image sequence numbers of different original images are different; Based on the target sequence number, an image sequence number is assigned to each of the sub-images obtained by dividing the same original image; wherein the image sequence number of the sub-image is used to determine the code stream data of the sub-image from the same original image to synthesize the output image after the original image is encoded.

8. The method according to claim 1, It is characterized in that The transmitting each of the to-be-encoded data to different encoders includes any one of the following: Based on a preset mapping relationship, each of the to-be-encoded data is transmitted to a different encoder; wherein the preset mapping relationship represents a corresponding relationship between a relative position of the sub-image in the original image and an encoder used to encode the to-be-encoded data of the sub-image; Based on the data amount of the data to be encoded and the parameter information of the encoder, a second matching degree between the data to be encoded and the encoder is obtained, and based on the second matching degree between each data to be encoded and a different encoder, each data to be encoded is transmitted to a different encoder; wherein the parameter information includes at least one of the encoding performance of the encoder and the amount of data to be encoded currently remaining in the encoder.

9. The method according to claim 8, It is characterized in that The transmitting each of the to-be-encoded data to the different encoders based on the second matching degree between each of the to-be-encoded data and the different encoders respectively comprises: Selecting the to-be-encoded data in order from high to low in terms of the data amount as current data; The current data is transmitted to an encoder among the unselected encoders that has the highest second matching degree with the current data.

10. The method according to claim 8, It is characterized in that The second matching degree is negatively correlated with the data amount of the to-be-encoded data.

11. The method according to claim 8, It is characterized in that When the parameter information includes the encoding performance, the second matching degree is positively correlated with the encoding performance.

12. The method according to claim 8, It is characterized in that In a case where the parameter information includes the amount of data to be encoded, the second matching degree is negatively correlated with the amount of data to be encoded.

13. The method according to claim 1, It is characterized in that The method further comprises: Detect whether the configuration information is effective once or multiple times; In response to the configuration information being effective for multiple times, a target number of frames in which the configuration information is effective in total is obtained, so that after the original image of each frame of the target number of frames is divided to obtain the sub-image, the configuration information is attached to the image data of the sub-image.

14. The method according to any one of claims 1 to 13, It is characterized in that The total number of the sub-images is the same as the total number of the encoders; And / or, the original image is obtained by fusing image signals sensed by a plurality of image sensors respectively, or the original image is obtained by sensing an image signal by a single image sensor; And / or, the sizes of different sub-images are the same, or the sizes of different sub-images are different; And / or, the configuration information includes: at least one of a target resolution, a target frame type, a target brightness value, and a target chrominance value, wherein the target resolution represents a resolution of an output image after encoding, the target frame type represents a frame type of an output image after encoding, the target brightness value represents a brightness value of an output image after encoding, and the target chrominance value represents a chrominance value of an output image after encoding; And / or, the configuration information is located at a target position of the data to be encoded, and the target position at least includes a tail position of the data to be encoded.

15. An encoding device, It is characterized in that The encoding device is applied to a processor in an electronic device, the electronic device further includes a plurality of encoders for image encoding, and the device includes: An image division module is used to divide the original image into several sub-images; A receiving detection module; used to detect whether the configuration information forwarded by the master encoder is received; wherein the encoder is the master encoder or the slave encoder, and the master encoder is configured with a communication interface at least for externally receiving the configuration information; a configuration adding module, configured to, in response to detecting the configuration information forwarded by the main encoder, attach the configuration information for image encoding to the image data of each of the sub-images to obtain the to-be-encoded data of each of the sub-images; A data transmission module is used to transmit each of the data to be encoded to different encoders so that they can be encoded in parallel by different encoders; wherein the encoder encodes the image data of the sub-image in the data to be encoded based on the configuration information in the data to be encoded to obtain the code stream data of the sub-image.

16. An electronic device, It is characterized in that It includes a memory, a processor and multiple encoders, the memory and the encoders are both coupled to the processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the encoding method according to any one of claims 1 to 14.

17. The electronic device according to claim 16, It is characterized in that The multiple encoders include a master encoder and slave encoders, and the master encoder is configured with a communication interface at least for externally receiving configuration information, the configuration information is used for image encoding, and the master encoder is also electrically connected to each of the slave encoders.

18. A computer-readable storage medium, It is characterized in that Program instructions that can be executed by a processor are stored, and the program instructions are used to implement the encoding method according to any one of claims 1 to 14.