CN117667333A - Process hosting method and device - Google Patents

Process hosting method and device Download PDF

Info

Publication number
CN117667333A
CN117667333A CN202211053067.2A CN202211053067A CN117667333A CN 117667333 A CN117667333 A CN 117667333A CN 202211053067 A CN202211053067 A CN 202211053067A CN 117667333 A CN117667333 A CN 117667333A
Authority
CN
China
Prior art keywords
session
server
client
target application
processes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211053067.2A
Other languages
Chinese (zh)
Inventor
卞盛伟
黄钦开
王钊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Cloud Computing Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Cloud Computing Technologies Co Ltd filed Critical Huawei Cloud Computing Technologies Co Ltd
Priority to CN202211053067.2A priority Critical patent/CN117667333A/en
Publication of CN117667333A publication Critical patent/CN117667333A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a hosting method and a device for a process, wherein the method comprises the following steps: health monitoring is carried out on the processes of the managed target application according to the monitoring period, and whether each process in the processes of the target application is in a health state or not is determined; when a server-side session creation request of the target application is received, determining a first process from processes of the target application, wherein the first process is a process which is in a healthy state and can be currently bound with a server-side session in the processes of the target application; and calling the first process to create a server session. The method and the device can simplify the deployment process of the target program and simultaneously reduce the operation and maintenance cost of the application.

Description

Process hosting method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for hosting a process.
Background
With the development of internet technology, new business application layers are endless, and the iterative development speed of business application is also faster and faster. After the service application development is completed, the service application needs to be deployed, so that the service application operates in a deployment environment, and the service application is operated and maintained.
Currently, when a service application is deployed, an organizer of the service application needs to construct a deployment environment first, and then deploy the service application in the constructed deployment environment. The process of constructing the deployment environment comprises the following steps: planning database functions, configuring resources, etc. When planning the number of servers, server resources need to be configured according to traffic of the service application.
The process of deploying the service application is complex, affects the iteration speed of the service application and results in higher operation and maintenance costs.
Disclosure of Invention
The application provides a process hosting method and device, which can simplify the deployment process of a target program and reduce the operation and maintenance cost of an application.
In a first aspect, the present application provides a method for hosting a process, the method comprising: health monitoring is carried out on the processes of the managed target application according to the monitoring period, and whether each process in the processes of the target application is in a health state or not is determined; when a server-side session creation request of the target application is received, determining a first process from processes of the target application, wherein the first process is a process which is in a healthy state and can be currently bound with a server-side session in the processes of the target application; and calling the first process to create a server session.
The server sessions may bind Client sessions (Client sessions) of the target application, each server Session may bind at least one Client Session, and its maximum number of bindable Client sessions is fixed. The client session represents a session in which a client of the target application is connected to the server session. Any process which is in a healthy state and has the number of the sessions of the bound server less than the number of the sessions of the maximum bindable server can be determined as the first process.
According to the method, the hosting of the process of the application, the health monitoring of the process and the creation of the server session by calling the process can be realized according to the application package provided by the application organizer, the application organizer does not need to construct a deployment environment and also does not need to operate and maintain the application, so that the deployment process of the target program is simplified and the operation and maintenance cost of the application is reduced.
In one possible implementation, the method further includes: and performing expansion and contraction processing on the process of the target application based on index data of the target application, wherein the index data comprises the number of server-side sessions which can be bound by each process in the process of the target application. Therefore, the number of processes can be expanded and contracted according to the practical requirements of the application, the waste of resources is reduced, and the resource cost is reduced to a certain extent.
The index data can be obtained based on the number of the sessions of the bound server of the process and the maximum number of the sessions of the bindable server. The number of bound server sessions for a process may be derived based on the identity of the server sessions for the process recorded in the hosting system.
In one possible implementation manner, the performing, based on the index data of the target application, the expansion and contraction processing on the process of the target application includes: when the process needing to expand the target application is determined according to the index data of the target application, determining the number of processes to be expanded; creating the processes of the target application according to the number of the processes to be expanded; when the process of the target application is determined to be scaled according to the index data of the target application, determining the number of processes to be scaled; ending the idle state process in the target application process according to the number of the to-be-scaled processes.
For example, the number of reserved server sessions may be preset, or the number of reserved server sessions may be determined according to the number of reserved idle processes indicated by the elasticity index. When the process of the capacity expansion target application is needed, determining the difference value between the number of reserved server side sessions and the number of bindable server side sessions of the current process, and determining the number of processes capable of binding the difference value with the number of server side sessions as the number of processes to be expanded. When the process of the capacity reduction target application is needed, determining the difference value between the bindable server side session number of the current process and the reserved server side session number, and determining the process number capable of binding the difference value server side session as the process number to be capacity reduced.
In one possible implementation manner, the creating the process of the target application according to the number of the processes to be expanded includes: executing the executable file of the target application to control the second process to perform initialization operation; and after the initialization operation of the second process is completed, obtaining the process information of the second process and setting the second process into an active state.
In a possible implementation manner, the ending, according to the number of to-be-scaled processes, the process in the idle state in the process of the target application includes: controlling a third process in an idle state in the process of the target application to carry out cleaning operation; and after the cleaning operation is finished, setting the third process to be in a termination state and recovering the resources of the third process.
In one possible implementation manner, the calling the first process to create a server session includes: generating and transmitting a session object of the server-side session, wherein the session object of the server-side session comprises: the identification of the server side session and the maximum number of the client side sessions which can be bound, wherein the session object of the server side session is used for binding the client side session of the target application with the server side session; invoking the first process to create the server session based on the session object of the server session; the method further comprises the steps of: and setting the server session to be in an active state.
After the session object of the server session is generated, the session object can be saved, and then the state tracking is performed on the server session based on the session object to determine whether the server session is ended. After the server session is ended, the bound process of the server session can report the end of the server session to the hosting system, and the reported content carries the identification of the server session. The hosting system determines whether a notification of the end of the server session is received based on a session object of the server session to determine whether the server session is ended.
In one possible implementation, the method further includes: receiving a client session creation request of the target application, wherein the client session creation request is used for indicating the server session; when the server side session is in an active state and a client side session can be bound, a first client side session bound with the server side session is created and set to a reserved state; transmitting a session object of the first client session, wherein the session object of the first client session comprises: the identification of the first client session and the process information of the first process, wherein a session object of the first client session is used for establishing connection between the first client session and the first process; invoking the first process to carry out connection verification, and determining whether the first client session successfully establishes connection with the first process; and when the first client session and the first process are successfully connected, setting the first client session into an active state.
The client session creation request may carry an identifier of the server session, so as to indicate the server session. Sending creation error information of the first client session to a terminal platform of the target application when the server session does not meet any of the following conditions: the server is in an active state and the server session may bind to the client session.
In one possible implementation, the method further includes: determining whether each client session establishing a connection with the first process is disconnected from the first process; when a second client session which establishes connection with the first process is disconnected with the first process, setting the second client session to be in a completion state, and binding the second client session with the server session; and unbinding the second client session and the server session, and recovering the resources of the second client session.
In one possible implementation, the method further includes: receiving a client session acquisition request, wherein the client session acquisition request is used for indicating the server session; and sending the session objects of all client sessions bound with the server session.
The process can realize that any client session bound by the same server session obtains session objects of other client sessions. For example, when the server session represents a game, the process may enable one player to obtain an identification (e.g., a user name) of other players participating in the game.
In one possible implementation, the method further includes: and determining a binding policy of the server-side session, wherein the binding policy comprises allowing binding of a new client session or refusing binding of the new client session. This increases the hosting flexibility of the process.
At this time, for the creation process of the first client session described in the foregoing process, when the number of bound client sessions of the server session is smaller than the maximum number of bindable client sessions thereof, and the binding policy of the server session allows binding of a new client session, the hosting system determines that the server session can bind the client session. Determining that the server session is not bindable to the client session when the server session does not satisfy any of the following conditions: the number of bound client sessions is less than the maximum number of bindable client sessions and the binding policy is such as to allow binding of new client sessions.
In one possible implementation, the method further includes: determining whether the server session is ended; when the server-side session is ended, setting the server-side session to be in a termination state; and unbinding the server session and the first process, and recovering the resources of the server session.
In a second aspect, the present application provides a hosting apparatus for a process, the apparatus comprising: the monitoring module is used for carrying out health monitoring on the processes of the managed target application according to the monitoring period and determining whether each process in the processes of the target application is in a health state or not; the first determining module is used for determining a first process from the processes of the target application when receiving a server session creation request of the target application, wherein the first process is a process which is in a healthy state and can be currently bound with a server session in the processes of the target application; and the first creating module is used for calling the first process to create a server session.
In one possible implementation, the apparatus further includes: and the expansion and contraction module is used for carrying out expansion and contraction processing on the process of the target application based on the index data of the target application, wherein the index data comprises the number of server-side sessions which can be bound by each process in the process of the target application.
In one possible implementation manner, the expansion and contraction module is specifically configured to: when the process needing to expand the target application is determined according to the index data of the target application, determining the number of processes to be expanded; creating the processes of the target application according to the number of the processes to be expanded; when the process of the target application is determined to be scaled according to the index data of the target application, determining the number of processes to be scaled; ending the idle state process in the target application process according to the number of the to-be-scaled processes.
In one possible implementation manner, the expansion and contraction module is specifically configured to: executing the executable file of the target application to control the second process to perform initialization operation; and after the initialization operation of the second process is completed, obtaining the process information of the second process and setting the second process into an active state.
In one possible implementation manner, the expansion and contraction module is specifically configured to: controlling a third process in an idle state in the process of the target application to carry out cleaning operation; and after the cleaning operation is finished, setting the third process to be in a termination state and recovering the resources of the third process.
In one possible implementation manner, the first creating module is specifically configured to: generating and transmitting a session object of the server-side session, wherein the session object of the server-side session comprises: the identification of the server side session and the maximum number of the client side sessions which can be bound, wherein the session object of the server side session is used for binding the client side session of the target application with the server side session; invoking the first process to create the server session based on the session object of the server session; the first creation module is further configured to set the server session to an active state.
In one possible implementation, the apparatus further includes: the receiving and transmitting module is used for receiving a client session creation request of the target application, wherein the client session creation request is used for indicating the server session; the second creating module is used for creating a first client session bound with the server session and setting the first client session into a reserved state when the server session is in an active state and the client session can be bound; the transceiver module is further configured to send a session object of the first client session, where the session object of the first client session includes: the identification of the first client session and the process information of the first process, wherein a session object of the first client session is used for establishing connection between the first client session and the first process; the apparatus further comprises: a verification module for: invoking the first process to carry out connection verification, and determining whether the first client session successfully establishes connection with the first process; and when the first client session and the first process are successfully connected, setting the first client session into an active state.
In one possible implementation, the apparatus further includes: a client session deletion module, configured to: determining whether each client session establishing a connection with the first process is disconnected from the first process; when a second client session which establishes connection with the first process is disconnected with the first process, setting the second client session to be in a completion state, and binding the second client session with the server session; and unbinding the second client session and the server session, and recovering the resources of the second client session.
In one possible implementation, the transceiver module is further configured to: receiving a client session acquisition request, wherein the client session acquisition request is used for indicating the server session; and sending the session objects of all client sessions bound with the server session.
In one possible implementation, the apparatus further includes: and the second determining module is used for determining the binding strategy of the server-side session, wherein the binding strategy comprises the steps of allowing the binding of the new client-side session or refusing the binding of the new client-side session.
In one possible implementation, the apparatus further includes: the server session deleting module is used for determining whether the server session is ended or not; when the server-side session is ended, setting the server-side session to be in a termination state; and unbinding the server session and the first process, and recovering the resources of the server session.
In a third aspect, the present application provides a hosting apparatus for a process, the apparatus comprising: one or more processors; a memory for storing one or more computer programs or instructions; when executed by the one or more processors, causes the one or more processors to implement the method of any of the first aspects.
In a fourth aspect, the present application provides a hosting apparatus of a process, the apparatus comprising a processor for performing the method of any of the first aspects.
In a fifth aspect, the present application provides a computer readable storage medium comprising a computer program or instructions which, when executed on a computer, cause the computer to perform the method of any of the first aspects.
Drawings
Fig. 1 is a schematic structural diagram of a hosting system of a process according to an embodiment of the present application;
FIG. 2 is an application schematic of a plurality of hosting systems of a process provided by an embodiment of the present application;
fig. 3 is a flow chart of a hosting method of a process according to an embodiment of the present application;
FIG. 4 is a flow chart of another embodiment of a method for hosting a process;
FIG. 5 is a block diagram of a hosting device for a process provided in an embodiment of the present application;
FIG. 6 is a block diagram of a hosting device of another process provided by an embodiment of the present application;
FIG. 7 is a block diagram of a hosting device of yet another process provided by an embodiment of the present application;
FIG. 8 is a block diagram of a hosting device of yet another process provided by an embodiment of the present application;
FIG. 9 is a block diagram of a hosting device of yet another process provided by an embodiment of the present application;
FIG. 10 is a block diagram of a hosting device of yet another process provided by an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a hosting device for a process according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is apparent that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The terms "first," "second," and the like in the description and in the claims and drawings are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion, such as a series of steps or elements. The method, system, article, or apparatus is not necessarily limited to those explicitly listed but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
It should be understood that in this application, "at least one" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
With the development of internet technology, various new business applications are layered endlessly, and the iteration speed of business applications is also faster and faster. After the service application development is completed, the service application needs to be deployed so that the service application can run in a deployment environment and the service application can be operated and maintained.
In the related technology, when the service application is deployed, for the deployment environments of public cloud and private cloud, an organizer of the service application is required to construct the deployment environment first, and then the service application is deployed in the constructed deployment environment. The process of constructing the deployment environment comprises the following steps: planning database functions, configuring resources, etc., the resources including server resources, network bandwidth resources, storage resources, computing resources, etc. The service application deployment process is complex, and an organizer of the service application needs to expend a great deal of manpower and energy to deploy the service application, so that the iteration speed of the service application is influenced and higher operation and maintenance cost is caused.
In addition, traffic peaks may occur for some of the service applications, such as gaming and transcoding service applications. In order to cope with the traffic peak phenomenon of the service application, the normal operation of the service application is ensured, and a large amount of redundant servers and resources are needed, so that the resource cost is higher in the process of deploying the service application.
The embodiment of the application provides a Process (Process) hosting method, so that the operation and maintenance cost of an application is reduced while the deployment Process of the application is simplified. The process refers to a back-end service process after the application package is instantiated on the computing instance, and the back-end service process after the game application is instantiated is a game process and the back-end service process after the transcoding application is instantiated is a transcoding process. The method can be applied to a hosting system of a process, please refer to fig. 1, fig. 1 is an application schematic diagram of the hosting system of the process provided in an embodiment of the present application, and fig. 1 shows the hosting system and a server management platform for providing resources to the hosting system. The hosting system includes a management plane and a data plane, the management plane may include at least one server, and an application Gateway (Application Gateway, app Gateway) component is disposed in the at least one server, and an Auxiliary proxy (Auxproxy) component is disposed in the data plane.
Upon hosting of a process, the Auxproxy component may be launched and the process created in the form of a virtual machine or container, and accordingly, the data plane may include at least one virtual machine or container. For the form of virtual machines, the App Gateway component may create a virtual machine based on the virtual machine image. For the form of containers, the hosting system may also include a container orchestration subsystem with which the App Gateway component creates containers by interacting.
The following describes an example of starting up an Auxproxy component and creating a process by means of a virtual machine. The App Gateway component determines the number of processes to be started after receiving an application packet, and one application packet corresponds to at least one process. And determining the number of virtual machines to be created according to the number of processes, wherein the number of processes which can be started by each virtual machine is fixed. And then the App Gateway component packages the application package and the Auxproxy component into a virtual machine image, and creates a virtual machine according to the virtual machine image. When creating the virtual machine, the App Gateway component writes an environment variable (e.g., may include an access address of the App Gateway component) in the virtual machine, the environment variable being used for interaction of the Auxproxy component with the App Gateway component deployed in the virtual machine.
As shown in fig. 1, the data plane includes created virtual machine 1 through virtual machine n. After the virtual machine is created, an App Gateway component is built in a created virtual machine, and the virtual machine starts an Auxproxy component by running the start script when starting, namely, one Auxproxy component is deployed in each virtual machine. The Auxproxy component determines an access address of the App Gateway component through the environment variable written in the virtual machine, and interacts with the App Gateway component according to the access address.
When the App Gateway component determines the number of processes to be started, in an example, the App Gateway component is preconfigured with a default number of starting processes, and the default number of starting processes may be determined as the number of processes to be started; in another example, the App Gateway component receives an elasticity indicator of the application, where the elasticity indicator is used to indicate a number of reserved idle processes, and the App Gateway component determines a number of processes that need to be started based on the elasticity indicator, for example, the number of reserved idle processes indicated by the elasticity indicator may be determined as the number of processes that need to be started.
The Auxproxy component obtains the number of processes to be started from the App Gateway component, and starts the processes according to the number of processes. A software development kit (software development kit, SDK) that the process needs to integrate is also deployed in the virtual machine where the process is deployed. As shown in fig. 1, a virtual machine 1 has deployed therein processes 1 to 3 and each process requires an integrated SDK.
After the processes are started according to the number of the processes to be started, the App Gateway component interacts with the SDK integrated in the process through the Auxproxy component so as to realize the management of the process and a Server Session. The server session represents a specific application processing request, and a process may bind at least one server session and process the bound server session. For example, for a gaming session, a server session may represent a game; for transcoding processes, a server session may represent a transcoding task for a live room. The management of the process includes at least one of: start, monitor, end, etc. of the process. The management of the server session includes at least one of: creation, activation, monitoring, termination, etc. of a server session.
Alternatively, the number of managed systems of a process may be multiple, one region for each managed system. The plurality of managed systems are managed by the management platform in a unified way. The management platform records hosting information of each hosting system, and the hosting information can include, for example, identification of an application corresponding to a process hosted by each hosting system, organizer information of the application, and the like. The management platform is used for receiving a request of the application, the request carries an organizer or an identifier of the application, determining a hosting system for processing the request based on information carried by the request, and forwarding the request to the hosting system.
For example, referring to fig. 2, fig. 2 is an application schematic diagram of a plurality of hosting systems of a process provided in an embodiment of the present application, and fig. 2 shows a management platform and 2 hosting systems, where the two hosting systems respectively correspond to an area 1 and an area 2. Any App Gateway component is used to interact with the various Auxproxy components in the hosted system to enable full lifecycle management of processes in the hosted system. Therefore, the application process can be deployed in the corresponding managed system according to the regional attribute of the flow required by the user of the application, the nearby deployment of the process is realized, and the processing performance is improved.
In the embodiment of the application, the hosting system can be applied to cloud scenes and edge scenes. The reliability, the safety and the processing capacity of the cloud scene are high. The hosting system in the edge scene is widely distributed, the data delay is small, and the instantaneity is high.
Referring to fig. 3, fig. 3 is a flow chart of a process hosting method provided in an embodiment of the present application, where the method may be applied to a process hosting system, for example, the process hosting system shown in fig. 1 or fig. 2, fig. 3 illustrates that process management includes process monitoring, and management of a server session includes creation of a server session, and the method may include the following flows:
101. and carrying out health monitoring on the processes of the hosted target application according to the monitoring period, and determining whether each process in the processes of the target application is in a health state.
The Auxproxy component in the virtual machine or the container deployed by the process of the target application can perform health monitoring on the process of the target application according to the monitoring period to obtain the health state returned by the process of the target application, and then the health state of each process of the target application is sent to the App Gateway component.
102. When a server-side session creation request of a target application is received, a first process is determined from processes of the target application, wherein the first process is a process which is in a healthy state and can be currently bound with the server-side session in the processes of the target application.
The server session creation request may be sent by a terminal platform of the target application, where the terminal platform causes the hosting system to start creating the server session by invoking a system interface of the hosting system. The terminal platform runs a terminal application corresponding to the target application, and the terminal application is developed by an organizer of the target application and is used for managing user login and unified interfaces of the target application. For example, when the target application is a game-like application, the terminal application is a game lobby.
103. And calling a first process to create a server session.
The server sessions may bind client sessions of the target application, each server session may bind at least one client session, and its maximum number of bindable client sessions is fixed. The client session represents a session in which a client of the target application is connected to the server session. Illustratively, when the target application is a game-like application, the server session indicates a game, and the client session indicates a player entering the game; when the target application is a transcoding class application, the server session indicates a transcoding task of a live room, and the client session indicates a push-pull stream of the live room. The live video of the live room is transmitted to the server, and the live video of the live room is obtained from the server by the client.
In summary, according to the method for hosting a process provided by the embodiment of the application, health monitoring is performed on the process of the hosted target application according to the monitoring period, whether each process of the target application is in a health state is determined, when a server-side session creation request of the target application is received, a first process which is in a health state and can bind the server-side session is determined from the processes of the target application, and then the first process is called to create the server-side session.
The following describes a process management process and a server session management process, and describes a process hosting method provided by the embodiment of the present application by taking as an example that the process management includes start, monitor and end of a process, and the server session management includes creation, activation, monitor and end of a server session.
Referring to fig. 4, fig. 4 is a flow chart of another process hosting method provided in an embodiment of the present application, where the method may be applied to a process hosting system, for example, the process hosting system shown in fig. 1 or fig. 2, and the method may include the following flow chart:
201. and carrying out health monitoring on the processes of the hosted target application according to the monitoring period, and determining whether each process in the processes of the target application is in a health state.
For example, an Auxproxy component in a virtual machine deployed by a process of a target application may invoke a health monitoring (onhealth check) interface to health monitor the application process. The process of the target application may return a true (true) indicating that it is in a healthy state or an error (false) indicating that it is not in a healthy state.
202. When a server-side session creation request of a target application is received, a first process is determined from processes of the target application, wherein the first process is a process which is in a healthy state and can be currently bound with the server-side session in the processes of the target application.
As can be seen from the foregoing description, each process of the target application can bind at least one server session, and the maximum number of bindable server sessions per process is fixed. The hosting system determines any process which is in a healthy state and has the number of the sessions of the bound server side smaller than the maximum number of the sessions of the bindable server side in the processes of the target application as a first process. As shown in fig. 1 or 2, this process may be performed by an App Gateway component in the hosting system.
The identity of the server session of each process is recorded in the hosting system, and the identity of the server session may be an identity number (identity document, ID) of the server session. After the server-side session of any process is successfully created, the hosting system adds the identification of the created server-side session to the recorded identification of the server-side session of any process. After the server-side session of any process is ended, the hosting system deletes the identifier of the server-side session ended in the recorded identifier of the server-side session of any process. The hosting system may thus determine the number of bound server sessions for the process based on the identity of the server session for the process of the currently recorded target application.
203. And calling a first process to create a server session.
The hosting system may first generate and create a requested sender (e.g., a terminal platform of the target application) of the request for the server session, and send a session object for the server session. And then invoking the first process to create a server session based on the session object of the server session. After the server session is successfully created, the server session is set to an active (active) state. The session object of the server session includes: the identity of the server session and the maximum number of bindable client sessions for the server session.
After generating the session object of the server session, the hosting system may save the session object, and then perform state tracking on the server session based on the session object to determine whether the server session is ended. After the server session is ended, the bound process of the server session can report the end of the server session to the hosting system, and the reported content carries the identification of the server session. The hosting system determines whether a notification of the end of the server session is received based on a session object of the server session to determine whether the server session is ended. Illustratively, when the server session represents a game, the end of the game is considered the end of the server session.
As shown in fig. 1 or fig. 2, after an App Gateway component in the hosting system generates and sends a session object of a server session to a sender of a server session creation request, an activation request of the server session is issued to an Auxproxy component in a virtual machine deployed by the first process. The Auxproxy component invokes an on-start server session (onstartversession) interface of the first process based on the activation request to cause the first process to activate the server session (i.e., actually create the server session). After the first process activates the server session, an activation server session (ActivateServerSession) interface of the SDK is called to send activation result information to an Auxproxy component of the virtual machine, and the Auxproxy component sends the received activation result information to an App Gateway component. The activation result information comprises activation success and activation failure, and when the activation result information comprises activation success, namely the server-side session creation success is indicated, the App Gateway component sets the server-side session into an active state. When the activation result information includes activation failure, the App Gateway component may re-issue an activation request of the server session to an Auxproxy component in the virtual machine deployed by the first process, so as to re-activate the server session.
204. After the first client session of the binding server session establishes connection with the first process, the first process is called to carry out connection verification, and whether the first client session successfully establishes connection with the first process is determined.
In an embodiment of the present application, the first client session is created by a hosting system. The hosting system may receive a client session creation request of the target application sent by a terminal platform of the target application, the client session creation request being used to indicate a server session. When the server session is in an active state and the client session can be bound, a first client session bound to the server session is created and set to a reserved (reserved) state. And then sending a session object of the first client session to a terminal platform of the target application, wherein the session object of the first client session comprises: the identification of the first client session and the process information of the first process, the identification of the first client session may be an ID of the first client session. The terminal platform establishes a connection between the first client session and the first process based on the received session object of the first client session. Sending creation error information of the first client session to a terminal platform of the target application when the server session does not meet any of the following conditions: the server is in an active state and the server session may bind to the client session.
The client session creation request may carry an identifier of the server session to indicate the server session, where the identifier of the server session is sent by the hosting system to the terminal platform in the foregoing process 203. The process information of the first process may include an internet protocol (Internet Protocol, IP) address and port of the process.
As can be seen from the foregoing description, the server session can bind at least one client session, and the maximum number of bindable client sessions of the server session is fixed. When the number of bound client sessions for the server session is less than the maximum number of bindable client sessions, the hosting system determines that the server session can bind the client sessions.
The hosting system records the status of each server session and the identity of the bound client session. After binding a new client session, the hosting system adds the identification of the new client session to the recorded identification of the client session bound by the any server session. After the client session bound by any one of the server sessions is ended, the hosting system deletes the identifier of the ending client session in the recorded identifier of the client session bound by any one of the server sessions. The hosting system may thus determine whether the server session is in an active state based on the state of the currently recorded server session, and determine the number of bound client sessions for the server session based on the identification of the client session to which the currently recorded server session is bound.
For example, after connection verification is performed and the verification result is successful, the first process calls an acceptclientSesion interface of the SDK to send verification success information to an Auxproxy component of the virtual machine. The Auxproxy component sends the received verification success information to the App Gateway component. The App Gateway component may set a waiting duration, take a time of creating the first client session as a start time, and determine that the first client session and the first process successfully establish a connection when the verification success information is received within the waiting duration. And when the verification success information is not received within the waiting time, determining that the connection between the first client session and the first process is not successfully established.
Alternatively, the process information of the first process may also be carried in the session object of the server session in the foregoing process 203, so long as it is ensured that the terminal platform receives the process information of the first process before establishing a connection with the first process, which is not limited in the embodiment of the present application.
205. And when the first client session successfully establishes connection with the first process, setting the first client session into an active state.
As shown in fig. 1 or fig. 2, the App Gateway component sets the first client session to an active state. For the case where the first client session and the first process do not successfully establish a connection, the first client session may be set to a timeout (timeout) state.
206. It is determined whether each client session establishing a connection with the first process is disconnected from the first process.
For example, if the target application is a game-like application, when a player leaves a game, the client session corresponding to the player disconnects from the first process. This process may be performed by an App Gateway component.
As shown in fig. 1 or fig. 2, when any client session that establishes a connection with the first process disconnects from the first process, the first process invokes a delete client session (remolcientsession) interface of the SDK to send delete information to the Auxproxy component, the delete information indicating the any client session. The Auxproxy component sends the deletion information of any client session to the App Gateway component. Thus, for any client session that establishes a connection with the first process, when the App Gateway component receives deletion information for the any client session, the App Gateway component determines that the any client session is disconnected from the first process. When the App Gateway component does not receive the deletion information of any client session, the App Gateway component determines that any client session is not disconnected from the first process.
207. And when the second client session which establishes connection with the first process is disconnected with the first process, setting the second client session to be in a finished state, and binding the second client session with the server session.
As shown in fig. 1 or fig. 2, the Auxproxy component receives the deletion information of the second client session, determines that the second client session is disconnected from the first process, and places the second client session in a completed state.
208. And unbinding the second client session and the server session, and recovering the resources of the second client session.
As shown in fig. 1 or fig. 2, the Auxproxy component unbinds the second client session from the server session, and sends deletion information of the second client session to the App Gateway component. The App Gateway component reclaims resources of the second client session. And the App Gateway component deletes the identifier of the second client session in the identifiers of the client sessions bound to the server session.
209. It is determined whether the server session is ended.
For example, if the target application is a game application, when a game is ended, the server session corresponding to the game is ended. This process may be performed by an App Gateway component.
As shown in fig. 1 or fig. 2, when the server session ends, a terminating server session (terminateserver session) interface of the SDK is called to send termination information to the Auxproxy component, the termination information indicating the server session. The Auxproxy component sends the termination information of the server session to the App Gateway component. Therefore, when the App Gateway component receives the termination information of the server-side session, the App Gateway component determines that the server-side session is ended. When the App Gateway component does not receive the termination information of the server-side session, the App Gateway component determines that the server-side session is not ended.
210. When the server session is ended, the server session is set to a termination state.
As shown in fig. 1 or fig. 2, the Auxproxy component receives the termination information of the server session, determines that the server session is ended, and sets the server session to a terminated state.
211. And unbinding the server session and the first process, and recovering the resources of the server session.
As shown in fig. 1 or fig. 2, the Auxproxy component unbinds the server session from the first process, and sends termination information of the server session to the App Gateway component. The App Gateway component reclaims the resources of the service session. And the App Gateway component deletes the identification of the server session in the identifications of all the server sessions of the first process.
The foregoing processes 201 to 211 explain the management process of the server session and the management process of the client session. As can be seen from the foregoing processes 201 to 211, in the hosting system provided by the embodiments of the present application, the App Gateway component may implement creation, deletion, modification, and status monitoring of a server session and a client session, determine a process of creating and processing the server session when a server session creation request is received, and schedule the process to create the server session and process the server session. The monitoring of the process can be realized through the Auxproxy component, and the states of the process, the server session and the client session are reported to the App Gateway component. The SDK can realize interaction of the process and the Auxproxy component in the virtual machine, and the state of the process, the server session and the client session can be reported to the Auxproxy component through the SDK process, so that the App Gateway component obtains the states of the process, the server session and the client session.
In this embodiment of the present application, the hosting system may further perform the capacity expansion and contraction processing on the process of the target application based on the index data of the target application, where the index data includes the number of server sessions that each process in the process of the target application can bind. Therefore, the number of processes can be expanded and contracted according to the practical requirements of the application, the waste of resources is reduced, and the resource cost is reduced to a certain extent. The index data may be derived based on the number of bound server sessions of the process and up to the number of bindable server sessions. The number of bound server sessions for a process may be derived based on the identity of the server sessions for the process recorded in the hosting system.
And when the process of the target application to be expanded is determined according to the index data of the target application, determining the number of the processes to be expanded. And then creating the processes of the target application according to the number of the processes to be expanded. For example, the number of reserved server sessions may be preset, or the number of reserved server sessions may be determined according to the number of reserved idle processes indicated by the elasticity index. And then determining the difference value between the number of the reserved server side sessions and the number of the bindable server side sessions of the current process, and determining the number of the processes capable of binding the difference value server side sessions as the number of the processes to be expanded.
When the process of the target application is created, an executable file of the target application can be executed to control the second process to perform an initialization operation. And after the initialization operation of the second process is completed, process information of the second process is acquired, and the second process is set to be in an active state. After the initialization operation is completed, the second process calls a process ready (ProcessReady) interface of the SDK to send process information to an Auxproxy component of the virtual machine. The Auxproxy component sends the process information of the second process to the App Gateway component. The process information is used for binding the subsequent server session and the process and connecting the client session and the process.
The foregoing description is given by taking the creation process of the second process as an example, and the creation process of the other processes may refer to the second process, which is not described herein in detail.
And when the process of the target application which needs to be scaled is determined according to the index data of the target application, determining the number of the processes to be scaled. And ending the idle state process in the processes of the target application according to the number of the processes to be scaled. For example, the number of reserved server sessions may be preset, or the number of reserved server sessions may be determined according to the number of reserved idle processes indicated by the elasticity index. And then determining the difference value between the bindable server-side session number of the current process and the reserved server-side session number, and determining the process number capable of binding the difference value server-side session as the process number to be contracted. It should be noted that, if the number of processes in the idle state in the processes of the current target application is less than or equal to the number of processes to be scaled, ending all the processes in the idle state; if the number of idle processes in the current target application process is greater than the number of processes to be scaled, the number of idle processes ended is equal to the number of processes to be scaled.
When the idle process of the target application is ended, a third idle process of the target application can be controlled to carry out cleaning operation. And after the cleaning operation is finished, setting the third process into a termination state and recovering the resources of the third process. The Auxproxy component may invoke a process termination (OnProcessTerminate) interface to control the third process to perform the cleaning operation. The third process invokes a process end (processing end) interface of the SDK after completing the cleaning operation and before ending, to send an end notification to the Auxproxy component to notify the Auxproxy component that the third process cleaning operation is ended. The Auxproxy component sets the third process to a termination state and sends an end notification of the third process to the App Gateway component. The App Gateway component reclaims the resources of the third process.
The foregoing description is given by taking the ending process of the third process as an example, and the creating process of the other processes may refer to the third process, which is not described herein in detail.
Optionally, in the embodiment of the present application, a client session acquisition request sent by a terminal platform of the target application may also be received, where the client session acquisition request is used to indicate a server session, for example, may indicate an identifier of the server session, and the identifier of the server session is carried in a session object of the server session received by the terminal platform. And then, the session objects of all client sessions bound with the server session are sent to the terminal platform of the target application. Taking the first process as an example, the first process may invoke a description client session (describe client session) interface of the SDK to send the client session acquisition request to the Auxproxy component after establishing a connection with the first client session. The Auxproxy component sends the client session acquisition request to the App Gateway component. The App Gateway component returns session objects of all client sessions bound by the server session to the first process through the Auxproxy component. The process can realize that any client session bound by the same server session obtains session objects of other client sessions. For example, when the server session represents a game, the process may enable one player to obtain an identification (e.g., a user name) of other players participating in the game.
In the embodiment of the application, a binding policy of the server session may also be determined, where the binding policy includes allowing binding of a new client session or refusing binding of a new client session. This increases the hosting flexibility of the process. For example, when the server session represents a game, the game may be set to allow a new player to join, or the game may be set to not allow a new player to join. At this time, for the creation process of the first client session described in the foregoing process 204, when the number of bound client sessions of the server session is less than the maximum number of bindable client sessions thereof, and the binding policy of the server session allows binding of a new client session, the hosting system determines that the server session can bind the client session. Determining that the server session is not bindable to the client session when the server session does not satisfy any of the following conditions: the number of bound client sessions is less than the maximum number of bindable client sessions and the binding policy is such as to allow binding of new client sessions.
It should be noted that, for the hosting process of the target application, the foregoing embodiments illustrate, by taking the first process as an example, the processes of creating a server session, ending the server session, establishing a connection with a client session, and the like, and illustrate, by taking the creation of the first client session, the ending of the second client session, and the creation and ending of the server session as examples, the relevant processes of the processes of other target applications may refer to the first process, the hosting processes of other applications may also refer to the hosting process of the target application, and the embodiments of the present application will not be repeated herein.
In summary, in the method for hosting a process provided in the embodiment of the present application, health monitoring is performed on a process of a hosted target application according to a monitoring period, whether each process of the target application is in a health state is determined, when a server session creation request of the target application is received, a first process which is in a health state and can bind to a server session is determined from the processes of the target application, and then the first process is invoked to create the server session. The process can realize the hosting of the process of the application, the health monitoring of the process and the calling of the process to create a server session according to the application package provided by the application organizer.
After the first client session of the binding server session establishes connection with the first process, the first process is called for connection verification, and if the first client session is determined to successfully establish connection with the first process, the first client session is set to be in an active state. The connection of the process and the client session can be realized according to the application package provided by the application organizer through the process.
The hosting system may also determine whether each client session that establishes a connection with the first process disconnects from the first process, place a second client session that establishes a connection with the first process in a completed state when the second client session disconnects from the first process, then unbind the second client session from the server session, and reclaim resources of the second client session. The end of the client session can be achieved through this process.
The hosting system can also monitor whether the server session is ended, and when the server session is ended, the server session is set to be in a termination state, the binding between the server session and the first process is released, and the resources of the server session are recovered. The end of the server session can be realized through the process.
And the hosting system can also perform expansion and contraction processing on the process of the target application based on the index data of the target application, so as to realize the creation and termination of the process. Therefore, the number of processes can be expanded and contracted according to the practical requirements of the application, the waste of resources is reduced, and the resource cost is reduced to a certain extent.
Therefore, the full life cycle management of the process can be realized by the hosting method of the process, which comprises the steps of process creation, state monitoring and termination; management of the server session can also be realized, including creation and termination of the server session; and implementing management of the client session, including creation, connection, and deletion of the client session. The server session management mechanism and the client session management mechanism are integrated, a stable and low-delay application deployment environment is provided, so that an application organizer does not need to construct the deployment environment or carry out operation and maintenance on the application, the deployment process of the target program is simplified, and the operation and maintenance cost of the application is reduced.
The sequence of the method provided by the embodiment of the application can be properly adjusted, and the process can be correspondingly increased or decreased according to the situation. Any person skilled in the art will readily recognize that the modified method is within the scope of the present disclosure, and the embodiments of the present disclosure should not be limited thereto.
The foregoing describes the hosting method of the process provided in the embodiments of the present application mainly from the perspective of the device. It will be appreciated that each device, in order to implement the above-described functions, includes corresponding hardware structures and/or software modules that perform the respective functions. Those of skill in the art will readily appreciate that the algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as hardware or a combination of hardware and computer software. Whether a function is implemented as hardware or computer software driven hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The embodiment of the application may divide the functional modules of each device according to the above method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated modules may be implemented in hardware or in software functional modules. It should be noted that, in the embodiment of the present application, the division of the modules is schematic, which is merely a logic function division, and other division manners may be implemented in actual implementation.
Fig. 5 is a block diagram of a hosting device of a process provided in an embodiment of the present application, where the hosting device of the process may be a management plane in the foregoing hosting system, and may also be a chip therein or other combination device, component, or other component having a hosting device function of the foregoing process. In the case of dividing each functional module by corresponding each function, the hosting device 300 of the process includes:
the monitoring module 301 is configured to perform health monitoring on the processes of the hosted target application according to a monitoring period, and determine whether each process in the processes of the target application is in a health state;
A first determining module 302, configured to determine, when a server session creation request of the target application is received, a first process from processes of the target application, where the first process is a process that is in a healthy state and is currently capable of binding a server session in the processes of the target application;
a first creating module 303, configured to invoke the first process to create a server session.
In connection with the foregoing solution, fig. 6 is a block diagram of a hosting device of another process according to an embodiment of the present application, and on the basis of fig. 5, the device 300 further includes:
the expansion and contraction module 304 is configured to perform expansion and contraction processing on a process of the target application based on index data of the target application, where the index data includes a number of server sessions that each process of the target application can bind.
In combination with the above solution, the expansion and contraction module 304 is specifically configured to: when the process needing to expand the target application is determined according to the index data of the target application, determining the number of processes to be expanded; creating the processes of the target application according to the number of the processes to be expanded; when the process of the target application is determined to be scaled according to the index data of the target application, determining the number of processes to be scaled; ending the idle state process in the target application process according to the number of the to-be-scaled processes.
In combination with the above solution, the expansion and contraction module 304 is specifically configured to: executing the executable file of the target application to control the second process to perform initialization operation; and after the initialization operation of the second process is completed, obtaining the process information of the second process and setting the second process into an active state.
In combination with the above solution, the expansion and contraction module 304 is specifically configured to: controlling a third process in an idle state in the process of the target application to carry out cleaning operation; and after the cleaning operation is finished, setting the third process to be in a termination state and recovering the resources of the third process.
In combination with the above solution, the first creating module 303 is specifically configured to: generating and transmitting a session object of the server-side session, wherein the session object of the server-side session comprises: the identification of the server side session and the maximum number of the client side sessions which can be bound, wherein the session object of the server side session is used for binding the client side session of the target application with the server side session; invoking the first process to create the server session based on the session object of the server session; the first creation module 303 is further configured to set the server session to an active state.
In connection with the foregoing solution, fig. 7 is a block diagram of a hosting device of another process according to an embodiment of the present application, and on the basis of fig. 5, the device 300 further includes:
a transceiver module 305, configured to receive a client session creation request of the target application, where the client session creation request is used to indicate the server session;
a second creating module 306, configured to create a first client session bound with the server session and set the first client session to a reserved state when the server session is in an active state and the client session can be bound;
the transceiver module 305 is further configured to send a session object of the first client session, where the session object of the first client session includes: the identification of the first client session and the process information of the first process, wherein a session object of the first client session is used for establishing connection between the first client session and the first process;
a checking module 307, configured to invoke the first process to perform connection checking, and determine whether the first client session successfully establishes a connection with the first process; and when the first client session and the first process are successfully connected, setting the first client session into an active state.
In connection with the foregoing solution, fig. 8 is a block diagram of a hosting device of another process according to an embodiment of the present application, and on the basis of fig. 5, the device 300 further includes:
a client session deletion module 308 for: determining whether each client session establishing a connection with the first process is disconnected from the first process; when a second client session which establishes connection with the first process is disconnected with the first process, setting the second client session to be in a completion state, and binding the second client session with the server session; and unbinding the second client session and the server session, and recovering the resources of the second client session.
In combination with the above solution, the transceiver module 305 is further configured to: receiving a client session acquisition request, wherein the client session acquisition request is used for indicating the server session; and sending the session objects of all client sessions bound with the server session.
In connection with the foregoing solution, fig. 9 is a block diagram of a hosting device of another process according to an embodiment of the present application, and on the basis of fig. 5, the device 300 further includes:
a second determining module 309 is configured to determine a binding policy of the server session, where the binding policy includes allowing binding of a new client session or refusing binding of a new client session.
In connection with the foregoing solution, fig. 10 is a block diagram of a hosting device of another process according to an embodiment of the present application, and on the basis of fig. 5, the device 300 further includes:
the server session deletion module 310 is configured to: determining whether the server session is ended; when the server-side session is ended, setting the server-side session to be in a termination state; and unbinding the server session and the first process, and recovering the resources of the server session.
Fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application, where the electronic device 400 may be a management plane, or a chip or a functional module in the management plane. As shown in fig. 11, the electronic device 400 includes a processor 401, a transceiver 402, and a communication line 403.
Wherein the processor 401 is configured to perform any of the method embodiments shown in fig. 3 and 4, and when performing a process such as transceiving data, the transceiver 402 and the communication line 403 may be selectively invoked to complete the corresponding operation.
Further, the electronic device 400 may also include a memory 404. The processor 401, the memory 404, and the transceiver 402 may be connected by a communication line 403.
Processor 401 is, among other things, a processor, a general purpose processor network processor (network processor, NP), a digital signal processor (digital signal processing, DSP), a microprocessor, a microcontroller, a programmable logic device (programmable logic device, PLD), or any combination thereof. The processor 401 may also be any other device having a processing function, such as a circuit, a device, or a software module, without limitation.
A transceiver 402 for communicating with other devices or other communication networks, which may be ethernet, radio access network (radio access network, RAN), wireless local area network (wireless local area networks, WLAN), etc. The transceiver 402 may be a module, circuitry, transceiver, or any device capable of enabling communications.
The transceiver 402 is mainly used for receiving and transmitting data, and may include a transmitter and a receiver for respectively transmitting and receiving signals; operations other than signaling are performed by the processor, such as creating a server session, unbinding a client session from a server session, and so on.
Communication lines 403 for conveying information between components included in electronic device 400.
In one design, the processor may be considered logic circuitry and the transceiver may be considered interface circuitry.
Memory 404 for storing instructions. Wherein the instructions may be computer programs.
The memory 404 may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM). The memory 404 may also be a compact disk (compact disc read-only memory) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media, or other magnetic storage device, etc. It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
It is noted that the memory 404 may exist separately from the processor 401 or may be integrated with the processor 401. Memory 404 may be used to store instructions or program code or some data, etc. The memory 404 may be located within the electronic device 400 or may be located outside the electronic device 400 without limitation. The processor 401 is configured to execute the instructions stored in the memory 604, so as to implement the method provided in the foregoing embodiment of the present application.
In one example, processor 401 may include one or more processors, such as processor 0 and processor 1 in fig. 11.
As an alternative implementation, electronic device 400 includes multiple processors, e.g., processor 407 may be included in addition to processor 401 in fig. 11.
As an alternative implementation, electronic device 400 also includes an output device 405 and an input device 406. Illustratively, the input device 406 is a keyboard, mouse, microphone, or joystick device, and the output device 405 is a display screen, speaker (spaker), or the like.
It should be noted that the electronic device 400 may be a chip system or a device having a similar structure as in fig. 11. The chip system may be composed of a chip or may include a chip and other discrete devices. Acts, terms and the like referred to between embodiments of the present application may be referenced to each other without limitation. In the embodiment of the present application, the name of the message or the name of the parameter in the message, etc. interacted between the devices are only an example, and other names may also be adopted in the specific implementation, and are not limited. Further, the constituent structure shown in fig. 11 does not constitute a limitation of the electronic device 400, and the electronic device 400 may include more or less components than those shown in fig. 11, or may combine some components, or may be a different arrangement of components, in addition to those shown in fig. 11.
The processors and transceivers described herein may be implemented on integrated circuits (integrated circuit, ICs), analog ICs, radio frequency ICs, mixed signal ICs, application specific integrated circuits (application specific integrated circuit, ASIC), printed circuit boards (printed circuit board, PCB), electronic devices, and the like. The processor and transceiver may also be fabricated using a variety of IC process technologies such as complementary metal oxide semiconductor (complementary metal oxide semiconductor, CMOS), N-type metal oxide semiconductor (NMOS), P-type metal oxide semiconductor (positive channel metal oxide semiconductor, PMOS), bipolar junction transistor (Bipolar Junction Transistor, BJT), bipolar CMOS (BiCMOS), silicon germanium (SiGe), gallium arsenide (GaAs), etc.
Fig. 12 is a schematic structural diagram of a hosting device for a process according to an embodiment of the present application. The hosting device of the process can be applied to the scene shown in the embodiment of the method. For ease of illustration, fig. 12 shows only the major components of the managed device of the process, including the processor, memory, control circuitry, and input-output devices. The processor is mainly used for processing the communication protocol and the communication data, executing the software program and processing the data of the software program. The memory is mainly used for storing software programs and data. The control circuit is mainly used for supplying power and transmitting various electric signals. The input/output device is mainly used for receiving data input by a user and outputting the data to the user.
When the hosting device of the process is a management plane, the control circuit can be a main board, the memory comprises a hard disk, a RAM, a ROM and other media with storage functions, the processor can comprise a baseband processor and a central processing unit, the baseband processor is mainly used for processing communication protocols and communication data, the central processing unit is mainly used for controlling the hosting device of the whole process, executing software programs and processing the data of the software programs, and the input and output devices comprise a display screen, a keyboard, a mouse and the like; the control circuit may further include or be connected to a transceiver circuit or transceiver, for example: network interfaces, etc., for transmitting or receiving data or signals, such as data transmissions and communications with other devices. Further, the wireless communication device can also comprise an antenna for receiving and transmitting wireless signals and transmitting data/signals with other devices.
According to the method provided by the embodiment of the application, the application further provides a computer program product, which comprises computer program code, which when run on a computer causes the computer to perform the method according to any of the embodiments of the application.
Embodiments of the present application also provide a computer-readable storage medium. All or part of the above-described method embodiments may be implemented by a computer or an apparatus having information processing capabilities to control the implementation of relevant hardware, and the computer program or the set of instructions may be stored in the above-described computer-readable storage medium, and the computer program or the set of instructions may include the above-described method embodiments when executed. The computer readable storage medium may be an internal storage unit of the management plane of any of the foregoing embodiments, such as a hard disk or a memory of the management plane. The computer readable storage medium may be an external storage device of the management plane, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card), or the like, which are provided on the management plane. Further, the computer readable storage medium may further include both an internal storage unit and an external storage device of the management plane. The computer-readable storage medium is used to store the computer program or instructions and other programs and data required by the management plane. The above-described computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (personal computer, server, network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (12)

1. A method of hosting a process, the method comprising:
health monitoring is carried out on the processes of the managed target application according to the monitoring period, and whether each process in the processes of the target application is in a health state or not is determined;
when a server-side session creation request of the target application is received, determining a first process from processes of the target application, wherein the first process is a process which is in a healthy state and can be currently bound with a server-side session in the processes of the target application;
and calling the first process to create a server session.
2. The method according to claim 1, wherein the method further comprises:
and performing expansion and contraction processing on the process of the target application based on index data of the target application, wherein the index data comprises the number of server-side sessions which can be bound by each process in the process of the target application.
3. The method according to claim 2, wherein the performing the scaling process on the process of the target application based on the index data of the target application includes:
when the process needing to expand the target application is determined according to the index data of the target application, determining the number of processes to be expanded;
creating the processes of the target application according to the number of the processes to be expanded;
when the process of the target application is determined to be scaled according to the index data of the target application, determining the number of processes to be scaled;
ending the idle state process in the target application process according to the number of the to-be-scaled processes.
4. A method according to claim 3, wherein said creating the process of the target application according to the number of processes to be expanded comprises:
executing the executable file of the target application to control the second process to perform initialization operation;
and after the initialization operation of the second process is completed, obtaining the process information of the second process and setting the second process into an active state.
5. The method according to claim 3 or 4, wherein the ending the idle process of the processes of the target application according to the number of to-be-scaled processes includes:
Controlling a third process in an idle state in the process of the target application to carry out cleaning operation;
and after the cleaning operation is finished, setting the third process to be in a termination state and recovering the resources of the third process.
6. The method of any of claims 1 to 5, wherein the invoking the first process to create a server session comprises:
generating and transmitting a session object of the server-side session, wherein the session object of the server-side session comprises: the identification of the server side session and the maximum number of the client side sessions which can be bound, wherein the session object of the server side session is used for binding the client side session of the target application with the server side session;
invoking the first process to create the server session based on the session object of the server session;
the method further comprises the steps of:
and setting the server session to be in an active state.
7. The method according to any one of claims 1 to 6, further comprising:
receiving a client session creation request of the target application, wherein the client session creation request is used for indicating the server session;
When the server side session is in an active state and a client side session can be bound, a first client side session bound with the server side session is created and set to a reserved state;
transmitting a session object of the first client session, wherein the session object of the first client session comprises: the identification of the first client session and the process information of the first process, wherein a session object of the first client session is used for establishing connection between the first client session and the first process;
invoking the first process to carry out connection verification, and determining whether the first client session successfully establishes connection with the first process;
and when the first client session and the first process are successfully connected, setting the first client session into an active state.
8. The method according to any one of claims 1 to 7, further comprising:
determining whether each client session establishing a connection with the first process is disconnected from the first process;
when a second client session which establishes connection with the first process is disconnected with the first process, setting the second client session to be in a completion state, and binding the second client session with the server session;
And unbinding the second client session and the server session, and recovering the resources of the second client session.
9. The method according to any one of claims 1 to 8, further comprising:
receiving a client session acquisition request, wherein the client session acquisition request is used for indicating the server session;
and sending the session objects of all client sessions bound with the server session.
10. The method according to any one of claims 1 to 9, further comprising:
and determining a binding policy of the server-side session, wherein the binding policy comprises allowing binding of a new client session or refusing binding of the new client session.
11. The method according to any one of claims 1 to 10, further comprising:
determining whether the server session is ended;
when the server-side session is ended, setting the server-side session to be in a termination state;
and unbinding the server session and the first process, and recovering the resources of the server session.
12. A hosting apparatus for a process, the apparatus comprising:
One or more processors;
a memory for storing one or more computer programs or instructions;
when executed by the one or more processors, causes the one or more processors to implement the method of any one of claims 1 to 11.
CN202211053067.2A 2022-08-31 2022-08-31 Process hosting method and device Pending CN117667333A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211053067.2A CN117667333A (en) 2022-08-31 2022-08-31 Process hosting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211053067.2A CN117667333A (en) 2022-08-31 2022-08-31 Process hosting method and device

Publications (1)

Publication Number Publication Date
CN117667333A true CN117667333A (en) 2024-03-08

Family

ID=90064840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211053067.2A Pending CN117667333A (en) 2022-08-31 2022-08-31 Process hosting method and device

Country Status (1)

Country Link
CN (1) CN117667333A (en)

Similar Documents

Publication Publication Date Title
CN109560952B (en) Network slice management method and equipment
US11108653B2 (en) Network service management method, related apparatus, and system
US20200326989A1 (en) Building pool-based m2m service layer through nfv
CN111163130B (en) Network service system and data transmission method thereof
CN102710534A (en) Cross-application network communication method and device
EP4029580A1 (en) Account access method and apparatus, storage medium, and electronic device
CN107181695A (en) Distributed caching method and device
CN110582998A (en) Group communication method and device, computer storage medium and computer equipment
CN112437153A (en) Equipment linkage processing method and device
CN111130820B (en) Cluster management method and device and computer system
EP3503484A1 (en) Message transmission method, device and network system
CN117667333A (en) Process hosting method and device
CN110753093A (en) Method and device for managing equipment in cloud computing system
CN113515392B (en) RPC calling method, device, equipment and storage medium
CN106230980A (en) A kind of address configuration method, Apparatus and system
Chang et al. Fog computing as a resource-aware enhancement for vicinal mobile mesh social networking
CN112584337A (en) Charging method and device for network slices
CN114363294B (en) Management method, device and system of tenant server
CN113395718B (en) Network performance optimization method and system under condition that main/standby convergence layer equipment transmits back network scene
CN114884911B (en) Network data transmission method, system and storage medium based on NFV
CN114500302B (en) ICE service arrangement method, ICE service arrangement device, terminal equipment and storage medium
CN113132188B (en) Communication method and network equipment
CN115525615A (en) Log collection method, client, terminal, server and storage medium
CN115733743A (en) Network service deployment method, NFVO (network function virtualization) and NFV (network function virtualization) system
CN115129487A (en) Event communication method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication