Decoding method and device of decoder

By decomposing the decoder process into independent main process and flow fetching process, and using the state machine model to connect, the complexity and stability of the existing decoder system in multi-window mode is solved, and the stability, efficiency and Scalability.

CN119094791APending Publication Date: 2024-12-06SHENZHEN BROVOTECH TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411091736.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Existing decoder systems are complex and difficult to control in multi-window mode, resulting in high resource consumption, low stability and efficiency, inability to compatible with multiple camera and picture layouts, and lack scalability.

Method used

The decoder process is decomposed into independent main process and flow fetch process, and connected through the state machine model, decomposed into multiple sub-steps to achieve process-based and ordered state execution, ensuring system stability and efficiency.

Benefits of technology

It realizes the long-term stable operation and efficient operation of the system, is compatible with a variety of cameras and picture layouts, is scalable, and improves the scalability and maintenance efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094791A_ABST
    Figure CN119094791A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of decoder systems, and particularly discloses a decoding method and device of a decoder, and the method comprises the steps: decomposing a decoding process of the decoder into a decoder main process and a decoder stream taking process which are independent of each other and do not interfere with each other, and decomposing the decoder main process into a plurality of first sub-steps; the method comprises the following steps of: firstly, decomposing a flow of a decoder into a plurality of flow sub-steps, finally, linking the first sub-step and the flow sub-steps, and abstracting complex services into a combined model of a state machine on the basis of the state machine, so that an internal mechanism is streamlined, and the services are orderly executed according to designed steps and states; therefore, operation of the whole system is standardized and simplified, stability and high efficiency of long-time operation of the system can be guaranteed, the system is compatible with various cameras and various picture layouts to have expandability, and the system can have different sub-processes according to different services to have good flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of decoder systems, and in particular relates to a decoding method and device of a decoder. Background Art

[0002] Decoder products mainly decode the audio and video streams that have been encoded by the camera and then output the image to the display. The characteristics of consumer products are limited resources, that is, limited resources such as CPU and memory, but the requirements are not low, because they are closer to users and are used more frequently, so the requirements for product experience and performance are relatively high. The decoder has higher requirements for memory and CPU than ordinary embedded devices, and consumes more; and the software and hardware involved in the decoder are more numerous and complex. In addition to conventional components such as CPU / memory, there are also HDMI / VGA interface devices and displays, etc., so not only decoding but also image output must be required, and the picture can be divided into multiple windows, that is, multi-screen, each window corresponds to a camera, and the maximum number of windows that can be supported is the number of channels (cameras) decoding output supported;

[0003] When there are multiple windows, the cameras corresponding to the windows can be switched to each other and many other services can be provided. Therefore, in addition to the high CPU and memory resource consumption of the decoder itself, the services are more complicated. However, if there is no good method for decoding control of general decoding products, it will be very messy, and the more control, the more complicated it will be. It is impossible to achieve order, stable and efficient control. Therefore, we need to propose a decoding method and device for the decoder to solve the above-mentioned problems, so that it can not only streamline the internal mechanism, but also make the services executed in an orderly manner according to the designed steps and states, thereby standardizing and simplifying the operation of the entire system, which can not only ensure the stability and efficiency of the system for a long time, but also make the system compatible with various cameras and various screen layouts and have scalability. Summary of the invention

[0004] The purpose of the present invention is to provide a decoding method and device for a decoder, which not only streamlines the internal mechanism, but also enables the business to be executed in an orderly manner according to the designed steps and states, thereby standardizing and simplifying the operation of the entire system, not only ensuring the stability and efficiency of the system for a long time, but also making the system compatible with various cameras and various screen layouts and scalable, so as to solve the problems raised in the above background technology.

[0005] To achieve the above object, the present invention adopts the following technical solutions:

[0006] A decoding method of a decoder comprises the following steps:

[0007] S1, decomposing the decoder decoding process into a decoder main process and a decoder stream fetching process which are independent and do not interfere with each other;

[0008] S2, the main process of the decoder is decomposed into multiple first sub-steps;

[0009] S3, the decoder fetching process is decomposed into multiple fetching sub-steps;

[0010] S4, connecting the first sub-step and the flow taking sub-step.

[0011] Preferably, the decoding process of the decoder is to introduce a state machine into a function, each normal and abnormal state corresponds to a case branch, and the normal and abnormal states can be flexibly set so that the process can be changed at any time.

[0012] Preferably, the decoder is configured as a Decoder device, and needs to be used in conjunction with an HDMI device and a Display device when decoding, the HDMI device is electrically connected to the Display device, and the HDMI device and the Decoder device are both electrically connected to the Display device.

[0013] Preferably, the decoder main process includes the following steps:

[0014] A1. Turn on the HDMI device;

[0015] A2. Turn on the Decoder device;

[0016] A3. Turn on the Display device;

[0017] A4. Bind the decoding channel and window number;

[0018] A5. Send data;

[0019] A6. When the data is sent successfully, the decoding channel and window number are unbound;

[0020] A7. After unbinding successfully, turn off the Display device;

[0021] A8. When the Display device is closed successfully, close the Decoder device;

[0022] A9. After the Decoder device is shut down successfully, shut down the HDMI device.

[0023] Preferably, in step A1, when the HDMI device is not successfully opened, the HDMI device is turned off; in step A2, when the Decoder device is not successfully opened, the Decoder device is turned off; in step A3, when the Display device is not successfully opened, the Display device is turned off.

[0024] Preferably, in step A5, the data sent is the encoder parameter information obtained from the camera stream. The Decoder device is a logical concept, corresponding to each camera, and is the decoding of the camera. The number of the Decoder devices is equal to the number of pictures. When the decoder main process exits, it is necessary to notify the Decoder device to stop acquiring the stream when releasing resources.

[0025] Preferably, the decoder stream acquisition process includes the following steps:

[0026] B1. Connect the camera and confirm that it is connected correctly;

[0027] B2. Write the camera data into the cache and confirm that the cache has been written;

[0028] B3. Get the cache handle. After the cache handle is obtained, get the most recent I frame and metadata.

[0029] B4, read the I frame and metadata, and when the I frame and metadata are successfully obtained, start the loop to obtain IPC media data and loop write cache;

[0030] B5. When you need to stop decoding a certain channel, release the cache. When the cache is released, close the camera connection.

[0031] Preferably, the streaming process includes N repeated split-screen data, the decoder main process is the overall control, monitoring and management of various devices, and the streaming process is the data source; the specific implementation is manifested in modifying parameters, switching screens and abnormal situations.

[0032] Preferably, in step S4, when the first sub-step and the stream acquisition sub-step are connected, the stream encoding and decoding information is first obtained from the decoder, and then the cache handle is obtained. After the cache handle is obtained, the most recent I frame and metadata are obtained, and then the relevant data is read, and then the relevant data is sent to the decoding channel and the window number is bound. When it is necessary to stop a certain decoding, it is necessary to unbind. After the unbinding is completed, the display and the decoder are turned off, and then the cache handle is released, and then the cache is released, and finally the camera connection is closed.

[0033] Based on the decoding method of a decoder described above, the present invention also provides a decoding device of a decoder, including an HDMI device, a Display device, a Decoder device connected to a camera, and a control module, wherein the HDMI device, the Display device and the Decoder device are all electrically connected to the control module, and the Display device is used to divide the video recording of the camera stream into multiple sub-screen displays, the Decoder device needs to obtain decoding parameter information from the camera, the number of Decoder devices is equal to the number of pictures, and the control module is used to decompose the decoder decoding process into a decoder main process and a decoder stream extraction process that are independent and non-interfering with each other according to the decoding parameter information of the Decoder device, and then decompose the decoder main process into multiple first sub-steps, and then decompose the decoder extraction process into multiple stream extraction sub-steps, and finally connect the first sub-step and the stream extraction sub-step.

[0034] The decoding method and device of a decoder proposed in the present invention have the following advantages compared with the prior art:

[0035] 1. The present invention decomposes the decoder decoding process into a decoder main process and a decoder stream fetching process which are independent and do not interfere with each other, then decomposes the decoder main process into multiple first sub-steps, then decomposes the decoder fetching process into multiple stream fetching sub-steps, and finally connects the first sub-step with the stream fetching sub-step. Based on the state machine, the present invention abstracts a state machine combination model from complex services, which not only makes the internal mechanism process-oriented, but also makes the services orderly executed according to the designed steps and states, thereby standardizing and simplifying the operation of the entire system, which not only ensures the stability and efficiency of the long-term operation of the system, but also makes the system compatible with various cameras and compatible with various screen layouts and has scalability, and also allows the system to have different sub-processes according to different services and thus has good scalability;

[0036] 2. The decoding device provided in the present invention is a model. Modeling means that the method can be used and reused repeatedly once it is generated. Therefore, it can be used not only for decoder devices, but also for storage devices with decoding output functions, and for streaming media with decoding output functions. It can also be extended to non-decoders and non-decoding systems. As long as the model is suitable, it is very efficient for design, development, and maintenance, and the stability and performance of the product itself are guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a flowchart of the main process of the decoder of the present invention;

[0038] Figure 2 The decoder of the present invention is a flow chart of the process of obtaining the stream;

[0039] Figure 3 This is a flowchart of the connection between the first sub-step and the flow extraction sub-step of the present invention;

[0040] Figure 4 The figure is a flowchart of decoding of a common decoder in the prior art. DETAILED DESCRIPTION

[0041] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0042] The present invention provides Figure 1-3 A decoding method of a decoder shown includes the following steps:

[0043] S1. Decompose the decoder decoding process into a decoder main process and a decoder stream fetching process which are independent and do not interfere with each other; the decoder decoding process is to introduce a state machine into a function, each normal and abnormal state corresponds to a case branch, and the normal and abnormal states can be flexibly set so that the process can be changed at any time.

[0044] The decoder is set as a Decoder device, and needs to be used in conjunction with an HDMI device and a Display device when decoding. The HDMI device is electrically connected to the Display device, and the HDMI device and the Decoder device are both electrically connected to the Display device.

[0045] S2, the main process of the decoder is decomposed into multiple first sub-steps;

[0046] The decoder main process includes the following steps:

[0047] A1. Turn on the HDMI device;

[0048] A2. Turn on the Decoder device;

[0049] A3. Turn on the Display device;

[0050] A4. Bind the decoding channel and window number;

[0051] A5. Send data;

[0052] The data sent is the encoder parameter information obtained from the camera. The Decoder device is a logical concept. Corresponding to each camera, it is the decoding of the camera. The number of Decoder devices is equal to the number of pictures. When the main process of the decoder exits, it is necessary to notify the Decoder device to stop obtaining the stream when releasing resources.

[0053] A6. When the data is sent successfully, the decoding channel and window number are unbound;

[0054] A7. After unbinding successfully, turn off the Display device;

[0055] A8. When the Display device is closed successfully, close the Decoder device;

[0056] A9. After the Decoder device is shut down successfully, shut down the HDMI device.

[0057] In step A1, when the HDMI device is not successfully opened, the HDMI device is turned off; in step A2, when the Decoder device is not successfully opened, the Decoder device is turned off; in step A3, when the Display device is not successfully opened, the Display device is turned off.

[0058] S3, the decoder fetching process is decomposed into multiple fetching sub-steps;

[0059] The decoder stream acquisition process includes the following steps:

[0060] B1. Connect the camera and confirm that it is connected correctly;

[0061] B2. Write the camera data into the cache and confirm that the cache has been written;

[0062] B3. Get the cache handle. After the cache handle is obtained, get the most recent I frame and metadata.

[0063] B4, read the I frame and metadata, and when the I frame and metadata are successfully obtained, start the loop to obtain IPC media data and loop write cache;

[0064] B5. When you need to stop decoding a certain channel, release the cache. When the cache is released, close the camera connection.

[0065] The streaming process contains N repeated split-screen data. The main process of the decoder is the overall control, monitoring and management of various devices, and the streaming process is the data source; the specific implementation is manifested in modifying parameters, switching screens and abnormal situations.

[0066] Among them, modify the parameters: for example, the display has a resolution, and the video encoding collected by the camera also has a resolution. When setting these key parameters, how to control and which process controls it. The display parameters belong to the main process, and the entire screen will be restarted. The modification of the camera parameters only requires restarting the corresponding stream acquisition process of the camera, and only restarting the sub-screen.

[0067] Switch screen: To change the number of screens, for example, switching from 4-split screen to 9-split screen, you need to restart not only the main process, but also the corresponding camera's streaming process. If you want to adjust the screens of two cameras, for example, when the screen is 4-split, you need to adjust the 1.2 split screen, just switch the 1.2 screen again, just call Figure 1 The sixth step and the fourth step are the two sub-steps.

[0068] Abnormal situation: When the camera goes online or offline, there is basically no impact, only the corresponding sub-screen will pause for a few seconds and then continue to play. If the HDMI interface is loose and there is no picture, re-insert the interface and the picture will immediately recover and continue to play.

[0069] Therefore, the other party's processes are mostly unaware of some operations and abnormalities. Although some operations involve the other party's processes, the few connections are only one-way and do not cause interference or intersection, thus ensuring the simplicity and efficiency of the system.

[0070] S4, connecting the first sub-step and the flow taking sub-step;

[0071] When the first sub-step is connected with the stream acquisition sub-step, first obtain the stream encoding and decoding information from the decoder, then obtain the cache handle, and after the cache handle is obtained, obtain the most recent I frame and metadata, and then read the relevant data, and then send the relevant data to the decoding channel and window number binding. When it is necessary to stop a certain decoding, it needs to be unbound. After the unbinding is completed, turn off the display and decoder, release the cache handle, release the cache, and finally close the camera connection.

[0072] like Figure 3As shown in the figure, the three connecting lines in the middle of the two processes, the upper and lower lines correspond to the simple interaction when the entire system starts and exits, and the middle connecting line is pure data transmission, which is normal and unidirectional. After the stream is taken, the data can be continuously sent to the decoder. Therefore, from the three connecting lines, the coupling is very low, and the three types of connections are all unidirectional. Therefore, from the overall point of view, the processes at both ends run separately, and the data in the middle is simply transmitted. The more pictures supported, the more data is transmitted. The main process is still one, and the camera's stream taking process can be copied. Therefore, the two major processes remain unchanged, and what changes is the amount of data transmitted in the middle. It is similar to a bridge, similar to the H shape. The piers at both ends are two types of large processes, and the channel in the middle is the data channel. The number of channels in the middle depends on the number of current pictures. The two major processes are two efficient state machines, so the entire decoder and decoding system is a three-dimensional layout of a state machine, which is a combination model of a state machine. We call it the state machine H model. The two ends of H represent two types of processes and are independent and non-interfering with each other, while the horizontal line in the middle represents a simple interaction between the two types of processes. A state machine is a mathematical model representing a finite number of states and behaviors such as transitions and actions between these states; therefore, the present invention is an H-type composite model of a state machine in terms of spatial layout.

[0073] By decomposing the decoder decoding process into independent and non-interfering decoder main process and decoder stream fetching process, and then decomposing the decoder main process into multiple first sub-steps, and then decomposing the decoder fetching process into multiple stream fetching sub-steps, and finally connecting the first sub-step and the stream fetching sub-step, based on the state machine, a combination model of state machines is abstracted from complex services, which not only makes the internal mechanism process-oriented, but also enables the service to be executed in an orderly manner according to the designed steps and states, thereby standardizing and simplifying the operation of the entire system, which not only ensures the stability and efficiency of the system for long-term operation, but also makes the system compatible with various cameras and various screen layouts and has scalability, and also allows the system to have different sub-processes according to different services and thus has good scalability.

[0074] Based on the decoding method of a decoder described above, the present invention also provides a decoding device of a decoder, including an HDMI device, a Display device, a Decoder device connected to a camera, and a control module, wherein the HDMI device, the Display device and the Decoder device are all electrically connected to the control module, and the Display device is used to divide the video recording of the camera stream into multiple sub-screen displays, the Decoder device needs to obtain decoding parameter information from the camera, the number of Decoder devices is equal to the number of pictures, and the control module is used to decompose the decoder decoding process into a decoder main process and a decoder stream extraction process that are independent and non-interfering with each other according to the decoding parameter information of the Decoder device, and then decompose the decoder main process into multiple first sub-steps, and then decompose the decoder extraction process into multiple stream extraction sub-steps, and finally connect the first sub-step and the stream extraction sub-step.

[0075] The device is a model. Modeling means that the method can be used repeatedly and reused once it is generated. Therefore, it can be used not only for decoder devices, but also for storage devices with decoding output functions, and for streaming media with decoding output functions. It can also be extended to non-decoder and non-decoding systems. As long as the model is suitable, it is very efficient for design, development, and maintenance, and the stability and performance of the product itself are guaranteed.

[0076] like Figure 4 The process steps of a common decoder in the prior art are shown as follows. The middle step "5. Send data" is the step that runs most of the time, a normal state. Before 5, various devices are initialized, and after 5, various devices are de-initialized, which is a reverse process of the previous initialization.

[0077] HDMI is a display interface, which is a hardware device and an overall output; while display is an image layout, a software device that can be changed and can be divided into many windows or multiple sub-screens, such as 1-split screen, 4-split screen, etc.

[0078] This is a common process. If there are any exceptions in the middle, if it is not well controlled, it will be a disaster for the entire program and the entire system. How to effectively and efficiently control it? Add a state machine. For example, introduce a state in each step, A1~A9, add one for normal steps, and find the corresponding deinitialization step if there is an exception. Please see Figure 1 Note that each node here is a state, rather than combining multiple steps into one function. If you don't use a state machine, Figure 4Steps 1-4 are an initialization function, and steps 5-9 are a deinitialization function. This is too granular and difficult to control. By introducing a state machine, 9 steps can be put into one function, but each normal and abnormal state corresponds to a case branch. The normal and abnormal states can be flexibly set, and the granularity becomes smaller. The granularity is not just 9, but a multiple of 9, and the process can be changed at any time. For example, step 2 will go to step 3 after it is executed under normal circumstances, and will go to step 8 under abnormal circumstances, instead of having to execute all steps 1-9. So from Figure 1 The maximum number of possible sub-processes (sub-branches) can reach 9 factorial without conflicting with each other, and each next step is very clear.

[0079] but Figure 1 Where does the data come from in step "5. Send data"? It comes from the camera. The camera streaming process is shown in Figure 2 , there are also eight steps, and a state machine device is also introduced. With the data, the control of the two processes is as described above: the decoder main process and the decoder stream fetching process.

[0080] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A decoding method of a decoder, Features: The steps include: S1, decomposing the decoder decoding process into a decoder main process and a decoder stream fetching process which are independent and do not interfere with each other; S2, the main process of the decoder is decomposed into multiple first sub-steps; S3, the decoder fetching process is decomposed into multiple fetching sub-steps; S4, connecting the first sub-step and the flow taking sub-step.

2. A decoding method of a decoder according to claim 1, Features: The decoding process of the decoder is to introduce a state machine into a function, each normal and abnormal state corresponds to a case branch, and the normal and abnormal states can be flexibly set so that the process can be changed at any time.

3. The decoding method of a decoder according to claim 2, Features: The decoder is set as a Decoder device, and needs to be used in conjunction with an HDMI device and a Display device when decoding. The HDMI device is electrically connected to the Display device, and the HDMI device and the Decoder device are both electrically connected to the Display device.

4. A decoding method of a decoder according to claim 3, Features: The decoder main process includes the following steps: A1. Turn on the HDMI device; A2. Turn on the Decoder device; A3. Turn on the Display device; A4. Bind the decoding channel and window number; A5. Send data; A6. When you need to stop playing a certain channel or all channels, unbind the decoding channel and window number; A7. After unbinding successfully, turn off the Display device; A8. When the Display device is closed successfully, close the Decoder device; A9. After the Decoder device is shut down successfully, shut down the HDMI device.

5. The decoding method of a decoder according to claim 4, Features: In step A1, when the HDMI device is not successfully opened, the HDMI device is turned off; in step A2, when the Decoder device is not successfully opened, the Decoder device is turned off; in step A3, when the Display device is not successfully opened, the Display device is turned off.

6. A decoding method of a decoder according to claim 5, Features: In step A5, the data sent is the encoder parameter information obtained from the camera. The Decoder device is a logical concept. Corresponding to each camera, it is the decoding of the camera. The number of Decoder devices is equal to the number of pictures. When the main process of the decoder exits, it is necessary to notify the Decoder device to stop obtaining the stream when releasing resources.

7. A decoding method of a decoder according to claim 6, Features: The decoder stream acquisition process includes the following steps: B1. Connect the camera and confirm that it is connected correctly; B2. Write the camera data into the cache and confirm that the cache has been written; B3. Get the cache handle. After the cache handle is obtained, get the most recent I frame and metadata. B4, read the I frame and metadata, and when the I frame and metadata are successfully obtained, start the loop to obtain IPC media data and loop write cache; B5. When you need to stop decoding a certain channel, release the cache. When the cache is released, close the camera connection.

8. A decoding method of a decoder according to claim 7, Features: The streaming process contains N repeated split-screen data. The main process of the decoder is the overall control, monitoring and management of various devices, and the streaming process is the data source; the specific implementation is manifested in modifying parameters, switching screens and abnormal situations.

9. A decoding method of a decoder according to claim 8, Features: Step S4, when the first sub-step and the stream acquisition sub-step are connected, first obtain the stream encoding and decoding information from the decoder, then obtain the cache handle, and after the cache handle is obtained, obtain the most recent I frame and metadata, and then read the relevant data, and then send the relevant data to the decoding channel and window number binding. When it is necessary to stop a certain decoding, it needs to be unbound. After the unbinding is completed, turn off the display and decoder, release the cache handle, release the cache, and finally close the camera connection.

10. A decoding device of a decoder, based on a decoding method of a decoder according to any one of claims 1 to 9, Features: The invention comprises an HDMI device, a Display device, a Decoder device connected to a camera, and a control module. The HDMI device, the Display device and the Decoder device are all electrically connected to the control module, and the Display device is used to divide the video recording obtained by the camera into multiple sub-screens for display. The Decoder device needs to obtain decoding parameter information from the camera. The number of the Decoder devices is equal to the number of the pictures. The control module is used to decompose the decoder decoding process into a decoder main process and a decoder stream obtaining process which are independent and do not interfere with each other according to the decoding parameter information of the Decoder device, and then decompose the decoder main process into multiple first sub-steps, and then decompose the decoder obtaining process into multiple stream obtaining sub-steps, and finally connect the first sub-step and the stream obtaining sub-step.