A software media server and a dual media engine switching control method thereof
By using a dual-media-engine switching control method, the media engine status can be monitored and switched in real time, which solves the server instability problem caused by single-engine failure and improves server stability and business processing flexibility without increasing hardware costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-23
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, media servers with a single media engine need to be restarted when they fail, resulting in poor stability. Furthermore, increasing hardware costs to improve stability is ineffective, and there is a lack of methods for controlling the switching between dual media engines.
A dual-media-engine switching control method is adopted. The media engine control module monitors the status in real time and performs primary/backup switching to ensure that the media server can operate stably for a long time without increasing hardware costs. Efficient switching is achieved by using media engine status query timers and token mechanisms.
It enables efficient and rapid primary/backup switching of media servers, ensuring long-term stable operation of the servers and flexible business processing. It can also automatically reset in the event of engine failure, improving the server's persistent performance.
Smart Images

Figure CN115756971B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of media processing technology, and in particular to a software media server and a dual media engine switching control method thereof. Background Technology
[0002] With the continuous expansion of audio and video conferencing services, customers have increasingly higher requirements for the audio and video transmission performance of media servers in audio and video transmission systems. They demand not only high clarity, high recognizability, and strong real-time performance, but also long-term stable operation of the media server. This poses a new challenge to the performance of media servers with a single media engine. Therefore, some R&D personnel are constantly optimizing media processing algorithms or adopting methods such as increasing memory capacity, replacing hard drives, and upgrading processors to ensure the long-term stable operation of media servers. However, this increases the hardware cost of the media server, and if the media engine in the media server fails, the media server stops working and must be restarted, severely reducing the stability of the media server. Therefore, the use of dual media engines and media engine switching control in software media servers plays a very important role in improving the stability of media servers. However, such technology is currently lacking. Summary of the Invention
[0003] In view of this, the present invention proposes a software media server and its dual media engine switching control method, which can perform real-time, efficient and fast master-slave switching of dual media engines. Without increasing the hardware cost of the software media server, it can ensure the long-term stable operation of the media server and improve the service persistence performance of the media server.
[0004] To achieve the above objectives, the present invention adopts the following technical solution:
[0005] A software media server with dual media engine switching control includes media engine A, media engine B and a media engine control module, with the two media engines operating in a primary / backup mode;
[0006] After the software media server starts normally, it creates three global variables in its memory and starts a media engine status query timer. The three global variables are the primary / standby status value of media engine A, the primary / standby status value of media engine B, and the token slave engine value. The primary / standby status value means 0 - invalid, 1 - primary, 2 - standby, and the token slave engine value means 0 - null, 1 - media engine A, 2 - media engine B. When the token belongs to a media engine, the other media engine cannot be set to the primary state. The media engine status query timer periodically queries the status of the media engines. When a media engine is in an invalid state, the media engine control module triggers the corresponding media engine to reset, ensuring that the media engine is in a working state.
[0007] The media engine control module is used to execute the following programs:
[0008] (1) After the media engine control module is initialized, media engine A is set to the master state and media engine B is set to the backup state. The token belongs to media engine A.
[0009] (2) When business a is established, the main media engine A is selected to process the business, and the media engine A is switched to the backup state; the media engine B is set to the main state, and the token belongs to the media engine B.
[0010] (3) Under the premise of step (2), service b is established, media engine B is in the master state, processes the service, and the token subordinate value is set to Null;
[0011] (4) Under the premise of step (2) or step (3), service a ends, media engine A is in an invalid state, the media engine status query timer queries and resets, and related resources are reclaimed;
[0012] (5) Under the premise of step (3), if service b ends and service a exists on media engine A, then media engine A is still in standby state and media engine B is still in master state, and the token slave value is Null.
[0013] (6) Under the premise of step (4), after media engine A is successfully reset, if media engine B has established a service, then media engine A is set to the primary state and media engine B is set to the backup state, and the token belongs to media engine A; otherwise, media engine A is set to the backup state, and the state and token belonging value of media engine B remain unchanged.
[0014] (7) When a media engine fails, the failed media engine is set to an invalid state, and the other media engine is set to the master state. The master media engine establishes resources and processes business. When the master media engine has not processed any business, the token belongs to the master media engine; otherwise, the token's belonging value is Null.
[0015] (8) When the media engine malfunctions and the media engine status query timer finds that the media engine is in an invalid state, the media control module triggers the media engine to reset and enter the working state.
[0016] A dual-media engine switching control method for a software media server, wherein the software media server includes media engine A, media engine B, and a media engine control module, and the two media engines operate in a primary / standby mode; the method includes the following steps:
[0017] (1) After the software media server starts normally, it creates three global variables in its memory and starts a media engine status query timer. The three global variables are the main / standby status value of media engine A, the main / standby status value of media engine B, and the token slave engine value. The main / standby status value means 0-invalid, 1-main, 2-standby. The token slave engine value means 0-Null, 1-media engine A, 2-media engine B. When the token belongs to a certain media engine, the other media engine cannot be set to the main state. The media engine status query timer periodically queries the status of the media engine. When the media engine is in an invalid state, the media engine control module triggers the corresponding media engine to reset, ensuring that the media engine is in a working state.
[0018] (2) After the media engine control module is initialized, media engine A is set to the master state and media engine B is set to the backup state. The token belongs to media engine A.
[0019] (3) When business a is established, the main media engine A is selected to process the business, and the media engine A is switched to the backup state; the media engine B is set to the main state, and the token belongs to the media engine B.
[0020] (4) Under the premise of step (3), service b is established, media engine B is in the master state, processes the service, and the token subordinate value is set to Null;
[0021] (5) Under the premise of step (3) or step (4), service a ends, media engine A is in an invalid state, the media engine status query timer is queried and reset, and related resources are reclaimed;
[0022] (6) Under the premise of step (4), if service b ends and service a exists on media engine A, then media engine A is still in standby state and media engine B is still in master state, and the token slave value is Null.
[0023] (7) Under the premise of step (5), after media engine A is successfully reset, if media engine B has established a service, then media engine A is set to the primary state and media engine B is set to the backup state, and the token belongs to media engine A; otherwise, media engine A is set to the backup state, and the state and token belonging value of media engine B remain unchanged.
[0024] (8) When a media engine fails, the failed media engine is set to an invalid state, and the other media engine is set to the master state. The master media engine establishes resources and processes business. When the master media engine has not processed any business, the token belongs to the master media engine; otherwise, the token's belonging value is Null.
[0025] (9) When the media engine malfunctions and the media engine status query timer finds that the media engine is in an invalid state, the media control module triggers the media engine to reset and enter the working state.
[0026] The beneficial effects of adopting the above technical solution are as follows:
[0027] 1. This invention implements a primary / backup switching control function for dual media engines, enabling real-time monitoring of the media engine's operating status and efficient, rapid switching between the two media engines. Furthermore, the backup media engine can acquire the right to reset after processing its business, and the reset of the backup media engine has no impact on the primary media engine or the media server.
[0028] 2. This invention uses a dual-media engine software for switching control, which can ensure the long-term stable operation of the media server without increasing the hardware cost of the software media server. Compared with a single media engine, the dual-engine software media server has more flexible business processing. When one of the media engines fails or has resource leakage, the media control module can trigger the media engine to reset and enter a working state, so that the dual-media engine server can continue to work, greatly improving the working persistence performance of the software media server. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the structure of the software media server in an embodiment of the present invention.
[0030] Figures 2-5 This is a media engine state diagram using the dual media engine switching control method of the present invention. Detailed Implementation
[0031] The present invention will now be described in detail with reference to the accompanying drawings.
[0032] A software media server with dual media engine switching control is disclosed. This software media server uses dual software media engines for switching control, which can ensure long-term stable operation of the media server without increasing the hardware cost of the software media server. Compared with a single media engine, the software media server has more flexible business processing.
[0033] like Figure 1 As shown, the software media server consists of a media engine control module and a primary and backup dual media engine. The engine switching control method is applied to the media engine control module. The primary media engine processes the business, and the backup media engine can be reset after processing the business. The reset of the backup media engine has no impact on the primary media engine and the media server.
[0034] The dual media engine switching control method of the software media server includes the following steps:
[0035] (1) After the software media server starts normally, it creates three global variables in its memory and starts a media engine status query timer. The three global variables are the main / standby status value of media engine A, the main / standby status value of media engine B, and the token slave engine value. The main / standby status values are 0-invalid, 1-main, and 2-standby, respectively. The token slave engine value is 0-Null, 1-media engine A, and 2-media engine B. When the token belongs to a certain media engine, the other media engine cannot be set to the main state. The media engine status query timer will periodically query the status of the media engine. When the media engine is in an invalid state, the media control module triggers the corresponding media engine to reset, ensuring that the media engine is in a working state.
[0036] (2) The software media server media engine control module is initialized, setting media engine A to the primary state and media engine B to the backup state, with the token subordinate to media engine A; see attached. Figure 2 As shown;
[0037] (3) When service a is established, media engine A is selected to process the service. Media engine A is switched to standby mode, media engine B is set to primary mode, and the token belongs to media engine B; see attached. Figure 3 As shown;
[0038] (4) Under the premise of step (3), service b is established, media engine B is selected to process the service, service a exists on media engine A, media engine B remains in the master state, and the token slave value is set to null; as shown in the appendix. Figure 4 As shown;
[0039] (5) Under the premise of step (3) or step (4), service a ends, media engine A is set to invalid state, and waits for reset;
[0040] (6) Under the premise of step (4), if service b ends and service a still exists on media engine A, then media engine A remains in standby mode, media engine B remains in master mode, and the token slave value is Null; as shown in the appendix. Figure 5 As shown;
[0041] (7) Under the premise of step (5), after media engine A is successfully reset, if media engine B has established a service, then media engine A is set to the primary state and media engine B is set to the backup state, and the token belongs to media engine A; otherwise, media engine A is set to the backup state, and everything else remains unchanged.
[0042] (8) When a media engine fails, the failed media engine is set to an invalid state, and the other media engine is set to the master state. The master media engine establishes resources and processes business. If the master media engine has not processed business before, the token belongs to the master media engine; otherwise, the token's belonging value is Null.
[0043] (9) When a media engine fails and the media engine status query timer finds that it is in an invalid state, the media control module triggers the media engine to reset and enter the working state (main state or standby state).
[0044] In summary, this invention ensures the long-term stable operation of the media server without increasing its cost. Compared to a single media engine, the dual-engine software media server offers more flexible business processing. Furthermore, if one media engine malfunctions or experiences resource leakage, the media control module can trigger a reset of that engine, allowing it to return to a working state. The dual-engine server can continue operating, significantly improving the sustained performance of the media server.
[0045] It should be noted that any modifications, equivalent substitutions, improvements, etc., made outside the spirit and principles of this invention are included within the scope of protection of this invention.
Claims
1. A software media server with dual media engine switching control, characterized in that, It includes Media Engine A, Media Engine B, and Media Engine Control Module. The two media engines work in a primary / backup mode. After the software media server starts normally, it creates three global variables in its memory and starts a media engine status query timer. The three global variables are the primary / standby status value of media engine A, the primary / standby status value of media engine B, and the token slave engine value. The primary / standby status value means 0 - invalid, 1 - primary, 2 - standby, and the token slave engine value means 0 - null, 1 - media engine A, 2 - media engine B. When the token belongs to a media engine, the other media engine cannot be set to the primary state. The media engine status query timer periodically queries the status of the media engines. When a media engine is in an invalid state, the media engine control module triggers the corresponding media engine to reset, ensuring that the media engine is in a working state. The media engine control module is used to execute the following programs: (1) After the media engine control module is initialized, media engine A is set to the master state and media engine B is set to the standby state. The token belongs to media engine A. (2) When business a is established, select the main media engine A to process the business, and switch the media engine A to the backup state at the same time. Media engine B is set to the master state, and the token belongs to media engine B. (3) Under the premise of step (2), service b is established, media engine B is in the master state, processes the service, and the token subordinate value is set to Null; (4) Under the premise of step (2) or step (3), service a ends, media engine A is in an invalid state, the media engine status query timer queries and resets, and related resources are reclaimed; (5) Under the premise of step (3), if service b ends and service a exists on media engine A, then media engine A is still in standby state and media engine B is still in master state, and the token slave value is Null. (6) Under the premise of step (4), after media engine A is successfully reset, if media engine B has established a service, then media engine A is set to the master state and media engine B is set to the backup state, and the token belongs to media engine A. Otherwise, media engine A is set to standby state, while the state and token subordination value of media engine B remain unchanged; (7) When a media engine fails, the failed media engine is set to an invalid state, and the other media engine is set to the primary state. The primary media engine establishes resources and processes business. When the main media engine has not processed any business, the token belongs to the main media engine; otherwise, the token's ownership value is null. (8) When the media engine malfunctions and the media engine status query timer finds that the media engine is in an invalid state, the media control module triggers the media engine to reset and enter the working state.
2. A dual-media engine switching control method for software media servers, characterized in that, The software-oriented media server includes media engine A, media engine B, and a media engine control module, with the two media engines operating in a primary / standby mode; the method includes the following steps: (1) After the software media server starts normally, it creates three global variables in its memory and starts a media engine status query timer. The three global variables are the main / standby status value of media engine A, the main / standby status value of media engine B, and the token slave engine value. The main / standby status value means 0-invalid, 1-main, 2-standby. The token slave engine value means 0-Null, 1-media engine A, 2-media engine B. When the token belongs to a certain media engine, the other media engine cannot be set to the main state. The media engine status query timer periodically queries the status of the media engine. When the media engine is in an invalid state, the media engine control module triggers the corresponding media engine to reset, ensuring that the media engine is in a working state. (2) After the media engine control module is initialized, media engine A is set to the master state and media engine B is set to the backup state. The token belongs to media engine A. (3) When business a is established, the main media engine A is selected to process the business, and the media engine A is switched to the backup state; the media engine B is set to the main state, and the token belongs to the media engine B. (4) Under the premise of step (3), service b is established, media engine B is in the master state, processes the service, and the token subordinate value is set to Null; (5) Under the premise of step (3) or step (4), service a ends, media engine A is in an invalid state, the media engine status query timer is queried and reset, and related resources are reclaimed; (6) Under the premise of step (4), if service b ends and service a exists on media engine A, then media engine A is still in standby state and media engine B is still in master state, and the token slave value is Null. (7) Under the premise of step (5), after media engine A is successfully reset, if media engine B has established a service, then media engine A is set to the primary state and media engine B is set to the backup state, and the token belongs to media engine A; otherwise, media engine A is set to the backup state, and the state and token belonging value of media engine B remain unchanged. (8) When a media engine fails, the failed media engine is set to an invalid state, and the other media engine is set to the master state. The master media engine establishes resources and processes business. When the master media engine has not processed any business, the token belongs to the master media engine; otherwise, the token's belonging value is Null. (9) When the media engine malfunctions and the media engine status query timer finds that the media engine is in an invalid state, the media control module triggers the media engine to reset and enter the working state.
Citation Information
Patent Citations
Slice storage and streaming service method for stream media system and multimedia files
CN101127898A
Media service backup method and system
CN104980693A