Streaming media seamless update method and device
By storing session information into shared memory during streaming update and starting a new process in a child process, inter-process communication and load monitoring are used to achieve seamless update of streaming media, the problem of waiting during streaming update is solved, and the user experience and system stability are improved.
Patent Information
- Application Number
- CN202510760553.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-09
AI Technical Summary
You need to wait during the streaming media update process, and seamless updates cannot be achieved, resulting in a reduced user experience.
Store the session information of the current total process into shared memory, duplicate the child process and start a new process, pass configuration information and control characters through inter-process communication, monitor real-time load and weights, and migrate streaming media to the new process according to migration priority.
It realizes smooth updates and seamless transfers of streaming media, improves user experience and system stability, and avoids service interruptions.
Smart Images

Figure CN120281752B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for seamlessly updating streaming media. Background Art
[0002] In the existing technology, streaming media is a technology and process that compresses a series of media data and sends the data in segments over the Internet, which can instantly transmit audio and video over the Internet for users to watch. Streaming media can be expressed in various forms, including video streams, audio streams, text streams, image streams and animation streams.
[0003] During the transmission process, streaming media needs to process protocols, and needs to continuously send and receive audio and video streams during its operation, and may need to process the audio and video streams. The process is relatively complicated. The service processes in the streaming media operating environment are mostly multi-process and multi-threaded. As a result, when updating the streaming media, it is necessary to stop the old process and start the new process first. There may be a long access interruption, which will cause a large delay in requesting services and reduce the user experience. Summary of the Invention
[0004] In response to the problems in the existing technology, the present application provides a method and device for seamless updating of streaming media, which can effectively solve the shortcomings of traditional technology in that the process of streaming media updating requires waiting and cannot achieve seamless updating, 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 updating process.
[0005] In order to solve at least one of the above problems, the present application provides the following technical solutions:
[0006] In a first aspect, the present application provides a method for seamlessly updating streaming media, comprising:
[0007] The session information of the current main process is stored in the shared memory. When a preset update signal is received, any child process in the current main process is forked and a new process is started in the child process. The configuration information of the current main process is passed to the new process. The configuration information includes configuration data, shared memory handle and main process control symbol.
[0008] Control the new process to perform initialization actions based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process;
[0009] Sending a session transfer instruction to each child process of the main process through inter-process communication, the session transfer instruction is used to notify the main process to start the session transfer, and the session transfer instruction includes all new process control symbols in the new process;
[0010] Based on the new process controller, match the total process controller with the new process controller 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, 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.
[0011] Furthermore, the method further includes: interrupting the current overall process when the overall process receives a preset update signal;
[0012] The sub-process of any main process is replicated through a preset replication function, and the sub-process is started as a new process through a preset execution function and the execution parameters corresponding to the preset execution function.
[0013] Furthermore, the method further includes: when the main process receives the session transfer instruction, cyclically matching the main process control symbol corresponding to each sub-process in the main process with the new process control symbol corresponding to each sub-process in the new process to obtain pairing information;
[0014] After matching the main process controller with the new process controller based on the new process controller to obtain pairing information, the following steps are also included:
[0015] Each child process in the control main process transfers the socket connection to each child process in the new process through the preset message sending function.
[0016] Furthermore, before migrating the streaming media in the overall process to the new process according to the migration priority and pairing information, the method further includes:
[0017] Set the session state of the overall process to the suspended session state;
[0018] After migrating the streaming media in shared memory to the new process according to the migration priority and pairing information, it also includes:
[0019] In the new process, each subprocess completes receiving the corresponding streaming media in the shared memory and sets the session state of the new process to the start session state.
[0020] Furthermore, the method further includes: closing the socket of each sub-process in the overall process corresponding to each sub-process in the new process, and sending an exit notification;
[0021] When the main process reclaims the resources of each sub-process in the main process, it exits the main process.
[0022] Furthermore, after controlling the new process to perform the initialization action based on the configuration information, the method further includes:
[0023] Get the old sub-process number of the sub-process included in the total process and the new sub-process number of the sub-process included in the new process;
[0024] comparing the number of old sub-processes with the number of new sub-processes, and if the number of old sub-processes is the same as the number of new sub-processes, executing the step of sending a session transfer instruction to each sub-process of the overall process;
[0025] If the number of old sub-processes is different from the number of new sub-processes, the update is stopped and an alarm log is generated.
[0026] Furthermore, the method further includes: inputting the real-time load information into a pre-trained historical load machine learning model, so as to dynamically adjust the current weight coefficient 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 delay tolerance, throughput, and state complexity;
[0027] A weighted average is performed on each current weight coefficient and category weight, and the weighted average results are sorted from high to low to obtain the migration priority corresponding to each streaming media from high to low.
[0028] In a second aspect, the present application provides a streaming media seamless update device, comprising:
[0029] The configuration module is used to store the session information of the current main process in shared memory. When receiving a preset update signal, it copies any child process in the current main process, starts a new process in the child process, and passes the configuration information of the current main process to the new process. The configuration information includes configuration data, shared memory handle and main process control symbol;
[0030] The replication module is used to control the new process to perform initialization actions based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process;
[0031] A startup module is used to send a session transfer instruction to each child process of the main process through inter-process communication. The session transfer instruction is used to notify the main process to start the session transfer. The session transfer instruction includes all new process control symbols in the new process.
[0032] The transfer module is used to match the main process controller with the new process controller based on the new process controller, 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 weight 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 weight, migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the main process.
[0033] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for seamlessly updating streaming media when executing the program.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the streaming media seamless update method when executed by a processor.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the steps of the streaming media seamless update method when executed by a processor.
[0036] As can be seen from the above technical solution, the present application provides a method and device for seamless updating of streaming media, which innovatively stores the session information of the current main process in shared memory. When a preset update signal is received, any sub-process in the main process is replicated, and a new process is started in the sub-process. At the same time, the configuration information of the main process is passed to the new process, wherein the configuration information includes configuration data, shared memory handle and main process control symbol, so that the new process can quickly take over the tasks of the current main process, achieve smooth update, and avoid service interruption caused by update. The new process completes initialization according to the configuration information, replicates its internal sub-processes, so that each sub-process inherits the configuration information of the new process, sends a transfer session instruction to each sub-process of the main process through inter-process communication, and starts transferring the session through the main process, wherein the transfer session instruction includes all new process control symbols in the new process, matches the main process control symbol with the new process control symbol according to the new process control symbol, and obtains pairing information, so that the session between the main process and the new process can be seamlessly transferred, ensuring the continuity of user operations. This method monitors the real-time load of shared memory, determines the real-time load information and the category weights corresponding to each preset streaming media type, and then determines the migration priority of each streaming media in the current shared memory based on the real-time load information and category weights. The streaming media in the shared memory are then migrated to a new process according to the migration priority and pairing information, and the overall process is exited. This method effectively addresses the shortcomings of traditional technologies, such as the waiting period during streaming media updates and the lack of seamless updates. It significantly improves the smoothness of process updates and the seamless transfer of sessions, enhancing stability and user experience during streaming media updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0038] Figure 1 Schematic diagram of the flow of the method for seamlessly updating streaming media in an embodiment of the present application;
[0039] Figure 2 This is a structural diagram of a streaming media seamless update device in an embodiment of the present application;
[0040] Figure 3 Schematic diagram of the structure of the electronic device in the embodiment of the present application.
[0041] Reference numerals:
[0042] 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 DESCRIPTION
[0043] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0044] The acquisition, storage, use, and processing of data in this application's technical solution comply with relevant national laws and regulations.
[0045] In view of the problems existing in the prior art, the present application provides a method and device for seamless updating of streaming media, which innovatively stores the session information of the current main process in shared memory. When a preset update signal is received, any sub-process in the main process is replicated, and a new process is started in the sub-process. At the same time, the configuration information of the main process is passed to the new process, wherein the configuration information includes configuration data, shared memory handle and main process control symbol, so that the new process can quickly take over the tasks of the current main process, achieve smooth update, and avoid service interruption caused by update. The new process completes initialization according to the configuration information, replicates its internal sub-processes, so that each sub-process inherits the configuration information of the new process, sends a transfer session instruction to each sub-process of the main process through inter-process communication, and starts transferring the session through the main process, wherein the transfer session instruction includes all new process control symbols in the new process, matches the main process control symbol with the new process control symbol according to the new process control symbol, and obtains pairing information, so that the session between the main process and the new process can be seamlessly transferred, ensuring the continuity of user operations. Monitor the real-time load of shared memory, determine the real-time load information and the category weights corresponding to each preset streaming media category, determine the migration priority of each streaming media in the current shared memory based on the real-time load information and category weights, 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.
[0046] In order to effectively solve the shortcomings 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 the session, and improve the stability and user experience during the streaming media update process, this application provides an embodiment of a streaming media seamless update method, see Figure 1 The streaming media seamless update method specifically includes the following contents:
[0047] Step S101: Store the session information of the current main process in the shared memory. When a preset update signal is received, copy any sub-process in the current main process, start a new process in the sub-process, and pass the configuration information of the current main process to the new process.
[0048] The configuration information includes configuration data, shared memory handle and overall process control symbol.
[0049] Optionally, this embodiment stores the session information of the current total process in shared memory, where shared memory is an efficient inter-process communication mechanism that allows multiple processes to access the same memory area. This ensures that session information is not lost during process updates and can be quickly accessed by new processes in shared memory.
[0050] When a preset update signal is received, any child process in the current overall process is replicated, where the preset update signal can be a SIGUSER2 signal. In the process of starting a new process, the configuration information of the current overall process is passed to the new process, where the configuration information includes configuration data, a shared memory handle, and a overall process control symbol. The configuration data is various parameters and settings required for the new process to run, the shared memory handle is used to access the shared memory that stores session information, and the overall process control symbol is used to control and synchronize the process.
[0051] This embodiment realizes the replication of the child process and the startup of the new process, while transmitting configuration information, so that the new process can quickly take over the current task, realize smooth update, and avoid service interruption caused by the update.
[0052] Step S102: Control the new process to perform initialization based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process.
[0053] Optionally, in this embodiment, the new process receives configuration information and performs initialization actions according to the configuration information. The initialization process may include but is not limited to setting up the operating environment and loading necessary resources. After the initialization is completed, the new process replicates its internal sub-processes so that each sub-process can 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.
[0054] This embodiment implements the initialization of the new process, so that the new process can smoothly take over the session and corresponding session information of the overall process.
[0055] Step S103: Sending a session transfer instruction to each child process of the main process through inter-process communication. The session transfer instruction is used to notify the main process to start session transfer. The session transfer instruction includes all new process control symbols in the new process.
[0056] Optionally, this embodiment sends a session transfer instruction to each child process of the main process through inter-process communication (IPC), wherein the session transfer instruction is used to notify the main process to start transferring the session, and the session transfer instruction includes all new process control symbols in the new process. The IPC mechanism can be implemented in various ways, such as pipes, message queues or sockets.
[0057] This embodiment sends a session transfer instruction to the main process after the new process is initialized, notifies the main process to start the session transfer through the session transfer instruction, and can also pass the new process control symbol to the main process.
[0058] Step S104: Based on the new process controller, match the main process controller with the new process controller 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 weight 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 the category weight, migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the main process.
[0059] Optionally, this embodiment matches the master process controller with the new process controller based on the new process controller to obtain pairing information. Simultaneously, monitoring the real-time load of the shared memory and determining the real-time load information of the shared memory and the category weights corresponding to each preset streaming media category can be achieved through a shared memory management mechanism, such as using shmget (a call function for creating or obtaining a shared memory segment) and shmat (a call function, a system call function for attaching a shared memory segment to the address space of the calling process) to access and manage the shared memory.
[0060] Based on real-time load information and category weights, the migration priority of each streaming media currently in shared memory is determined. Based on the migration priority and pairing information, the streaming media in shared memory are migrated to the new process. During the migration process, a signaling mechanism can be used to synchronize operations between processes to ensure data consistency and integrity.
[0061] After completing the streaming media migration, exit the main process. This means that the new process has taken over all session information and streaming media data, allowing you to smoothly switch from the old version to the new version.
[0062] This embodiment monitors the load of the shared memory and determines the migration priority, so that the streaming media technology can be reasonably migrated according to the current state, thus avoiding resource waste and improving operation efficiency.
[0063] Furthermore, before storing the session information of the current overall process in the shared memory, the file name of the executable program file corresponding to the overall process is modified, and the executable program file of the new process is stored in a designated directory.
[0064] For example, the name of the executable program file of the overall process is sever, and the modified file name may be sever.old.
[0065] Furthermore, the overall process is the parent process of the sub-processes included in the overall process, and the overall process includes multiple sub-processes.
[0066] This embodiment achieves this by replicating the child process and starting a new process while passing configuration information, so that the new process can quickly take over the current session, achieve smooth updates, and avoid service interruptions caused by updates. By sending transfer session instructions and matching control characters, the session between the main process and the new process can be seamlessly transferred to ensure the continuity of user operations. At the same time, the real-time load of the shared memory is monitored to determine the migration priority, so that the streaming media data can be reasonably migrated according to the current status, avoiding waste of resources and improving operating efficiency.
[0067] In some embodiments, upon receiving a preset update signal, forking any sub-process in the current overall process and starting a new process in the sub-process includes:
[0068] When the overall process receives a preset update signal, the current overall process is interrupted;
[0069] The sub-process of any main process is replicated through a preset replication function, and the sub-process is started as a new process through a preset execution function and the execution parameters corresponding to the preset execution function.
[0070] Optionally, this embodiment interrupts the current total process when the total process receives a preset update signal, wherein the preset update signal may be a SIGUSR2 signal, wherein the SIGUSR2 signal is an asynchronous notification mechanism for transmitting events and information between processes or between an operating system and a process. When the total process receives a preset update signal, a signal processing function may be triggered, and the signal processing function is used to interrupt the execution of the current total process.
[0071] In addition, any child process in the total process is replicated through a preset replication function, wherein the preset replication function can be a fork() function, which can create a child process. The child process is a copy of the parent process and has the same code segment, data segment and stack. When replicating the child process, a new memory block and kernel data structure are allocated for the child process, and part of the data structure content of the parent process is copied to the child process.
[0072] In addition, in the child process, the child process is started as a new process by using a preset execution function and execution parameters corresponding to the preset execution function, wherein the preset execution function can be an exec() function, and the exec() function can replace the code segment, data segment, and stack of the current process with the content of the new program, thereby realizing the update of the process.
[0073] For example, you can use the execl() function to start a new process. The execl() function can load the executable file in the specified path and transfer control to the file.
[0074] Furthermore, when starting a new process, the configuration information of the master process is passed to the new process. This configuration information includes configuration data, a shared memory handle, and the master process control symbol. This configuration information can be passed through environment variables, command-line parameters, or files. For example, the configuration information can be passed as command-line parameters to the exec() function, or stored in shared memory for access by the new process.
[0075] This embodiment achieves this by replicating the child process and starting a new process while transferring configuration information, ensuring that the new process can quickly take over the current task, achieving smooth updates, and avoiding service interruptions caused by updates.
[0076] In some embodiments, based on the new process controller, the overall process controller is matched with the new process controller to obtain pairing information, including:
[0077] When the master process receives the transfer session instruction, it cyclically matches the master process control symbol corresponding to each sub-process in the master process with the new process control symbol corresponding to each sub-process in the new process to obtain pairing information;
[0078] After matching the main process controller with the new process controller based on the new process controller to obtain pairing information, the following steps are also included:
[0079] Each child process in the control main process transfers the socket connection to each child process in the new process through the preset message sending function.
[0080] Optionally, in this embodiment, when the main process receives a transfer session instruction, in the main process, a cyclic matching is performed on the main process control symbol corresponding to each sub-process and the new process control symbol corresponding to each sub-process in the new process obtained through the transfer session instruction, that is, the main process control symbol corresponding to the sub-process in the main process and the new process control symbol of the sub-process in the new process are compared one by one to obtain matching pairing information. The pairing information is used to indicate the matching relationship between the sub-process of the main process and the sub-process of the new process, that is, the relationship in which the socket connection transfer operation can be performed.
[0081] Among them, the process control identifier (PID) is the identity of each process. It is automatically generated and is unique, persistent and immutable. During the matching process, the uniqueness of the process control identifier is used to accurately identify and distinguish different sub-processes.
[0082] Furthermore, after the main process receives the transfer session instruction from the new process, it can cyclically select the sub-processes of the main process and the sub-processes of the new process to pair up and transfer the session, and send a session transfer instruction to the sub-processes in the main process. The session transfer instruction includes the new process control symbol of the sub-process of the new process.
[0083] In addition, after matching the main process control symbol with the new process control symbol according to the new process control symbol and obtaining the pairing information, each sub-process in the main process is controlled to transfer the socket connection to the corresponding sub-process in the new process through the preset message sending function, so that the sub-process of the new process takes over the session task corresponding to the sub-process of the main process.
[0084] Among them, the socket connection transfer involves the transfer of file descriptors. The preset message sending function can send the socket file descriptor corresponding to the sub-process in the overall process to the corresponding sub-process of the new process through a call or a specific communication mechanism to complete the socket connection transfer.
[0085] Furthermore, during the transfer session between the main process and the new process, process control and resource allocation can be achieved through the process control block. The process control block is used to manage and control the data structure of the process, including but not limited to process status, program counter, data registers, process scheduling information, and process identifier.
[0086] In addition, during the process of cyclic matching and session transfer, synchronization issues caused 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 matching and transfer operations and avoid data competition or resource conflicts.
[0087] This embodiment realizes that by transferring the socket connection from the main process to the new process, resources can be allocated more reasonably. The new process can improve resource utilization efficiency according to its own resource requirements and processing capabilities. At the same time, it allows the transfer of socket connections between processes, which can more flexibly adjust the real-time load of the process. When expanding or optimizing, some connections can be conveniently migrated to the new process without restarting the entire program or making complex configuration adjustments. In the event that the main process has problems or requires maintenance, the socket connection can be transferred to the new process, thereby avoiding network service interruption due to the failure of a single process and improving stability and reliability.
[0088] In some embodiments, before migrating the streaming media in the overall process to the new process according to the migration priority and pairing information, the method further includes:
[0089] Set the session state of the overall process to the suspended session state;
[0090] After migrating the streaming media in shared memory to the new process according to the migration priority and pairing information, it also includes:
[0091] In the new process, each subprocess completes receiving the corresponding streaming media in the shared memory and sets the session state of the new process to the start session state.
[0092] Optionally, this embodiment sets the session state of the master process to a suspended state before migrating the streaming media in the master process to the new process according to the migration priority and pairing information. This prevents the streaming media data in the master process from being processed or modified during the migration process, thereby ensuring data consistency and integrity during the migration process. By pausing the session state, the streaming media data can be kept in a relatively stable state during the migration process, avoiding migration failures or data inconsistencies caused by dynamic data changes.
[0093] In addition, after the streaming media in the shared memory is migrated to the new process according to the migration priority and pairing information, the child process of the new process completes the reception of the corresponding streaming media in the shared memory. When 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 of the streaming media and started to process and transmit the streaming media normally. By setting the session state to the start session state, the new process can respond to external requests in a timely manner, ensuring the continuity and stability of the streaming media service.
[0094] Among them, the migration priority can be obtained by comprehensively evaluating multiple factors such as the importance and urgency of the streaming media. Streaming media with high priority will be migrated first to ensure the timeliness and integrity of key data. Pairing information is used to represent the correspondence between the sub-processes of the main process and the sub-processes of the new process, so that the streaming media can be accurately migrated from the sub-processes of the main process to the corresponding sub-processes of the new process.
[0095] This embodiment implements setting the session state of the overall process to the paused session state before migration, which can effectively avoid dynamic changes in data during the migration process, ensure the consistency and integrity of the migrated data, reduce errors and problems caused by data inconsistency, and improve reliability and stability. After the migration is completed, the session state of the new process is set to the started session state, so that the new process can take over the processing of streaming media in a timely manner, so that users will hardly feel any service interruption during the migration process, thereby improving user experience.
[0096] In some embodiments, exiting the overall process includes:
[0097] Close the sockets of each sub-process in the overall process corresponding to each sub-process in the new process and send an exit notification;
[0098] When the main process reclaims the resources of each sub-process in the main process, it exits the main process.
[0099] Optionally, before exiting the main process, this embodiment closes the sockets of each sub-process in the main process corresponding to each sub-process in the new process. The socket is an important resource for network communication. If it is not closed correctly, it may cause resource leakage or communication abnormality.
[0100] In addition, after closing the socket, an exit notification is sent to the new process, where the exit notification can be a signal, message, or other form of communication, used to inform the new process that the main process is about to exit so that the new process can make corresponding preparations, such as saving status, cleaning up resources, etc.
[0101] In addition, when the main process reclaims the resources of each child process in the main process, it indicates that the main process has entered the exit phase, where the resources of the child process include but are not limited to memory, file descriptors, sockets, etc. These resources are recycled to avoid resource waste and potential resource leakage problems.
[0102] In addition, after confirming that the resource recovery of the sub-process is completed, the main process is exited. Exiting the main process can release all resources occupied by the main process, including but not limited to closing all open files, releasing memory, etc., thereby ensuring that resources are used reasonably.
[0103] This embodiment achieves reasonable allocation and recycling of resources to run other processes or tasks more efficiently, thereby improving performance and stability.
[0104] In some embodiments, after controlling the new process to perform an initialization action based on the configuration information, the method further includes:
[0105] Obtain the old sub-process number of the sub-process included in the total process and the new sub-process number of the sub-process included in the new process;
[0106] comparing the number of old sub-processes with the number of new sub-processes, and if the number of old sub-processes is the same as the number of new sub-processes, executing the step of sending a session transfer instruction to each sub-process of the overall process;
[0107] If the number of old sub-processes is different from the number of new sub-processes, the update is stopped and an alarm log is generated.
[0108] Optionally, this embodiment obtains 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 using the pgrep -P <total process ID> | wc -l command, 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 count the number of rows, that is, the number of child processes.
[0109] To obtain the number of new child processes included in the new process, you can also use the pgrep -P <new process ID> | wc -l command to count the number of child processes of the new process, where <new process ID> is the process ID of the new process.
[0110] In addition, by comparing the number of old sub-processes and the number of new sub-processes, when the number of old sub-processes is the same as the number of new sub-processes, the number of sub-processes representing the new process is consistent with the number of sub-processes of the total process. At this time, the step of sending a session transfer instruction to each sub-process of the total process can be executed to transfer the session state of the sub-process of the total process to the new process, so that the new process can take over the work of the total process normally.
[0111] If the number of old and new subprocesses differs, indicating that the number of subprocesses of the new process is inconsistent with the total number of subprocesses of the process, there may be some problems, such as the failure to create subprocesses of the new process or the abnormal exit of subprocesses of the total process. In this case, to ensure stability and data security, the update is stopped and an alarm log is generated to promptly identify and resolve the problem.
[0112] This embodiment implements a method of sending a session transfer instruction to each subprocess of the main process when the number of old and new subprocesses is the same. This ensures that the session state of the subprocesses of the main process is correctly transferred to the new process, allowing the new process to smoothly take over the work of the main process and maintain normal operation. When the number of old and new subprocesses differs, the update is stopped and an alarm log is generated. This allows timely detection of the inconsistency between the number of subprocesses of the new process and the number of subprocesses of the main process, allowing for rapid identification of the problem and implementation of appropriate measures to prevent further escalation, thereby ensuring stability and data security.
[0113] In some embodiments, determining the migration priority of each streaming media currently included in the shared memory based on the real-time load information and the category weight includes:
[0114] Input the real-time load information into a pre-trained historical load machine learning model to dynamically adjust the current weight coefficient 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.
[0115] A weighted average is performed on each current weight coefficient and category weight, and the weighted average results are sorted from high to low to obtain the migration priority corresponding to each streaming media from high to low.
[0116] Optionally, this embodiment inputs real-time load information into a pre-trained historical load machine learning model, wherein the historical load machine learning model is trained based on historical load data and can dynamically adjust the current weight coefficient of each preset influencing factor according to the input real-time load information. The preset influencing factors include delay tolerance, throughput, and state complexity. The real-time load information is used to ensure the real-time operating status of each current streaming media, including but not limited to delay, throughput, CPU utilization, memory utilization, etc., which can reflect the current load situation of the streaming media.
[0117] Delay tolerance: indicates the tolerance of streaming media to delay. Some streaming media, such as real-time video conferencing, are very sensitive to delay, while other streaming media, such as video on demand, have a higher tolerance for delay.
[0118] Throughput: refers to the amount of data transmitted by streaming media per unit time. High-throughput streaming media requires more bandwidth and processing power.
[0119] State complexity: indicates the complexity of the state information of the streaming media. Streaming media with high state complexity may require more computing resources to process its state information.
[0120] Category weight refers to a weight pre-set based on the preset streaming media category of the streaming media. The preset streaming media categories include video streams, audio streams, text streams, etc. Different types of streaming media have different requirements and importance for resources, and can be weighted averaged according to the category weight.
[0121] In addition, the current weight coefficients and the category weights are weighted averaged to obtain the comprehensive weight of each streaming media, where the comprehensive weight represents the current importance and resource requirements of the current streaming media.
[0122] In addition, the weighted average results (i.e., the comprehensive weights mentioned above) are sorted from high to low to obtain the migration priorities corresponding to each streaming media from high to low. Streaming media with high priorities will be migrated first so that resources can be allocated to more important streaming media first.
[0123] This embodiment achieves more accurate resource allocation by determining migration priorities based on real-time load information and category weights, giving priority to migrating high-priority streaming media, ensuring the stable operation of critical streaming media, and thus improving resource allocation efficiency. Dynamic adjustment of weight coefficients can better adapt to changes in system load, avoid performance bottlenecks caused by unreasonable resource allocation, and improve streaming media performance and user experience.
[0124] In order to effectively solve the shortcomings of traditional technologies in that they require waiting during the process of streaming media updating and cannot achieve seamless updating, the present application provides an embodiment of a streaming media seamless updating device for achieving seamless updating of all or part of the content of the streaming media. Figure 2 The streaming media seamless update device specifically includes the following contents:
[0125] Configuration module 10, used to store the session information of the current main process in shared memory. When receiving a preset update signal, it copies any child process in the current main process, starts a new process in the child process, and passes the configuration information of the current main process to the new process. The configuration information includes configuration data, shared memory handle and main process control symbol;
[0126] The replication module 20 is used to control the new process to perform initialization actions based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process;
[0127] The startup module 30 is used to send a session transfer instruction to each child process of the main process through inter-process communication. The session transfer instruction is used to notify the main process to start the session transfer. The session transfer instruction includes all new process control symbols in the new process;
[0128] The transfer module 40 is used to match the main process controller with the new process controller based on the new process controller, 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 weight 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 the category weight, migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the main process.
[0129] From the above description, it can be seen that the streaming media seamless update device provided by the embodiment of the present application can innovatively store the session information of the current main process in the shared memory, and when receiving a preset update signal, replicate any child process in the main process, and start a new process in the child process, and at the same time pass the configuration information of the main process to the new process, wherein the configuration information includes configuration data, shared memory handle and main process control symbol, so that the new process can quickly take over the tasks of the current main process, achieve smooth update, and avoid service interruption caused by update. The new process completes initialization according to the configuration information, replicates its internal child processes, so that each child process inherits the configuration information of the new process, sends a transfer session instruction to each child process of the main process through inter-process communication, and starts transferring the session through the main process, wherein the transfer session instruction includes all new process control symbols in the new process, matches the main process control symbol with the new process control symbol according to the new process control symbol, and obtains pairing information, so that the session between the main process and the new process can be seamlessly transferred, ensuring the continuity of user operations. This method monitors the real-time load of shared memory, determines the real-time load information and the category weights corresponding to each preset streaming media type, and then determines the migration priority of each streaming media in the current shared memory based on the real-time load information and category weights. The streaming media in the shared memory are then migrated to a new process according to the migration priority and pairing information, and the overall process is exited. This method effectively addresses the shortcomings of traditional technologies, such as the waiting period during streaming media updates and the lack of seamless updates. It significantly improves the smoothness of process updates and the seamless transfer of sessions, enhancing stability and user experience during streaming media updates.
[0130] From a hardware perspective, in order to effectively address the shortcomings of traditional technologies such as the need to wait during streaming media updates and the inability to achieve seamless updates, significantly improve the smoothness of process updates and seamless session transfers, and enhance stability and user experience during streaming media updates, the present application provides an embodiment of an electronic device for implementing all or part of the content of the streaming media seamless update method, and the electronic device specifically includes the following content:
[0131] A processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to transmit information between the streaming media seamless update device and related devices such as core business systems, user terminals, and related databases; the logic controller can be a desktop computer, a tablet computer, a mobile terminal, etc., but 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 streaming media seamless update device in the embodiments, and their contents are incorporated herein, and any repetitions are not repeated.
[0132] It is understandable 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), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.
[0133] In practical applications, portions of the streaming media seamless update method can be executed on the electronic device side as described above, or all operations can be performed on the client device. The specific selection can be based on the processing capabilities of the client device and the limitations of the user's usage scenario. This application does not impose any restrictions on this. If all operations are performed on the client device, the client device may also include a processor.
[0134] The aforementioned client device may include a communication module (i.e., a communication unit) capable of establishing a communication connection with a remote server to facilitate data transmission with the server. The server may include a server at the task scheduling center or, in other implementation scenarios, a server on an intermediate platform, such as a server on a third-party server platform that is communicatively linked to the task scheduling center server. The server may comprise a single computer device, a server cluster consisting of multiple servers, or a distributed server configuration.
[0135] Figure 3 Schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 3 As 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 is worth noting that the 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.
[0136] In one embodiment, the streaming media seamless update method function may be integrated into the central processing unit 9100. The central processing unit 9100 may be configured to perform the following control:
[0137] Step S101: Store the session information of the current main process in shared memory. When a preset update signal is received, replicate any child process in the current main process, start a new process in the child process, and pass the configuration information of the current main process to the new process. The configuration information includes configuration data, shared memory handle, and main process control symbol.
[0138] Step S102: Control the new process to perform initialization based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process;
[0139] Step S103: Sending a session transfer instruction to each child process of the main process through inter-process communication. The session transfer instruction is used to notify the main process to start session transfer. The session transfer instruction includes all new process control symbols in the new process.
[0140] Step S104: Based on the new process controller, match the main process controller with the new process controller 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 weight 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 the category weight, migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the main process.
[0141] As can be seen from the above description, the electronic device provided by the embodiment of the present application innovatively stores the session information of the current main process in shared memory. When a preset update signal is received, any sub-process in the main process is replicated, and a new process is started in the sub-process. At the same time, the configuration information of the main process is passed to the new process, wherein the configuration information includes configuration data, shared memory handle and main process control symbol, so that the new process can quickly take over the tasks of the current main 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 sub-processes so that each sub-process inherits the configuration information of the new process. A transfer session instruction is sent to each sub-process of the main process through inter-process communication, and the transfer session is started through the main process. The transfer session instruction includes all new process control symbols in the new process. According to the new process control symbol, the main process control symbol is matched with the new process control symbol to obtain pairing information, so that the session between the main process and the new process can be seamlessly transferred, ensuring the continuity of user operations. This method monitors the real-time load of shared memory, determines the real-time load information and the category weights corresponding to each preset streaming media type, and then determines the migration priority of each streaming media in the current shared memory based on the real-time load information and category weights. The streaming media in the shared memory are then migrated to a new process according to the migration priority and pairing information, and the overall process is exited. This method effectively addresses the shortcomings of traditional technologies, such as the waiting period during streaming media updates and the lack of seamless updates. It significantly improves the smoothness of process updates and the seamless transfer of sessions, enhancing stability and user experience during streaming media updates.
[0142] In another embodiment, the streaming media seamless update device can be configured separately 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, and the streaming media seamless update method function can be implemented through the control of the central processing unit.
[0143] like Figure 3 As 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 is worth noting that the electronic device 9600 does not necessarily have to include Figure 3 In addition, the electronic device 9600 may also include all components shown in Figure 3 For components not shown, reference may be made to the prior art.
[0144] like Figure 3 As shown, the central processing unit 9100 is sometimes also referred to as a controller or operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.
[0145] Memory 9140 can be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It can store the aforementioned failure-related information and also store programs that execute the relevant information. The CPU 9100 can execute the programs stored in memory 9140 to implement information storage or processing.
[0146] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 may be, for example, a keypad or touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0147] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), or SIM card. Alternatively, it may be a memory that retains information even when power is off, can be selectively erased, and is capable of storing additional data. Examples of such memory are sometimes referred to as EPROMs. 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 for storing application programs and function programs, or processes used by the central processing unit 9100 to execute operations of the electronic device 9600.
[0148] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, images, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various driver programs for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0149] 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 the case of a conventional mobile communication terminal.
[0150] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless local area network modules. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130, providing audio output via the speaker 9131 and receiving audio input from the microphone 9132, thereby implementing common telecommunication functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor 9130 is coupled to the central processing unit 9100, enabling local recording via the microphone 9132 and playback of stored audio via the speaker 9131.
[0151] Embodiments of the present application also provide a computer-readable storage medium capable of implementing all steps of the method for seamlessly updating streaming media in the above-mentioned embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the computer program implements all steps of the method for seamlessly updating streaming media in the above-mentioned embodiment, where the execution subject is a server or a client. For example, when the processor executes the computer program, the following steps are implemented:
[0152] Step S101: Store the session information of the current main process in shared memory. When a preset update signal is received, replicate any child process in the current main process, start a new process in the child process, and pass the configuration information of the current main process to the new process. The configuration information includes configuration data, shared memory handle, and main process control symbol.
[0153] Step S102: Control the new process to perform initialization based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process;
[0154] Step S103: Sending a session transfer instruction to each child process of the main process through inter-process communication. The session transfer instruction is used to notify the main process to start session transfer. The session transfer instruction includes all new process control symbols in the new process.
[0155] Step S104: Based on the new process controller, match the main process controller with the new process controller 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 weight 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 the category weight, migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the main process.
[0156] As can be seen from the above description, the computer-readable storage medium provided by the embodiment of the present application innovatively stores the session information of the current main process in shared memory. When a preset update signal is received, any sub-process in the main process is replicated, and a new process is started in the sub-process. At the same time, the configuration information of the main process is passed to the new process, wherein the configuration information includes configuration data, shared memory handle and main process control symbol, so that the new process can quickly take over the tasks of the current main process, achieve smooth updates, and avoid service interruptions caused by updates. The new process completes initialization according to the configuration information, replicates its internal sub-processes, so that each sub-process inherits the configuration information of the new process, sends a transfer session instruction to each sub-process of the main process through inter-process communication, and starts transferring the session through the main process, wherein the transfer session instruction includes all new process control symbols in the new process, matches the main process control symbol with the new process control symbol according to the new process control symbol, and obtains pairing information, so that the session between the main process and the new process can be seamlessly transferred, ensuring the continuity of user operations. This method monitors the real-time load of shared memory, determines the real-time load information and the category weights corresponding to each preset streaming media type, and then determines the migration priority of each streaming media in the current shared memory based on the real-time load information and category weights. The streaming media in the shared memory are then migrated to a new process according to the migration priority and pairing information, and the overall process is exited. This method effectively addresses the shortcomings of traditional technologies, such as the waiting period during streaming media updates and the lack of seamless updates. It significantly improves the smoothness of process updates and the seamless transfer of sessions, enhancing stability and user experience during streaming media updates.
[0157] The embodiments of the present application also provide a computer program product capable of implementing all steps of the method for seamlessly updating streaming media in the above-mentioned embodiment, where the execution subject is a server or a client. When the computer program / instructions are executed by a processor, the steps of the method for seamlessly updating streaming media are implemented. For example, the computer program / instructions implement the following steps:
[0158] Step S101: Store the session information of the current main process in shared memory. When a preset update signal is received, replicate any child process in the current main process, start a new process in the child process, and pass the configuration information of the current main process to the new process. The configuration information includes configuration data, shared memory handle, and main process control symbol.
[0159] Step S102: Control the new process to perform initialization based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process;
[0160] Step S103: Sending a session transfer instruction to each child process of the main process through inter-process communication. The session transfer instruction is used to notify the main process to start session transfer. The session transfer instruction includes all new process control symbols in the new process.
[0161] Step S104: Based on the new process controller, match the main process controller with the new process controller 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 weight 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 the category weight, migrate the streaming media in the shared memory to the new process according to the migration priority and pairing information, and exit the main process.
[0162] As can be seen from the above description, the computer program product provided by the embodiment of the present application innovatively stores the session information of the current main process in shared memory. When a preset update signal is received, any sub-process in the main process is replicated, and a new process is started in the sub-process. At the same time, the configuration information of the main process is passed to the new process, wherein the configuration information includes configuration data, shared memory handle and main process control symbol, so that the new process can quickly take over the tasks of the current main process, achieve smooth updates, and avoid service interruptions caused by updates. The new process completes initialization according to the configuration information, replicates its internal sub-processes, so that each sub-process inherits the configuration information of the new process, sends a transfer session instruction to each sub-process of the main process through inter-process communication, and starts transferring the session through the main process, wherein the transfer session instruction includes all new process control symbols in the new process, matches the main process control symbol with the new process control symbol according to the new process control symbol, and obtains pairing information, so that the session between the main process and the new process can be seamlessly transferred, ensuring the continuity of user operations. This method monitors the real-time load of shared memory, determines the real-time load information and the category weights corresponding to each preset streaming media type, and then determines the migration priority of each streaming media in the current shared memory based on the real-time load information and category weights. The streaming media in the shared memory are then migrated to a new process according to the migration priority and pairing information, and the overall process is exited. This method effectively addresses the shortcomings of traditional technologies, such as the waiting period during streaming media updates and the lack of seamless updates. It significantly improves the smoothness of process updates and the seamless transfer of sessions, enhancing stability and user experience during streaming media updates.
[0163] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, apparatuses, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.
[0164] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes 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 a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.
[0165] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0166] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0167] Specific embodiments are used in the present invention to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
Claims
1. A method for seamlessly updating streaming media, characterized in that: The method comprises: The session information of the current main process is stored in the shared memory. When a preset update signal is received, any child process in the current main process is forked, and a new process is started in the child process. The configuration information of the current main process is passed to the new process. The configuration information includes configuration data, shared memory handle and main process control symbol; Controlling the new process to perform an initialization action based on the configuration information, and replicating the sub-processes included in the new process so that each of the sub-processes in the new process inherits the configuration information of the new process; Sending a session transfer instruction to each child process of the main process through inter-process communication, wherein the session transfer instruction is used to notify the main process to start session transfer, and the session transfer instruction includes all new process control symbols in the new process; Based on the new process controller, the overall process controller is matched with the new process controller to obtain pairing information, and the real-time load of the shared memory is monitored to determine the real-time load information of the shared memory and the category weights corresponding to each preset streaming media category. Based on the real-time load information and the category weights, the migration priority of each streaming media currently included in the shared memory is determined, and the streaming media in the shared memory is migrated to the new process according to the migration priority and the pairing information, and the overall process is exited.
2. The method according to claim 1, characterized in that When the preset update signal is received, replicating any sub-process in the current overall process and starting a new process in the sub-process includes: When the overall process receives a preset update signal, interrupting the current overall process; The sub-process of any of the main processes is replicated through a preset replication function, and the sub-process is started as a new process through a preset execution function and execution parameters corresponding to the preset execution function.
3. The method according to claim 1, characterized in that The matching of the overall process controller and the new process controller based on the new process controller to obtain pairing information includes: When the main process receives the session transfer instruction, cyclically matching the main process control symbol corresponding to each sub-process in the main process with the new process control symbol corresponding to each sub-process in the new process to obtain pairing information; After matching the general process controller with the new process controller based on the new process controller to obtain pairing information, the method further includes: Control each of the sub-processes in the overall process to transfer the socket connection to each of the sub-processes 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 overall process to the new process according to the migration priority and the pairing information, the method further includes: Setting the session state of the overall process to a suspended session state; After migrating the streaming media in the shared memory to the new process according to the migration priority and the pairing information, the method further includes: Each of the sub-processes in the new process completes receiving the corresponding streaming media in the shared memory, and sets the session state of the new process to the start session state.
5. The method according to claim 1, wherein The step of exiting the overall process includes: Closing the socket of each sub-process in the overall process corresponding to each sub-process in the new process, and sending an exit notification; When the main process reclaims the resources of each sub-process in the main process, the main process exits.
6. The method according to claim 1, wherein After controlling the new process to perform an initialization action based on the configuration information, the method further includes: Obtaining the number of old sub-processes of the sub-process included in the total process and the number of new sub-processes of the sub-process included in the new process; Comparing the number of the old sub-processes with the number of the new sub-processes, and when the number of the old sub-processes is the same as the number of the new sub-processes, executing the step of sending a session transfer instruction to each sub-process of the overall process; When the number of the old sub-processes is different from the number of the new sub-processes, the update is stopped and an alarm log is generated.
7. The method according to claim 1, characterized in that The determining the migration priority of each streaming media currently included in the shared memory based on the real-time load information and the category weight includes: Inputting the real-time load information into a pre-trained historical load machine learning model to dynamically adjust the current weight coefficient of each preset influencing factor based on the real-time load information through the historical load machine learning model, wherein the preset influencing factors include delay tolerance, throughput, and state complexity; A weighted average is performed on each current weight coefficient and the category weight, and the results of the weighted average are sorted from high to low to obtain the migration priority corresponding to each streaming media from high to low.
8. A streaming media seamless update device, characterized in that: The device comprises: A configuration module is configured to store the session information of the current main process in shared memory, and upon receiving a preset update signal, replicate any child process in the current main process, start a new process in the child process, and pass the configuration information of the current main process to the new process, wherein the configuration information includes configuration data, a shared memory handle, and a main process control symbol; a replica module, configured to control the new process to perform an initialization action based on the configuration information, and replicate the sub-processes included in the new process so that each sub-process in the new process inherits the configuration information of the new process; a startup module, configured to send a session transfer instruction to each child process of the main process through an inter-process communication method, wherein the session transfer instruction is used to notify the main process to start the session transfer, and the session transfer instruction includes all new process control symbols in the new process; A transfer module is used to match the overall process controller with the new process controller based on the new process controller 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 currently included in the 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 priority and the pairing information, and exit the overall process.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the streaming media seamless update method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the streaming media seamless update method according to any one of claims 1 to 7 are implemented.
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