Disclosure of Invention
In view of this, embodiments of the present invention provide a server management method, an apparatus, an electronic device, and a computer storage medium, so as to solve the problems that, in the prior art, a plurality of clients are likely to access the same algorithm server resource at the same time, and a digital human algorithm server cannot be connected quickly.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
a first aspect of an embodiment of the present invention shows a server management method, where the method includes:
acquiring a connection application request sent by a client, wherein the connection application request at least comprises a server type;
determining a target digital human algorithm server according to the connection application request;
determining and storing a target resource based on any path of idle resources in the target digital human algorithm server, wherein the target resource refers to any path of idle resources marked by deduction in advance;
sending a connection instruction to the client, wherein the connection instruction is used for prompting the client to connect a target digital human algorithm server within a first preset time;
and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource.
Optionally, the method further includes:
and releasing the stored target resource when the client is determined not to be connected with the target digital human algorithm server within the first preset time.
Optionally, after determining that the client connects to the target digital human algorithm server within the first preset time, the method further includes:
and modifying the pre-deduction mark of the target resource into a deduction mark.
Optionally, the determining a target digital human algorithm server according to the connection application request includes:
inquiring whether a digital human algorithm server which is the same as the server in type and is in an idle state exists in the server list;
and if the server exists, setting the digital human algorithm server which is in the same type as the server in the server list and is in an idle state as a target digital human algorithm server.
Optionally, the determining and storing a target resource based on any one path of idle resources in the target digital human algorithm server includes:
pre-deducting and marking any idle resource in the target digital human algorithm server;
and setting the resources with the pre-deduction marks removed as target resources and storing the target resources.
Optionally, the method further includes: and when the time for connecting the client and the target digital human algorithm server exceeds second preset time, disconnecting the client and the target digital human algorithm server.
A second aspect of the embodiments of the present invention shows a server management apparatus, including:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a connection application request sent by a client, and the connection application request at least comprises a server type;
the processing unit is used for determining a target digital human algorithm server according to the connection application request;
the storage unit is used for determining and storing a target resource based on any path of idle resource in the target digital human algorithm server, wherein the target resource refers to any path of idle resource for pre-deducting marks;
the system comprises a sending unit, a receiving unit and a processing unit, wherein the sending unit is used for sending a connection instruction to the client, and the connection instruction is used for prompting the client to connect a target digital human algorithm server within first preset time;
and the service unit is used for providing the digital man service for the client through the target resource when the client is determined to be connected with the target digital man algorithm server within the first preset time.
Optionally, the method further includes:
and the resource release unit is used for releasing the stored target resource when the client is determined not to be connected with the target digital human algorithm server within a first preset time.
A third aspect of the embodiments of the present invention shows an electronic device, where the electronic device is configured to run a program, where the program executes the server management method shown in the first aspect of the embodiments of the present invention when running.
A fourth aspect of the embodiments of the present invention shows a computer storage medium, where the storage medium includes a storage program, and when the program runs, a device in which the storage medium is located is controlled to execute the server management method shown in the first aspect of the embodiments of the present invention.
Based on the server management method, the device, the electronic equipment and the computer storage medium provided by the embodiment of the invention, the method comprises the steps of obtaining a connection application request sent by a client, wherein the connection application request at least comprises a server type; determining a target digital human algorithm server according to the connection application request; determining a target resource based on any path of free resources in the target digital human algorithm server, and storing the target resource in a server list, wherein the target resource refers to any path of free resources marked by pre-deduction; sending a connection instruction to the client, wherein the connection instruction is used for prompting the client to connect a target digital human algorithm server within a first preset time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource. In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Referring to fig. 1, a schematic diagram of an application architecture of a management system of multiple clients and servers is shown, according to an embodiment of the present invention, where the system includes: a gateway 10, a central control module 20, a schedule management schedule module 30 and a server management module 40.
The plurality of clients 50 includes a client 51 and a client 52.
Wherein, N quantity is a plurality.
In a specific implementation, the client 50 is connected to the central control module 20 through a gateway, and the central control module 20 is connected to the schedule management schedule module 30 and the server management module 40, respectively.
The list of servers in the calendar management schedule module 30 is used for updating and stores all digital human algorithm servers in an idle state.
The processing procedure for server management based on the architecture comprises the following steps:
the central control module 20 obtains a connection application request sent by the client 50 through the gateway 10, wherein the connection application request at least comprises a server type; according to the connection application request, acquiring available and idle digital human algorithm servers from the schedule management schedule module 30, and further determining a target digital human algorithm server; determining a target resource based on any one path of idle resources in the target digital human algorithm server, and storing the target resource into a storage system redis of a server management module 40; and sending a connection instruction to the client, wherein the connection instruction is used for prompting the client to connect the target digital human algorithm server within a first preset time.
When it is determined that the client 50 is connected to the target digital human algorithm server within the first preset time, the central control module 20 provides a digital human service for the client 50 through a target resource in a storage system redis of the server management module 40, that is, provides a digital human video stream for a digital human front end, that is, a client.
It should be noted that the target resource refers to any one of the idle resources for performing the pre-deduction marking.
In the present invention, the number of the digital human algorithm servers is plural, and a plurality of the digital human algorithm servers are integrated to be controlled by the central control module 20.
Wherein, each digital human algorithm server has a plurality of resources.
It can be understood that when any one path of resource in the digital human algorithm server is still idle, the digital human algorithm server is in an idle state.
In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Based on the application architecture disclosed in the embodiment of the present invention, referring to fig. 2, a flowchart of a server management method disclosed in the embodiment of the present invention is shown, where the method includes:
step S201: and acquiring a connection application request sent by the client.
In step S201, the connection application request at least includes a server type.
Optionally, the client sends a connection application request to the central control module through the gateway.
In the process of implementing step S201 specifically, the central control module receives the server type carrying the digital human algorithm server to which the client wants to connect through the gateway.
It should be noted that there are many types of servers, that is, there are many types of servers, such as an audio digital human algorithm server, a video digital human algorithm server, and the like.
Step S202: and determining a target digital human algorithm server according to the connection application request.
It should be noted that the process of implementing step S202 includes the following steps:
step S11: and inquiring whether the server list has a digital human algorithm server which has the same type as the server and is in an idle state, if so, executing the step S12, and if not, returning the information of no idle server to the client through the gateway.
In the process of implementing the step S11, traversing the server list in the schedule module, determining whether there is a digital human algorithm server in an idle state and the type of the server is the same, if so, executing the step S12, and if not, returning information of no idle server to the client through the gateway.
Step S12: and setting the digital human algorithm server which is in the same type as the server and is in an idle state in the server list as a target digital human algorithm server.
In the process of implementing step S12, the central control module calls the schedule management schedule module to query the idle digital human algorithm server corresponding to the server type, so as to obtain an available digital human algorithm server IP, and sets it as the target digital human algorithm server.
Step S203: and determining a target resource based on any path of free resources in the target digital human algorithm server, and storing the target resource to a server list.
In step S203, the target resource refers to any free resource for performing the pre-deduction marking.
It should be noted that the process of implementing step S203 specifically includes the following steps:
step S21: and pre-deducting and marking any idle resource in the target digital human algorithm server.
In the embodiment of the invention, the target digital human algorithm server may only have one path of idle resources, and may also have multiple paths of idle resource data. If the target digital human algorithm server is determined to have multiple paths of idle resources, setting a resource mark of any path as a pre-deduction mark, and updating a server list; optionally, if it is determined that only one path of free resources exists in the target digital human algorithm server, setting the mark of the path of resources as a pre-deduction mark, and updating the server list.
Step S22: and setting the resources with the pre-deduction marks removed as target resources and storing the target resources.
In the process of implementing step S22 specifically, the resource after deducting the mark in advance is set as a target resource, and the target resource is updated to the redis cache of the storage system.
It should be noted that, in the process of updating to the redis cache of the storage system, a technician may set a connection expiration time, i.e., a first preset time.
Step S204: and sending a connection instruction to the client.
In step S204, the connection instruction is used to prompt the client to connect to the target digital human algorithm server within a first preset time.
In the process of implementing step S204 specifically, after determining the target resource providing service for the client, the central control module sends a connection instruction to the client, so that the client reminds the client of being connected based on the client within the first preset time.
Step S205: detecting whether a client is connected with the target digital human algorithm server within a first preset time, executing a step S206 when the client is determined to be connected with the target digital human algorithm server within the first preset time, and executing a step S207 when the client is determined not to be connected with the target digital human algorithm server within the first preset time.
In the process of implementing step S205 specifically, the central control module detects in real time whether the client is connected to the target digital human algorithm server, if it is determined that the client is connected to the target digital human algorithm server within the first preset time, step S206 is executed, and if it is determined that the client is not connected to the target digital human algorithm server within the first preset time, step S207 is executed.
Step S206: and providing digital human services for the client through the target resources.
In the process of implementing step S206 specifically, the client may perform digital human algorithm server access, so that the digital human algorithm server replies the digital human audio/video stream to the client to provide the digital human service.
Step S207: and releasing the stored target resource.
In the process of implementing step S207 specifically, the stored target resource is released to update the server list.
In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource. And releasing the stored target resource when the client is determined not to be connected with the target digital human algorithm server within the first preset time. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Based on the server management method shown in the above embodiment of the present invention, with reference to fig. 2 and fig. 3, after determining that the client connects to the target digital human algorithm server within a preset time, the method further includes:
step S208: and modifying the pre-deduction mark of the target resource into a deduction mark.
In the process of implementing step S208 specifically, the deduction mark is modified to be a deduction mark, and meanwhile, the resources cached on the redis of the storage system are deleted, and the server list is updated.
In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, modifying the pre-deduction mark of the target resource into a deduction mark, and updating the server list so as to provide digital human service for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
The server management method based on the embodiment of the invention further comprises the following steps:
step S31: judging whether the time for connecting the client with the target digital human algorithm server exceeds a second preset time, executing the step S32 when the time for connecting the client with the target digital human algorithm server exceeds the second preset time, and returning to continue executing the step S205 when the time for connecting the client with the target digital human algorithm server does not exceed the second preset time.
In the process of implementing step S31, detecting the connection time between the client and the target digital human algorithm server in real time, executing step S32 when the connection time between the client and the target digital human algorithm server exceeds a second preset time, and returning to continue executing step S205 when the connection time between the client and the target digital human algorithm server does not exceed the second preset time.
It should be noted that the second preset time is set in advance empirically, and the embodiment of the present invention is not limited thereto.
Step S32: and disconnecting the client from the target digital human algorithm server.
In the process of implementing step S32 specifically, it is determined that the connection time between the client and the target digital human algorithm server is too long, and at this time, the connection between the client and the target digital human algorithm server is disconnected.
In the embodiment of the invention, the connection time of the client and the target digital human algorithm server is detected in real time, when the connection time of the client and the target digital human algorithm server exceeds a second preset time, the connection of the client and the target digital human algorithm server is disconnected, and when the connection time of the client and the target digital human algorithm server does not exceed the second preset time, the digital human service is continuously provided for the client through the target resource.
Corresponding to the server management method described in the above embodiment of the present invention, an embodiment of the present invention shows a server management apparatus, and as shown in fig. 4, the server management apparatus is a schematic structural diagram of the server management apparatus shown in the embodiment of the present invention, and the apparatus includes:
an obtaining unit 401, configured to obtain a connection application request sent by a client, where the connection application request at least includes a server type.
A processing unit 402, configured to determine a target digital human algorithm server according to the connection application request.
A storage unit 403, configured to determine a target resource based on any one path of idle resources in the target digital human algorithm server, and store the target resource, where the target resource refers to any one path of idle resources for performing pre-deduction marking.
A sending unit 404, configured to send a connection instruction to the client, where the connection instruction is used to prompt the client to connect to the target digital human algorithm server within a first preset time.
A service unit 405, configured to provide a digital people service for the client through the target resource when it is determined that the client is connected to the target digital people algorithm server within a first preset time.
It should be noted that, the specific principle and the implementation process of each unit in the server management device disclosed in the above embodiment of the present invention are the same as the server management method shown in the above embodiment of the present invention, and reference may be made to corresponding parts in the server management method disclosed in the above embodiment of the present invention, which are not described herein again.
In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, providing digital human service for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Based on the server management device shown in the above embodiment of the present invention, referring to fig. 5 in conjunction with fig. 4, the server management device is further provided with a resource releasing unit 406.
A resource releasing unit 406, configured to release the stored target resource when it is determined that the client is not connected to the target digital human algorithm server within a first preset time.
In the embodiment of the invention, when the client is determined not to be connected with the target digital human algorithm server within the first preset time, the stored target resource is released. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Optionally, based on the server management apparatus shown in the foregoing embodiment of the present invention, referring to fig. 6 in combination with fig. 5, the server management apparatus is further provided with a modification unit 407.
The modifying unit is used for modifying the pre-deduction mark of the target resource into a deduction mark.
In the embodiment of the invention, a target digital human algorithm server for service is determined through a connection application request, and a target resource is determined from any path of idle resources in the target digital human algorithm server, so that other clients can not use the resource by pre-deducting the resource, thereby preventing a plurality of clients from accessing the same resource at the same time; and when the client is determined to be connected with the target digital human algorithm server within the first preset time, modifying the pre-deduction mark of the target resource into a deduction mark, and updating the server list so as to provide digital human service for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
Optionally, based on the server management apparatus shown in the above embodiment of the present invention, referring to fig. 7 in combination with fig. 6, the server management apparatus is further provided with a disconnection unit 408.
A disconnecting unit 408, configured to disconnect the client from the target digital human algorithm server when a time for connecting the client with the target digital human algorithm server exceeds a second preset time.
In the embodiment of the invention, the connection time of the client and the target digital human algorithm server is detected in real time, when the connection time of the client and the target digital human algorithm server exceeds a second preset time, the connection of the client and the target digital human algorithm server is disconnected, and when the connection time of the client and the target digital human algorithm server does not exceed the second preset time, the digital human service is continuously provided for the client through the target resource.
Optionally, based on the server management apparatus shown in the foregoing embodiment of the present invention, the processing unit 402 is specifically configured to: inquiring whether a digital human algorithm server which is the same as the server in type and is in an idle state exists in the server list; and if the server exists, setting the digital human algorithm server which is in the same type as the server in the server list and is in an idle state as a target digital human algorithm server.
The storage unit 403 is specifically configured to: pre-deducting and marking any idle resource in the target digital human algorithm server; and setting the resources with the pre-deduction marks removed as target resources and storing the target resources.
In the embodiment of the invention, whether a digital human algorithm server which is the same as the server in type and is in an idle state exists in the server list is inquired; and taking the digital human algorithm server which is in the same type as the server and is in an idle state in the server list as a target digital human algorithm server. Then, pre-deducting and marking any path of idle resources in the target digital human algorithm server; and setting the resources with the pre-deduction marks removed as target resources and storing the target resources. And when the client is determined to be connected with the target digital human algorithm server within the first preset time, the digital human service is provided for the client through the target resource. By the method, the phenomenon that a plurality of clients access the same resource at the same time is prevented, and the digital human algorithm server can be connected quickly.
The embodiment of the invention also discloses an electronic device, which is used for operating the database storage process, wherein the server management method disclosed in the figure 2 is executed when the database storage process is operated.
The embodiment of the invention also discloses a computer storage medium, which comprises a storage database storage process, wherein when the storage database storage process runs, the equipment where the storage medium is located is controlled to execute the server management method disclosed in the figure 2.
In the context of this disclosure, a computer storage medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed 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 modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.