Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a live broadcast service upgrade processing method, a live broadcast service upgrade processing apparatus, and a computer readable storage medium and a server for implementing the live broadcast service upgrade processing method.
In a first aspect, an embodiment of the present disclosure provides a live broadcast service upgrade processing method, including:
when detecting that a service process of a live broadcast service is upgraded, disconnecting an index request sent by a client to the service process;
sending a notification message to the client, wherein the notification message instructs the client to retry sending a new index request;
receiving a new index request sent by the client, responding the new index request by the updated new service process to re-slice, and returning index information of a slice file to the client;
and responding to a patch request sent by the client, and sending a corresponding slice file to the client, wherein the patch request is generated by the client based on the index information.
In some embodiments of the present disclosure, the sending, by the disconnection client, the index request to the business process includes:
when the business process is detected to be upgraded, sending state indicating information to the business process, wherein the state indicating information indicates that the business process configures the self state into a closed state;
and when detecting that the self state of the business process is a closing state, closing the index request of the business process.
In some embodiments of the present disclosure, the sending, when it is detected that the business process is upgraded, status indication information to the business process includes:
when the business process is detected to be upgraded, judging whether the business process is currently processing the live stream;
and when the business process is currently processing the live stream, sending the state indication information to the business process.
In some embodiments of the present disclosure, the method further comprises:
and when the live stream is not processed currently by the business process, all requests sent to the business process by the client are disconnected, wherein all the requests at least comprise the index request.
In some embodiments of the present disclosure, the sending a patch request to a client in response to a patch request sent by the client, where the patch request carries an identifier of a required slice file, includes:
analyzing the patch request to acquire the identifier of the slice file;
determining a corresponding target slice file based on the identification of the slice file;
and sending the target slice file to the client.
In some embodiments of the present disclosure, before the step of receiving a new index request sent by the client, the method further includes:
and upgrading the business process to the new business process in a hot upgrading mode.
In a second aspect, an embodiment of the present disclosure provides a live broadcast service upgrade processing apparatus, including:
the request closing module is used for disconnecting the index request sent by the client to the business process when detecting that the business process of the live broadcast business is upgraded;
a notification retry module, configured to send a notification message to the client, where the notification message indicates the client to retry sending a new index request;
the service processing module is used for receiving a new index request sent by the client, responding the new index request by the updated new service process to perform re-slicing, and returning index information to the client;
and the request processing module is used for responding to a patch request sent by the client and sending a corresponding slice file to the client, wherein the patch request is generated by the client based on the index information.
In some embodiments of the present disclosure, the request shutdown module includes an information processing module and a shutdown module; wherein, the information processing module comprises:
the upgrading detection submodule is used for detecting whether the business process is upgraded or not;
the information sending submodule is used for sending state indicating information to the business process when the upgrading detection submodule detects that the business process is upgraded, and the state indicating information indicates that the business process configures the self state into a closed state;
and the closing module is used for closing the index request of the business process when detecting that the self state of the business process is a closing state.
In some embodiments of the present disclosure, the information processing module further includes:
the judging submodule is used for judging whether the business process is currently processing the live stream or not when the upgrading detection submodule detects that the business process is upgraded;
the information sending submodule is further configured to send the state indication information to the service process when the service process is currently processing a live stream.
In some embodiments of the present disclosure, the shutdown module is further configured to:
and when the judging submodule determines that the business process does not process the live stream currently, all requests sent to the business process by the client are disconnected, wherein all the requests at least comprise the index request.
In some embodiments of the present disclosure, the patch request carries an identifier of a required slice file, and the request processing module is specifically configured to:
analyzing the patch request to acquire the identifier of the slice file;
determining a corresponding target slice file based on the identification of the slice file;
and sending the target slice file to the client.
In some embodiments of the present disclosure, the apparatus further comprises:
and the upgrading module is used for upgrading the business process to the new business process in a hot upgrading mode before the business processing module receives the new index request sent by the client.
In a third aspect, an embodiment of the present disclosure provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps of the live broadcast service upgrade processing method described in any of the foregoing embodiments are implemented.
In a fourth aspect, an embodiment of the present disclosure provides a server, including:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to execute the steps of the live service upgrade processing method according to any one of the above embodiments through executing the executable instructions.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
when detecting that a service process of a live broadcast service is upgraded, disconnecting an index request sent by a client to the service process, sending a notification message to the client, wherein the notification message instructs the client to retry sending a new index request, then receiving the new index request sent by the client, responding the new index request by the upgraded new service process to re-slice, returning index information of a slice file to the client, and finally responding a patch request sent by the client and generated based on the index information, and sending a corresponding slice file to the client. In this way, according to the scheme adopted by this embodiment, when the service process is upgraded, the index request of the service process is disconnected, that is, the new index request is not received, then the client is instructed to resend the new index request, then the upgraded new service process responds to the new index request to re-slice, and finally, the patch request sent by the client is responded again and the corresponding slice file is returned to the client, so that the problem that the patch request occurs 404 in the upgrading process is avoided, and the experience of the user in watching the live broadcast content is improved.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
It is to be understood that, hereinafter, "at least one" means one or more, "a plurality" means two or more. "and/or" is used to describe the association relationship of the associated objects, meaning that there may be three relationships, for example, "a and/or B" may mean: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
Fig. 1 is a flowchart of a live broadcast service upgrade processing method shown in this disclosure, and the live broadcast service upgrade processing method may be applied to a server, such as a P2P live broadcast service server, but is not limited thereto. The live broadcast service upgrading processing method can comprise the following steps:
step S101: and when detecting that the service process of the live broadcast service is upgraded, disconnecting the index request sent to the service process by the client.
Illustratively, the business process is a business process of a live broadcast business before upgrading. The client may include, but is not limited to, a tablet, a smart phone, a computer, etc., which may establish a communication connection with the server, such as a Transmission Control Protocol (TCP) connection. The index request can generally include, but is not limited to, identification information such as name, number and the like of the audio and video that the user wants to view, and the server can receive and respond to the index request sent by the client.
In an embodiment, when the server detects that a service process of the live service is upgraded, the server disconnects an index request sent by the client to the service process, that is, the service process does not receive an index request sent by a response client any more from the current time.
Step S102: and sending a notification message to the client, wherein the notification message instructs the client to retry sending a new index request.
For example, after disconnecting the index request sent by the client to the business process, the server may send a notification message to the client to instruct the client to resend a new index request.
Step S103: and receiving a new index request sent by the client, responding to the new index request by the updated new service process to perform re-slicing, and returning index information of the sliced file to the client.
Illustratively, the new service process is a service process after the service process of the live broadcast service is upgraded. And after receiving the notification message, the client resends the new index request to the server, and the updated new business process in the server responds to the new index request to re-slice so as to produce a slice file and returns the index information of the slice file to the client.
Step S104: and responding to a patch request sent by the client, and sending a corresponding slice file to the client, wherein the patch request is generated by the client based on the index information.
Illustratively, after re-slicing and returning index information of a slice file to a client, the server receives a patch request generated by the client based on the index information, and responds to the patch request to return a corresponding slice file to the client, so that the client acquires a missing slice file to play audio and video.
According to the live broadcast service upgrading processing method provided by the embodiment of the disclosure, when it is detected that the service process of the live broadcast service is upgraded, the index request sent by the client to the service process is disconnected, a notification message is sent to the client to indicate the client to retry sending of the new index request, then the new index request sent by the client is received, the upgraded new service process responds to the new index request to perform re-slicing, the index information of the slice file is returned to the client, and finally the patch request generated based on the index information and sent by the client is responded, and the corresponding slice file is sent to the client. In this way, according to the scheme adopted by this embodiment, when the service process is upgraded, the index request of the service process is disconnected, that is, the new index request is not received, then the client is instructed to resend the new index request, then the upgraded new service process responds to the new index request to re-slice, and finally, the patch request sent by the client is responded again and the corresponding slice file is returned to the client, so that the problem that the patch request occurs 404 in the upgrading process is avoided, and the experience of the user in watching the live broadcast content is improved.
Optionally, in some embodiments of the present disclosure, before receiving the new index request sent by the client in step S103, when the business process is upgraded, the business process may be upgraded to the new business process in a hot upgrade manner.
Specifically, the hot upgrading is also realized without stopping the upgrading, the service process is not required to be restarted in the upgrading process, the service process can be kept stable, so that the quick switching can be realized, the seamless switching is basically realized, the user feels no sense, the influence on the live content is avoided, such as blockage and the like, and the live watching experience of the user is improved. It will be appreciated that the particular process hot upgrade approach may be understood with reference to the prior art and will not be described in detail herein.
Optionally, in some embodiments of the present disclosure, with reference to fig. 2, the step S101 of interrupting the index request sent by the client to the service process may specifically include the following steps:
step S201: and when the business process is detected to be upgraded, sending state indicating information to the business process, wherein the state indicating information indicates that the business process configures the self state into a closed state.
For example, the self-state of the business process may include, but is not limited to, a normal state and a shutdown state, the normal state may be identified by the attribute parameter 0, and the shutdown state may be identified by the attribute parameter 1. In the closed state, even if the business process does not receive the index request sent by the response client after the current time.
Specifically, in an example, when detecting that the service process is upgraded, the server sends state indication information to the service process, and the service process sets an attribute parameter of the service process to 1 in response to the state indication information, that is, configures a state of the service process to a closed state.
Step S202: and when detecting that the self state of the business process is a closing state, closing the index request of the business process.
Illustratively, when the server detects that the attribute parameter of the business process is 1, that is, the business process is determined to be in a shutdown state, the index request of the business process is shut down at this time, even if the business process does not receive the index request sent by the response client any more from the current time.
After step S202, step S102 to step S104 may be continuously performed, which may specifically refer to the detailed description in the foregoing embodiments and is not repeated herein.
According to the scheme of the embodiment, the problem that the patching request is 404 generated in the upgrading process is avoided, the experience of watching live broadcast content of a user is improved, and meanwhile, the service process is indicated to configure the self state into the closed state by sending the state indication information to the service process, so that the closing of the index request of the service process can be simply, conveniently and quickly realized, and the overall processing efficiency is improved to a certain extent.
Optionally, on the basis of the foregoing embodiments, in some embodiments of the present disclosure, with reference to fig. 3, when it is detected in step S201 that the service process is upgraded, sending state indication information to the service process may specifically include the following steps:
step S301: and when the business process is detected to be upgraded, judging whether the business process is currently processing the live stream.
It should be noted that, even if the service process does not receive any index request from the responding client after the current time, the service process may receive a response to other requests, such as a live stream processing request, at the current time or before. At this time, if all requests of the business process are closed, the live content playing may be affected, such as increasing the pause. Therefore, in this embodiment, before the index request of the service process is to be closed when the service process is upgraded, the server may determine whether the service process is currently processing the live stream.
Step S302: and when the business process is currently processing the live stream, sending the state indication information to the business process.
Specifically, when the server determines that the business process is currently processing the live stream, the server sends the state indication information to the business process to indicate that the business process only closes the index request, i.e., a part of the requests, instead of all the requests, so that the business process can, for example, continue to receive and respond to other requests, such as a request for processing the live stream. Therefore, the influence on the playing of live content can be reduced, such as the reduction of pause, and the live watching experience of a user is further improved.
Optionally, on the basis of the above embodiments, in some embodiments of the present disclosure, the method may further include: and when the live stream is not processed currently by the business process, all requests sent to the business process by the client are disconnected, wherein all the requests at least comprise the index request.
Specifically, when the server determines that the service process is not currently processing the live stream, all requests sent by the service process, such as an index request and a live stream processing request, may be closed. In this way, in this embodiment, an index request or all requests for only closing the service process may be flexibly set according to actual needs, so that the application range of the embodiment is wide.
Optionally, on the basis of the foregoing embodiments, in some embodiments of the present disclosure, the patch request may carry an identifier, such as a unique code, of the required slice file. Correspondingly, as shown in fig. 4, in step S104, in response to the patch request sent by the client, sending a corresponding slice file to the client, specifically, the following steps may be included:
step S401: and analyzing the patch request to acquire the identification of the slice file.
Illustratively, after receiving a patch request sent by a client, a server parses the patch request to obtain an identifier, such as a unique code, of a slice file.
Step S402: determining a corresponding target slice file based on the identification of the slice file.
For example, after the server parses the patch request to obtain the identifier of the slice file, such as the unique code, the server may look up the corresponding target slice file in the previously re-sliced slice file based on the unique code. Each slice file can carry an identifier such as a unique code, so that the server can conveniently compare and determine the target slice file, and if the unique code in the patch request is the same as the unique code of a certain slice file, the slice file can be determined to be the target slice file.
Step S403: and sending the target slice file to the client.
For example, after the server finds and determines the target slice file, the target slice file may be sent to the client, and the client may implement live content playing based on the target slice file and other slice files that have been acquired before.
According to the scheme adopted by the embodiment, when the business process is upgraded, the index request of the business process is disconnected, namely the new index request is not received, the client is indicated to resend the new index request, the upgraded new business process responds to the new index request to re-slice, and finally the patch request sent by the client is responded to and the corresponding slice file is returned to the client, so that the problem that the patch request has 404 in the upgrading process is avoided, and the experience of watching live broadcast content by a user is improved.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc. Additionally, it will also be readily appreciated that the steps may be performed synchronously or asynchronously, e.g., among multiple modules/processes/threads.
Based on the same inventive concept, the embodiment of the present disclosure further provides a live broadcast service upgrade processing apparatus, as shown in fig. 5, the live broadcast service upgrade processing apparatus may include arequest closing module 501, a notification retrymodule 502, aservice processing module 503, and arequest processing module 504; wherein:
therequest closing module 501 is configured to disconnect an index request sent by a client to a service process of a live broadcast service when detecting that the service process is upgraded.
The notification retrymodule 502 is configured to send a notification message to the client, where the notification message instructs the client to retry sending a new index request.
Theservice processing module 503 is configured to receive a new index request sent by the client, re-slice the updated new service process in response to the new index request, and return index information to the client.
Therequest processing module 504 is configured to send, in response to a patch request sent by the client, a corresponding slice file to the client, where the patch request is generated by the client based on the index information.
When detecting that the service process of the live broadcast service is updated, the device for processing the upgrade of the live broadcast service provided by the embodiment of the present disclosure disconnects the index request sent by the client to the service process, sends a notification message to the client to instruct the client to retry sending a new index request, then receives the new index request sent by the client, re-slices the updated new service process in response to the new index request, returns the index information of the slice file to the client, and finally sends a corresponding slice file to the client in response to a patch request generated based on the index information and sent by the client. In this way, according to the scheme adopted by this embodiment, when the service process is upgraded, the index request of the service process is disconnected, that is, the new index request is not received, then the client is instructed to resend the new index request, then the upgraded new service process responds to the new index request to re-slice, and finally, the patch request sent by the client is responded again and the corresponding slice file is returned to the client, so that the problem that the patch request occurs 404 in the upgrading process is avoided, and the experience of the user in watching the live broadcast content is improved.
Optionally, in some embodiments of the present disclosure, therequest closing module 501 may include an information processing module and a closing module; the information processing module may include an upgrade detection submodule and an information sending submodule, the upgrade detection submodule is configured to detect whether the service process is upgraded, the information sending submodule is configured to send status indication information to the service process when the upgrade detection submodule detects that the service process is upgraded, and the status indication information indicates that the service process configures a self status as a closed status. And the closing module is used for closing the index request of the business process when detecting that the self state of the business process is a closing state.
In some embodiments of the present disclosure, the information processing module may further include a determining submodule, configured to determine, when the upgrade detecting submodule detects that the service process is upgraded, whether the service process is currently processing a live stream; the information sending submodule is further configured to send the state indication information to the service process when the service process is currently processing a live stream.
Optionally, in some embodiments of the present disclosure, the closing module is further configured to: and when the judging submodule determines that the business process does not process the live stream currently, all requests sent to the business process by the client are disconnected, wherein all the requests at least comprise the index request.
Optionally, in some embodiments of the present disclosure, the patch request carries an identifier of a required slice file, and therequest processing module 504 is specifically configured to: analyzing the patch request to acquire the identifier of the slice file; determining a corresponding target slice file based on the identification of the slice file; and sending the target slice file to the client.
Optionally, in some embodiments of the present disclosure, the apparatus may further include an upgrading module, configured to upgrade the service process to the new service process in a hot upgrade manner before the service processing module receives the new index request sent by the client.
The specific manner in which the above-mentioned embodiments of the apparatus, and the corresponding technical effects brought about by the operations performed by the respective modules, have been described in detail in the embodiments related to the method, and will not be described in detail herein.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units. The components shown as modules or units may or may not be physical units, i.e. may be located in one place or may also be distributed over a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the wood-disclosed scheme. One of ordinary skill in the art can understand and implement it without inventive effort.
The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the live broadcast service upgrade processing method according to any one of the embodiments.
By way of example, and not limitation, such readable storage media can be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Embodiments of the present disclosure also provide a server, which includes a processor and a memory, where the memory is used to store executable instructions of the processor. Wherein the processor is configured to execute the steps of the live service upgrade processing method in any one of the above embodiments via executing the executable instructions.
Theserver 600 according to this embodiment of the present invention is described below with reference to fig. 6. Theserver 600 shown in fig. 6 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in FIG. 6, theserver 600 is in the form of a general purpose computing device. The components ofserver 600 may include, but are not limited to: at least oneprocessing unit 610, at least onestorage unit 620, abus 630 that connects the various system components (including thestorage unit 620 and the processing unit 610), adisplay unit 640, and the like.
Wherein the storage unit stores program code, which can be executed by theprocessing unit 610, so that theprocessing unit 610 executes the steps according to various exemplary embodiments of the present invention described in the above live service upgrade processing method section of this specification. For example, theprocessing unit 610 may perform the steps of the live service upgrade processing method as shown in fig. 1.
Thestorage unit 620 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)6201 and/or acache memory unit 6202, and may further include a read-only memory unit (ROM) 6203.
Thememory unit 620 may also include a program/utility 6204 having a set (at least one) ofprogram modules 6205,such program modules 6205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 630 may be one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
Theserver 600 may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with theserver 600, and/or with any devices (e.g., router, modem, etc.) that enable theserver 600 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O)interface 650. Further, theserver 600 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) via anetwork adapter 660. Thenetwork adapter 660 may communicate with the other modules of theserver 600 via thebus 630. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with theserver 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, where the software product may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the live service upgrade processing method according to the embodiments of the present disclosure.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.