A method and device for smooth upgrading of containerized real-time audio and video distribution background

Through the containerized real-time audio and video distribution background smooth upgrade method, the coordination of new and old containers and docker directory mounts are used to solve the problem that the existing technology mid-to-intermediate audio and video background cannot be upgraded without perception, and realizes uninterrupted audio and video streaming Transmission and user experience.

CN118467012BActive Publication Date: 2024-11-26YISU CLOUD TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410940133.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-26
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

The existing open source audio and video backend services do not support container-based smooth upgrades, which makes it impossible to perform unconsciously when upgrading the version during real-time audio and video streaming, affecting the customer's audio and video transmission experience.

Method used

采用容器化的实时音视频分发后台平滑升级方法,通过新老容器的配合,发送平滑退出指令,老容器在接收到信令后关闭对外端口,继续提供服务,新容器接管请求,预设时间段 Exit the old container randomly or without playback streams, use docker's subdirectory mount to achieve file resource isolation, and manage requests through private and public ports.

Benefits of technology

It realizes the uninterrupted version upgrade during real-time audio and video streaming, ensuring user experience, avoiding service interruptions during the upgrade process, and improving system stability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467012B_ABST
    Figure CN118467012B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and device for smoothly upgrading a containerized real-time audio and video distribution background, belonging to the field of smooth upgrading technology, the method comprising: starting a new container to obtain a system including an old container and a new container, sending a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade; after the old container receives the signaling of smooth exit, the old container closes the external port of the old container, and provides services for requests entering through a private port, and during the smooth exit of the old container, new access requests are provided by the new container; within the first time period after a preset time period, the old container is randomly and violently exited or the old container is exited when there is no playback stream in the old container; wherein the private port of the old container and the external port of the new container are both open. The present invention is based on a method and device for smoothly upgrading a real-time audio and video distribution background in which the new and old containers cooperate, which can smoothly upgrade without interruption in the user transmission process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of real-time audio and video background smooth upgrade, and in particular to a method and device for smooth upgrade of a containerized real-time audio and video distribution background. Background Art

[0002] In the real-time audio and video background, the transmission process of an audio and video stream often takes several hours or even longer. At this time, if the version needs to be upgraded, it is hoped that the customer will not be aware of it, that is, it will not affect the customer's current audio and video transmission.

[0003] Nowadays, it is becoming more and more popular to use containers, k8s and other management background services, but the current open source audio and video background services do not support smooth upgrades based on containers. Therefore, this patent is about how to perform smooth upgrades based on containers. Summary of the invention

[0004] In view of the above deficiencies in the prior art, the purpose of the invention is to provide a method, device, electronic device and storage medium for the smooth upgrade of a containerized real-time audio and video distribution background, based on the smooth upgrade of the real-time audio and video distribution background in combination with new and old containers, and the user transmission process will not be interrupted.

[0005] The first aspect of the present invention provides a method for smoothly upgrading a containerized real-time audio and video distribution background, comprising:

[0006] Start a new container to obtain a system including the old container and the new container, send a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade;

[0007] After receiving the smooth exit signaling, the old container closes its external port and provides services for requests entering through the private port. During the smooth exit of the old container, new access requests are served by the new container.

[0008] Randomly and violently exit the old container in the first time period after the preset time period or exit the old container when there is no playback stream in the old container;

[0009] Among them, the private port of the old container and the external port of the new container are opened.

[0010] Furthermore, in the above-mentioned smooth upgrade method of a containerized real-time audio and video distribution background, the files of the new container and the old container are mounted using Docker's sub-directories to achieve file resource isolation; wherein private files are not mounted, and public information is mounted through a public directory.

[0011] Furthermore, in the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background, both the external port and the private port of the old container are configured with identifiers;

[0012] The flag is used to determine whether to close the port after receiving a smooth exit instruction.

[0013] Furthermore, in the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background, the private port includes: a private port of the container and a private port of a process in the container;

[0014] Among them, the private port of the container is different for different containers, and different processes in the container can share;

[0015] The private ports of the processes in the container are different private ports for different processes in different containers.

[0016] Furthermore, in the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background, the method further includes: before upgrading, merging back to the source in one of the following two ways;

[0017] The first method: seize the lock for merging back to the source, record the process IP and private port for merging back to the source; if the lock for merging back to the source is not seized, record the process IP and private port for merging back to the source to pull the corresponding process;

[0018] The second method: The new container of the first machine is hashed to the second machine, and the stream played before the upgrade is pulled from the new container of the second machine. The new container of the second machine queries whether the second machine has an old container and whether the old container has a stream played before the upgrade. If the query result shows that there is an old container and the old container has a stream played before the upgrade, the corresponding process of the old container is pulled to the stream played before the upgrade. Otherwise, the process goes back to the upper layer.

[0019] Furthermore, the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background further includes: in the smooth exit process, merging back to the source in one of the following two ways;

[0020] The first method: seize the lock for merging back to the source, record the process IP and private port for merging back to the source; if the lock for merging back to the source is not seized, record the process IP and private port for merging back to the source to pull the corresponding process;

[0021] The second method: The new container of the first machine is hashed to the second machine, and the stream played before the upgrade is pulled from the new container of the second machine. The new container of the second machine queries whether the second machine has an old container and whether the old container has a stream played before the upgrade. If the query result shows that there is an old container and the old container has a stream played before the upgrade, the corresponding process of the old container is pulled to the stream played before the upgrade. Otherwise, the process goes back to the upper layer.

[0022] Furthermore, the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background further includes: pulling the stream played before upgrading from the CDN server.

[0023] The second aspect of the present invention further provides a containerized real-time audio and video distribution background smooth upgrade device, comprising:

[0024] New module and sending module: used to start a new container to obtain a system including the old container and the new container, send a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade;

[0025] Receiving module: used for closing the external port of the old container after receiving the signaling of smooth exit, and providing services for the requests entering through the private port. During the smooth exit of the old container, new access requests are served by the new container;

[0026] Exit module: used to randomly and violently exit the old container within the first time period after the preset time period or to exit the old container when the old container has no playback stream;

[0027] Among them, the private port of the old container and the external port of the new container are opened.

[0028] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;

[0029] The processor is used to execute the smooth upgrade method of a containerized real-time audio and video distribution background as described in any one of the above items by calling the program or instruction stored in the memory.

[0030] In a fourth aspect of the present invention, a computer-readable storage medium is further proposed, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute a smooth upgrade method for a containerized real-time audio and video distribution background as described in any one of the above items.

[0031] The beneficial effects of the present invention are as follows: a new container is started to obtain a system including an old container and a new container, a smooth exit instruction is sent to the old container, and after the old container receives the smooth exit signaling, the external port of the old container is closed, and the private port of the old container is used for internal communication. The private port of the old container will not be closed during the smooth exit process, and the external port of the new container is opened, and new access requests are served by the new container. During the smooth exit process, the externally exposed port does not receive new requests, and only the old request service is maintained without interruption. After a preset time period, most of the old request services can be exited, and the old container can be violently exited; or, when the old container has no playback stream, the old container is immediately exited. During this period of time, the externally exposed port of the new container is open, and the new access request is served by the new container, thereby achieving smooth upgrade, and the user transmission process will not be interrupted. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.

[0033] Figure 1 A diagram of a method for smooth upgrading of a containerized real-time audio and video distribution background provided by an embodiment of the present invention;

[0034] Figure 2 A schematic diagram of merging and returning to the source through redis before upgrading provided by an embodiment of the present invention;

[0035] Figure 3 A schematic diagram of merging and returning to the source through redis during a smooth exit process provided by an embodiment of the present invention;

[0036] Figure 4 A schematic diagram of merging back to the source by merging back to the source mode 2 during a smooth exit process provided by an embodiment of the present invention;

[0037] Figure 5 A diagram of a smooth upgrade device for a containerized real-time audio and video distribution background provided by an embodiment of the present invention;

[0038] Figure 6 A schematic block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.

[0040] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.

[0041] In the description of the present invention, the terms "first", "second", and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be internal communication between two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0042] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.

[0043] Before introducing the embodiments of the present invention, professional terms involved in the present invention are first introduced.

[0044] Real-time communication: Real-time communication technology with latency ranging from tens of milliseconds to several seconds.

[0045] Smooth upgrade: In the real-time audio and video background, the transmission process of an audio and video stream often takes several hours or even longer. At this time, if the version needs to be upgraded, it is hoped that the customer will not be aware of it, that is, it will not affect the customer's current audio and video transmission.

[0046] Smooth exit: During the upgrade process, old requests are not interrupted and new requests are not accepted.

[0047] The present invention proposes a containerized real-time audio and video distribution background smooth upgrade method, device, electronic device and storage medium, which is based on the smooth upgrade of the real-time audio and video distribution background by the cooperation of new and old containers, and the user transmission process will not be interrupted.

[0048] Method Embodiment

[0049] Figure 1 A diagram of a smooth upgrade method for a containerized real-time audio and video distribution background provided by an embodiment of the present invention.

[0050] In the first aspect of the present invention, a containerized real-time audio and video distribution background smooth upgrade method is proposed, combining Figure 1 , including three steps from S1 to S3:

[0051] S1: Start a new container to obtain a system including the old container and the new container, send a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade.

[0052] Specifically, in the embodiment of the present invention, before the upgrade, there is only an old container in the system, and starting a new container adds a new container to the system with only the old container. Therefore, starting the new container obtains a system including the old container and the new container, and sends a smooth exit instruction to the old container, and the old container continues to provide services for the old requests before the upgrade.

[0053] S2: After receiving the smooth exit signaling, the old container closes the external port of the old container and provides services for requests entering through the private port. The old container is exiting smoothly, and new access requests are served by the new container.

[0054] Specifically, in the embodiment of the present invention, a smooth exit instruction is sent to the old container. After receiving the smooth exit signaling, the old container closes the external port of the old container, such as port 80 and port 1965, and uses the private port of the old container for internal communication. The private port of the old container will not be closed during the smooth exit process. The old container provides services for incoming requests through the private port. Here, the external port of the new container is opened, and the new access request is served by the new container.

[0055] S3: Randomly and violently exit the old container within the first time period after the preset time period or exit the old container when the old container has no playback stream.

[0056] Specifically, in the embodiment of the present invention, there are two ways to exit the old container:

[0057] The first method: the preset time period can be 6 hours, 7 hours, etc., and the first time period can be within one hour. Here, the length of the preset time period and the first time period is flexibly set according to the actual situation, and does not limit the protection scope of the invention. Here, it can be a random violent exit within a one-hour time period after 6 hours. A random mechanism is added here. For example, after 5 hours, it can be randomly exited within an hour to prevent a large number of old containers from exiting together at the same time, resulting in a sudden drop in a large number of communication links.

[0058] The second method: exit the old container immediately when the old container does not play the stream.

[0059] It should be understood that the online duration of most real-time audio and video streams is less than 6 hours. Therefore, as long as the old container is exiting smoothly and the externally exposed ports do not receive new requests and only the old request services are maintained uninterrupted, most of the old request services can be exited after 6 hours, and the old container can be violently exited at this time; or, the old container can be exited immediately when it does not play the stream. During this period, the externally exposed ports of the new container are open, and new access requests are served by the new container.

[0060] It should also be understood that the 6h here can be set flexibly.

[0061] Furthermore, in the above-mentioned smooth upgrade method of a containerized real-time audio and video distribution background, the files of the new container and the old container are mounted using Docker's sub-directories to achieve file resource isolation; wherein private files are not mounted, and public information is mounted through a public directory.

[0062] Specifically, in the embodiment of the present invention, private files are not mounted, and public information, such as logs, customer domain name configuration, etc., are mounted through a public directory.

[0063] Furthermore, in the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background, both the external port and the private port of the old container are configured with identifiers;

[0064] The flag is used to determine whether to close the port after receiving a smooth exit instruction.

[0065] Specifically, in the embodiment of the present invention, a smooth exit instruction is sent to the old container. After the old container receives the smooth exit signaling, the external port of the old container is closed by configuring an identifier, thereby improving the closing efficiency and user experience.

[0066] Furthermore, in the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background, the private port includes: a private port of the container and a private port of a process in the container;

[0067] Among them, the private port of the container is different for different containers, and different processes in the container can share;

[0068] The private ports of the processes in the container are different private ports for different processes in different containers.

[0069] Specifically, in the embodiment of the present invention, private ports can be divided into multiple groups, and one container occupies one group (the private ports of the container and the private ports of the process in the container). When the container is started, the allocation is detected, that is, the group of ports that are not occupied is used.

[0070] Furthermore, in the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background, the method further includes: before upgrading, merging back to the source in one of the following two ways;

[0071] Among them, the first method: seize the lock of the merge back to the source, record the process IP and private port of the merge back to the source, and merge back to the source; if the lock of the merge back to the source is not seized, record the process IP and private port of the merge back to the source to pull the corresponding process.

[0072] Specifically, in the embodiment of the present invention, redis is used to seize the locks of merging back to the source and record the distribution of the locks of seizing and merging back to the source.

[0073] Figure 2 A schematic diagram of merging and returning to the source through redis before upgrading is provided in an embodiment of the present invention.

[0074] Exemplary, combined Figure 2 Before the upgrade, the old container is merged back to the source through redis. After the old container 1 goes to redis for query, the old container 2 uses the private port to merge back to the source.

[0075] The second method: The new container of the first machine is hashed to the second machine, and the stream played before the upgrade is pulled from the new container of the second machine. The new container of the second machine queries whether the second machine has an old container and whether the old container has a stream played before the upgrade. If the query result shows that there is an old container and the old container has a stream played before the upgrade, the corresponding process of the old container is pulled to the stream played before the upgrade. Otherwise, the process goes back to the upper layer.

[0076] Furthermore, the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background further includes: in the smooth exit process, merging back to the source in one of the following two ways;

[0077] Among them, the first method: seize the lock of the merge back to the source, record the process IP and private port of the merge back to the source, and merge back to the source; if the lock of the merge back to the source is not seized, record the process IP and private port of the merge back to the source to pull the corresponding process.

[0078] Here, the lock used to seize and merge data back to the source is a distributed lock, which can be implemented using components such as redis.

[0079] Figure 3 A schematic diagram of merging back to the source through redis during a smooth exit process provided by an embodiment of the present invention.

[0080] Exemplary, combined Figure 3 During the smooth exit process, the old container is merged back to the source through redis. After the new container 1 goes to redis for query, it goes to the old container 2 for merge back to the source using the private port. After the old container 2 goes to redis for query, it goes to the old container 2 for merge back to the source using the private port. Finally, it is merged back to the source to the old container 1, and the old container 1 is returned to the upper layer.

[0081] The second method: The new container of the first machine is hashed to the second machine, and the stream played before the upgrade is pulled from the new container of the second machine. The new container of the second machine queries whether the second machine has an old container and whether the old container has a stream played before the upgrade. If the query result shows that there is an old container and the old container has a stream played before the upgrade, the corresponding process of the old container is pulled to the stream played before the upgrade. Otherwise, the process goes back to the upper layer.

[0082] Figure 4 A schematic diagram of merging back to the source through merging back to the source mode 2 during a smooth exit process provided by an embodiment of the present invention.

[0083] Combination Figure 4 , including seven steps: the Actor is playing stream A, the old container of the first machine is hash-merged and returned to the source, the old container of the second machine is returned to the source at the upper layer, the Actor is playing stream A, the new container of the first machine is hash-merged and returned to the source, the new container of the second machine uses http request to query whether the old container of the second machine has the stream played before the upgrade, if yes, go to the corresponding process of the old container of the second machine to pull the stream played before the upgrade, otherwise go directly to the upper layer to return to the source.

[0084] Furthermore, the above-mentioned method for smooth upgrading of a containerized real-time audio and video distribution background further includes: pulling the stream played before upgrading from the CDN server.

[0085] Specifically, in the embodiment of the present invention, there are two scenarios for going to the CDN server to pull the stream played before the upgrade:

[0086] The first type: the old container of machine A plays the stream played before the upgrade, and the stream played before the upgrade is on the container of machine B. The second type: the new container of machine A plays the stream played before the upgrade, and the stream played before the upgrade is on the old container of machine B.

[0087] Here, the push stream on the old container reports the IP address of the machine where it is located and the private port of the process to the CDN server. In this way, whether the new or old container wants to play the stream played before the upgrade, it will go to the CDN server to query the distribution of the stream played before the upgrade, and then go to the corresponding IP address and use the corresponding private port to pull the stream.

[0088] Device Embodiment

[0089] Figure 5 A diagram of a smooth upgrade device for a containerized real-time audio and video distribution background provided by an embodiment of the present invention.

[0090] In a second aspect of the present invention, a containerized real-time audio and video distribution background smooth upgrade device is also proposed, combining Figure 5 ,include:

[0091] The new module 51 and the sending module 52 are used to create a new container to obtain a system including the old container and the new container, and the old container continues to provide services for requests before the upgrade.

[0092] Specifically, in the embodiment of the present invention, there is only an old container in the system before the upgrade, and the new container startup module 51 adds a new container to the system with only the old container. Therefore, the new container startup obtains a system including the old container and the new container, and the sending module 52 sends a smooth exit instruction to the old container.

[0093] Receiving module 53: used for closing the external port of the old container after receiving the smooth exit signaling, and providing services for the requests entering through the private port. During the smooth exit of the old container, new access requests are served by the new container.

[0094] Specifically, in the embodiment of the present invention, a smooth exit instruction is sent to the old container. After receiving the smooth exit signaling, the receiving module 53 of the old container closes the external port of the old container, such as port 80 and port 1935, and uses the private port of the old container for internal communication. The private port of the old container will not be closed during the smooth exit process. Here, the external port of the new container is opened, and the new access request is served by the new container.

[0095] Exit module 54: used for randomly and violently exiting the old container within a first time period after a preset time period or exiting the old container when the old container has no playing stream.

[0096] Specifically, in the embodiment of the present invention, the exit module 54 exits the old container in two ways:

[0097] The first method: the preset time period can be 6 hours, and the first time period can be within 1 hour. It should be understood that the preset time period and the first time period can be flexibly set according to actual conditions, and the protection scope of the present invention is not limited thereto. For example, a random and violent exit within a one-hour time period after 6 hours can prevent a large number of old containers from exiting together at the same time, resulting in a sudden drop in a large number of communication links.

[0098] The second method: exit the old container immediately when the old container does not play the stream.

[0099] It should be understood that the online duration of most real-time audio and video streams is less than 6 hours. Therefore, as long as the old container is exiting smoothly and the externally exposed ports do not receive new requests and only the old request services are maintained uninterrupted, most of the old request services can be exited after 6 hours, and the old container can be violently exited at this time; or, the old container can be exited immediately when it does not play the stream. During this period, the externally exposed ports of the new container are open, and new access requests are served by the new container.

[0100] According to a third aspect of the present invention, an electronic device is provided, comprising: a processor and a memory;

[0101] The processor is used to execute the smooth upgrade method of a containerized real-time audio and video distribution background as described in any one of the above items by calling the program or instruction stored in the memory.

[0102] In a fourth aspect of the present invention, a computer-readable storage medium is further proposed, wherein the computer-readable storage medium stores a program or instruction, wherein the program or instruction enables a computer to execute a smooth upgrade method for a containerized real-time audio and video distribution background as described in any one of the above items.

[0103] Figure 6 It is a schematic block diagram of an electronic device provided by an embodiment of the present invention.

[0104] like Figure 6 As shown, the electronic device includes: at least one processor 601, at least one memory 602 and at least one communication interface 603. The various components in the electronic device are coupled together through a bus system 604. The communication interface 603 is used to transmit information between external devices. It can be understood that the bus system 604 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 604 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 6 Various buses are labeled as bus system 604 .

[0105] It can be understood that the memory 602 in this embodiment can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories.

[0106] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system and application programs.

[0107] The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. A program that implements any method of a containerized real-time audio and video distribution background smooth upgrade method provided in an embodiment of the present invention can be included in the application.

[0108] In an embodiment of the present invention, the processor 601 calls a program or instruction stored in the memory 602, specifically, a program or instruction stored in an application, and the processor 601 is used to execute the steps of each embodiment of a method for smooth upgrading of a containerized real-time audio and video distribution background provided in an embodiment of the present invention.

[0109] Start a new container to obtain a system including the old container and the new container, send a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade;

[0110] After receiving the smooth exit signaling, the old container closes its external port and provides services for requests entering through the private port. During the smooth exit of the old container, new access requests are served by the new container.

[0111] Forcefully exit the old container after a preset period of time or when the old container does not play any streams;

[0112] Among them, the private port of the old container and the external port of the new container are opened.

[0113] Any method in the method for smooth upgrading of a containerized real-time audio and video distribution background provided by an embodiment of the present invention can be applied to the processor 601, or implemented by the processor 601. The processor 601 can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 601 or instructions in the form of software. The above-mentioned processor 601 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0114] The steps of any method in the method for smooth upgrading of a containerized real-time audio and video distribution background provided by an embodiment of the present invention can be directly embodied as being executed by a hardware decoding processor, or being executed by a combination of hardware and software units in the decoding processor. The software unit can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602, and completes the steps of the method in combination with its hardware.

[0115] Those skilled in the art will appreciate that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present invention and to form different embodiments.

[0116] Those skilled in the art will appreciate that the description of each embodiment has its own emphasis, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0117] Although the embodiments of the present invention are described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims. The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed by the present invention, and these modifications or substitutions should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

[0118] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for smooth upgrading of a containerized real-time audio and video distribution background, characterized in that: include: Start a new container to obtain a system including the old container and the new container, send a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade; After receiving the smooth exit signaling, the old container closes its external port and provides services for requests entering through the private port. During the smooth exit of the old container, new access requests are served by the new container. Randomly and violently exit the old container in the first time period after the preset time period or exit the old container when there is no playback stream in the old container; Among them, the private port of the old container and the external port of the new container are both open.

2. According to claim 1, a method for smoothly upgrading a containerized real-time audio and video distribution background is characterized in that: The files of the new container and the old container are mounted using Docker's sub-directories to achieve file resource isolation; private files are not mounted, and public information is mounted through a public directory.

3. According to claim 1, a method for smoothly upgrading a containerized real-time audio and video distribution background is characterized in that: The external ports and private ports of the new container and the old container are both configured with identifiers; The flag is used to determine whether to close the port after receiving a smooth exit instruction.

4. According to claim 1, a method for smoothly upgrading a containerized real-time audio and video distribution background is characterized in that: The private port includes: a private port of the container and a private port of a process in the container; Among them, the private port of the container is different for different containers, and different processes in the container can share; The private ports of the processes in the container are different private ports for different processes in different containers.

5. According to claim 1, a method for smoothly upgrading a containerized real-time audio and video distribution background is characterized in that: The method further includes: merging back to the source in one of the following two ways before upgrading; The first method: seize the lock for merging back to the source, record the process IP and private port for merging back to the source; if the lock for merging back to the source is not seized, record the process IP and private port for merging back to the source to pull the corresponding process; The second method: The new container of the first machine is hashed to the second machine, and the new container of the second machine is used to pull the stream played before the upgrade. The new container of the second machine queries whether the second machine has an old container and whether the old container has the stream played before the upgrade. If the query result shows that there is an old container and the old container has the stream played before the upgrade, the corresponding process of the old container is used to pull the stream played before the upgrade. Otherwise, the process goes back to the upper layer.

6. According to claim 1, a method for smoothly upgrading a containerized real-time audio and video distribution background is characterized in that: The method further includes: in the smooth exit process, merging back to the source in one of the following two ways; The first method: seize the lock for merging back to the source, record the process IP and private port for merging back to the source; if the lock for merging back to the source is not seized, record the process IP and private port for merging back to the source to pull the corresponding process; The second method: The new container of the first machine is hashed to the second machine, and the new container of the second machine is used to pull the stream played before the upgrade. The new container of the second machine queries whether the second machine has an old container and whether the old container has the stream played before the upgrade. If the query result shows that there is an old container and the old container has the stream played before the upgrade, the corresponding process of the old container is used to pull the stream played before the upgrade. Otherwise, the process goes back to the upper layer.

7. According to claim 1, a method for smoothly upgrading a containerized real-time audio and video distribution background is characterized in that: The method further includes: fetching the stream played before the upgrade from the CDN server.

8. A containerized real-time audio and video distribution background smooth upgrade device, characterized in that: include: New module and sending module: used to start a new container to obtain a system including the old container and the new container, send a smooth exit instruction to the old container, and the old container continues to provide services for requests before the upgrade; Receiving module: used for closing the external port of the old container after receiving the signaling of smooth exit, and providing services for the requests entering through the private port. During the smooth exit of the old container, new access requests are served by the new container; Exit module: used to randomly and violently exit the old container within the first time period after the preset time period or to exit the old container when the old container has no playback stream; Among them, the private port of the old container and the external port of the new container are both open.

9. An electronic device, characterized in that: include: Processor and memory; The processor is used to execute the smooth upgrade method of the containerized real-time audio and video distribution background as described in any one of claims 1 to 7 by calling the program or instruction stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and the program or instruction enables a computer to execute a smooth upgrade method for a containerized real-time audio and video distribution background as described in any one of claims 1 to 7.