Service process processing method and related equipment
By synchronizing memory status and task configuration information to the storage system during the execution of the service process, the task interruption caused by service process exceptions is solved, and the rapid task recovery and system reliability are achieved.
Patent Information
- Application Number
- CN202410015916.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, service process exceptions cause task execution interruption, affect task execution efficiency and reduce system reliability and recoverability. Especially when resources are insufficient or system errors, manual recovery of service process may lead to loss of task progress.
By synchronizing memory status information and task configuration information to the storage system during the execution of the service process, if the process is abnormal, this information is obtained from the storage system to call the new service process to continue the task, ensuring that the task will resume to the previous progress.
Improve task execution efficiency, enhance system reliability and recoverability, avoid duplicate configuration, and ensure that tasks are quickly restored in case of interruptions.
Smart Images

Figure CN120256037A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technologies, and in particular, to a service process processing method, a service process processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the development of computer technologies, various functional services can be provided in a computer device, and these functional services are implemented by running corresponding service processes (which can be simply referred to as processes) in an operating system. Exemplarily, if a user enables a certain function, a task corresponding to the function can be created, and a service process can be called to schedule corresponding resources to execute the task, thereby making the function available. In the actual application process, a running service process may encounter an exception (such as a process crash) due to reasons such as insufficient resources or system errors, which may cause the interruption of task execution and problems such as abnormal program exit. Currently, in the case of a service process exception, it is possible to manually recover the service process, which is not very friendly to some service processes that require task configuration, and may cause the loss of some task progress, thereby affecting the task execution efficiency and reducing the reliability and recoverability of the system. Summary of the Invention
[0003] Embodiments of this application provide a service process processing method and related devices, which can improve the task execution efficiency and enhance the reliability and recoverability of the system.
[0004] On the one hand, embodiments of this application provide a service process processing method, which includes:
[0005] In response to an execution request of a target multimedia task, call a first service process to execute the target multimedia task based on first task configuration information of the target multimedia task;
[0006] During the execution of the target multimedia task by the first service process, synchronize the memory state information and the first task configuration information of the first service process to a storage system, where the memory state information of the first service process changes dynamically as the target multimedia task is executed;
[0007] If the first service process encounters an exception before the target multimedia task is completed, obtain the memory state information and the first task configuration information of the first service process from the storage system;
[0008] Call a second service process to continue executing the target multimedia task based on the obtained memory state information and the first task configuration information of the first service process.
[0009] On the one hand, embodiments of this application provide a service process processing device, which includes:
[0010] A processing unit, configured to, in response to an execution request of a target multimedia task, call a first service process to execute the target multimedia task based on first task configuration information of the target multimedia task;
[0011] A synchronization unit, configured to, during the execution of the target multimedia task by the first service process, synchronize the memory state information and the first task configuration information of the first service process to a storage system, where the memory state information of the first service process changes dynamically as the target multimedia task is executed;
[0012] An acquisition unit, configured to, if the first service process encounters an exception before the execution of the target multimedia task is completed, acquire the memory state information and the first task configuration information of the first service process from the storage system;
[0013] The processing unit is further configured to call a second service process to continue executing the target multimedia task based on the acquired memory state information and first task configuration information of the first service process.
[0014] On the one hand, an embodiment of the present application provides a computer device, which includes:
[0015] A processor, suitable for executing a computer program;
[0016] A computer-readable storage medium, in which a computer program is stored. When the computer program is executed by the processor, the service process processing method as described above is implemented.
[0017] Correspondingly, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is loaded and executed by the processor to implement the service process processing method as described above.
[0018] Correspondingly, an embodiment of the present application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by the processor, the service process processing method as described above is implemented.
[0019] In an embodiment of the present application, in response to an execution request for a target multimedia task, a first service process may be invoked to execute the target multimedia task based on first task configuration information of the target multimedia task. During the execution of the target multimedia task by the first service process, the memory status information of the first service process and the first task configuration information of the target multimedia task may be synchronized to a storage system, and the memory status information of the first service process changes dynamically as the target multimedia task is executed. In the event that the first service process encounters an exception, the memory status information and the first task configuration information of the first service process may be obtained from the storage system, and a second service process may be invoked to continue processing the target multimedia task based on the memory status information and the first task configuration information of the first service process. In this way, in the event that a service process encounters an exception, a new service process (i.e., the second service process) may be launched, and the latest information previously synchronized to the storage system may be applied to the new service process, thereby automatically and effectively restoring the execution status of the service process and the configuration of the target multimedia task to resume the target multimedia task to the previous task progress. In this way, in the event of a task interruption, the target multimedia task can be continued based on the previous task progress, which effectively enhances the reliability and recoverability of the system; in addition, since the configuration of the target multimedia task can be restored based on the first task configuration information previously backed up to the storage system without having to be configured repeatedly, the execution efficiency of the multimedia task can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] To more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0021] Figure 1 is an architecture diagram of a service process processing system provided by an exemplary embodiment of the present application;
[0022] Figure 2 is a flowchart of a service process processing method provided by an exemplary embodiment of the present application;
[0023] Figure 3a is a scenario diagram of a task configuration provided by an exemplary embodiment of the present application;
[0024] Figure 3b is another scenario diagram of a task configuration provided by an exemplary embodiment of the present application;
[0025] Figure 3cIt is a schematic diagram of information synchronization provided by an exemplary embodiment of the present application;
[0026] Figure 4 It is a schematic flowchart of another service process handling method provided by an exemplary embodiment of the present application;
[0027] Figure 5a It is a schematic diagram of the memory state information synchronization of a service process provided by an exemplary embodiment of the present application;
[0028] Figure 5b It is a schematic diagram of service process crash detection provided by an exemplary embodiment of the present application;
[0029] Figure 5c It is a schematic diagram of the recovery of memory state information provided by an exemplary embodiment of the present application;
[0030] Figure 5d It is a comparison schematic diagram of task configuration recovery provided by an exemplary embodiment of the present application;
[0031] Figure 6 It is an architecture diagram of another service process handling system provided by an exemplary embodiment of the present application;
[0032] Figure 7 It is a schematic structural diagram of a service process handling device provided by an exemplary embodiment of the present application;
[0033] Figure 8 It is a schematic structural diagram of a computer device provided by an exemplary embodiment of the present application. Detailed implementation manners
[0034] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0035] The present application provides a service process handling method. The service process handling method can, in response to an execution request of a target multimedia task, invoke a first service process and execute the target multimedia task based on first task configuration information of the target multimedia task. In this way, the first service process can execute the target multimedia task based on the latest task configuration information. During the execution of the target multimedia task by the first service process, the memory status information of the first service process and the first task configuration information of the target multimedia task can both be synchronized to a storage system. Thus, when an exception occurs to the first service process (such as the first service process crashing), the memory status information and the first task configuration information of the first service process can be directly obtained from the storage system, and a second service process can be invoked to execute the target multimedia task based on the memory status information and the first task configuration information of the first service process. In this way, the second service process can take over the execution of the target multimedia task from the first service process that has encountered an exception. The second service process can be adjusted to the corresponding execution state based on the memory status information of the first service process, and the configuration of the target multimedia task can be restored to the previous configuration based on the first task configuration information synchronized to the storage system before the exception occurred, rather than being restored to the initial configuration. This can avoid the information required for reconfiguring the target multimedia task, improve the execution efficiency of the multimedia task, and ensure that the multimedia task can quickly resume normal operation in case of interruption, enhancing the reliability and recoverability of the system. Further, if the storage system is a distributed storage system, it can also improve the efficiency of obtaining synchronized data based on the fast data reading and writing capabilities provided by the distributed system, thereby further improving the execution efficiency of the multimedia task and the data recovery efficiency.
[0036] A so-called multimedia task refers to a task that uses various media forms such as images, audio, and video to display and convey a certain function. The function mentioned here can be the function service provided by an application program, and the application programs include but are not limited to: game application programs, office application programs, live broadcast application programs, social application programs, and information flow application programs, etc. Among them, information flow is a data form that continuously provides content to an object, including but not limited to: one or more of video streams, audio streams, text data streams, image data streams, etc. Information flow application programs are, for example, short video application programs, content application programs, etc. In one embodiment, a multimedia task can be created after enabling one or more functions in an application program and configuring relevant information. For example, in an office application program, when a user initiates a video conference and configures information such as the number of participants, an audio-visual task can be created. Another example is that in a game application program, after a user enables game live broadcast and sets information such as the live broadcast platform, an audio-visual task can also be created, and this audio-visual task supports transmitting the live broadcast content to the corresponding live broadcast platform for playback. For the sake of easy understanding, the target multimedia task mentioned in this application refers to one multimedia task among multiple multimedia tasks to be executed. For each multimedia task, when there is an execution requirement, the multimedia task can be executed according to the technical solution provided in the embodiments of this application and relevant information can be synchronized during the task execution process, so as to quickly and accurately resume based on the previously synchronized information in the case of interruption of multimedia task execution.
[0037] A multimedia task has task configuration information, which refers to the parameter values configured when using a function, and the task configuration information is determined by the task type of the multimedia task. For example, when initiating a video conference, parameters such as the number of participants, the start time of the conference, the duration of the conference, and the conference reminder time need to be configured as task configuration information. Another example is that when enabling game live broadcast, parameters such as the live broadcast platform, the layout of the live broadcast window, and the push position of the live broadcast need to be configured as task configuration information. The first task configuration information is the information configured for the target multimedia task before its execution, and this information includes the parameters provided by the corresponding function service and the parameter values. A multimedia task can correspond to one or more function services, and the task configuration information of different multimedia tasks can be different, for example, it can be reflected in different values of the same parameter.
[0038] A service process refers to the process in which a program with specific functions is dynamically executed once on a data set. It is an independent unit for the system to allocate and schedule resources. In this application, a service process can also be simply referred to as a process, or a plug-in process, or a virtualization process, or a Worker process. A service process can correspond to one function or multiple functions. In other words, one function can correspond to multiple service processes, and a combination of multiple functions can also correspond to one service process. Exemplarily, when using the live broadcast function and the voice-changing special effect function in a game application, a service process can be launched to execute the live broadcast task corresponding to the live broadcast function and the voice-changing task corresponding to the voice-changing special effect function. Or, two service processes can also be launched to execute the live broadcast task and the voice-changing task respectively. For ease of understanding, in this application, one service process corresponds to one function. If different users use the same function to create different multimedia tasks, or the same user uses different functions to create different multimedia tasks, different service processes can be used to execute these multimedia tasks respectively. In this application, a service process executing a multimedia task can also be understood as the service process processing the multimedia task.
[0039] Each service process has memory status information, which can be used to indicate the execution status of the service process, and this execution status can be used to reflect the changes during the execution process of the service process. Optionally, the execution status of the service process can include a ready state, a running state, and a blocked state. A service process is in the ready state after creation, waiting to be scheduled for execution. When the service process is scheduled for execution, it is in the running state. When the service process needs to wait for certain events (such as I / O operations) to complete before it can continue to execute, it enters the blocked state. The execution status of the service process changes with events during the execution process. For example, when the event that the service process is waiting for is completed, it will change from the blocked state to the ready state, waiting to be scheduled for execution. The memory status information is the information stored in the memory space of the service process, which can be used to store the data required for the operation of the corresponding service process, and this data is generated or used during the execution of the multimedia task. The memory status information includes but is not limited to: code segment, heap memory information, stack memory information, etc. Among them, the code segment is used to store the program code corresponding to the execution of the corresponding multimedia task, the heap memory information is used to store the objects and data dynamically created during multimedia execution, and the stack memory information is used to store local variables and function call information. These memory status information are necessary for the service process to run in memory and are also an important part of the process state. The memory status information changes dynamically with the execution of the multimedia task. The dynamic change here means that: with the execution of the multimedia task, the memory status information can be continuously updated, including but not limited to: adding, deleting, or modifying. For example, in an audio-visual task, it is necessary to create timbre parameters for providing timbre changes, then the created timbre parameters can be added to the heap memory information. Another example is that during the execution of the program code, a corresponding function needs to be called, and the name of the called function can be added to the stack memory information. For another example, the execution progress of the multimedia task depends on the execution of the program code. When the execution position of the program code changes, the execution progress of the multimedia task may change, so the current execution position of the program code stored in the register can be updated in real time, so that when an exception occurs in the service process, the execution of the program code can be taken over based on the recorded current execution position. In one implementation, when starting a multimedia task, the program code corresponding to the multimedia task can be first written into the memory space of the service process, and then the program code can be run, and the data generated or used during the program operation and the data used to indicate the program operation status (such as the current execution position of the program) can be stored in the memory space.
[0040] The first service process refers to the service process that is invoked for the first time to execute the target multimedia task; the second service process refers to the newly launched service process for continuously executing the target multimedia task. The first service process can be a newly created service process or a relatively idle process obtained from the process pool, and the same applies to the second service process. The second service process and the first service process can be processes from the same process pool. Among them, the process pool is used to provide a fixed number of service processes. Since the creation and destruction of service processes take a certain amount of time, when there are many multimedia tasks to be executed, the creation and destruction of service processes will bring high time costs, thus affecting the execution efficiency of tasks. Therefore, a process pool can be introduced to store service processes. In a feasible implementation manner, the target multimedia task is one of the multiple multimedia tasks to be executed. If the number of multimedia tasks to be executed is greater than or equal to the preset number, a service process is obtained from the process pool to execute the corresponding multimedia task, and after the multimedia task is executed, the service process is put back into the process pool to continue waiting for a new multimedia task. Among them, the preset number can be the number of tasks that are preset and have a relatively low user delay perception, and can be set based on experience. If the number of multimedia tasks to be executed is less than the preset number, new service processes can be created to execute the multimedia tasks.
[0041] In another feasible implementation manner, if the number of multimedia tasks to be executed is less than or equal to the number of service processes in the process pool, a process can be directly obtained from the process pool as a service process. If the number of multimedia tasks to be executed is greater than the number of service processes in the process pool but the waiting duration of the multimedia task is within the preset duration, it indicates that the service processes in the process pool may not be sufficient. At this time, it is necessary to wait for other multimedia tasks to be executed and then put back the corresponding service processes. However, since the waiting duration of the multimedia task is within an acceptable range, after the waiting duration reaches the preset duration, a process can be selected from the process pool as a service process to execute the multimedia task. If the number of multimedia tasks to be executed is greater than the number of service processes in the process pool, and the waiting duration of the multimedia task exceeds the preset duration, since the long waiting time of the multimedia task may cause the user to perceive a large delay or lag, new service processes can be created.
[0042] In the above manner, by introducing the process pool, at most a fixed number of service processes are running at the same time, which can reduce the scheduling difficulty of the operating system and save the time for opening and closing service processes. To a certain extent, it can achieve the effect of multi-process concurrency and improve the task execution efficiency. In an embodiment, according to the types of tasks executed by the service processes, the service processes can include the following types: audio service processes, video service processes, and audio-video service processes, etc. Exemplarily, the above first service process and second service process are both audio service processes.
[0043] In this application, the storage system is a system for storing critical data, which refers to the data used to restore the task progress of multimedia tasks, including the memory status information and the first task configuration information mentioned above, and can be specifically used to restore the progress and original configuration of the target multimedia task. In one implementation, the storage system can include any one of the following: local storage space, centralized storage system, or distributed storage system. Among them, ① local storage refers to the local storage space of the device where the service process runs. For example, if the first service process runs in the Worker node, then the corresponding storage system can be the memory or disk of the Worker node, etc. ② A centralized storage system refers to a system composed of a single storage device; in a centralized storage system, all data is stored on the central storage device (such as a central server), and only the data of the central storage device needs to be backed up. Once the central storage device fails, the entire system will be paralyzed; in addition, if you want to improve the storage capacity and performance, you need to increase the capacity of the storage device or optimize the performance of the storage device to achieve it. ③ A distributed storage system refers to a system composed of multiple distributed storage devices; in a distributed storage system, data is scattered and stored in each node (i.e., storage device, such as a server), and the data redundancy and backup mechanism can ensure the security and fault tolerance of the data. Even if one or more storage devices fail, the entire system can still run normally; the distributed storage system can increase the storage capacity and performance by adding nodes, and can read and write data from multiple nodes in parallel, with high read and write performance and throughput. In summary, the distributed storage system has high reliability, scalability, and high throughput.
[0044] The storage system of the present application may adopt a distributed storage system (such as Redis, a high-performance in-memory key-value storage system suitable for storing critical data). The distributed storage system includes multiple nodes, and the memory state information corresponding to the service processes for executing multimedia tasks can be dispersedly stored in each node of the storage system. In one implementation, different types of information included in the memory state information of the service process (such as information of types like program code, heap memory information, and stack memory information) can be dispersedly stored in different nodes. In this way, when obtaining the memory state information of the service process from the distributed storage system, different types of information can be obtained from each node, thereby obtaining the memory state information. Additionally, each type of information included in the memory state information (such as any one of program code, heap memory information, and stack memory information, etc.) can also be stored in multiple nodes, and each node can manage a complete type of information to ensure data security through a data backup mechanism. Exemplarily, the heap memory information can be stored in nodes a and b in Redis, and complete heap memory information can be obtained whether from node a or node b. The stack memory information can be stored in nodes c and d in Redis, and complete stack memory information can be obtained whether from node c or node d.
[0045] Compared with a centralized storage system, based on the fast access to data of the distributed storage system, after the service process crashes, the critical data (including the latest synchronized memory state information and the first task configuration information) required to restore the task progress can be quickly obtained from the distributed storage system, thereby greatly improving the speed of task progress restoration, reducing the waiting time for users to wait for restoration, and improving the restoration efficiency. Additionally, if multiple multimedia tasks need to be executed in a computer device, multiple service processes can be run. If multiple service processes all experience exceptions successively or at the same time, then based on the high-performance read and write capabilities provided by this distributed storage system, the corresponding synchronized data can be quickly read, thereby quickly restoring the task states of each multimedia task before. Compared with the single data access point provided by the centralized storage system, storing data in the distributed storage system and quickly reading it when needed can provide better restoration capabilities and can handle more complex process crash scenarios.
[0046] Based on the above definitions, the principle of the service process handling method proposed in the embodiments of the present application is elaborated below. Specifically, the general principle of this method is as follows: In response to an execution request for a target multimedia task, a first service process is called to execute the target multimedia task based on the first task configuration information of the target multimedia task; during the execution of the target multimedia task by the first service process, the memory status information and the first task configuration information of the first service process are synchronized to the storage system, where the memory status information of the first service process changes dynamically as the target multimedia task is executed; based on this characteristic, after the memory status information of the first service process changes during the synchronization process, it also needs to be synchronized to the storage system to facilitate obtaining the latest memory status information later for accurately restoring the execution status of the service process. If the first service process encounters an exception before the completion of the target multimedia task, the memory status information and the first task configuration information of the first service process are obtained from the storage system; a second service process is called to continue executing the target multimedia task based on the obtained memory status information and the first task configuration information of the first service process. Thus, based on the backup of the memory status information and the first task configuration information of the first service process in the storage system, these data can be obtained from the storage system to restore to the previous memory status and task configuration, thereby restoring the target multimedia task to the previous task progress and configuration, and having a new service process continue to handle the interrupted target multimedia task, improving the processing efficiency of the target multimedia task, and enhancing the reliability and recoverability of the system.
[0047] In specific implementation, the above-mentioned method can be executed by a computer device, and the computer device can be a terminal or a server. For example, as Figure 1In the service processing system shown, a client can run on the terminal. The client can be an application program. Based on this client, an execution request for a target multimedia task can be submitted. Specifically, the execution request for the target multimedia task can be sent to the server through the terminal. Here, the server can be the background server corresponding to the client. Exemplarily, when the target multimedia task is an audio-video task, the execution request for the audio-video task can be submitted to the voice background server. Optionally, the target multimedia task can be created by the client or created by the server after receiving the execution request for the target multimedia task. The server can also obtain the first task configuration information of the target multimedia task and invoke the first service process to execute the target multimedia task based on the first task configuration information. During the execution of the target multimedia task, the server can synchronize the memory state information of the first service process and the first task configuration information to the storage system (such as redis). Based on this, if the first service process encounters an exception (such as crashing) before the execution of the target multimedia task is completed, then the latest data synchronized for the target multimedia task and the first service process before the first service process encounters the exception can be obtained from the storage system, so as to invoke a new service process (i.e., the second service process) to continue processing the target multimedia task based on the synchronized latest data. In the above technical solution, since the memory state information of the service process and the first task configuration information of the target multimedia task are synchronized in real time, even if the first service process encounters an exception and causes the interruption of the target multimedia task, the task state of the target multimedia task can be restored based on the information synchronized in the storage system before, thus ensuring the reliability of the entire system. Moreover, the first service process is virtualized and runs on the server side, and the client does not need to pay attention to issues such as the state of the first service process, task flow, and data security, which makes the client's invocation of various functions more flexible.
[0048] The above-mentioned terminals include but are not limited to: smart phones, tablet computers, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, vehicle-mounted terminals, smart cameras, virtual reality devices, etc. This application does not make any restrictions in this regard. Regarding the number of terminals, this application does not make any restrictions. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms, but is not limited thereto. Regarding the number of servers, this application does not make any restrictions.
[0049] Based on the above service process handling method, a recovery system applicable to the scenario of abnormal service exit can be implemented. Based on this recovery system, it is possible to ensure that during the execution of each multimedia task, the memory status information of the service process and the task configuration information of the multimedia task are synchronized in real time. Furthermore, when the service process crashes, the multimedia task can be restored to the previous progress through the real-time synchronized memory status information and task configuration information, enhancing the reliability and recoverability of the system and improving the processing efficiency of the multimedia task.
[0050] The technical solution provided in this application can be applied to the back-end architectures of various Internet products. Exemplarily, the Internet product can be GVoice (a voice call service product), Glive (a live broadcast product), and these Internet products can be applied to application programs. For example, applying GVoice and Glive in a game application program can provide functions such as one-key live broadcast start and voice change. Specifically, in a game application program, players can call the one-key live broadcast function to connect to various live broadcast platforms to start a live broadcast, and the generation of the live broadcast screen is generated by Glive in the cloud using game frame synchronization data. This method greatly reduces the loss of game performance, enabling players to smoothly conduct a live broadcast while enjoying the game. In addition, the voice change function in the game application program is implemented based on GVoice, and this function can provide players with more interactive fun. Players can choose the voice of their favorite game characters for team communication in the game, enhancing the immersion and interest of the game. Moreover, this voice change function can also be used as a sound effect in the live broadcast to improve the viewing experience of the live broadcast and increase the viewing pleasure of the audience.
[0051] It can be understood that in the specific implementation of this application, data related to user information (such as user identification, device identification, etc.) is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0052] It should be noted that in this application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. It should be understood that there is no logical or chronological dependency among "first", "second", and "nth", nor are the quantity and execution order limited. Additionally, in the embodiments of this application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. Furthermore, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.
[0053] The service process handling method provided by the embodiments of this application will be elaborated in detail below.
[0054] Please refer to Figure 2 , which is a service process handling method provided by an exemplary embodiment of this application. This service process handling method can be executed by the aforementioned computer device (such as a server), or jointly executed by a terminal and a server; for the convenience of elaboration, hereinafter, the example of the computer device executing this service process handling method will be used for illustration. This service process handling method may include the following steps S201 - S204.
[0055] S201, in response to an execution request for a target multimedia task, call a first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0056] In a specific implementation, the general logic for the computer device to execute S201 above may be: in response to an execution request for a target multimedia task, obtain the first task configuration information of the target multimedia task, and determine the first service process; then, the first service process can be run, and during the running process of the first service process, execute the target multimedia task based on the first task configuration information, thereby implementing the functional service corresponding to the target multimedia task.
[0057] Optionally, the computer device may be a server. The execution request for the target multimedia task may be generated when using a certain functional service (abbreviated as a function) of a target application in a terminal and sent by the terminal to the server. The target application is, for example, a game application. In one implementation manner, the server may create a target multimedia task based on the execution request and then call the first service process to execute the target multimedia task. In another implementation manner, the terminal may create a target multimedia task and send the target multimedia task to the server, so that the server can directly call the first service process to execute the target multimedia task based on the execution request.
[0058] Among them, the first service process has the ability to process data related to the target multimedia task. Exemplarily, if the target multimedia task is an audio-video task, then the first service process has the ability to process audio-video streams. Specifically, the first service process has the ability to encode and decode audio data and video data. The use of the function service is closely related to the operation of the service process. There is a corresponding relationship between the multimedia task and the function service. One function service can correspond to one or more service processes. Therefore, the first service process can refer to one or more service processes for running the function service corresponding to the target multimedia task. Exemplarily, the first service process can include a service process responsible for generating the live broadcast screen and pushing the live broadcast, and can also include a service process responsible for displaying the user interface, sending and receiving network requests, and interpreting and executing code. Multiple function services can also correspond to one service process. For example, the target multimedia task includes an audio voice-changing task and a live broadcast task, that is, the voice-changing function is used during the live broadcast. Then the first service process can also be a service process to process the live broadcast task and the audio voice-changing task; or two service processes can be used respectively to process the live broadcast task and the audio voice-changing task. For ease of understanding, this application takes the first service process as one service process as an example for exemplary illustration. The computer device ensures the execution of the target multimedia task based on the first service process and the first task configuration information, thereby ensuring the normal use of the corresponding function service.
[0059] Further, the target multimedia task corresponds to the function service in the target application program, and the function service needs to be configured with corresponding parameters. For example, when a user uses the voice-changing function in a game application program, the user needs to first configure the parameters involved in the voice-changing function to customize the desired voice-changing effect, and then create an audio task. Thus, the audio task corresponds to task configuration information, and the task configuration information is used to indicate the changed voice attributes. The voice attributes here include but are not limited to: the timbre of the voice, the emotions expressed by the voice, etc. In this application, the task configuration information can be determined according to different task types. The task configuration information is adapted to the task type and is crucial for the execution of the multimedia task. The first task configuration information is the information configured for the target multimedia task before its execution. The first task configuration information can be the task configuration information customized by the user; if the user does not specify the task configuration information, then the first task configuration information can be the system default task configuration information.
[0060] In one embodiment, based on the different types of the target multimedia task, the first task configuration information is also different: ① If the target multimedia task includes an audio voice conversion task, the first service process includes an audio service process, and the first task configuration information includes at least one of the following: a voice conversion timbre parameter and a voice conversion emotion parameter; wherein, the voice conversion timbre parameter can determine the sound quality of the voice conversion effect. Specifically, the voice conversion timbre parameter is used to determine the timbre after voice conversion, and the timbre can be the timbre of a certain object's voice, for example, the voice timbre of a certain virtual character, or it can be the timbre of a male voice, a female voice, etc., and different timbres can be set according to the user's needs. The voice conversion emotion parameter is used to determine the adjusted voice emotion. Since the voice can represent the emotion of the voice sender, the voice conversion emotion parameter can adjust the emotion of the voice conversion effect, such as happiness, sadness or anger. In addition, the first task configuration information can also include a voice conversion pitch parameter, which is used to determine the pitch after voice conversion, such as high pitch, medium pitch or low pitch, etc. The first task configuration information set for the audio voice conversion task is not limited herein. ② If the target multimedia task includes a live broadcast task, the first service process includes a live broadcast service process, and the first task configuration information includes at least one of the following: a live broadcast platform parameter, a live broadcast window layout parameter, and a live broadcast streaming address parameter. Among them, the live broadcast platform parameter is used to determine the target platform for the live broadcast. Exemplarily, if the value of the live broadcast platform parameter is the live broadcast platform app1, then it can be determined that the live broadcast is carried out in app1. The live broadcast window layout parameter is used to determine the layout of the live broadcast screen; for example, single window, multiple windows, picture-in-picture, etc. The live broadcast streaming address parameter is used to determine the push position of the live broadcast content. The live broadcast streaming address parameter is the target address of the live broadcast stream, and live broadcast streaming refers to pushing the live broadcast content to the server, and the target address can be the address of the server. The live broadcast platform parameter can include the platform identifiers of multiple live broadcast platforms, and the live broadcast streaming address parameter can also include multiple target addresses. In this way, by setting parameters such as the live broadcast streaming address parameter and the live broadcast platform parameter, live broadcasts can be started simultaneously on multiple platforms. In addition to the above parameters, other parameters of the live broadcast screen can also be configured according to different live broadcast scenarios and networks, such as a picture quality parameter, which is used to indicate the clarity of the live broadcast screen, such as high definition (720P), ultra high definition (1080P) or super high definition (4K); it can also include a picture style parameter, which is used to indicate the style of the live broadcast screen as landscape or portrait, etc. ③ If the target multimedia task includes a live broadcast task and a voice conversion task, then the first task configuration information includes each parameter mentioned in ① and ② above, including: voice conversion timbre, live broadcast platform, voice conversion emotion, live broadcast window layout, live broadcast streaming address and other parameters.
[0061] In one embodiment, the target multimedia task is initiated in the target application, and the target application can provide a configuration interface corresponding to the function service. The terminal can perform parameter configuration in the configuration interface to obtain the first task configuration information and upload it to the configuration management center, so that the server can obtain the first task configuration information from the configuration management center. In a specific implementation, the configuration interface is used to display the value options of the configuration parameters. Then, based on the selection of the target value option, the value of the configuration parameter can be obtained, and the first task configuration information can be generated. For example, please refer to Figure 3a the schematic diagram of task configuration shown in the figure. The target application is a game application. In the service interface 300 provided by the game application, one-click live broadcast can be enabled, and the live broadcast platform can be set to connect to major live broadcast platforms to start the live broadcast. Specifically, by clicking the live broadcast control 301, the configuration interface 302 corresponding to the live broadcast can be displayed. Multiple live broadcast platforms are displayed in the configuration interface 302. When setting the live broadcast platform, the user can select one or more live broadcast platforms, so that the live broadcast content can be played on multiple platforms at the same time. Further, before the live broadcast, live broadcast special effects can be set. For example, Figure 3b as shown in the figure, the configuration interface 310 corresponding to the live broadcast special effects can be displayed. In this configuration interface 310, the voice-changing effect used during the live broadcast can be enabled, and multiple sound effect description information of virtual characters are displayed in this configuration interface 310. Specific voice-changing sound effects can be selected in this configuration interface. Specifically, before the live broadcast, the voice-changing effect can be set to "Qian Jin" 311 to display the sound effect of vitality and energy. Based on the above Figure 3a and Figure 3b parameter configurations shown in the figure, the first task configuration information obtained includes the live broadcast platform parameters and the voice-changing sound effect parameters.
[0062] Since the task configuration information supports dynamic changes according to the user's needs, the configured first task configuration information supports flexible changes during the execution of the target multimedia task. By changing the first task configuration information, new task configuration information can be obtained. Thus, the first task configuration information originally used by the first service process to execute the target multimedia task will be changed to the new task configuration information; and, with the change of the task configuration information, the execution result of the multimedia task may be different. Therefore, when the execution result is returned to the client, the latest service effect under the new task configuration information will be brought. Exemplarily, as in the above Figure 3b if the voice-changing effect is changed from "Qian Jin" to "Little Fox", then the corresponding voice-changing special effect will also change, thereby changing the sound effect used during the live broadcast.
[0063] S202. During the execution of the target multimedia task by the first service process, synchronize the memory state information and the first task configuration information of the first service process to the storage system.
[0064] In a specific implementation, during the execution of a target multimedia task by a first service process, the computer device may store the program code of the functional service corresponding to the target multimedia task in the memory space of the first service process, and write the data generated and used during the running of the program code into the memory space of the first service process, so as to obtain the memory state information of the first service process. Specifically, during the running of the program code, some objects or data may be created, some functions may be called, some important calculation results may be calculated, or some files or network connections may be called, and these information can all determine the execution state of the service process. Therefore, these information can be saved in the memory space of the first service process and are collectively referred to as memory state information. As the program code is executed, new objects or data may be created, and the execution position, calculation results, called functions, etc. of the program code may all change. Therefore, the state information stored in the memory space of the first service process will also change. That is, the memory state information of the first service process changes dynamically with the execution of the target multimedia task.
[0065] In one embodiment, the computer device may synchronize the memory state information of the first service process to the storage system before the first change in the memory state information. After that, whenever the memory state information changes, the changed memory state information may be synchronized to the storage system. In this way, as the target multimedia task is executed, the storage system includes the memory state information of the first service process synchronized at multiple timestamps. These memory state information can be arranged in the order of the synchronization timestamps, so as to obtain the memory state information of the corresponding synchronization timestamp when needed later. The memory state information of each synchronization timestamp is used to indicate the progress of the first service process at the corresponding synchronization timestamp, and the progress of the first service process matches the progress of the target multimedia task; the progress indicated by different memory state information may be different. By synchronizing the dynamically changing memory state information to the storage system, the backup of the memory state can be realized, so that the memory state information synchronized to the storage system is always consistent with the memory state information possessed by the first service process at the latest progress, thereby ensuring that the execution state and progress of the service process in an abnormal scenario can be correctly restored.
[0066] In addition to the memory state information of the first service process, the first task configuration information of the target multimedia task will also be synchronized to the storage system. Exemplarily, the storage system is a distributed storage system redis, such as Figure 3cThe schematic diagram of information synchronization shown can store the memory state information of the first service process, including the heap, stack, register state, global variables, file descriptors, etc. into Redis, and store the first task configuration information, including tone parameters, emotion parameters, streaming address parameters, live streaming platform parameters, and live streaming layout parameters, etc. into Redis.
[0067] In the specific synchronization process, the first task configuration information of the target multimedia task and the task identifier of the target multimedia task can establish a corresponding relationship and be written into the storage system. Based on the task identifier, it is convenient to obtain the task configuration information related to the target multimedia task subsequently. In addition, by synchronizing the first task configuration information and the memory state information in the same storage system, it can be made that the subsequent acquisition of these synchronized information is also obtained from the same storage system, which can save the resources and time spent on data acquisition, and thus improve the efficiency of data acquisition. In this application, the storage system can be a distributed storage system. Then the technical solution provided by this application can be applied to the recovery system based on the distributed storage system. With the support of the distributed storage system, it can further make the data acquisition speed faster, so as to quickly recover the data, reduce the user's waiting time for the function to recover, and improve the user experience.
[0068] S203, if the first service process has an exception before the target multimedia task is completed, obtain the memory state information and the first task configuration information of the first service process from the storage system.
[0069] In one embodiment, the computer device can detect the running state of the first service process in real time or at regular intervals. This running state can be used to indicate whether the first service process is running normally, so as to determine whether the first service process has an exception. If the first service process is not running normally, for example, the first service process crashes or there is a problem with the network connection of the first service process, then it can be determined that the first service process has an exception. That is, the first service process having an exception includes at least one of the following situations: the first service process crashes, the network connection is interrupted, etc.
[0070] Before the target multimedia task is completed, an exception in the first service process will affect the execution of the target multimedia task, thereby affecting the availability of the function service corresponding to the target multimedia task. For example, when the audio service process crashes, the audio task is interrupted, resulting in the abnormal exit of the audio service being used in the application. In this case, an exception handling and recovery mechanism can be automatically triggered to avoid the situation where the function becomes unavailable due to a process crash. This mechanism includes obtaining the first task configuration information synchronized before the exception from the storage system, and the memory status information of the first service process. The memory status information of the first service process obtained here is the latest memory status information synchronized by the first service process before the exception. In the specific acquisition process, the first timestamp when the first service process has an exception can be determined. Since the memory status information of the first service process stored in the storage system all has corresponding synchronization timestamps, based on the first timestamp, among the various memory status information of the first service process stored in the storage system, the memory status information whose synchronization timestamp is earlier than the first timestamp and closest to the first timestamp in terms of interval is found, and this found memory status information is the memory status information of the first service process obtained.
[0071] S204, call the second service process to continue executing the target multimedia task based on the obtained memory status information of the first service process and the first task configuration information.
[0072] In a specific implementation, the second service process is a service process different from the first service process. That is, the second service process and the first service process are different service processes, but both the second service process and the first service process have the ability to process data related to the target multimedia task. Applying the obtained memory status information of the first service process and the first task configuration information to the second service process, specifically, the memory status information of the first service process obtained from the storage system can be written into the memory space of the second service process, so that the memory status information in the second service process includes the memory status information of the first service process. Then, call the second service process to continue executing the target multimedia task based on the first task configuration information. Similarly, during the process of calling the second service process to execute the target multimedia task, since the target multimedia task has not been completed, the memory status information in the second service process can change dynamically as the target multimedia task is executed. Based on the recovery of the relevant memory status information and task configuration information in the second service process, the second service process can take over from the first service process and continue to execute the target multimedia task at the task progress where the target multimedia task was before the first service process had an exception, so that the function service corresponding to the target multimedia task can be used normally.
[0073] Based on the data obtained from the storage system, the previous state of the target multimedia task and the memory data of the first service process can be quickly restored, and the entire recovery system has reliability and stability. Specifically, based on the memory state information of the first service process obtained from the storage system, the memory state information of the second service process can be adjusted to the memory state information before the first service process encounters an exception, and then the execution state of the second service process can be adjusted to the execution state before the first service process encounters an exception. Based on the first task configuration information, the configuration of the multimedia task can be restored to the previous configuration. In this way, the new service process (i.e., the second service process) can seamlessly take over the multimedia task processed before. This mechanism can significantly improve the stability and reliability of the system because it can reduce task interruptions caused by the failure of a single process, improve the overall performance of the system, and also improve the ability to respond to emergencies. Based on the fast and accurate recovery ability, it can ensure that the functional service is always in an available state.
[0074] In another embodiment, the first service process is used to execute multiple multimedia tasks, and the multiple multimedia tasks include the target multimedia task. During the synchronization process, the task configuration information of each multimedia task is synchronized to the storage system, and the memory state information of the first service process may include the data created or used during the runtime of the program code of the functional service corresponding to each media task. That is to say, the memory state information of the first service process can not only be used to indicate the progress of the target multimedia task, but also be used to indicate the progress of other multimedia tasks executed by the first service process. If the first service process encounters an exception after the target multimedia task is completed and there is at least one multimedia task that has not been completed, then for each of the at least one multimedia task, the task configuration information of each of the at least one multimedia task and the memory state information of the first service process can be obtained from the storage system with reference to the processes shown in S203 and S204, so as to call at least one second service process and continue to execute each multimedia task based on the obtained task configuration information and the memory state information of the first service process, that is, restore the previous state of each multimedia task. Among them, the at least one multimedia task refers to one or more multimedia tasks other than the target multimedia task among the multiple multimedia tasks.
[0075] The service process processing method provided by the embodiment of the present application can, in response to an execution request of a target multimedia task, call a first service process and execute the target multimedia task based on the first task configuration information of the target multimedia task. In this way, the first service process can execute the target multimedia task based on the latest task configuration information. During the execution of the target multimedia task by the first service process, both the memory state information of the first service process and the first task configuration information of the target multimedia task can be synchronized to the storage system. Thus, when an exception occurs to the first service process (for example, the first service process crashes), the memory state information and the first task configuration information of the first service process can be directly obtained from the storage system, and a second service process can be called to execute the target multimedia task based on the memory state information and the first task configuration information of the first service process. In this way, the second service process can take over the execution of the target multimedia task by the first service process that has encountered an exception. The second service process can be adjusted to the corresponding memory state based on the memory state information of the first service process, and based on the first task configuration information synchronized to the storage system before the exception occurred, the configuration of the target multimedia task can be restored to the previous configuration instead of the initial configuration. This can avoid reconfiguring the information required for the target multimedia task, improve the execution efficiency of the multimedia task, and ensure that the multimedia task can quickly resume normal operation in case of interruption, enhancing the reliability and recoverability of the system. Further, if the storage system is a distributed storage system, it can also improve the efficiency of obtaining synchronized data based on the fast data reading and writing capabilities provided by the distributed system, thereby further improving the execution efficiency of the multimedia task and the data recovery efficiency.
[0076] Please refer to Figure 4 , which is another service process processing method provided by an exemplary embodiment of the present application. This service process processing method can be executed by the aforementioned computer device (such as a server), or jointly executed by a terminal and a server; for the convenience of description, hereinafter, it will be described by taking the computer device executing this service process processing method as an example. This service process processing method may include the following steps S401 - S405.
[0077] S401, in response to an execution request of a target multimedia task, call a first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0078] In one embodiment, the target multimedia task is initiated by a target application, which can be any application. Initiating by the target application means using the corresponding function service in the target application, which can indicate the need to create and execute the multimedia task corresponding to the function service. For example, if the target application is a game application, the user can enable the voice-changing function in the game application, thereby submitting an execution request for the audio task corresponding to the voice-changing function. Then, the server creates the audio task and executes the audio task to ensure the normal use of the voice-changing function in the game application. Based on this, the execution request includes the application information of the target application. Here, the application information refers to the information used to identify the target application, including but not limited to: the name of the target application, the version number of the target application, and the type of the target application, etc. Exemplarily, the application information of a certain application includes: "name: xx Mingyue" (the name of the application), "version3012" (the version number of the application), and "type: character interaction" (the type of the application).
[0079] To ensure the security and stability of the system, before the computer device executes the above step S401, it can verify the information carried in the execution request, specifically including the content shown in steps ① - ② as follows: Step ① Obtain service authentication information, which is used to record the information of at least one application program with service permissions; Step ② If the service authentication information includes the application information of the target application, trigger the execution of the target step. The target step refers to: in response to the execution request of the target multimedia task, calling the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0080] In a specific implementation, the technical solution provided in this application can provide an exception handling and recovery service. Any application program can register for this exception handling and recovery service, so that the application information of the application program that registers for this service can be recorded in the service authentication information to indicate that the application program has the service permission to use this exception handling and recovery service. Then, based on the usage permission of this exception handling and recovery service, in the case where the original first service process encounters an exception, based on the latest data synchronized to the storage system in real time, the task progress and configuration of the target multimedia task can be restored, and a new second service process can be called to continue executing the progress before the target multimedia task to ensure the availability of the application program's function. Thus, at least one application program involved in the service authentication information is an application program that has registered for the above exception handling and recovery service. If the service authentication information includes the application information of the target application, it means that the target application has registered for the above exception handling and recovery service and has service permissions, then the execution of the target step can be triggered, that is, the above Figure 4S401 in the illustrated embodiment, thereby applying the technical solution provided by the present application to provide a recovery service in the case of abnormal service exit. In this embodiment, by verifying and authorizing the carried application information, it can be ensured that all tasks entering the system come from: legitimate internal applications that have registered for this exception handling and recovery service, thereby ensuring the security and stability of the system.
[0081] In another embodiment, the target multimedia task is initiated by a target application program, and the target application program runs on a target terminal. Based on this, the execution request includes not only the application information of the target application program but also the device identifier of the target terminal; the device identifier can be a device number or a terminal name. Among them, the device number can distinguish different terminals to achieve unique identification and management of devices. For example, the device number of the target terminal is 23734785, and the terminal name is laptop. Based on this, the above-mentioned service authentication information also includes the device identifiers of at least one terminal. Then, when the service authentication information includes the application information of the target application program and the device identifier of the target terminal, it not only indicates that the target application program is a legitimate application program but also that the target terminal is a legitimate terminal that has previously registered for this service, so that the target step can be executed to apply the exception handling and recovery service provided by the present application. In this embodiment, not only can the legitimacy of the application program be verified, but also the legitimacy of the device can be verified, thereby restricting the devices accessing the system and further enhancing the security of the system.
[0082] In yet another embodiment, the target multimedia task is initiated by a target user through a target application program, and the target application program runs on a target terminal. The execution request of the target multimedia task may include the following: the application information of the target application program, the device identifier of the target terminal, and the user information of the target user; the user information of the target user is used to identify the target user, for example, it can be the ID assigned when the target user registers the target application program, or the user name of the target user, etc. Based on this, the service authentication information is used to record: the application information of at least one application program, the device identifiers of at least one terminal, and the user information of at least one user. If the service authentication information includes: the application information of the target application program, the device identifier of the target terminal, and the user information of the target user, it not only indicates that the target application program is a legitimate application program, the target terminal is also a legitimate terminal that has previously registered for this service, and the target user is a user with service usage permissions, then the target step can be executed to apply the exception handling and recovery service provided by the present application. In this embodiment, in addition to verifying the application program and the terminal, the user can also be further verified, so that this exception handling and recovery service can be opened for some specific users to use, thereby enhancing the security and stability of the system.
[0083] In the above-mentioned embodiments related to authentication processing, the execution request of the target multimedia task may further include a timestamp; this timestamp is used to record the timeliness of verification. In one implementation, the computer device generates an authentication code based on the object information of the registered exception handling and recovery service. Among them, the object information of the registered exception handling and recovery service may include one or more of the following: the application information of the target application, the device identifier of the target terminal, and the user information of the target user; the timestamp may be the time point when the authentication code is generated, and the authentication code has a validity period to indicate that the authentication code is valid within this validity period. For example, the authentication code is 30 seconds, which means that the authentication code is valid for authentication within 30 seconds after it is generated. Based on the timestamp and the validity period, the authentication code can have corresponding timeliness to ensure the security of verification. Exemplarily, if an external attack is launched on the recovery system, such as intercepting the authentication code for substitution verification, and the timestamp when the authentication code is generated is 15:00:00 and the validity period is 1 minute, based on this timestamp and the validity period, it can be determined that the expiration time point of the authentication code is 15:01. Then, after reaching the expiration time point, the authentication code becomes invalid and cannot be used for verification, thus ensuring the security of the system.
[0084] In one implementation, the computer device may include multiple functional modules. The functional module dedicated to receiving the execution request of the multimedia task can be called the server module, and the functional module dedicated to authentication processing is called the authentication gateway module. After the server module receives the execution request, it can forward the execution request to the authentication gateway module, and then the authentication gateway module executes the above-mentioned authentication processing flow based on the information carried in the execution request.
[0085] In one embodiment, for the same multimedia task, it may be repeatedly submitted due to the operation of a certain user, or repeatedly submitted by different users. If duplicate removal processing is not performed, it will not only waste resources by repeatedly executing the same task, but may also affect the correct execution of the task. For example, if different session objects in a session initiate a quick meeting successively in this session, then the terminals of different session objects will all submit the same multimedia task. If duplicate removal processing is not performed subsequently, other session objects may participate in different meetings, thus affecting the meeting requirement that all original participants participate in an online meeting. Each multimedia task has a task identifier (taskid) after it is created, and the execution request of each multimedia task may include the task identifier of the corresponding multimedia task. Based on the task identifier, duplicate submitted multimedia tasks can be filtered to achieve duplicate removal of multimedia tasks. In a specific implementation, the execution request of the target multimedia task includes the task identifier of the target multimedia task. The implementation of duplicate removal may include the following steps 1.1 - step 1.3.
[0086] Step 1.1: Obtain task submission information, which is used to record the task identifiers of one or more submitted multimedia tasks.
[0087] In a specific implementation, the computer device can receive one or more multimedia tasks submitted by the client and record the task identifier of each multimedia task in the task submission information. The task identifier of a multimedia task can be a randomly assigned string in digital form, such as WZ12345task1. It can also be in other forms, such as a combination of a function service identifier and an assigned task serial number to obtain the task identifier "live12-task1234", and this application does not limit this. Thus, before executing the target multimedia task, the task submission information can include the task identifiers of at least one multimedia task. In the embodiments of this application, the target multimedia task can be deduplicated based on the task identifier of the target multimedia task and the task submission information. Specifically, refer to the following Step 1.2 - Step 1.3.
[0088] Step 1.2: If the task submission information includes the task identifier of the target multimedia task, then perform deduplication processing on the target multimedia task.
[0089] If the task submission information includes the task identifier of the target multimedia task, it indicates that the target multimedia task has been submitted before, that is, the target multimedia task has the phenomenon of duplicate submission. Then, the currently submitted target multimedia task can be deduplicated so that the target multimedia task only needs to be executed once. In a feasible implementation, the previously submitted target multimedia task can be transmitted to a distributed coordination service cluster, which includes multiple coordination devices and is used to schedule a suitable service process for the target multimedia task. This distributed coordination service cluster is, for example, a Zookeeper cluster. Zookeeper is a distributed open-source distributed application coordination service.
[0090] Step 1.3: If the task submission information does not include the task identifier of the target multimedia task, then trigger the execution of the target step, where the target step refers to: in response to the execution request of the target multimedia task, calling the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0091] In one embodiment, if the task submission information does not include the task identifier of the target multimedia task, it indicates that the target multimedia task has not been submitted before. Then, the target step can be triggered. Based on the execution of the target step, the execution of the target multimedia task can be guaranteed. That is, according to the technical solution shown in the above embodiment, in the case where the target multimedia task is interrupted, the task progress and task configuration can still be quickly restored, so as to guarantee the continuous execution of the target multimedia task after recovery. In addition, the task identifier of the target multimedia task can be recorded in the task submission information, so that when the same multimedia task is received again next time, filtering processing can be performed based on the task identifier recorded in the task submission information.
[0092] It can be understood that the sequence numbers of the above steps (such as 1.1 or 1.2, etc.) in this application do not necessarily constitute a limitation on the execution order of each step. For example, either step 1.2 or step 1.3 can be executed instead of in sequence. In the process shown in the above steps 1.1 - 1.3, based on the task identifier and the recorded task identifier, duplicate detection is performed on the submitted target multimedia task, and the duplicate submitted target multimedia tasks can be filtered out, thereby avoiding wasting resources to process the same multimedia task.
[0093] In one embodiment, if the computer device simultaneously receives execution requests for multiple (i.e., two or more) multimedia tasks, and the task identifiers of each multimedia task are the same, and the task submission information does not include the task identifiers of each multimedia task, then one multimedia task can be randomly selected from the multiple multimedia tasks as the target multimedia task, and then the target step is triggered to be executed. In this way, duplicate processing of the same multimedia task can also be achieved.
[0094] It should be noted that the task duplicate processing can be performed after the authentication processing. For example: if the service authentication information includes the application information of the target application program, then the step of obtaining the task submission information can be triggered first, and it is detected whether the target multimedia task is a duplicate submitted multimedia task according to the process shown in the above steps 1.1 - 1.3, and then it is decided whether to execute the target step.
[0095] In one embodiment, a user can perform parameter configuration in the service interface of a target application. After the configuration is completed, first task configuration information can be formed based on the configured parameter (key) and the value of the parameter (value), and the first task configuration information can be uploaded to a configuration management center. Based on this, the synchronization logic for the first task configuration information can be specifically as follows: Before the first service process executes a multimedia task, the computer device can obtain the first task configuration information from the configuration management center, and then write the first task configuration information into the storage system during the execution of the multimedia task by the first service process. In addition, the first task configuration information obtained from the configuration management center is applied to the first service process, so that the first service process executes the target multimedia task based on the first task configuration information. Specifically, during the execution of the target multimedia task by the first service process, the program code of the function service corresponding to the target multimedia task needs to be run. Specifically, the program code can be run based on the first task configuration information to achieve the service effect required for task configuration.
[0096] In one embodiment, the first task configuration information is managed by a configuration management center. Based on the above introduction, the first task configuration information can be set by the user before the execution of the target multimedia task and uploaded to the configuration management center for management after the setting is completed. However, during the execution of the target multimedia task, the first task configuration information may need to be dynamically adjusted, and the adjusted first task configuration information will also be uploaded to the configuration management center in real time. For example, during the execution of an audio voice-changing task, the user can change the value of the voice-changing parameter to change the first task configuration information, so as to form new task configuration information (i.e., the second task configuration information) and upload it to the configuration management center. Based on this, the computer device can also perform the following steps a - step b.
[0097] Step a: Monitor the first task configuration information stored in the configuration management center during the execution of the target multimedia task by the first service process.
[0098] Step b: If it is monitored that the first task configuration information stored in the configuration information management center has changed, read the second task configuration information from the configuration management center and write the second task configuration information into the storage system.
[0099] Specifically, the configuration management center is used to store the task configuration information of each multimedia task, and a corresponding relationship is established between the task configuration information and the task identifier of the multimedia task, indicating that the task configuration information is the configuration of the corresponding multimedia task. Based on the processing of the target multimedia task in this application, a corresponding relationship is established between the task identifier of the target multimedia task and the first task configuration information. The computer device can monitor whether the task configuration information corresponding to the task identifier of the target multimedia task has changed (for example, a new task configuration information is added). In a specific implementation, a callback function can be registered. The callback function provides a callback interface for monitoring whether the task configuration information of any multimedia task in the configuration management center has changed. If it is detected that the task configuration information of the target multimedia task in the configuration information management center has changed, indicating that in addition to the first task configuration information, there is also other task configuration information, then it can be considered that the first task configuration information has changed. Thus, the new task configuration information can be reloaded through the callback interface, that is, the changed first task configuration information can be read out and written into the storage system to achieve the synchronization of the changed first task configuration information. In this application, the second task configuration information refers to the changed first task configuration information. Based on the synchronization of the second task configuration information, it is possible to back up multiple task configuration information of the target multimedia task in the storage system, that is, the storage system includes the first task configuration information and the second task configuration information of the target multimedia task. In addition, in addition to being written into the storage system, the second task configuration information can also be provided to the first service process, so that the first service process can execute the target multimedia task based on the second task configuration information, thereby updating the execution status of the target multimedia task.
[0100] Optionally, the above steps a - b can be executed by a task manager. Based on the interaction between the task manager and the configuration management center, steps a - b can monitor the change situation of the task configuration information of the multimedia task, and then synchronize the latest task configuration information of the target multimedia task to the storage system in real time when the first task configuration information changes, which is convenient for quickly restoring the task configuration and progress of the target multimedia task after the service process crashes.
[0101] Further, if an exception occurs in the first service process after the second task configuration information is written into the storage system, the recovery of the configuration of the target multimedia task will be implemented based on the second task configuration information. Specifically, in the case where an exception occurs in the first service process before the target multimedia task is completed, the second task configuration information can be obtained from the storage system, and the second service process can be called to continue executing the target multimedia task based on the memory status information of the first service process and the second task configuration information. It should be noted that if the user further makes changes based on the second task configuration information before the first service process has an exception, for example, changes it to the third task configuration information (different from the first task configuration information), then the third task configuration information can also be written into the storage system so that when the first service process has an exception, the third task configuration information can be obtained from the storage system, and the second service process can execute the target multimedia task based on the third task configuration information.
[0102] Based on the above implementation method, once the task configuration information of the target multimedia task stored in the configuration management center changes, the computer device can obtain the changed task configuration information from it and synchronize it to the storage system. In this way, all the task configuration information of the target multimedia task stored in the configuration management center will be synchronously updated to the storage system in real time. In another implementation method, each task configuration information carries a change time point. If the task configuration information of the target multimedia task changes relatively frequently, to save storage space, the task configuration information at the target time point can be selected from the configuration management center and synchronized to the storage system. The target time point is a preset number of change time points selected based on sorting multiple change time points. For example: after arranging 4 change time points in ascending order, the last 2 change time points can be selected as the target time points, and the task configuration information corresponding to the target time points can be synchronized to the storage system. In this way, the task configuration information of the most recent several changes can be synchronized, which is convenient for recovering the most recent configuration based on the most recent task configuration information in the case where an exception occurs in the first service process.
[0103] In one embodiment, the determination method for the first service process can refer to the following content shown in (1)-(2):
[0104] (1) Select at least one service process that is adapted to the task type of the target multimedia task from the process pool according to the adaptation relationship between the task type and the process type.
[0105] The process pool includes multiple service processes, and one service process corresponds to one process type. The process type is determined based on the processing capabilities of the service process, and the process type can be used to indicate the data types that the corresponding service process supports processing. For example, if a service process is used to process audio - video streams, then the process type of this service process is an audio - video process. Another example is that if a service process is used to process audio, then the process type of this service process is an audio process. The task type of a multimedia task can be used to indicate the data types required to process the multimedia task. For example, the data to be processed in an audio - video task is an audio - video stream. The adaptation relationship between the task type and the process type refers to the relationship where the data types indicated by the task process to be processed are the same as the data types indicated by the process type to support processing.
[0106] (2) Select a first service process from at least one service process and run the first service process.
[0107] If one service process is selected, the selected service process can be directly determined as the first service process, or it can be further detected whether the process attributes of this service process meet the conditions for executing the target multimedia task, and then it can be determined whether to determine this service process as the first service process. If multiple service processes are selected, then one service process can be randomly selected from them as the first service process, or the first service process can be selected according to the process attributes of the first service process and the task attributes of the target multimedia task. The above - mentioned process attributes include but are not limited to the load of the first service process, the amount of system resources configured for the first service process, etc., and the task attributes include but are not limited to: the task volume corresponding to the target multimedia task, the amount of system resources required to execute the target multimedia task, and so on.
[0108] After the first service process is selected, the computer device can run the first service process. In a specific implementation, the memory status information required by the first service process can be obtained, and then based on writing this memory status information into the memory space of the first service process to update the memory status information of the first service process, and then run the first service process based on the updated memory status information.
[0109] In a feasible implementation manner, when the computer device selects the first service process from at least one service process, the following steps (2.1) - step (2.3) can be executed.
[0110] Step (2.1) Obtain the load information of each service process in at least one service process. The load information includes load capacity and load volume. The load capacity is used to indicate the maximum task volume that the corresponding service process allows to load; the load volume is used to indicate the task volume that the corresponding service process has already loaded.
[0111] In a specific implementation, a service process supports loading one or more multimedia tasks, and each multimedia task has a task volume, which is used to indicate the amount of data to be processed when the multimedia task is completed. For example, a certain multimedia task is an audio-video session task, and the audio-video session task indicates that 100 session objects are accessed to participate in the session. Therefore, the task volume of this audio-video session task includes the audio-video data volumes of 100 session objects. When creating a service process, the maximum task volume that the service process is allowed to load can be set. For example, a service process is allowed to load 3 multimedia tasks, and the sum of the task volumes corresponding to the 3 multimedia tasks is 1GB, which means that the maximum amount of data that can be processed is 1GB. At the moment when the computer device receives an execution request for a target multimedia task, for any service process selected that is adapted to the task type of the target multimedia task, it may have loaded one or more other multimedia tasks, so the load of the service process is the sum of the task volumes corresponding to the loaded multimedia tasks; it may also not have loaded any multimedia tasks, so the load of the service process is 0.
[0112] Step (2.2) determines the load margin of each service process according to the load information of each service process.
[0113] Based on the load capacity and load included in the load information, when the computer device determines the load margin of each service process, for any service process, the difference can be calculated based on the maximum task volume indicated by the load capacity of the service process and the loaded task volume indicated by the load, and the obtained task volume difference can be used as the load margin of the service process. This load margin is used to indicate the remaining task volume that the corresponding service process is allowed to load. Exemplarily, the load capacity is used to indicate that the maximum task volume is 2GB, and the load indicates that the loaded task volume is 1GB, then the task volume that can be loaded indicated by this load margin is 1GB. It can be understood that the load margin of each service process can be obtained in the above manner. If a certain service process does not load any multimedia tasks, then the remaining task volume indicated by the load margin of this service process is the same as the maximum task volume allowed to be loaded indicated by the load capacity.
[0114] Step (2.3) determines any service process in at least one service process whose corresponding load margin meets the load condition as the first service process; wherein, the corresponding load margin meeting the load condition includes: the corresponding load margin is greater than or equal to the task volume corresponding to the target multimedia task.
[0115] In a specific implementation, the computer device can compare the load margin of each service process in at least one service process with the task volume corresponding to the target multimedia task. If the load margin of a certain service process is greater than or equal to the task volume corresponding to the target multimedia task, it indicates that the certain service process supports the load of the multimedia task, and thus the service process can be determined as the first service process.
[0116] In this way, considering the specific load conditions and load capabilities of each service process, a service process with appropriate load can be selected from at least one adapted service process as the first service process. In this way, for the service processes in the process pool, load balancing can be achieved, and for the target multimedia task, a relatively idle service process can also be provided for execution, thereby realizing the reasonable allocation of multimedia tasks.
[0117] In another feasible implementation manner, when the computer device selects the first service process from at least one service process, the following steps (3.1) - step (3.2) can be executed.
[0118] Step (3.1) Obtain the system resource quota of each service process in at least one service process, and the system resource quota is used to indicate the amount of system resources allocated to the corresponding service process.
[0119] During the running process, a service process needs to use corresponding system resources, which may include but are not limited to: memory space, input and output devices (such as disk I / O), files, and other operating system resources, etc. During the process of creating a service process, memory space can be allocated for the new service process to store program code, the running state of the process, the stack, and other data. After that, when starting the program code, the computer device can call the service process to execute the program code. Specifically, the program code can be loaded from the disk into the memory space, and during the running process of the service process, the data created by the running of the program code, the files called, etc. can be written into this memory space. In addition to allocating memory space, system resources such as the CPU (Central Processing Unit, also known as the processor) and disk I / O (Input / Output) used by the service process can also be allocated, so as to perform more fine-grained control and management of system resources. In one implementation, all service processes of an application can share the same system resource quota. Exemplarily, the total CPU usage rate of all service processes of a certain application is restricted not to exceed 50%, the total memory usage of all service processes does not exceed 1GB (a storage capacity unit), and the speed of all service processes when reading / writing to the disk does not exceed 200KB / s (i.e., 200 bytes per second). In another implementation, different service processes of an application can be configured with different system resource quotas, so as to better handle different functional services and improve the running fluency of functional services.
[0120] The system resource quota of each service process can also be understood as a resource restriction on the corresponding service process. For a target multimedia task, executing the target multimedia task requires a corresponding amount of system resources. The computer device can predict the amount of system resources required for the target multimedia task, so as to select a first service process from at least one service process based on the system resource quota of the service process and the predicted amount of system resources required for the target multimedia task.
[0121] Step (3.2) determines any service process among at least one service process whose corresponding system resource quota meets the quota condition as the first service process; wherein, the corresponding system resource quota meeting the quota condition means that the amount of system resources indicated by the corresponding system resource quota is greater than or equal to the amount of system resources required to execute the target multimedia task.
[0122] The computer device can compare the system resource quota of each service process in at least one service process with the amount of target system resources required for the target multimedia task. For any service process, if the amount of system resources indicated by the system resource quota of this service process is greater than or equal to the amount of system resources required to execute the target multimedia task, it means that this service process can call sufficient system resources to execute the target multimedia task, and thus it can be determined as the first service process. On the contrary, if the amount of system resources indicated by the system resource quota of a certain service process is less than the amount of system resources required to execute the target multimedia task, then this service process cannot be determined as the first service process, and the computer device can continue to check other service processes.
[0123] In this way, considering whether the system resource quota of each service process matches the amount of system resources required for the target multimedia task, and then selecting the first service process from at least one service process. In this way, the first service process not only matches the task type of the target multimedia task in terms of process type, but also can support the efficient and smooth processing of the target multimedia task based on the system resources available to the service process itself.
[0124] In another feasible implementation manner, the above two methods can be combined to select a service process from at least one service process whose corresponding load margin meets the load condition and whose corresponding system resource quota meets the quota condition; that is, the above steps (2.1)-(2.2) and the above step (3.1) can be executed respectively, and then steps (2.3) and (3.2) are combined, and any service process from at least one service process whose corresponding load margin meets the load condition and whose corresponding system resource quota meets the quota condition is determined as the first service process. In this way, not only the load of the service process is considered, but also the system resource quota of the service process is considered, so that the selection of the first service process can be more accurate and more reasonable.
[0125] S402, during the execution of the target multimedia task by the first service process, synchronize the memory status information and the first task configuration information of the first service process to the storage system.
[0126] In one embodiment, the memory status information includes first memory information; the first memory information is used to store the data created during the execution of the target multimedia task. Exemplarily, the first memory information is heap memory information. A heap is dynamically allocated memory, and the heap memory information is used to store the objects and data dynamically created during the runtime of the program. The program mentioned here is the program code of the functional service corresponding to the target multimedia task. The first memory information changes dynamically with the execution of the target multimedia task, that is, it changes dynamically with the runtime of the program. Based on this, during the execution of the target multimedia task by the first service process, synchronizing the memory status information of the first service process to the storage system includes: during the execution of the target multimedia task by the first service process, whenever the first memory information of the first service process changes, writing the changed first memory information to the storage system; wherein, the changed first memory information is also written to the memory space of the first service process.
[0127] In a specific implementation, new objects or new data can be dynamically created during the runtime of the program. Then, the first memory information required by the first service process will change and be updated. To ensure the consistency between the first service process and the program runtime, and to save and back up the first memory information of the first service process so as to restore the previous state after the service process crashes, the changed first memory information can be written to both the memory space of the first service process and the storage system simultaneously. In this way, a dual-write strategy can be implemented to ensure the reliability and persistence of the data. It can be understood that the first memory information written to the memory space of the first service process will be destroyed when the first service process crashes. However, based on the synchronization of the first memory information of the first service process by the storage system at each change moment, the corresponding first memory information can be obtained from the storage system and restored.
[0128] Exemplarily, as Figure 5a shown in the schematic diagram of the synchronization of the memory status information of the service process, it includes Process 1 and Process 2, which are used to execute the audio voice conversion task and the live broadcast task respectively. Both of these processes include heap memory information. Among them, the heap memory information in Process 1 stores map1(1, value1; 2, value2), where value1 and value2 are the data created during the runtime of the program code of the voice conversion function. The heap memory information in Process 2 stores map2(1, value6; 2, value9), where value6 and value9 are the data created during the runtime of the program code of the live broadcast function. When these data are written to the memory space of the process, they can all be synchronized to the storage system redis, so that redis can include the above-mentioned heap memory information.
[0129] Further, in one embodiment, the memory status information further includes second memory information, which is used to store data used during the execution of the target multimedia task. Exemplarily, the second memory information includes, but is not limited to, at least one of the following: stack memory information, register status, global variables, and file descriptors. Among them, the stack memory information can also be simply referred to as the stack, which is used to store local variables and function call information. If you want to restore to a specific function call state, then you need to save the stack information; registers are usually used to store the current execution position of the program (program counter), the current top position of the stack (stack pointer), and some important calculation results. These information are very important for restoring the execution state of the service process; global variables exist throughout the program run, and their status may affect the state and progress of the process; file descriptors are used to describe the status of files opened during the program run. This is because the service process opens some files or network connections during the run, then the status of these files or network connections (for example, the current read / write position) also needs to be saved.
[0130] During the execution of the target multimedia task by the first service process, for the synchronization of the second memory information, it can include any one of the following logics ① and ②: ① Whenever the second memory information changes, write the changed second memory information into the storage system; ② Every time the first preset time interval elapses, obtain the second memory information and write the obtained second memory information into the storage system.
[0131] For any synchronization logic of the second memory information, for the second memory information, whenever the second memory information changes, the changed second memory information is also written into the memory space of the first service process. Taken together, during the execution of the target multimedia task, in one implementation, similar to the storage of the first memory information, the synchronization timing of the second memory information is at the moment when the second memory information changes. Further, combined with the synchronization logic of the first memory information, it can be obtained that: whenever the memory status information of the first service process changes, the changed memory status information can be written into the storage system and into the memory space of the first service process, so as to achieve double writing of the memory status information. While backing up the memory status information, it can ensure that the first service process is consistent with the state of the program run.
[0132] In another implementation, the synchronization timing of the second memory information is timed, and the time unit of the first preset duration interval for the timing can be seconds, minutes, or hours. For example, if the first preset duration is 1 second, then the second memory information can be obtained every 1 second and written into the storage system. Based on the execution of the target multimedia task, the second memory information obtained in different times may be different, so the second memory information written into the storage system also has differences. Based on the change of the second memory information, the changed second memory information can also be written into the memory space of the first service process. Combining the synchronization logic of the first memory information, that is: whenever the memory information changes, it is written into the memory space of the first service process; for the first memory information, whenever it changes, it is written into the storage system to implement the backup of the first memory information, and for the second memory information, the second memory information is obtained every second preset duration and written into the storage system to perform backup to the storage system regularly.
[0133] S403, if the first service process has an exception before the execution of the target multimedia task is completed, obtain the memory state information and the first task configuration information of the first service process from the storage system.
[0134] In one embodiment, the first service process is managed by a task manager (Manager), and a heartbeat connection is established between the first service process and the task manager. In a specific implementation, the computer device includes a distributed coordination service cluster and multiple task managers. The distributed coordination service cluster includes multiple servers. Each multimedia task can be transmitted to the distributed coordination service cluster, and then the distributed coordination service cluster schedules the corresponding task manager to manage the service process for executing the corresponding multimedia task. A task manager can be used to manage one or more service processes, and each service process is used to execute one or more multimedia tasks. In a specific implementation, the distributed coordination service cluster can allocate the received multimedia tasks to appropriate task managers based on the loads of the respective task managers, so as to achieve the load balancing of each task manager. After receiving a multimedia task, any task manager can select an appropriate service process according to the task type of the multimedia task to process the multimedia task, and establish a heartbeat connection with the service process to monitor the running state of the service process. Then, for the target multimedia task, the task manager receiving the target multimedia task can establish a heartbeat connection with the first service process. Based on this, whether the first service process has an exception can be determined in the following ways shown in (1) and (2).
[0135] (1) Invoke the first service process to send a heartbeat packet to the task manager every second preset duration to report the running state of the first service process.
[0136] In a specific implementation, the time unit of the second preset duration can be seconds, minutes, or hours. This application does not limit this. For example, if the second preset duration is per second, then the first service process can send a heartbeat packet to the task manager every second. The heartbeat packet is a periodic signal used to monitor the running state of the service process. If the first service process is in a normal running state, then the first service process can regularly send a heartbeat packet to the task manager to indicate that it is in a normal running state. On the contrary, if the first service process is in an abnormal running state, then the first service process may no longer send a heartbeat packet to the task manager, or may send a heartbeat packet only after exceeding the second preset duration, which may both result in the task manager not receiving a heartbeat packet within the second preset duration.
[0137] (2) If the task manager does not receive a heartbeat packet sent by the first service process within the second preset duration, it is determined that the first service process has an abnormality.
[0138] If the task manager does not receive a heartbeat response from the first service process within the second preset time, then the task manager will consider that the connected first service process may have crashed or there is a problem with the network connection. At this time, it can be determined that the first service process has an abnormality.
[0139] It can be seen that the method shown in the above (1)-(2) is a mechanism for monitoring the running state of a service process based on heartbeat packets. In this mechanism, by regularly sending heartbeat packets between the task manager and the service process, the running state of the service process can be confirmed. If the task manager does not receive a heartbeat packet from the service process within a certain period of time, it will consider that the service process has crashed. This heartbeat packet mechanism enables the system to quickly detect whether the service process is abnormal and immediately perform recovery, thus ensuring the stability of the system and the continuity of task execution.
[0140] Exemplarily, based on the process shown in the above (1)-(2), a schematic diagram of service process crash detection as shown in Figure 5b can be provided, as shown in Figure 5bAs shown, when the first service process is running normally, it can send a heartbeat packet to the task manager. When the heartbeat packet is not refreshed at regular intervals, it means that the task manager has not received the heartbeat packet sent by the first service process within the predetermined time, so it can be determined that the program may have crashed (i.e., the service process has crashed), and then the exception handling and recovery mechanism can be triggered. Further, when an exception occurs in the service process is detected, the task manager can immediately start a new service process (i.e., the second service process) to replace the crashed first service process, and can retrieve the memory status information (such as the stack memory status) of the first service process and the first task configuration information from the storage system. Then, the memory status information and the first task configuration information retrieved from the storage system are restored to the new service process. In this way, the new service process can replace the crashed service process and continue to execute the unfinished target multimedia task, thus ensuring the continuity of the multimedia task and the reliability of the system. After the second service process finishes executing the target multimedia task, the execution result of the target multimedia task can be returned to the client through the task manager. It can be understood that if an exception occurs in the second service process before the target multimedia task is completed, then the third service process can be called to execute the target multimedia task. The determination method of the third service process can refer to the determination method of the second service process or the first service process. For example, a service process other than the first service process and the second service process is selected from multiple service processes adapted to the task type.
[0141] In one embodiment, each service process is assigned a unique identifier PID (Process ID) when it is created, which is referred to as the process identifier in this application. Each multimedia task is also assigned a unique identifier (taskid) when it is created, which is referred to as the task identifier in this application. Therefore, when the computer device obtains the memory status information and the first task configuration information of the first service process from the storage system, it can be obtained in the following specific way: first obtain the process identifier of the first service process and the task identifier of the target multimedia task, and then obtain the memory status information of the first service process from the storage system according to the process identifier of the first service process; and obtain the first task configuration information of the target multimedia task from the storage system according to the task identifier of the target multimedia task.
[0142] In a specific implementation, since both the process identifier and the task identifier are unique, in the storage system, the memory state information of each service process can correspond to the process identifier of the corresponding service process, and the task configuration information of the multimedia task executed by each service process can correspond to the task identifier of the corresponding multimedia task. For the first service process that has an exception, to restore the state of the first service process before, it is necessary to retrieve the previously saved memory state information and the first task configuration information of the first service process from the storage system. Based on the correspondence between the identifier and the information, the memory state information of the first service process can be obtained from the storage system based on the process identifier of the first service process, and the first task configuration information of the target multimedia task can be obtained based on the task identifier of the target multimedia task. It should be noted that the memory state information and the task configuration information obtained here are the latest ones before the first service process has an exception. If the storage system includes the second task configuration information (i.e., the changed first task configuration information), then in this step, the second task configuration information of the target multimedia task can be specifically obtained based on the task identifier. Further, if the storage system stores additional task configuration information and records the memory state information of the first service process at each synchronization timestamp, then in order to obtain the latest key data from the storage system, in addition to referring to the process identifier and the task identifier, it is also necessary to refer to the first timestamp when the first service process has an exception. Each memory state information and task configuration information in the storage system carries a synchronization timestamp, so that based on this first timestamp, the memory state information with a synchronization timestamp earlier than this first timestamp and having the smallest interval from the first timestamp, and the task configuration information of the target multimedia task can be found from the storage system.
[0143] S404. Determine the second service process, and write the memory state information of the first service process into the memory space of the second service process to update the memory state information of the second service process.
[0144] In one embodiment, the number of at least one service process adapted to the task type includes two or more. The second service process can be any service process other than the first service process among the at least one service process adapted to the task type. The determination logic for the second service process can be exactly the same as the determination logic for the first service process introduced above, or there can be differences. For example, among the service processes other than the first service process in the at least one service process, the second service process can be selected based on the load information of the service process. In another embodiment, if no suitable service process is selected as the second service process among the at least one service process adapted to the task type, then a new service process can be created as the second service process.
[0145] By writing the memory state information of the first service process into the memory space of the second service process, it is possible to restore the memory information of the crashed first service process in the second service process, that is, the updated memory state information of the second service process includes the memory state information of the first service process. Exemplarily, please refer to Figure 5c the schematic diagram of restoring the memory state information shown. When process 1 crashes, a new process (i.e., process 4) can be launched, and the heap memory information of process 1 can be pulled from the distributed storage system redis, and the heap memory information of process 1 can be restored to process 4. Thus, the heap memory information of process 4 includes the heap memory information map1(1, value1; 2, value2) of process 1.
[0146] S405, call the second service process and continue to execute the target multimedia task based on the first task configuration information.
[0147] In a specific implementation, the first task configuration information can be given to the second service process. After the program code is written into the memory space of the second service process, the program code can achieve the service effect corresponding to the function service based on the first task configuration information. By restoring the task configuration information required for the service process to execute the target multimedia task, in this way, even if the first service process crashes, the user's task configuration can be accurately restored based on the backup in the storage system, without the need for the user to reconfigure after launching the second service process. This solves the problem that only the default configuration scheme can be used after launching a new service process, resulting in the user having to reconfigure, and can improve the task execution efficiency. For example, combined with the Figure 5d schematic diagram of comparing the restoration of task configuration shown. As shown in (1) of Figure 5d , when using the voice-changing function, if the program crashes, the user may encounter the situation that the voice-changing suddenly fails. Based on this solution, the user does not need to reconfigure the parameters, but restores the original configuration based on the previously configured information (including parameters such as timbre and emotion), and then continues to use the voice-changing function. Similarly, during the live broadcast of one-key live broadcast, if the program crashes, it may cause the live broadcast to be interrupted. Based on this solution, the anchor does not need to reset the parameters related to the live broadcast (including parameters such as the live broadcast platform, live broadcast layout, and live broadcast streaming address), nor does it need to start the live broadcast again. Instead, the corresponding task configuration information is obtained from the storage system redis, so as to restore the original information. As can be seen from the comparison, as shown in (2) of Figure 5d , if the task configuration information is not synchronized in real time, only the default configuration can be restored.
[0148] The service process handling method provided by the embodiments of the present application can re-determine a new service process (i.e., the second service process) when the first service process encounters an exception. By writing the memory status information of the first service process obtained from the storage system into the second service process, the recovery of memory data can be achieved. Further, after the memory data is recovered, the original task configuration can be automatically restored based on the first task configuration information, and then the target multimedia task can be continued to be executed. In this way, there is no need for the user to manually restore the previous task configuration, which can improve the task processing efficiency and ensure the reliability and recoverability of the system.
[0149] Based on the service process handling method introduced in the above embodiments, a schematic diagram of the architecture of another service process handling system can be provided. This service process system is a recovery system applicable to the scenario of abnormal service exit, such as Figure 6 shown. This service process system can interact with multiple clients (such as Figure 6 the client 1 and client 2 shown in
[0150] 1. The client (such as client 1) submits a multimedia task to the voice background server server. After that, the server server passes the multimedia task to the authentication gateway, and the authentication gateway verifies and authorizes the information carried by the multimedia task. This step ensures that all tasks entering the system come from legitimate internal applications that have registered for this service, thus guaranteeing the security and stability of the system.
[0151] 2. According to the task identifier (taskid) assigned when creating the multimedia task, the repeatedly submitted multimedia tasks are filtered, and then the multimedia tasks are transmitted to the distributed coordination service cluster (Zookeeper Cluster).
[0152] 3. The cluster can allocate multimedia tasks to the appropriate task manager Manager according to the load of each task manager. After receiving a multimedia task, the task manager can select an appropriate virtualized Worker process for processing based on the task type of the multimedia task and establish a heartbeat connection with the Worker process.
[0153] 4. The Worker process processes multimedia tasks of the corresponding task type (such as multimedia tasks corresponding to functions like one-key live broadcast and voice change). At the same time, each time the stack information and program configuration information in the program memory are modified, the memory stack status and task configuration information of the service process can be synchronized to the distributed memory database Redis (a storage system) in real time, and the processing result is returned to the Worker process.
[0154] 5. If the Manager does not receive a heartbeat packet from the Worker process within a predetermined time, it will consider that the Worker may have crashed or there is a problem with the network connection. At this time, the Manager determines that the Worker process has crashed and retrieves the stack memory status and task configuration information of the Worker process from Redis. Then, a new Worker process is launched, and the memory status information and task configuration information retrieved from Redis are restored to the new Worker process. The new Worker process continues to process the previous multimedia tasks to ensure the continuity of multimedia tasks and the reliability of the system.
[0155] 6. The Worker sends the processing result to the client (such as Client 1) via the Manager.
[0156] The above interaction process can use the Redis cluster to synchronize the memory status information and task configuration information of the Worker node process in real time, which is convenient for launching a new Worker process after the Worker process crashes, so as to restore the memory status information and task configuration information to the new Worker process. In this way, the virtualization of the Worker process can be realized, and the running status of the service process can be monitored in real time. The distributed storage system (such as Redis) is used to store the latest memory status information and task configuration information of the process, and the exception handling and recovery process are automatically triggered when the service process crashes, quickly restoring the task status and memory data before the service process crashed, which can ensure the reliability of the system and improve the processing efficiency of multimedia tasks.
[0157] Next, the service process processing device provided by the embodiments of the present application will be described in detail.
[0158] Please refer to Figure 7 , Figure 7The figure is a schematic structural diagram of a service process processing device provided by an exemplary embodiment of the present application. The above service process processing device may be a computer program (including program code) running in a computer device. For example, the service process processing device is an application software. The service process processing device may be used to execute corresponding steps in the method provided by the embodiments of the present application. As Figure 7 shown, the service process processing device may include: a processing unit 701, a synchronization unit 702, and an acquisition unit 703.
[0159] The processing unit 701 is configured to, in response to an execution request for a target multimedia task, call a first service process to execute the target multimedia task based on first task configuration information of the target multimedia task;
[0160] The synchronization unit 702 is configured to, during the execution of the target multimedia task by the first service process, synchronize the memory state information and the first task configuration information of the first service process to the storage system, where the memory state information of the first service process changes dynamically as the target multimedia task is executed;
[0161] The acquisition unit 703 is configured to, if the first service process encounters an exception before the execution of the target multimedia task is completed, acquire the memory state information and the first task configuration information of the first service process from the storage system;
[0162] The processing unit 701 is configured to call a second service process to continue executing the target multimedia task based on the acquired memory state information and first task configuration information of the first service process.
[0163] In one embodiment, the execution request includes the task type of the target multimedia task. The processing unit 701 may further be configured to:
[0164] Select at least one service process adapted to the task type of the target multimedia task from a process pool according to the adaptation relationship between the task type and the process type;
[0165] Select the first service process from the at least one service process and run the first service process.
[0166] In one embodiment, when the processing unit 701 selects the first service process from the at least one service process, it is specifically configured to:
[0167] Acquire the load information of each service process in the at least one service process. The load information includes load capacity and load volume. The load capacity is used to indicate the maximum task volume that the corresponding service process allows to be loaded. The load volume is used to indicate the task volume that the corresponding service process has already loaded;
[0168] Determine the load margin of each service process according to the load information of each service process;
[0169] Determine any service process in at least one service process whose corresponding load margin meets the load condition as the first service process; wherein, the corresponding load margin meeting the load condition includes: the corresponding load margin is greater than or equal to the task volume corresponding to the target multimedia task.
[0170] In another embodiment, when the processing unit 701 selects the first service process from at least one service process, it is specifically configured to:
[0171] Obtain the system resource quota of each service process in at least one service process, where the system resource quota is used to indicate the amount of system resources allocated to the corresponding service process;
[0172] Determine any service process in at least one service process whose corresponding system resource quota meets the quota condition as the first service process; wherein, the corresponding system resource quota meeting the quota condition means that the amount of system resources indicated by the corresponding system resource quota is greater than or equal to the amount of system resources required to execute the target multimedia task.
[0173] In one embodiment, the memory status information includes first memory information; the first memory information is used to store the data created during the execution of the target multimedia task; when the synchronization unit 702 synchronizes the memory status information of the first service process to the storage system during the execution of the target multimedia task by the first service process, it is specifically configured to:
[0174] During the execution of the target multimedia task by the first service process, whenever the first memory information of the first service process changes, write the changed first memory information into the storage system; wherein, the changed first memory information is also written into the memory space of the first service process.
[0175] In one embodiment, the memory status information further includes second memory information, and the second memory information is used to store the data used during the execution of the target multimedia task; when the synchronization unit 702 synchronizes the memory status information of the first service process to the storage system during the execution of the target multimedia task by the first service process, it is specifically further configured to:
[0176] During the execution of the target multimedia task by the first service process, whenever the second memory information changes, write the changed second memory information into the storage system; or, every time the first preset time period elapses, obtain the second memory information and write the obtained second memory information into the storage system;
[0177] Wherein, whenever the second memory information changes, the changed second memory information is also written into the memory space of the first service process.
[0178] In one embodiment, when the obtaining unit 703 obtains the memory status information and the first task configuration information of the first service process from the storage system, it is specifically configured to:
[0179] Obtain the process identifier of the first service process and the task identifier of the target multimedia task;
[0180] According to the process identifier of the first service process, obtain the memory status information of the first service process from the storage system; and according to the task identifier of the target multimedia task, obtain the first task configuration information of the target multimedia task from the storage system.
[0181] In one embodiment, when the processing unit 701 invokes the second service process to continue executing the target multimedia task based on the obtained memory status information and the first task configuration information of the first service process, it specifically performs the following operations:
[0182] Determine the second service process;
[0183] Write the memory status information of the first service process into the memory space of the second service process to update the memory status information of the second service process;
[0184] Invoke the second service process to continue executing the target multimedia task based on the first task configuration information.
[0185] In one embodiment, the first service process is managed by the task manager, and a heartbeat connection is established between the first service process and the task manager; the processing unit 701 is further configured to:
[0186] Invoke the first service process to send a heartbeat packet to the task manager at intervals of a second preset duration to report the running status of the first service process;
[0187] If the task manager does not receive the heartbeat packet sent by the first service process within the second preset duration, it is determined that the first service process has an exception.
[0188] In one embodiment, the first task configuration information is managed by the configuration management center; the processing unit 701 is further configured to:
[0189] During the process of the first service process executing the target multimedia task, monitor the first task configuration information stored in the configuration management center;
[0190] If it is monitored that the first task configuration information stored in the configuration information management center has changed, read the second task configuration information from the configuration management center and write the second task configuration information into the storage system;
[0191] Among them, the second task configuration information refers to the changed first task configuration information, and the first service process executes the target multimedia task based on the second task configuration information.
[0192] In one embodiment, the target multimedia task is initiated by a target application; the execution request includes the application information of the target application; the processing unit 701 is further configured to:
[0193] Obtain service authentication information, where the service authentication information is used to record the application information of at least one application with service permissions;
[0194] If the service authentication information includes the application information of the target application, then trigger the execution of a target step, where the target step refers to: in response to the execution request of the target multimedia task, calling the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0195] In one embodiment, the processing unit 701 is further configured to:
[0196] Obtain task submission information, where the task submission information is used to record the task identifiers of one or more submitted multimedia tasks;
[0197] If the task submission information includes the task identifier of the target multimedia task, then perform deduplication processing on the target multimedia task;
[0198] If the task submission information does not include the task identifier of the target multimedia task, then trigger the execution of a target step, where the target step refers to: in response to the execution request of the target multimedia task, calling the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0199] In one embodiment, if the target multimedia task includes an audio voice conversion task, then the first service process includes an audio service process, and the first task configuration information includes at least one of the following: voice conversion timbre parameters and voice conversion emotion parameters; among them, the voice conversion timbre parameters are used to determine the timbre after voice conversion, and the voice conversion emotion parameters are used to determine the adjusted voice emotion; if the target multimedia task includes a live broadcast task, then the first service process includes a live broadcast service process, and the first task configuration information includes at least one of the following: live broadcast platform parameters, live broadcast window layout parameters, and live broadcast streaming address parameters; among them, the live broadcast platform parameters are used to determine the target platform for live broadcast, the live broadcast window layout parameters are used to determine the layout of the live broadcast screen, and the live broadcast streaming address parameters are used to determine the push position of the live broadcast content.
[0200] In an embodiment of the present application, in response to an execution request for a target multimedia task, a first service process may be called to execute the target multimedia task based on first task configuration information of the target multimedia task. During the execution of the target multimedia task by the first service process, the memory status information of the first service process and the first task configuration information of the target multimedia task may be synchronized to a storage system. In the event of an exception in the first service process, the memory status information and the first task configuration information of the first service process may be obtained from the storage system, and a second service process may be called to continue processing the target multimedia task based on the memory status information and the first task configuration information of the first service process. In this way, when an exception occurs in the service process, a new service process (i.e., the second service process) can be launched, and these synchronized information can be applied to the new service process, so that the target multimedia task can be restored to the previous task progress and the target multimedia task can be continued to be processed following the previous task progress in the event of a task interruption, which effectively enhances the reliability and recoverability of the system; in addition, since the configuration of the target multimedia task can be restored based on the first task configuration information previously backed up to the storage system without having to be configured repeatedly, the execution efficiency of the multimedia task can be improved.
[0201] Next, the computer device provided in the embodiment of the present application will be described in detail.
[0202] Please refer to Figure 8 , Figure 8 FIG. 10 is a schematic structural diagram of a computer device (i.e., the above-mentioned first consensus node) provided in an embodiment of the present application. The computer device may include a stand-alone device (such as one or more of a server, a node, a terminal, etc.), or may include components inside a stand-alone device (such as a chip, a software module, or a hardware module, etc.). The computer device at least includes a processor 801, an input interface 802, an output interface 803, and a computer-readable storage medium 804. Among them, the processor 801, the input interface 802, the output interface 803, and the computer-readable storage medium 804 in the computer device may be connected by a bus or other means. The computer-readable storage medium 804 may be stored in the memory of the computer device. The computer-readable storage medium 804 is used to store a computer program, and the computer program includes program instructions. The processor 801 is used to execute the program instructions stored in the computer-readable storage medium 804. The processor 801 (or CPU (Central Processing Unit, central processor)) is the computing core and control core of the computer device, and is adapted to implement one or more instructions, and is specifically adapted to load and execute one or more instructions to implement the corresponding method flow or the corresponding function. In a feasible implementation manner, the processor 801 in the embodiment of the present application may be used to perform the following operations:
[0203] In response to an execution request for a target multimedia task, call a first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task;
[0204] During the execution of the target multimedia task by the first service process, synchronize the memory state information and the first task configuration information of the first service process to the storage system, where the memory state information of the first service process changes dynamically as the target multimedia task is executed;
[0205] If the first service process encounters an exception before the target multimedia task is completed, obtain the memory state information and the first task configuration information of the first service process from the storage system;
[0206] Call a second service process to continue executing the target multimedia task based on the obtained memory state information and the first task configuration information of the first service process.
[0207] In one embodiment, the execution request includes the task type of the target multimedia task; the processor 801 can also be used to perform the following operations:
[0208] According to the adaptation relationship between the task type and the process type, select at least one service process adapted to the task type of the target multimedia task from the process pool;
[0209] Select a first service process from the at least one service process and run the first service process.
[0210] In one embodiment, when the processor 801 selects the first service process from the at least one service process, it is specifically used to perform the following operations:
[0211] Obtain the load information of each service process in the at least one service process, where the load information includes the load capacity and the load volume. The load capacity is used to indicate the maximum task volume that the corresponding service process allows to load; the load volume is used to indicate the task volume that the corresponding service process has already loaded;
[0212] Determine the load margin of each service process according to the load information of each service process;
[0213] Determine any service process in the at least one service process whose corresponding load margin meets the load condition as the first service process; where the corresponding load margin meeting the load condition includes: the corresponding load margin is greater than or equal to the task volume corresponding to the target multimedia task.
[0214] In another embodiment, when the processor 801 selects the first service process from the at least one service process, it is specifically used to perform the following operations:
[0215] Obtain the system resource quota of each service process in at least one service process, where the system resource quota is used to indicate the amount of system resources allocated to the corresponding service process;
[0216] Determine any service process in at least one service process whose corresponding system resource quota meets the quota condition as the first service process; where the corresponding system resource quota meeting the quota condition means that the amount of system resources indicated by the corresponding system resource quota is greater than or equal to the amount of system resources required to execute the target multimedia task.
[0217] In one embodiment, the memory status information includes first memory information; the first memory information is used to store the data created during the execution of the target multimedia task; when the processor 801 synchronizes the memory status information of the first service process to the storage system during the execution of the target multimedia task by the first service process, it is specifically used to perform the following operations:
[0218] During the execution of the target multimedia task by the first service process, whenever the first memory information of the first service process changes, write the changed first memory information to the storage system; where the changed first memory information is also written to the memory space of the first service process.
[0219] In one embodiment, the memory status information further includes second memory information, and the second memory information is used to store the data used during the execution of the target multimedia task; when the processor 801 synchronizes the memory status information of the first service process to the storage system during the execution of the target multimedia task by the first service process, it is specifically further used to perform the following operations:
[0220] During the execution of the target multimedia task by the first service process, whenever the second memory information changes, write the changed second memory information to the storage system; or, every time the first preset duration elapses, obtain the second memory information and write the obtained second memory information to the storage system;
[0221] Wherein, whenever the second memory information changes, the changed second memory information is also written to the memory space of the first service process.
[0222] In one embodiment, when the processor 801 obtains the memory status information and the first task configuration information of the first service process from the storage system, it is specifically used to perform the following operations:
[0223] Obtain the process identifier of the first service process and the task identifier of the target multimedia task;
[0224] Obtain the memory status information of the first service process from the storage system according to the process identifier of the first service process; and obtain the first task configuration information of the target multimedia task from the storage system according to the task identifier of the target multimedia task.
[0225] In one embodiment, when the processor 801 calls the second service process to continue executing the target multimedia task based on the obtained memory status information and the first task configuration information of the first service process, the following operations are specifically performed:
[0226] Determine the second service process;
[0227] Write the memory status information of the first service process into the memory space of the second service process to update the memory status information of the second service process;
[0228] Call the second service process to continue executing the target multimedia task based on the first task configuration information.
[0229] In one embodiment, the first service process is managed by the task manager, and a heartbeat connection is established between the first service process and the task manager; the processor 801 is further configured to perform the following operations:
[0230] Call the first service process to send a heartbeat packet to the task manager at intervals of a second preset duration to report the running status of the first service process;
[0231] If the task manager does not receive the heartbeat packet sent by the first service process within the second preset duration, it is determined that the first service process has an exception.
[0232] In one embodiment, the first task configuration information is managed by the configuration management center; the processor 801 is further configured to perform the following operations:
[0233] During the execution of the target multimedia task by the first service process, monitor the first task configuration information stored in the configuration management center;
[0234] If it is monitored that the first task configuration information stored in the configuration information management center has changed, read the second task configuration information from the configuration management center and write the second task configuration information into the storage system;
[0235] Wherein, the second task configuration information refers to the changed first task configuration information, and the first service process executes the target multimedia task based on the second task configuration information.
[0236] In one embodiment, the target multimedia task is initiated by a target application program; the execution request includes the application information of the target application program; the processor 801 is further configured to perform the following operations:
[0237] Obtain service authentication information, which is used to record the application information of at least one application program with service permissions;
[0238] If the service authentication information includes the application information of the target application program, trigger the execution of the target step, where the target step refers to: in response to the execution request of the target multimedia task, call the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0239] In one embodiment, the processor 801 is further configured to perform the following operations:
[0240] Obtain task submission information, which is used to record the task identifiers of one or more submitted multimedia tasks;
[0241] If the task submission information includes the task identifier of the target multimedia task, perform deduplication processing on the target multimedia task;
[0242] If the task submission information does not include the task identifier of the target multimedia task, trigger the execution of the target step, where the target step refers to: in response to the execution request of the target multimedia task, call the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
[0243] In one embodiment, if the target multimedia task includes an audio voice conversion task, the first service process includes an audio service process, and the first task configuration information includes at least one of the following: voice conversion timbre parameters and voice conversion emotion parameters; where the voice conversion timbre parameters are used to determine the timbre after voice conversion, and the voice conversion emotion parameters are used to determine the adjusted voice emotion;
[0244] If the target multimedia task includes a live broadcast task, the first service process includes a live broadcast service process, and the first task configuration information includes at least one of the following: live broadcast platform parameters, live broadcast window layout parameters, and live broadcast streaming address parameters; where the live broadcast platform parameters are used to determine the target platform of the live broadcast, the live broadcast window layout parameters are used to determine the layout of the live broadcast screen, and the live broadcast streaming address parameters are used to determine the push location of the live broadcast content.
[0245] In an embodiment of the present application, in response to an execution request for a target multimedia task, a first service process may be called to execute the target multimedia task based on first task configuration information of the target multimedia task. During the execution of the target multimedia task by the first service process, the memory state information of the first service process and the first task configuration information of the target multimedia task may be synchronized to a storage system. In the event of an exception in the first service process, the memory state information of the first service process and the first task configuration information may be obtained from the storage system, and a second service process may be called to continue processing the target multimedia task based on the memory state information of the first service process and the first task configuration information. In this way, when an exception occurs in the service process, a new service process (i.e., the second service process) can be launched, and these synchronized information can be applied to the new service process, so that the target multimedia task can be restored to the previous task progress and continue to be processed following the previous task progress of the target multimedia task in the event of a task interruption, which effectively enhances the reliability and recoverability of the system. Additionally, since the configuration of the target multimedia task can be restored based on the first task configuration information previously backed up to the storage system without having to be configured repeatedly, the execution efficiency of the multimedia task can be improved.
[0246] In addition, it should be noted that an embodiment of the present application also provides a computer-readable storage medium storing a computer program for the foregoing service process processing method. When the computer program is executed by a processor, it executes the description of the service process processing method in the embodiment of the present application. That is, when one or more processors load and execute the computer program, the description of the service process processing method in the embodiment can be implemented, which will not be elaborated here, nor will the beneficial effects of the same method be described here.
[0247] The foregoing computer-readable storage medium may be an internal storage unit of the service process processing device or the foregoing computer device provided in any of the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc., equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0248] In one aspect of the present application, a computer program product or a computer program is provided. The computer program product includes a computer program, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method for processing a service process provided in one aspect of the embodiments of the present application.
[0249] In one aspect of the present application, another computer program product or a computer program is provided. The computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps of the method for processing a service process provided in the embodiments of the present application.
[0250] The steps in the method of the embodiments of the present application can be adjusted, combined, and deleted according to actual needs.
[0251] The units in the device of the embodiments of the present application can be combined, divided, and deleted according to actual needs.
[0252] The above-disclosed are only some embodiments of the present application, and the scope of the rights of the present application cannot be limited thereby. Therefore, equivalent changes made to the claims of the present application still fall within the scope covered by the present application.
Claims
1. A service process handling method, characterized in that, The method includes: In response to an execution request for a target multimedia task, calling a first service process to execute the target multimedia task based on first task configuration information of the target multimedia task; During the execution of the target multimedia task by the first service process, synchronizing memory state information of the first service process and the first task configuration information to a storage system, where the memory state information of the first service process changes dynamically as the target multimedia task is executed; If the first service process encounters an exception before the target multimedia task is completed, obtaining the memory state information of the first service process and the first task configuration information from the storage system; Calling a second service process to continue executing the target multimedia task based on the obtained memory state information of the first service process and the first task configuration information.
2. The method according to claim 1, wherein The execution request includes a task type of the target multimedia task; the method further includes: Selecting at least one service process adapted to the task type of the target multimedia task from a process pool according to an adaptation relationship between the task type and the process type; Selecting a first service process from the at least one service process and running the first service process.
3. The method according to claim 2, wherein The selecting a first service process from the at least one service process includes: Obtaining load information of each service process in the at least one service process, where the load information includes a load capacity and a load amount, the load capacity is used to indicate a maximum task amount that the corresponding service process allows to load; the load amount is used to indicate a task amount that the corresponding service process has loaded; Determining a load margin of each service process according to the load information of each service process; Determining any service process in the at least one service process whose corresponding load margin meets a load condition as the first service process; where the corresponding load margin meeting the load condition includes: the corresponding load margin is greater than or equal to the task amount corresponding to the target multimedia task.
4. The method according to claim 2, wherein The selecting a first service process from the at least one service process includes: Obtaining a system resource quota of each service process in the at least one service process, where the system resource quota is used to indicate an amount of system resources allocated to the corresponding service process; Determining any service process in the at least one service process whose corresponding system resource quota meets a quota condition as the first service process; where the corresponding system resource quota meeting the quota condition means that the amount of system resources indicated by the corresponding system resource quota is greater than or equal to the amount of system resources required to execute the target multimedia task.
5. The method according to claim 1, characterized in that, The memory state information includes first memory information; the first memory information is used to store data created during the execution of the target multimedia task; During the execution of the target multimedia task by the first service process, synchronizing the memory state information of the first service process to the storage system includes: During the execution of the target multimedia task by the first service process, whenever the first memory information of the first service process changes, the changed first memory information is written into the storage system; wherein, the changed first memory information is also written into the memory space of the first service process.
6. The method according to claim 5, wherein The memory status information further includes second memory information, and the second memory information is used to store data used during the execution of the target multimedia task; During the execution of the target multimedia task by the first service process, synchronizing the memory status information of the first service process to the storage system further includes: During the execution of the target multimedia task by the first service process, whenever the second memory information changes, the changed second memory information is written into the storage system; or, every first preset time interval, the second memory information is acquired and the acquired second memory information is written into the storage system; Wherein, whenever the second memory information changes, the changed second memory information is also written into the memory space of the first service process.
7. The method according to claim 1, wherein Obtaining the memory status information and the first task configuration information of the first service process from the storage system includes: Obtaining the process identifier of the first service process and the task identifier of the target multimedia task; According to the process identifier of the first service process, obtaining the memory status information of the first service process from the storage system; and, according to the task identifier of the target multimedia task, obtaining the first task configuration information of the target multimedia task from the storage system.
8. The method according to any one of claims 1-7, characterized in that, Invoking a second service process to continue executing the target multimedia task based on the obtained memory status information and the first task configuration information of the first service process includes: Determining the second service process; Writing the memory status information of the first service process into the memory space of the second service process to update the memory status information of the second service process; Invoking the second service process to continue executing the target multimedia task based on the first task configuration information.
9. The method according to any one of claims 1-7, characterized in that, The first service process is managed by a task manager, and a heartbeat connection is established between the first service process and the task manager; the method further includes: Invoking the first service process to send a heartbeat packet to the task manager every second preset time interval to report the running status of the first service process; If the task manager does not receive the heartbeat packet sent by the first service process within the second preset time interval, it is determined that the first service process has an exception.
10. The method according to any one of claims 1-7, characterized in that, The first task configuration information is managed by a configuration management center; the method further includes: During the execution of the target multimedia task by the first service process, monitoring the first task configuration information stored in the configuration management center; If it is detected that the first task configuration information stored in the configuration information management center has changed, read the second task configuration information from the configuration management center and write the second task configuration information into the storage system; Wherein, the second task configuration information refers to the changed first task configuration information, and the first service process executes the target multimedia task based on the second task configuration information.
11. The method according to any one of claims 1-7, characterized in that, The target multimedia task is initiated by a target application; the execution request includes the application information of the target application; the method further includes: Obtain service authentication information, where the service authentication information is used to record the application information of at least one application program with service permissions; If the application information of the target application program is included in the service authentication information, trigger the execution of a target step, where the target step refers to: in response to the execution request of the target multimedia task, call the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
12. The method according to any one of claims 1-7, characterized in that, The method further includes: Obtain task submission information, where the task submission information is used to record the task identifiers of one or more submitted multimedia tasks; If the task identifier of the target multimedia task is included in the task submission information, perform deduplication processing on the target multimedia task; If the task identifier of the target multimedia task is not included in the task submission information, trigger the execution of a target step, where the target step refers to: in response to the execution request of the target multimedia task, call the first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task.
13. The method according to any one of claims 1-7, characterized in that If the target multimedia task includes an audio voice conversion task, the first service process includes an audio service process, and the first task configuration information includes at least one of the following: a voice conversion timbre parameter and a voice conversion emotion parameter; wherein, the voice conversion timbre parameter is used to determine the timbre after voice conversion, and the voice conversion emotion parameter is used to determine the adjusted voice emotion; If the target multimedia task includes a live broadcast task, the first service process includes a live broadcast service process, and the first task configuration information includes at least one of the following: a live broadcast platform parameter, a live broadcast window layout parameter, and a live broadcast streaming address parameter; wherein, the live broadcast platform parameter is used to determine the target platform for live broadcast, the live broadcast window layout parameter is used to determine the layout of the live broadcast screen, and the live broadcast streaming address parameter is used to determine the push position of the live broadcast content.
14. A service process processing device, characterized in that, The device includes: A processing unit, configured to, in response to an execution request of a target multimedia task, call a first service process to execute the target multimedia task based on the first task configuration information of the target multimedia task; A synchronization unit, configured to synchronize the memory state information of the first service process and the first task configuration information to a storage system during the execution of the target multimedia task by the first service process, where the memory state information of the first service process changes dynamically as the target multimedia task is executed; An acquisition unit, configured to, if the first service process encounters an exception before the execution of the target multimedia task is completed, acquire the memory state information of the first service process and the first task configuration information from the storage system; The processing unit is further configured to call a second service process to continue executing the target multimedia task based on the acquired memory state information of the first service process and the first task configuration information.
15. A computer device, characterized in that, Comprising: A processor, adapted to execute a computer program; A computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by the processor, it executes the service process processing method according to any one of claims 1-13.
16. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, and when the computer program is executed by the processor, it executes the service process processing method according to any one of claims 1-13.
17. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions, and when the computer program or computer instructions are executed by the processor, they implement the service process processing method according to any one of claims 1-13.