Streaming media seamless updating method and device
By storing session information into shared memory during streaming update and duplicating subprocesses, inter-process communication is used to achieve smooth updates and seamless transfer of streaming media, the problem of access interruption in streaming media updates is solved, and user experience and system stability are improved.
Patent Information
- Application Number
- CN202510760553.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2045-06-09
AI Technical Summary
In the prior art, the old process needs to be stopped and the new process is started during the streaming media update process, resulting in access interruptions and delays, affecting the user experience.
By storing the session information of the current total process into shared memory, replicating the child process and starting a new process, initializing the configuration information, and seamless transfer of sessions through inter-process communication, monitoring the shared memory load and determining migration priorities, ensuring smooth updates of streaming media.
It realizes seamless transfer during streaming media update process, improves user experience and system stability, and avoids service interruptions and delays.
Smart Images

Figure CN120281752A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method and device for seamless update of streaming media. Background Art
[0002] In the prior art, streaming media is a technology and process in which a series of media data is compressed and then sent in segments over the Internet, enabling real-time transmission of audio and video for users to watch. The forms of streaming media are diverse, including video streams, audio streams, text streams, image streams, and animation streams.
[0003] During the transmission of streaming media, protocols need to be processed, and during its operation, it is necessary to continuously receive and send audio and video streams, and may also need to process audio and video streams. The process is relatively complex. In the operating environment of streaming media, most service processes are multi-process and multi-threaded. As a result, during the update of streaming media, it is necessary to first stop the old process and start a new process, which may result in a long interruption in access, causing a large delay in request services and reducing the user experience. Summary of the Invention
[0004] Aiming at the problems in the prior art, this application provides a method and device for seamless update of streaming media, which can effectively solve the deficiencies in the prior art such as the need to wait during the update of streaming media and the inability to achieve seamless update, significantly improve the smooth update of processes and the seamless transfer of sessions, and improve the stability and user experience during the update of streaming media.
[0005] To solve at least one of the above problems, this application provides the following technical solutions: In a first aspect, this application provides a method for seamless update of streaming media, including: Storing the session information of the current total process in the shared memory. When a preset update signal is received, replicating any subprocess in the current total process, starting a new process in the subprocess, and passing the configuration information of the current total process to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control symbol; Controlling the new process to perform initialization actions based on the configuration information, and replicating the subprocesses included in the new process so that each subprocess in the new process inherits the configuration information of the new process; Sending a session transfer instruction to each subprocess of the total process through an inter-process communication method. The session transfer instruction is used to notify the total process to start transferring the session, and the session transfer instruction includes all the new process control symbols in the new process; Based on the new process control symbol, match the total process control symbol with the new process control symbol to obtain pairing information, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the category weights corresponding to each preset streaming media category, determine the migration priorities of each streaming media included in the current shared memory based on the real-time load information and the category weights, migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, and exit the total process.
[0006] Further, it also includes: when the total process receives a preset update signal, interrupt the current total process; Clone the subprocess of any total process through a preset cloning function, and start the subprocess as a new process through a preset execution function and the execution parameters corresponding to the preset execution function.
[0007] Further, it also includes: when the total process receives a transfer session instruction, circularly match the total process control symbols corresponding to each subprocess in the total process with the new process control symbols corresponding to each subprocess in the new process to obtain pairing information; After matching the total process control symbol with the new process control symbol based on the new process control symbol to obtain pairing information, it also includes: Control each subprocess in the total process to transfer the socket connection to each subprocess in the new process through a preset message sending function.
[0008] Further, before migrating the streaming media in the total process to the new process according to the migration priorities and the pairing information, it also includes: Set the session state of the total process to a paused session state; After migrating the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, it also includes: After each subprocess in the new process finishes receiving the corresponding streaming media in the shared memory, set the session state of the new process to a start session state.
[0009] Further, it also includes: close the sockets of each subprocess in the total process corresponding to each subprocess in the new process, and send an exit notification; When the total process reclaims the resources of each subprocess in the total process, exit the total process.
[0010] Further, after controlling the new process to perform an initialization action based on the configuration information, it also includes: Obtain the old subprocess number of the subprocesses included in the total process and the new subprocess number of the subprocesses included in the new process; Compare the old subprocess number and the new subprocess number, and when the old subprocess number is the same as the new subprocess number, perform the step of sending a transfer session instruction to each subprocess of the total process; When the number of old child processes is different from the number of new child processes, stop the update and generate an alarm log.
[0011] Furthermore, it further includes: inputting the real-time load information into a pre-trained historical load machine learning model to dynamically adjust the current weight coefficients of each preset influencing factor based on the real-time load information through the historical load machine learning model, where the preset influencing factors include latency tolerance, throughput, and status complexity; Perform a weighted average on each current weight coefficient and the type weight, sort the results of the weighted average from high to low to obtain the migration priorities of each corresponding streaming media from high to low.
[0012] In a second aspect, the present application provides a streaming media seamless update device, including: A configuration module for storing the session information of the current total process in the shared memory, replicating any child process in the current total process when receiving a preset update signal, starting a new process in the child process, and passing the configuration information of the current total process to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control symbol; A replication module for controlling the new process to perform initialization actions based on the configuration information, replicating the child processes included in the new process so that each child process in the new process inherits the configuration information of the new process; A start module for sending a transfer session instruction to each child process of the total process through an inter-process communication method, where the transfer session instruction is used to notify the total process to start transferring the session, and the transfer session instruction includes all the new process control symbols in the new process; A transfer module for matching the total process control symbol with the new process control symbol based on the new process control symbol to obtain pairing information, monitoring the real-time load of the shared memory, determining the real-time load information of the shared memory and the type weights corresponding to each preset streaming media type, determining the migration priorities of each streaming media included in the current shared memory based on the real-time load information and the type weights, migrating the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, and exiting the total process.
[0013] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the program, it implements the steps of the streaming media seamless update method.
[0014] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the streaming media seamless update method.
[0015] Fifth aspect, the present application provides a computer program product, including computer programs / instructions, which implement the steps of the seamless update method for streaming media when executed by a processor.
[0016] As can be seen from the above technical solutions, the present application provides a seamless update method and device for streaming media. By innovatively storing the session information of the current total process in the shared memory, when a preset update signal is received, any subprocess in the total process is replicated, and a new process is started in this subprocess. At the same time, the configuration information of the total process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control flag, enabling the new process to quickly take over the tasks of the current total process, achieve smooth update, and avoid service interruption caused by update. The new process completes initialization according to the configuration information and replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. A transfer session instruction is sent to each subprocess of the total process through inter-process communication, and the total process starts to transfer the session. Among them, the transfer session instruction includes all the new process control flags in the new process. According to the new process control flags, the total process control flag is matched with the new process control flags to obtain pairing information, enabling the seamless transfer of the session between the total process and the new process and ensuring the continuity of user operations. Monitor the real-time load of the shared memory, determine the real-time load information and the type weights corresponding to each preset streaming media type, determine the migration priorities of each streaming media in the current shared memory according to the real-time load information and the type weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information and then exit the total process. This method effectively solves the deficiencies of traditional technologies that need to wait during the streaming media update process and cannot achieve seamless update, significantly improves the smooth update of the process and the seamless transfer of the session, and improves the stability and user experience during the streaming media update process. Description of the Drawings
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0018] Figure 1 It is a flowchart of the seamless update method for streaming media in the embodiments of the present application; Figure 2 It is a structural diagram of the seamless update device for streaming media in the embodiments of the present application; Figure 3 It is a structural diagram of the electronic device in the embodiments of the present application.
[0019] Reference Signs: Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. Detailed implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the accompanying drawings in the embodiments of this application. Apparently, the described embodiments are some but not all of the embodiments of this application. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
[0021] In the technical solutions of this application, the acquisition, storage, use, processing, etc. of data all comply with the relevant regulations of national laws and regulations.
[0022] Considering the problems existing in the prior art, this application provides a method and device for seamless update of streaming media. By innovatively storing the session information of the current total process in the shared memory, when a preset update signal is received, any subprocess in the total process is replicated, and a new process is started in this subprocess. At the same time, the configuration information of the total process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control flag, enabling the new process to quickly take over the tasks of the current total process, achieve smooth update, and avoid service interruption caused by update. The new process completes initialization according to the configuration information and replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. A transfer session instruction is sent to each subprocess of the total process through inter-process communication, and the transfer of the session starts through the total process. Among them, the transfer session instruction includes all the new process control flags in the new process. According to the new process control flags, the total process control flag is matched with the new process control flags to obtain pairing information, enabling the seamless transfer of the session between the total process and the new process and ensuring the continuity of user operations. Monitor the real-time load of the shared memory, determine the real-time load information and the type weights corresponding to each preset streaming media type, determine the migration priority of each streaming media in the current shared memory according to the real-time load information and the type weights, and migrate the streaming media in the shared memory to the new process according to the migration priority and the pairing information and then exit the total process.
[0023] In order to effectively solve the deficiencies of traditional technologies, such as the need to wait during the streaming media update process and the inability to achieve seamless updates, significantly improve the smooth update of the process and the seamless transfer of sessions, and enhance the stability and user experience during the streaming media update process, this application provides an embodiment of a streaming media seamless update method. Refer to Figure 1 , the streaming media seamless update method specifically includes the following content: Step S101: Store the session information of the current total process in the shared memory. When a preset update signal is received, replicate any subprocess in the current total process, and start a new process in the subprocess, and transfer the configuration information of the current total process to the new process.
[0024] Among them, the configuration information includes configuration data, a shared memory handle, and a total process control flag.
[0025] Optionally, in this embodiment, the session information of the current total process is stored in the shared memory. Among them, the shared memory is an efficient inter-process communication mechanism that allows multiple processes to access the same memory area, enabling the session information not to be lost during the process update and can be quickly accessed by the new process in the shared memory.
[0026] When a preset update signal is received, replicate any subprocess in the current total process. Among them, the preset update signal can be the SIGUSER2 signal. During the process of starting the new process, transfer the configuration information of the current total process to the new process. Among them, the configuration information includes configuration data, a shared memory handle, and a total process control flag. The configuration data are various parameters and settings required for the new process to run. The shared memory handle is used to access the shared memory storing the session information, and the total process control flag is used for process control and synchronization.
[0027] This embodiment realizes replicating the subprocess and starting a new process, and at the same time transfers the configuration information, enabling the new process to quickly take over the current task, achieve smooth update, and avoid service interruption caused by the update.
[0028] Step S102: Control the new process to perform initialization actions based on the configuration information, and replicate the subprocesses included in the new process, so that each subprocess in the new process inherits the configuration information of the new process.
[0029] Optionally, in this embodiment, the new process receives the configuration information and performs initialization actions according to the configuration information. Among them, the initialization process may include but is not limited to setting the running environment and loading necessary resources. After the initialization is completed, the new process replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. It can be considered that the new version of the program has been started at this time.
[0030] This embodiment realizes the initialization of a new process, enabling the new process to smoothly take over the sessions and corresponding session information of the total process.
[0031] Step S103: Send a session transfer instruction to each subprocess of the total process through inter-process communication. The session transfer instruction is used to notify the total process to start transferring sessions, and all new process control characters in the new process are included in the session transfer instruction.
[0032] Optionally, in this embodiment, a session transfer instruction is sent to each subprocess of the total process through inter-process communication (IPC). The session transfer instruction is used to notify the total process to start transferring sessions, and all new process control characters in the new process are included in the session transfer instruction. The IPC mechanism can be implemented in various ways, such as pipes, message queues, or sockets.
[0033] This embodiment realizes sending a session transfer instruction to the total process after the initialization of the new process, notifying the total process to start transferring sessions through the session transfer instruction, and being able to transfer the new process control characters to the total process.
[0034] Step S104: Based on the new process control characters, match the total process control characters with the new process control characters to obtain pairing information, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the type weights corresponding to each preset streaming media type, determine the migration priorities of each streaming media included in the current shared memory based on the real-time load information and type weights, migrate the streaming media in the shared memory to the new process according to the migration priorities and pairing information, and exit the total process.
[0035] Optionally, in this embodiment, based on the new process control characters, match the total process control characters with the new process control characters to obtain pairing information. At the same time, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the type weights corresponding to each preset streaming media type, which can be implemented through the management mechanism of the shared memory. For example, use shmget (a call function for creating or obtaining a shared memory segment) and shmat (a call function for attaching a shared memory segment to the address space of the calling process) to call and manage the shared memory.
[0036] According to the real-time load information and type weights, determine the migration priorities of each streaming media included in the current shared memory. Migrate the streaming media in the shared memory to the new process according to the migration priorities and pairing information. During the migration process, a signal mechanism can be used to synchronize the operations between processes to ensure the consistency and integrity of the data.
[0037] After the streaming media migration is completed, exit the total process, that is, the new process has taken over all session information and streaming media data and can smoothly switch from the old version to the new version.
[0038] This embodiment realizes monitoring the load of the shared memory and determining the migration priority, enabling the streaming media technology to migrate reasonably according to the current state, avoiding resource waste, and improving the operation efficiency.
[0039] Furthermore, before storing the session information of the current total process in the shared memory, modify the file name of the executable program file corresponding to the total process, and store the executable program file of the new process in the specified directory.
[0040] Among them, for example, if the file name of the executable program file of the total process is sever, the modified file name can be sever.old.
[0041] Even further, the total process is the parent process of the child processes included in the total process, and there are multiple child processes included in the total process.
[0042] This embodiment realizes replicating the child process and starting a new process, and at the same time passing the configuration information, enabling the new process to quickly take over the current session, realizing smooth update, avoiding service interruption caused by the update, enabling seamless transfer of the session between the total process and the new process by sending a transfer session instruction and matching control characters, ensuring the coherence of user operations, and at the same time monitoring the real-time load of the shared memory to determine the migration priority, enabling the streaming media data to migrate reasonably according to the current state, avoiding wasting resources, and improving the operation efficiency.
[0043] In some embodiments, when receiving a preset update signal, replicating any child process in the current total process and starting a new process in the child process includes: When the total process receives the preset update signal, interrupt the current total process; Replicate any child process of the total process through a preset replication function, and start the child process as a new process through a preset execution function and the execution parameters corresponding to the preset execution function.
[0044] Optionally, in this embodiment, when the total process receives the preset update signal, the current total process is interrupted. Among them, the preset update signal can be the SIGUSR2 signal. Among them, the SIGUSR2 signal is an asynchronous notification mechanism used to transmit events and information between processes or between the operating system and processes. When the total process receives the preset update signal, a signal processing function can be triggered, and the signal processing function is used to interrupt the execution of the current total process.
[0045] In addition, any subprocess in the total process is replicated through a preset replication function. The preset replication function can be the fork() function. The fork() function can create a subprocess, which is a copy of the parent process and has the same code segment, data segment, and stack. When replicating the subprocess, a new memory block and kernel data structure are allocated for the subprocess, and part of the content of the data structure of the parent process is copied into the subprocess.
[0046] Furthermore, in the subprocess, the subprocess is started as a new process through a preset execution function and the execution parameters corresponding to the preset execution function. The preset execution function can be the exec() function. The exec() function can replace the code segment, data segment, and stack of the current process with the content of a new program, thereby realizing the update of the process.
[0047] For example, the execl() function can be used to start a new process. The execl() function can load the executable file under the specified path and transfer the control right to this file.
[0048] Further, when starting a new process, the configuration information of the total process is passed to the new process. The configuration information includes configuration data, shared memory handles, and the total process control flag. These configuration information can be passed through environment variables, command-line parameters, or files. For example, the configuration information can be passed as a command-line parameter to the exec() function, or the configuration information can be stored through shared memory for access by the new process.
[0049] This embodiment realizes that by replicating the subprocess and starting a new process, and at the same time passing the configuration information, it ensures that the new process can quickly take over the current task, realizes smooth update, and avoids service interruption caused by the update.
[0050] In some embodiments, based on the new process control flag, the total process control flag is matched with the new process control flag to obtain pairing information, including: In the case that the total process receives a transfer session instruction, the total process control flags corresponding to each subprocess in the total process are cyclically matched with the new process control flags corresponding to each subprocess in the new process to obtain pairing information; After obtaining the pairing information by matching the total process control flag with the new process control flag based on the new process control flag, it further includes: Controlling each subprocess in the total process to transfer the socket connection to each subprocess in the new process through a preset message sending function.
[0051] Optionally, when the main process receives a transfer session instruction, in the main process, the main process control symbols corresponding to each subprocess are cyclically matched with the new process control symbols corresponding to each subprocess in the new process obtained through the transfer session instruction, that is, the main process control symbols corresponding to the subprocesses in the main process are compared one by one with the new process control symbols of the subprocesses in the new process to obtain matching pairing information, and the pairing information is used to represent the matching relationship between the subprocess of the main process and the subprocess of the new process, that is, the relationship that can perform socket connection transfer operations.
[0052] Among them, the process identifier (PID) is the identity identifier of each process, which is automatically generated and has uniqueness, persistence, and immutability. During the matching process, different subprocesses are accurately identified and distinguished through the uniqueness of the process identifier.
[0053] Further, after the main process receives the transfer session instruction of the new process, it can cyclically select the subprocesses of the main process and the subprocesses of the new process to perform the work of pairing transfer sessions, and send a session transfer instruction to the subprocesses in the main process. The session transfer instruction includes the new process control symbols of the subprocesses of the new process.
[0054] In addition, after matching the main process control symbols and the new process control symbols according to the new process control symbols to obtain the pairing information, control each subprocess in the main process to transfer the socket connection to the corresponding subprocess in the new process through a preset send message function, so that the subprocess of the new process takes over the session task corresponding to the subprocess of the main process.
[0055] Among them, socket connection transfer involves the transfer of file descriptors. The preset send message function can send the socket file descriptor corresponding to the subprocess in the main process to the corresponding subprocess in the new process through a call or a specific communication mechanism to complete the socket connection transfer.
[0056] Further, during the process of transferring sessions between the main process and the new process, the control of the process and the allocation of resources can be achieved through the process control block. The process control block is a data structure used to manage and control processes, including but not limited to process status, program counter, data register, process scheduling information, and process identifier.
[0057] In addition, during the process of cyclic matching and transfer sessions, the synchronization problems brought by concurrent operations can be considered, that is, the operating system may use synchronization mechanisms such as locks and semaphores to ensure the correctness and consistency of the matching and transfer operations, and avoid data competition or resource conflicts.
[0058] This embodiment realizes that by transferring the socket connection from the main process to a new process, resources can be more reasonably allocated. The new process can improve the resource utilization efficiency according to its own resource requirements and processing capabilities. At the same time, allowing the transfer of socket connections between processes can more flexibly adjust the real-time load of the process. When expanding or optimizing, part of the connections can be conveniently migrated to the new process without restarting the entire program or making complex configuration adjustments. And in the case where the main process has problems or needs maintenance, the socket connection can be transferred to the new process, thus avoiding network service interruption caused by the failure of a single process and improving stability and reliability.
[0059] In some embodiments, before migrating the streaming media in the main process to the new process according to the migration priority and pairing information, it further includes: Setting the session state of the main process to the paused session state; After migrating the streaming media in the shared memory to the new process according to the migration priority and pairing information, it further includes: After each subprocess in the new process finishes receiving the corresponding streaming media in the shared memory, setting the session state of the new process to the start session state.
[0060] Optionally, before migrating the streaming media in the main process to the new process according to the migration priority and pairing information, this embodiment sets the session state of the main process to the paused session state. In order to avoid the streaming media data in the main process from being continuously processed or modified during the migration process, thus ensuring the consistency and integrity of the data during the migration process. By pausing the session state, the streaming media data can be in a relatively stable state during the migration process, avoiding problems such as migration failure or data inconsistency caused by the dynamic change of the data.
[0061] In addition, after migrating the streaming media in the shared memory to the new process according to the migration priority and pairing information, when the subprocesses in the new process complete the reception of the corresponding streaming media in the shared memory, after the reception is completed, the session state of the new process is set to the start session state, indicating that the new process has officially taken over the processing work of the streaming media and starts to normally process and transmit the streaming media. By setting the session state to the start session state, the new process can timely respond to external requests and ensure the continuity and stability of the streaming media service.
[0062] Among them, the migration priority can be comprehensively evaluated based on multi-dimensional factors such as the importance and urgency of the streaming media. The streaming media with a higher migration priority is migrated first to ensure the timeliness and integrity of key data. The pairing information is used to represent the corresponding relationship between the subprocesses of the main process and the subprocesses of the new process, so that the streaming media can be accurately migrated from the subprocesses of the main process to the corresponding subprocesses of the new process.
[0063] In this embodiment, the session state of the total process is set to the suspended session state before migration, which can effectively avoid the dynamic changes of data during migration, ensure the consistency and integrity of the migrated data, reduce errors and problems caused by data inconsistency, improve reliability and stability. After migration is completed, the session state of the new process is set to the start session state, enabling the new process to take over the processing work of the streaming media in a timely manner, so that users can hardly feel the interruption of the service during migration, improving the user experience.
[0064] In some embodiments, exiting the total process includes: Closing the sockets of each subprocess in the total process corresponding to each subprocess in the new process and sending an exit notice; When the total process reclaims the resources of each subprocess in the total process, the total process exits.
[0065] Optionally, before exiting the total process in this embodiment, the sockets of each subprocess in the total process corresponding to each subprocess in the new process are closed. Among them, the socket is an important resource for network communication. If it is not closed correctly, it may lead to resource leakage or communication anomalies.
[0066] In addition, after closing the socket, an exit notice is sent to the new process. The exit notice can be a signal, a message, or other forms of communication, used to inform the new process that the total process is about to exit, so that the new process can make corresponding preparations, such as saving the state, cleaning up resources, etc.
[0067] In addition, when the total process reclaims the resources of each subprocess in the total process, it indicates that the total process begins to enter the exit stage. Among them, the resources of the subprocess include but are not limited to memory, file descriptors, sockets, etc. These resources are reclaimed to avoid resource waste and potential resource leakage problems.
[0068] In addition, after determining that the resource recovery of the subprocess is completed, the total process exits. Exiting the total process can release all resources occupied by the total process, including but not limited to closing all open files, releasing memory, etc., thus ensuring the reasonable utilization of resources.
[0069] This embodiment realizes the reasonable allocation and recovery of resources to run other processes or tasks more efficiently, improving performance and stability.
[0070] In some embodiments, after controlling the new process to perform initialization actions based on the configuration information, it further includes: Obtaining the number of old subprocesses included in the total process and the number of new subprocesses included in the new process; Compare the number of old child processes and the number of new child processes. When the number of old child processes is the same as the number of new child processes, perform the step of sending a transfer session instruction to each child process of the total process. When the number of old child processes is different from the number of new child processes, stop the update and generate an alarm log.
[0071] Optionally, in this embodiment, to obtain the number of old child processes of the child processes included in the total process, the number of child processes of the total process can be counted by the command pgrep -P <total process ID> | wc -l, where <total process ID> represents the process ID of the total process, pgrep -P is used to find the process IDs of all child processes of the specified parent process, and wc -l is used to calculate the number of lines, that is, the number of child processes.
[0072] To obtain the number of new child processes of the child processes included in the new process, similarly, the number of child processes of the new process can be counted by the command pgrep -P <new process ID> | wc -l, where <new process ID> is the process ID of the new process.
[0073] In addition, compare the number of old child processes and the number of new child processes. When the number of old child processes is the same as the number of new child processes, it indicates that the number of child processes of the new process is consistent with the number of child processes of the total process. At this time, the step of sending a transfer session instruction to each child process of the total process can be performed to transfer the session state of the child processes of the total process to the new process, so that the new process can normally take over the work of the total process.
[0074] When the number of old child processes is different from the number of new child processes, it indicates that the number of child processes of the new process is inconsistent with the number of child processes of the total process, and there may be some problems, such as the failure to create child processes of the new process or the abnormal exit of child processes of the total process, etc. In this case, to ensure stability and data security, stop the update and generate an alarm log to facilitate timely discovery and solution of problems.
[0075] This embodiment realizes that when the number of old child processes is the same as the number of new child processes, sending a transfer session instruction to each child process of the total process can ensure that the session state of the child processes of the total process can be correctly transferred to the new process, enabling the new process to smoothly take over the work of the total process and maintain normal operation. When the number of old child processes is different from the number of new child processes, stopping the update and generating an alarm log can timely discover the problem that the number of child processes of the new process is inconsistent with the number of child processes of the total process, quickly locate the problem, take corresponding measures to solve it, and avoid the problem from further expanding, thereby ensuring stability and data security.
[0076] In some embodiments, determining the migration priorities of each streaming media included in the current shared memory based on real-time load information and category weights includes: Input the real-time load information into a pre-trained historical load machine learning model to dynamically adjust the current weight coefficients of each preset influencing factor based on the real-time load information through the historical load machine learning model. The preset influencing factors include latency tolerance, throughput, and state complexity; Perform a weighted average on each current weight coefficient and category weight, and sort the results of the weighted average from high to low to obtain the migration priorities corresponding to each streaming media from high to low.
[0077] Optionally, in this embodiment, the real-time load information is input into a pre-trained historical load machine learning model. The historical load machine learning model is trained based on historical load data and can dynamically adjust the current weight coefficients of each preset influencing factor according to the input real-time load information. The preset influencing factors include latency tolerance, throughput, and state complexity. The real-time load information is used to ensure the real-time operating state of each current streaming media, including but not limited to latency, throughput, central processing unit usage, memory usage, etc., and can reflect the current load situation of the streaming media.
[0078] Latency tolerance: It represents the degree of tolerance of the streaming media to latency. Some streaming media, such as real-time video conferencing, are very sensitive to latency, while other streaming media, such as video on demand, have a higher tolerance for latency.
[0079] Throughput: It represents the amount of data transmitted by the streaming media per unit time. Streaming media with high throughput require more bandwidth and processing power.
[0080] State complexity: It represents the complexity of the state information of the streaming media. Streaming media with high state complexity may require more computing resources to process their state information.
[0081] The category weight refers to the weight preset according to the preset streaming media categories of the streaming media. The preset streaming media categories include video streams, audio streams, text streams, etc. Different types of streaming media have different resource requirements and importance, and weighted averaging can be performed according to the category weights.
[0082] In addition, perform a weighted average on each current weight coefficient and category weight to obtain the comprehensive weight of each streaming media. The comprehensive weight represents the importance and resource requirements of the current streaming media at present.
[0083] Furthermore, sort the results of the weighted average (i.e., the above-mentioned comprehensive weight) from high to low to obtain the migration priorities corresponding to each streaming media from high to low. Among them, the streaming media with higher priority will be migrated first so that resources can be preferentially allocated to more important streaming media.
[0084] This embodiment realizes determining the migration priority based on real-time load information and category weights, which can allocate resources more accurately, preferentially migrate high-priority streaming media, ensure the stable operation of critical streaming media, thereby improving the resource allocation efficiency. Dynamically adjusting the weight coefficient can better adapt to the changes in system load, avoid performance bottlenecks caused by unreasonable resource allocation, and improve the performance and user experience of streaming media.
[0085] In order to effectively solve the deficiencies of traditional technologies that need to wait during the update of streaming media and cannot achieve seamless updates, etc., this application provides an embodiment of a streaming media seamless update device for realizing all or part of the content of the seamless update of the streaming media. See Figure 2 , the streaming media seamless update device specifically includes the following content: Configuration module 10, which is used to store the session information of the current total process in the shared memory. When receiving a preset update signal, it replicates any child process in the current total process, starts a new process in the child process, and transfers the configuration information of the current total process to the new process. The configuration information includes configuration data, a shared memory handle, and a total process control flag; Replication module 20, which is used to control the new process to perform initialization actions based on the configuration information, and replicate the child processes included in the new process, so that each child process in the new process inherits the configuration information of the new process; Startup module 30, which is used to send transfer session instructions to each child process of the total process through inter-process communication. The transfer session instructions are used to notify the total process to start transferring the session, and the transfer session instructions include all the new process control flags in the new process; Transfer module 40, which is used to match the total process control flag with the new process control flag based on the new process control flag to obtain pairing information, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the category weights corresponding to each preset streaming media category, determine the migration priority of each streaming media included in the current shared memory based on the real-time load information and category weights, and migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the total process.
[0086] As can be seen from the above description, the streaming media seamless update device provided by the embodiments of the present application can innovatively store the session information of the current total process in the shared memory. When a preset update signal is received, any subprocess in the total process is replicated, and a new process is started in this subprocess. At the same time, the configuration information of the total process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control flag, enabling the new process to quickly take over the tasks of the current total process, achieve smooth update, and avoid service interruption caused by update. The new process completes initialization according to the configuration information and replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. A transfer session instruction is sent to each subprocess of the total process through inter-process communication, and the transfer of the session starts through the total process. Among them, the transfer session instruction includes all the new process control flags in the new process. According to the new process control flags, the total process control flag is matched with the new process control flags to obtain pairing information, enabling the seamless transfer of the session between the total process and the new process and ensuring the continuity of user operations. Monitor the real-time load of the shared memory, determine the real-time load information and the type weights corresponding to each preset streaming media type, determine the migration priorities of each streaming media in the current shared memory according to the real-time load information and the type weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information and then exit the total process. This method effectively solves the deficiencies of traditional technologies in the process of streaming media update, such as the need to wait and the inability to achieve seamless update, significantly improves the smooth update of the process and the seamless transfer of the session, and improves the stability and user experience during the streaming media update process.
[0087] From a hardware perspective, in order to effectively solve the deficiencies of traditional technologies in the process of streaming media update, such as the need to wait and the inability to achieve seamless update, significantly improve the smooth update of the process and the seamless transfer of the session, and improve the stability and user experience during the streaming media update process, the present application provides an embodiment of an electronic device for implementing all or part of the content in the streaming media seamless update method. The electronic device specifically includes the following: A processor, a memory, a communications interface, and a bus; wherein, the processor, the memory, and the communications interface complete communication with each other through the bus; the communications interface is used to implement information transmission between the streaming media seamless update device and related devices such as the core business system, the user terminal, and the related database. The logic controller can be a desktop computer, a tablet computer, a mobile terminal, etc., and this embodiment is not limited thereto. In this embodiment, the logic controller can be implemented with reference to the embodiments of the streaming media seamless update method and the embodiments of the streaming media seamless update device in the embodiments, and the content is incorporated herein, and the repeated parts will not be described again.
[0088] It can be understood that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), an in-vehicle device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, smart watches, smart bracelets, etc.
[0089] In practical applications, part of the streaming media seamless update method may be executed on the side of the electronic device as described above, or all operations may be completed in the client device. Specifically, it can be selected according to the processing capacity of the client device and the limitations of the user usage scenario, etc. This application does not make any limitations in this regard. If all operations are completed in the client device, the client device may further include a processor.
[0090] The above-mentioned client device may have a communication module (i.e., a communication unit), and can communicate with a remote server to realize data transmission with the server. The server may include a server on the side of the task scheduling center. In other implementation scenarios, it may also include a server of an intermediate platform, such as a server of a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or may include a server cluster composed of multiple servers, or a server structure of a distributed device.
[0091] Figure 3 It is a schematic block diagram of the system composition of the electronic device 9600 according to an embodiment of the present application. As Figure 3 shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It should be noted that this Figure 3 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0092] In one embodiment, the function of the streaming media seamless update method may be integrated into the central processing unit 9100. Among them, the central processing unit 9100 may be configured to perform the following controls: Step S101: Store the session information of the current total process in the shared memory. When a preset update signal is received, replicate any subprocess in the current total process, and start a new process in the subprocess, and transfer the configuration information of the current total process to the new process. The configuration information includes configuration data, a shared memory handle, and a total process control symbol; Step S102: Control the new process to perform an initialization action based on the configuration information, and replicate the subprocesses included in the new process, so that each subprocess in the new process inherits the configuration information of the new process; Step S103: Send a transfer session instruction to each subprocess of the master process through inter-process communication. The transfer session instruction is used to notify the master process to start transferring the session, and all new process control characters in the new process are included in the transfer session instruction; Step S104: Based on the new process control characters, match the master process control characters with the new process control characters to obtain pairing information, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the category weights corresponding to each preset streaming media category, determine the migration priorities of each streaming media included in the current shared memory based on the real-time load information and the category weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, and then exit the master process.
[0093] As can be seen from the above description, the electronic device provided in the embodiment of the present application stores the session information of the current master process in the shared memory innovatively. When a preset update signal is received, any subprocess in the master process is replicated, and a new process is started in this subprocess. At the same time, the configuration information of the master process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and master process control characters, enabling the new process to quickly take over the tasks of the current master process, achieving smooth updates, and avoiding service interruptions caused by updates. The new process completes initialization according to the configuration information and replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. A transfer session instruction is sent to each subprocess of the master process through inter-process communication, and the master process starts transferring the session. Among them, the transfer session instruction includes all the new process control characters in the new process. According to the new process control characters, the master process control characters are matched with the new process control characters to obtain pairing information, enabling the seamless transfer of the session between the master process and the new process and ensuring the continuity of user operations. Monitor the real-time load of the shared memory, determine the real-time load information and the category weights corresponding to each preset streaming media category, determine the migration priorities of each streaming media in the current shared memory according to the real-time load information and the category weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information and then exit the master process. This method effectively solves the deficiencies in the traditional technology that need to wait during the streaming media update process and cannot achieve seamless updates, significantly improves the smooth update of the process and the seamless transfer of the session, and improves the stability and user experience during the streaming media update process.
[0094] In another implementation, the streaming media seamless update device can be separately configured from the central processing unit 9100. For example, the streaming media seamless update device can be configured as a chip connected to the central processing unit 9100 to implement the functions of the streaming media seamless update method through the control of the central processing unit.
[0095] Such as Figure 3As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It should be noted that the electronic device 9600 does not necessarily have to include Figure 3 all the components shown in Figure 3 ; in addition, the electronic device 9600 may further include
[0096] As Figure 3 shown, the central processing unit 9100, sometimes also referred to as a controller or operation control, may include a microprocessor or other processor devices and / or logic devices. The central processing unit 9100 receives inputs and controls the operations of the various components of the electronic device 9600.
[0097] Among them, the memory 9140, for example, may be one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. It can store the above information related to failures, and can also store programs for executing relevant information. And the central processing unit 9100 can execute the program stored in the memory 9140 to implement information storage or processing, etc.
[0098] The input unit 9120 provides inputs to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to supply power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.
[0099] The memory 9140 may be a solid-state memory. For example, a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be such a memory that stores information even when powered off, can be selectively erased and has more data. Examples of this type of memory are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, and the application / function storage unit 9142 is used to store application programs and function programs or the processes for operating the electronic device 9600 through the central processing unit 9100.
[0100] The memory 9140 may further include a data storage unit 9143 for storing data such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).
[0101] The communication module 9110 is a transmitter / receiver that transmits and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as in the case of a conventional mobile communication terminal.
[0102] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module, and / or a wireless local area network module, etc. The communication module 9110 (transmitter / receiver) is also coupled to the speaker 9131 and the microphone 9132 via the audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, so as to implement normal telecommunication functions. The audio processor 9130 may include any suitable buffers, decoders, amplifiers, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.
[0103] Embodiments of the present application also provide a computer-readable storage medium capable of implementing all steps of the seamless update method for streaming media with the execution subject being a server or a client in the above embodiments. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, all steps of the seamless update method for streaming media with the execution subject being a server or a client in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented: Step S101: Store the session information of the current total process in the shared memory. When a preset update signal is received, replicate any subprocess in the current total process, and start a new process in the subprocess. Transfer the configuration information of the current total process to the new process. The configuration information includes configuration data, a shared memory handle, and a total process control character. Step S102: Control the new process to perform an initialization action based on the configuration information, and replicate the subprocesses included in the new process, so that each subprocess in the new process inherits the configuration information of the new process. Step S103: Send a transfer session instruction to each subprocess of the master process through inter-process communication. The transfer session instruction is used to notify the master process to start transferring the session. The transfer session instruction includes all new process control characters in the new process. Step S104: Based on the new process control characters, match the master process control characters with the new process control characters to obtain pairing information, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the type weights corresponding to each preset streaming media type, determine the migration priorities of each streaming media included in the current shared memory based on the real-time load information and the type weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, and then exit the master process.
[0104] As can be seen from the above description, the computer-readable storage medium provided by the embodiments of the present application innovatively stores the session information of the current master process in the shared memory. When a preset update signal is received, any subprocess in the master process is replicated, and a new process is started in this subprocess. At the same time, the configuration information of the master process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and master process control characters, enabling the new process to quickly take over the tasks of the current master process, achieve smooth updates, and avoid service interruptions caused by updates. The new process completes initialization according to the configuration information and replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. A transfer session instruction is sent to each subprocess of the master process through inter-process communication to start transferring the session by the master process. The transfer session instruction includes all new process control characters in the new process. Based on the new process control characters, the master process control characters are matched with the new process control characters to obtain pairing information, enabling seamless transfer of the session between the master process and the new process and ensuring the continuity of user operations. Monitor the real-time load of the shared memory, determine the real-time load information and the type weights corresponding to each preset streaming media type, determine the migration priorities of each streaming media in the current shared memory according to the real-time load information and the type weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information and then exit the master process. This method effectively solves the deficiencies of traditional technologies that need to wait during the streaming media update process and cannot achieve seamless updates, significantly improves the smooth update of the process and the seamless transfer of the session, and improves stability and the user experience during the streaming media update process.
[0105] An embodiment of the present application also provides a computer program product capable of implementing all the steps of the streaming media seamless update method with the execution subject being a server or a client in the above embodiments. When the computer program / instructions are executed by a processor, the steps of the streaming media seamless update method are implemented. For example, the computer program / instructions implement the following steps: Step S101: Store the session information of the current total process into the shared memory. When a preset update signal is received, replicate any subprocess in the current total process, start a new process in the subprocess, and transfer the configuration information of the current total process to the new process. The configuration information includes configuration data, a shared memory handle, and a total process control flag. Step S102: Control the new process to perform an initialization action based on the configuration information, and replicate the subprocesses included in the new process so that each subprocess in the new process inherits the configuration information of the new process. Step S103: Send a session transfer instruction to each subprocess of the total process through an inter-process communication method. The session transfer instruction is used to notify the total process to start transferring the session, and the session transfer instruction includes all the new process control flags in the new process. Step S104: Based on the new process control flag, match the total process control flag with the new process control flag to obtain pairing information, monitor the real-time load of the shared memory, determine the real-time load information of the shared memory and the category weights corresponding to each preset streaming media category, determine the migration priorities of each streaming media included in the current shared memory based on the real-time load information and the category weights, and migrate the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, and then exit the total process.
[0106] As can be seen from the above description, the computer program product provided by the embodiments of the present application innovatively stores the session information of the current total process in the shared memory. When a preset update signal is received, any subprocess in the total process is replicated, and a new process is started in this subprocess. At the same time, the configuration information of the total process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control flag, enabling the new process to quickly take over the tasks of the current total process, achieve smooth updates, and avoid service interruptions caused by updates. The new process completes initialization according to the configuration information and replicates its internal subprocesses, enabling each subprocess to inherit the configuration information of the new process. A transfer session instruction is sent to each subprocess of the total process through inter-process communication, and the transfer of the session starts through the total process. Among them, the transfer session instruction includes all the new process control flags in the new process. According to the new process control flags, the total process control flag is matched with the new process control flags to obtain pairing information, enabling the seamless transfer of the session between the total process and the new process and ensuring the continuity of user operations. The real-time load of the shared memory is monitored to determine the real-time load information and the type weights corresponding to each preset streaming media type. According to the real-time load information and the type weights, the migration priorities of each streaming media in the current shared memory are determined, and the streaming media in the shared memory are migrated to the new process according to the migration priorities and the pairing information, and then the total process exits. This method effectively solves the deficiencies of traditional technologies that need to wait during the streaming media update process and cannot achieve seamless updates, significantly improves the smooth update of the process and the seamless transfer of the session, and improves the stability and user experience during the streaming media update process.
[0107] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, apparatus, or computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0108] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (apparatuses), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementing in the process Figure 1 one process or multiple processes and / or blocks Figure 1means for the functions specified in one or more boxes.
[0109] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 means for the functions specified in one or more boxes.
[0110] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one Figure 1 process or more processes and / or boxes Figure 1 means for the functions specified in one or more boxes.
[0111] Specific embodiments are used in the present invention to illustrate the principles and implementation manners of the present invention. The descriptions of the above embodiments are only for helping to understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for seamless update of streaming media, characterized in that, The method includes: Storing the session information of the current total process in the shared memory. When a preset update signal is received, replicating any subprocess in the current total process, starting a new process in the subprocess, and passing the configuration information of the current total process to the new process, where the configuration information includes configuration data, a shared memory handle, and a total process control flag; Controlling the new process to perform an initialization action based on the configuration information, and replicating the subprocesses included in the new process so that each subprocess in the new process inherits the configuration information of the new process; Sending a session transfer instruction to each subprocess of the total process through an inter-process communication method, where the session transfer instruction is used to notify the total process to start transferring the session, and the session transfer instruction includes all the new process control flags in the new process; Based on the new process control flags, matching the total process control flag with the new process control flags to obtain pairing information, monitoring the real-time load of the shared memory, determining the real-time load information of the shared memory and the type weights corresponding to each preset streaming media type, determining the migration priorities of each streaming media included in the current shared memory based on the real-time load information and the type weights, and migrating the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, and then exiting the total process.
2. The method according to claim 1, characterized in that When a preset update signal is received, replicating any subprocess in the current total process and starting a new process in the subprocess includes: Interrupting the current total process when the total process receives a preset update signal; Replicating any subprocess of the total process through a preset replication function, and starting the subprocess as a new process through a preset execution function and the execution parameters corresponding to the preset execution function.
3. The method according to claim 1, characterized in that, Based on the new process control flags, matching the total process control flag with the new process control flags to obtain pairing information includes: When the total process receives the session transfer instruction, circularly matching the total process control flags corresponding to each subprocess in the total process with the new process control flags corresponding to each subprocess in the new process to obtain pairing information; After based on the new process control flags, matching the total process control flag with the new process control flags to obtain pairing information, it further includes: Controlling each subprocess in the total process to transfer the socket connection to each subprocess in the new process through a preset message sending function.
4. The method according to claim 1, wherein Before migrating the streaming media in the total process to the new process according to the migration priorities and the pairing information, it further includes: Setting the session state of the total process to a paused session state; After migrating the streaming media in the shared memory to the new process according to the migration priorities and the pairing information, it further includes: When each subprocess in the new process finishes receiving the corresponding streaming media in the shared memory, setting the session state of the new process to a start session state.
5. The method according to claim 1, characterized in that, Exiting the total process includes: Close the sockets of each subprocess in the total process corresponding to each subprocess in the new process, and send an exit notice. When the total process reclaims the resources of each subprocess in the total process, exit the total process.
6. The method according to claim 1, wherein After controlling the new process to perform initialization actions based on the configuration information, it further includes: Obtain the number of old subprocesses included in the total process and the number of new subprocesses included in the new process. Compare the number of old subprocesses and the number of new subprocesses. When the number of old subprocesses is the same as the number of new subprocesses, perform the step of sending a transfer session instruction to each subprocess of the total process. When the number of old subprocesses is different from the number of new subprocesses, stop updating and generate an alarm log.
7. The method according to claim 1, characterized in that Determining the migration priority of each streaming media included in the current shared memory based on the real-time load information and the type weight includes: Input the real-time load information into a pre-trained historical load machine learning model to dynamically adjust the current weight coefficients of each preset influencing factor based on the real-time load information through the historical load machine learning model. The preset influencing factors include delay tolerance, throughput, and state complexity. Perform weighted averaging on each current weight coefficient and the type weight, sort the results of the weighted averaging from high to low, and obtain the migration priorities corresponding to each streaming media from high to low.
8. A streaming media seamless update device, characterized in that, The device includes: A configuration module for storing the session information of the current total process in the shared memory, replicating any subprocess in the current total process when receiving a preset update signal, starting a new process in the subprocess, and passing the configuration information of the current total process to the new process. The configuration information includes configuration data, a shared memory handle, and a total process control character. A replication module for controlling the new process to perform initialization actions based on the configuration information, and replicating the subprocesses included in the new process so that each subprocess in the new process inherits the configuration information of the new process. A start module for sending a transfer session instruction to each subprocess of the total process through an inter-process communication method. The transfer session instruction is used to notify the total process to start transferring the session, and the transfer session instruction includes all the new process control characters in the new process. A transfer module for matching the total process control character with the new process control character based on the new process control character to obtain pairing information, monitoring the real-time load of the shared memory, determining the real-time load information of the shared memory and the type weight corresponding to each preset streaming media type, determining the migration priority of each streaming media included in the current shared memory based on the real-time load information and the type weight, migrating the streaming media in the shared memory to the new process according to the migration priority and the pairing information, and exiting the total process.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the streaming media seamless update method according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the steps of the seamless update method for streaming media according to any one of claims 1 to 7.
Citation Information
Patent Citations
High-resolution satellite remote sensing product large-scale production
CN106155773A
Application process configuration updating method and system, terminal equipment and storage medium
CN111831350A
RTMP connection migration method, apparatus and device, and readable storage medium
CN114827096A
Database session process processing method, storage medium and equipment
CN116166437A
Multi-process application migration method and device, storage medium and electronic equipment
CN117971423A