Task processing method, server, computing device, storage medium and program product
By introducing a hierarchical architecture of logical nodes and task nodes in distributed servers, the problem of idle physical machine resources caused by the reduction of virtual server users is solved, and more efficient resource utilization and resource waste are achieved.
Patent Information
- Application Number
- CN202411568929.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-14
AI Technical Summary
In a distributed server, when the number of virtual server users decreases, the physical machine processing resources are easily idle, resulting in waste of resources.
By dividing task processing into two parts: logical nodes and task nodes, the logical nodes are responsible for calling exclusive resources of the client, and the task nodes are responsible for calling common resources, thereby processing task requests between two types of nodes, reducing the execution pressure of a single node.
It effectively improves the resource usage efficiency of the physical machine, reduces the hardware occupation of resource calls, avoids the idle waste of physical machine resources, and allows multiple virtual servers to be merged to execute on one physical machine.
Smart Images

Figure CN119440769A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more particularly to a task processing method. The present application also relates to a server, a computing device, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the rapid development of the Internet, the amount of data has exploded, and traditional single-point servers can no longer meet the needs of large-scale applications. At this time, distributed servers came into being and gradually became the mainstream choice of today's Internet architecture. Distributed servers are a collection of multiple computers based on a network, which work together to complete common tasks. These computers are distributed in the network and communicate with each other through the network to form a whole, and work together to complete large-scale, high-concurrency data processing and business processing.
[0003] In order to cope with a large number of users, a distributed server usually has multiple virtual servers. The game tasks of each virtual server are usually processed on a corresponding physical machine, that is, each virtual server is assigned to a separate physical machine for operation. However, when the number of users of multiple virtual servers decreases, the processing resources of each physical machine will inevitably become idle. Summary of the invention
[0004] In view of this, the embodiment of the present application provides a task processing method to solve the technical defects existing in the prior art. The embodiment of the present application also provides a task processing method, a server, a computing device, a computer-readable storage medium, and a computer program product.
[0005] According to a first aspect of an embodiment of the present application, a task processing method is provided, which is applied to a logical node of a server, wherein the server includes at least one logical node and at least one task node, each logical node correspondingly records exclusive resources of each client in at least one virtual server, and each task node correspondingly records shared resources required for interaction between clients in at least one virtual server; the task processing method includes: In response to a task request sent by a target client, calling an exclusive resource of the target client; A target virtual server corresponding to the target client is determined, and a task request is sent to a target task node corresponding to the target virtual server, so that the target task node calls the recorded shared resource in response to the task request.
[0006] According to a second aspect of an embodiment of the present application, a task processing method is provided, which is applied to a task node of a server, wherein the server includes at least one logical node and at least one task node, each logical node correspondingly records exclusive resources of each client in at least one virtual server, and each task node correspondingly records shared resources required for interaction between clients in at least one virtual server; the task processing method includes: receiving a task request sent by a logical node, wherein the task request is a task request sent by a target client in response to the logical node, determining a target virtual server corresponding to the target client, and calling an exclusive resource of the target client before sending the task request; In response to the task request, the recorded shared resource is called.
[0007] According to a third aspect of an embodiment of the present application, a task processing method is provided, which is applied to a server, wherein the server includes at least one logical node and at least one task node, each logical node correspondingly records exclusive resources of each client in at least one virtual server, and each task node correspondingly records shared resources required for interaction between clients in at least one virtual server; the task processing method includes: The logical node responds to the task request sent by the target client and calls the exclusive resource of the target client; The logic node determines the target virtual server corresponding to the target client, and sends the task request to the target task node corresponding to the target virtual server; The target task node calls the recorded shared resources in response to the task request.
[0008] According to a fourth aspect of an embodiment of the present application, a server is provided, the server comprising at least one logical node and at least one task node, each logical node correspondingly recording exclusive resources of a client of at least one virtual server, and each task node correspondingly recording shared resources required for interaction between clients of at least one virtual server; The logical node is used to respond to the task request sent by the target client, call the exclusive resources of the target client; determine the target virtual server corresponding to the target client, and send the task request to the target task node corresponding to the target virtual server; The target task node is used to call the recorded shared resources in response to the task request.
[0009] According to a fifth aspect of an embodiment of the present application, there is provided a computing device, including: a memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the task processing method applied to the logical node or task node is implemented.
[0010] According to a sixth aspect of an embodiment of the present application, a computer-readable storage medium is provided, which stores a computer program / instruction. When the computer program / instruction is executed by a processor, the task processing method applied to a logical node or a task node is implemented.
[0011] According to a seventh aspect of an embodiment of the present application, a computer program product is provided, including a computer program / instruction, which implements the above-mentioned task processing method applied to a logical node or a task node when the computer program / instruction is executed by a processor.
[0012] The present application provides a task processing method based on the server, which receives the task request initiated by the target client through the logical node, calls the exclusive resource to execute the corresponding exclusive task, determines the target virtual server corresponding to the target client, sends the task request to the target task node corresponding to the target virtual server, and the target task node responds to the task request and calls the shared resource to execute the corresponding interactive task. The task request of the target client is processed in two types of nodes to reduce the execution pressure of a single node, and the task node calls the shared resource when processing multiple task requests, which reduces the hardware occupation of resource calls and improves the efficiency of physical machine use, so that multiple game servers that were originally executed on multiple physical machines can be merged and executed on one physical machine, reducing the idle waste of physical machine resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 It is a structural diagram of a server architecture; Figure 2 It is a structural diagram of a server architecture provided by an embodiment of the present application; Figure 3 is a flowchart of a task processing method applied to a logical node provided by an embodiment of the present application; Figure 4 is a flowchart of a task processing method applied to a task node provided by an embodiment of the present application; Figure 5 This is a flowchart of a task processing method applied to a server provided by an embodiment of the present application; Figure 6 It is a processing flow chart of a task processing method applied to a game server task processing scenario provided by an embodiment of the present application; Figure 7 This is a schematic diagram of the structure of a server provided by an embodiment of the present application; Figure 8 It is a structural diagram of a task processing device applied to a logical node provided by an embodiment of the present application; Fig. 9 It is a structural diagram of a task processing device applied to a task node provided by an embodiment of the present application; Fig.10 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0014] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0015] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0016] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0017] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0018] In the current distributed service system, multiple clients often log in to a virtual server. A virtual server corresponds to a physical machine, and the physical machine processes the task requests of all players in the corresponding virtual server. Figure 1 As shown, Figure 1 It is a structural diagram of a server architecture. Figure 1Among them, Client 1 1, Client 1 2, and Client 1 X are clients logged in on Virtual Server 1, and Client 2 1, Client 2 2, and Client 2 Y are clients logged in on Virtual Server 2. When there is cross-server communication, Virtual Server 1 and Virtual Server 2 can communicate through Cross-Server 1. Under this architecture, when the project loses users due to operational reasons, the emergence of new projects, etc., the number of players logged in on the virtual server decreases, and the physical machine designed to handle user requests when the virtual server is full will be idle and wasted. However, due to the corresponding relationship between virtual servers and physical machines, virtual servers on other physical machines cannot be moved to vacant physical machines for operation.
[0019] In order to address the above problems, this application provides Figure 2 The task processing method shown in the structural diagram of a server architecture is Figure 1 In the server architecture shown, the virtual server is divided into two parts: the logical node and the task node. The logical node is used to respond to the client task request and call the client exclusive resources to process the task; determine the virtual server corresponding to the client, and send the task request to the task node. The task node is used to receive the task request sent by the logical node and call the shared resources on the task node to process the task request. Through such an architectural design, the task request processing originally performed by a single virtual server is split and executed on two types of nodes. The logical node performs the processing of exclusive resources, and the task node performs the processing of shared resources, so that tasks of multiple virtual servers calling shared resources can be executed on one task node, saving the memory resources occupied by the physical machine calling resources, effectively improving the resource calling efficiency of the physical machine, and allowing multiple virtual machines in a non-fully loaded state to share a physical machine for processing, effectively saving the physical machine resources under the server architecture.
[0020] The present application provides a task processing method, a task processing device, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0021] Figure 3 A flowchart of a task processing method applied to a logical node according to an embodiment of the present application is given. The method specifically includes the following steps: Step 302: In response to the task request sent by the target client, the exclusive resource of the target client is called.
[0022] In the process of executing task processing in the virtual service architecture, the target client sends the client task request to the logical node for processing. The target client refers to any client logged in on the logical node of the virtual service architecture provided in this application, which can communicate with the logical node through the network or other means, and send the client's task request to the logical node.
[0023] The logical node can respond to the task request sent by the target client, call the exclusive resources of the target client, and process the subtask that calls the exclusive resources of the target client in the task request. Specifically, the logical node can analyze the resource call in the task request, and call the exclusive resources of the target client for processing the subtask that calls the exclusive resources of the target client contained in the task request, wherein the subtask that calls the exclusive resources of the target client for processing is a subtask that the logical node can process by calling the exclusive resources, and the exclusive resources refer to all data and resources required to process the subtask. The exclusive resources are allocated to the logical node when the client is connected to the corresponding logical node, and can be stored on the client, or on the physical machine corresponding to the logical node that processes the subtask, or on other storage units with storage capacity, which are not limited here. Resource call refers to the resources that need to be called to process the corresponding task request.
[0024] In this embodiment, by accepting the task request of the client at the logical node and calling the target client's exclusive resource processing task to call the exclusive resource, a part of the task processing of the virtual server is separated to the logical node for execution, thereby improving the task processing efficiency. Among them, since the logical node is responsible for processing tasks such as task distribution and resource calling of exclusive resource subtasks, and does not bear client requests, the logical node is stateless and can be expanded or deleted at will as needed, or placed on other physical machines for execution. Therefore, the tasks carried by the logical node can be separated from the tasks carried by the task node before the virtual service starts running, and they can be executed separately, effectively avoiding the reduction of the physical machine's carrying capacity caused by such tasks occupying the resources of a single physical machine.
[0025] It should be noted that after a client logs in to a logical node, all requests until the client logs out are executed by the logical node. At this time, the logical node is stateful, but when the client logs out, the previous information will be released. At this time, the logical node is stateless, and when the client logs in again, it can be assigned to any logical node, not limited to the logical node logged in before.
[0026] In addition, when the virtual server is turned on, it is necessary to first allocate the virtual server to be turned on on the corresponding physical machine according to the hardware resources. Therefore, in response to the task request sent by the target client, the target virtual server corresponding to the target client is determined, and the exclusive resources of the target client are called. Before that, the task processing method of the present application also includes: In response to a request for opening a virtual server to be opened, obtaining resource occupancy information of each task node; According to the resource occupancy information of each task node, determine the host task node corresponding to the virtual server to be opened from each task node; Create task information for the virtual server to be opened on the task-bearing node.
[0027] Specifically, the logical node can respond to the service opening request of the virtual service to be opened, and obtain the resource occupancy information of each task node, and determine the corresponding host task node of the virtual service to be opened from the task node according to the resource occupancy information of the task node, and create the task information of the virtual service to be opened on the host task node, wherein the task information refers to the thread in the task node that executes the task of calling shared resources of each virtual service, and the task information is used to process the task request corresponding to the virtual service, and the resource occupancy information of the task node refers to the occupancy of the task information in the task node. When the task information load in the task node reaches the carrying capacity of the task node, no new task information is created for the task node. Through the above method, the present application can select the host task node of the virtual service to be opened in the task node according to the resource occupancy information of each task node, and ensure that the processing capacity of the task node matches the virtual service carried on the task node.
[0028] Furthermore, according to the resource occupation information of each task node, the step of determining the bearer task node corresponding to the virtual server to be opened from each task node can be specifically implemented by the following steps: According to the resource occupation information of each task node and the resource information of the virtual server to be opened, a task bearing node having shared resources with the virtual server to be opened is determined from among the task nodes.
[0029] That is, the logical node can obtain the resource occupancy information of each task node and the resource information of the server to be started, determine the task node whose resource occupancy information is consistent with the resource information of the server to be started, and use the task node as the hosting task node of the virtual server to be started, and use the corresponding resource occupancy information as the common resource of the virtual server hosted on the task node. In other words, in the task processing method provided in the present application, there may be one or more virtual servers that call the same common resources on the same task node. The above-mentioned virtual server hosting method enables multiple virtual servers that call the same common resources to be executed on the same task node, so that the physical machine that processes the task of the task node can make only one resource call and execute multiple subtasks corresponding to the common resources, which effectively improves the efficiency of the resource call utilization of the physical machine and increases the carrying capacity of the physical machine to accommodate virtual machines.
[0030] For example, a MOBA (Multiplayer Online Battle Arena) game has two virtual servers, namely virtual server A and virtual server B, and another MMO (Massively Multiplayer Online) game has two virtual servers, virtual server C and virtual server D. There are task nodes 1 and task nodes 2 on two physical machines respectively. Virtual server A is determined to be hosted on task node 1, virtual server C is hosted on task node 2, and virtual servers B and virtual servers D are in the waiting state. At this time, if virtual service B sends a service opening request to the logical node, the logical node obtains the resource occupancy of task node 1 and analyzes the resource information of virtual service B. If task node 1 can carry the task information of another virtual service, and the resource information of virtual service B is the same as the resource information of the current task node 1, then the task information of virtual service A and virtual service B is established on task node 1, and the task requests of virtual service A and virtual service B are processed. When there are task requests for virtual service A and virtual service B, the task node calls the shared resources for task processing through the task information corresponding to virtual service A and the task information corresponding to virtual service B. At this time, if virtual service D also has a service opening request, and it is determined that both task node 1 and task node 2 can create task information, but the resource information of virtual service D is the same as that of task node 2, then the task information of virtual service D will be established on task node 2.
[0031] Step 304: Determine the target virtual server corresponding to the target client, and send the task request to the target task node corresponding to the target virtual server, so that the target task node calls the recorded shared resources in response to the task request.
[0032] The logical node can determine the target virtual server corresponding to the target client based on the task request sent by the target client. Since the virtual server information will be broadcast to all logical nodes when the virtual server is opened, the logical node can determine the virtual server corresponding to the target client based on the target client information and the received virtual server information. The virtual server corresponding to the client can be determined by checking the registry, searching the historical records, etc., which are not limited here.
[0033] After determining the target virtual server corresponding to the target client, the logic node can send the task request to the target task node corresponding to the target virtual server according to the target virtual server. The target task node will respond to the task request and call the shared resource to process the task request according to the task request.
[0034] It should be noted that there is no sequential execution relationship between the logical node calling the exclusive resources and determining the target virtual server corresponding to the target client mentioned in this application. The exclusive resources may be called first and then the target virtual server corresponding to the target client may be determined, or the target virtual server corresponding to the target client may be determined first and then the exclusive resources may be called, or both may be executed in parallel.
[0035] Figure 4 A flowchart of a task processing method applied to a task node according to an embodiment of the present application is provided. The method is applied to the task node and specifically includes the following steps: Step 402: receiving a task request sent by a logical node, wherein the task request is sent after the logical node responds to the task request sent by a target client, calls the exclusive resources of the target client, determines the target virtual server corresponding to the target client, and sends it.
[0036] The task node may accept a task request sent by the logic node, wherein the task request includes interaction subtasks between clients of the virtual server.
[0037] Step 404: In response to the task request, call the recorded shared resources.
[0038] Specifically, task information of at least one virtual server is set in the task node, and the task information is used to process interaction subtasks between clients of the virtual server.
[0039] The task node receives the task request sent by the logical node, calls the shared resources recorded by the task node according to the interactive subtasks contained in the task request, and executes the interactive subtasks between the clients contained in the task request. The task node accepts the task request sent by the logical node through a message queue, event bus or shared memory, which is not limited here.
[0040] Further, the recorded shared resources are called to execute the steps of the interactive subtask corresponding to the target client in the target task corresponding to the task request, which can be specifically implemented in the following manner: The recorded shared resources are called, the task information corresponding to the target virtual server is executed, and the interactive subtasks between the target clients in the target task corresponding to the task request are executed.
[0041] Among them, according to the content of step 302, one or more virtual servers are hosted on a task node. When multiple virtual servers with the same content called by the same games or corresponding task requests are hosted on a task node, the resources called in the task node are shared resources. Taking virtual servers A and B of the same MOBA game as an example, since they are two virtual servers under the same game, when processing client interactive tasks, the task information corresponding to virtual servers A and B will call the same set of resources. At this time, the resources are the shared resources of the task node. Alternatively, when there is only task information corresponding to one virtual server on the task node, in order to unify the name, the resources called by it are also used as shared resources.
[0042] Since there may be one or more virtual servers calling the same shared resources on the same task node, one or more corresponding task information is allocated to each target virtual server on the task node. The task node calls the shared resources recorded by the task node according to the interactive sub-tasks contained in the task request, and executes the task information corresponding to the target virtual server, so that the task information processes the interactive sub-tasks between each client of each virtual server.
[0043] Through this embodiment, the task node receives the task request sent by the logical node, and the task information executes the interactive task according to the shared resources. The interactive tasks of one or more virtual servers are processed in the same task node. The resource call occupancy is reduced by reusing the shared resources, so that multiple virtual servers can process interactive subtasks on one physical machine, thereby improving the utilization efficiency of a single physical machine and reducing the idle waste of the physical machine.
[0044] Figure 5 A flowchart of a task processing method applied to a server provided in an embodiment of the present application is given. Taking the overall application of the task processing method in a task system as an example, the task processing method is further described, which specifically includes the following steps: Step 502: The logical node calls the exclusive resources of the target client in response to the task request sent by the target client.
[0045] Step 504: The logical node determines the target virtual server corresponding to the target client, and sends the task request to the target task node corresponding to the target virtual server.
[0046] Step 506: The target task node calls the recorded shared resources in response to the task request.
[0047] The implementation process of steps 502-506 is Figure 3 , Figure 4 The corresponding steps of the embodiments shown are the same or similar, and the details are shown in Figure 3 , Figure 4 The embodiments are not described in detail here.
[0048] In one or more implementations of this embodiment, the server also includes a configuration node; The configuration node is used to respond to the service opening request of the virtual server to be opened, obtain the resource occupancy information of each task node; determine the host task node corresponding to the virtual server to be opened from each task node according to the resource occupancy information of each task node; and create the task information of the virtual server to be opened on the host task node.
[0049] During the process of starting the virtual service to be started, the configuration node can respond to the service start request of the virtual service to be started, obtain the resource occupancy information of each task node, determine the host task node corresponding to the virtual service to be started from each task node according to the resource occupancy information of each task node, and create task information of the virtual service to be started on the host task node, wherein the task information refers to the thread in the task node that executes the task of calling shared resources of each virtual server, and the task information is used to process the task request corresponding to the virtual server, and the resource occupancy information of the task node refers to the occupancy status of the task information in the task node. When the task information load in the task node reaches the carrying capacity of the task node, new task information will no longer be created for the task node.
[0050] Furthermore, after the virtual server is opened, the user will log in to the virtual server according to the client. When the user logs in through the client, the client needs to be assigned to the corresponding logical node so that the logical node processes the task request sent by the client. Therefore, in one or more implementations of this embodiment, the server also includes: The configuration node is used to determine the number of clients corresponding to each logical node according to the resource information of each logical node.
[0051] That is to say, the configuration node in this application can determine the number of clients that each logical node can carry based on the physical machine resource information corresponding to each logical node, that is, the physical machine carrying capacity corresponding to each logical node, and allocate the clients to the logical nodes for processing.
[0052] Specifically, in this application, the configuration node can assign corresponding weights to each logical node according to the carrying capacity of the physical machine corresponding to each logical node. The logged-in clients are assigned to the corresponding logical nodes according to the weights. For example, assuming that there are 100 logged-in clients and 20 logical nodes, if the carrying capacity of the physical machine corresponding to each logical node is the same, the same weight is assigned to each logical node, and at this time, each logical node is assigned 5 clients to process task requests.
[0053] The task processing method provided by the present application is to split the virtual server in the existing technical architecture into two parts: a logical node and a task node. The logical node is used to respond to the client's task request and call the client's exclusive resources to perform task processing; determine the virtual server corresponding to the client, and send the task request to the task node. The task node is used to receive the task request sent by the logical node and call the shared resources on the task node to process the task request. Through such an architectural design, the task request processing originally performed by a single virtual server is split and executed on two types of nodes. The logical node performs the processing of exclusive resources, and the task node performs the processing of shared resources, so that tasks of multiple virtual servers calling shared resources can be executed on one task node, saving the memory resources occupied by the physical machine calling resources, effectively improving the resource calling efficiency of the physical machine, and enabling multiple virtual machines in a non-fully loaded state to share a physical machine for processing, effectively saving the physical machine resources under the server architecture.
[0054] The following combination Figure 6 A processing flow chart of a task processing method applied to a game server task processing scenario provided by an embodiment of the present application is given. Taking the application of the task processing method provided by the present application to the game server task processing scenario as an example, the task processing method is further described, which specifically includes the following steps: Step 602: the game logic node calls the exclusive resources of the target client in response to the game task request sent by the target client; The game logic node receives the game task request sent by the target client, analyzes the task resource calling situation in the game task request, and calls the exclusive resources of the target client for processing the game subtask contained in the game task request that calls the exclusive resources of the target client.
[0055] In addition, when logging in as a client, the client needs to be assigned to an appropriate game logic node to avoid excessive pressure on a single game logic node. At this time, the player client can be assigned according to the weight of each game logic node. Specifically, assuming that the configurations of the physical machines corresponding to the logic nodes are consistent, the weights are set to the same number, and the client is evenly assigned to each logic node. When the physical machines corresponding to certain game logic nodes have different configurations, different weights are set according to the memory and central processing unit. A lower weight is set for the game logic node corresponding to the physical machine with a low configuration, and a higher weight is set for the game logic node corresponding to the physical machine with a high configuration. The weight determines how many clients are assigned to each game logic node, and ultimately the weight can be better allocated.
[0056] Step 604: the game logic node determines the target virtual game server corresponding to the target client, and sends the game task request to the target game task node corresponding to the target virtual game server; The game logic node can determine the virtual game server corresponding to the target client based on the target client information and the virtual game server information stored in the game logic node. After a game server is started, the information will be synchronized to all game logic nodes. No matter which game logic node the player's client is in, the data can identify which game server it belongs to.
[0057] The game logic node determines the game task node that hosts the virtual game server according to the virtual game server corresponding to the target client, that is, the target game task node corresponding to the target virtual game server, and sends the game task request to the target game task node.
[0058] Step 606: The target game task node calls the recorded shared game resources in response to the game task request.
[0059] The game task node receives the game task request sent by the game logic node, and finds the task information corresponding to the game virtual server on the game task node according to the game virtual server corresponding to the game task request. The task information calls the shared resources recorded by the game task node according to the interactive subtasks contained in the game task request to process the game task request.
[0060] The game task node can enable multiple task information, and a single game server belongs to a certain task information. At the same time, multiplayer interactive gameplay can create an additional task information for each game server to execute.
[0061] Through the above-mentioned method, the present application reduces the resource consumption on the physical machine and improves the resource utilization efficiency of a single physical machine. For example, the map resources and configuration resources required for player interactive gameplay occupy a large amount of m, and the independent resources of the player client occupy a small amount of n. Under the prior art, x servers require (m+n)*x resources. Under the technical solution of the present application, x servers require y game task nodes and z game logic nodes, that is, (y*m+n*z). Active and inactive servers share game logic nodes, so z is less than x. Multiple inactive game servers can be on the same game task node, so y is less than x. As a result, resources are greatly reduced overall.
[0062] Corresponding to the above method embodiment, the present application also provides a server embodiment, Figure 7 FIG. 1 shows a schematic diagram of the structure of a server provided by an embodiment of the present application. Figure 7 As shown, the server 700 includes at least one logical node 702 and at least one task node 704, each logical node 702 correspondingly records the exclusive resources of the client of at least one virtual server, and each task node 704 correspondingly records the shared resources required for interaction between the clients of at least one virtual server; The logic node 702 is used to respond to the task request sent by the target client, call the exclusive resources of the target client; determine the target virtual server corresponding to the target client, and send the task request to the target task node corresponding to the target virtual server; The task node 704 is used to call the recorded shared resources in response to the task request.
[0063] Optionally, the server 700 further includes: The configuration node is used to respond to the service opening request of the virtual server to be opened, obtain the resource occupancy information of each task node; determine the host task node corresponding to the virtual server to be opened from each task node according to the resource occupancy information of each task node; and create the task information of the virtual server to be opened on the host task node.
[0064] The above is a schematic solution of a server of this embodiment. It should be noted that the technical solution of the server and the technical solution of the task processing method described above are of the same concept, and the details of the technical solution of the server that are not described in detail can be found in the description of the technical solution of the task processing method described above.
[0065] Corresponding to the above method embodiment, the present application also provides an embodiment of a logical node of a task processing device, Figure 8 FIG. 1 shows a schematic diagram of a task processing device applied to a logical node according to an embodiment of the present application. Figure 8 As shown, the device comprises: The response module 802 is configured to call the exclusive resource of the target client in response to the task request sent by the target client; The transmission module 804 is configured to determine the target virtual server corresponding to the target client, and send the task request to the target task node corresponding to the target virtual server, so that the target task node calls the recorded shared resources in response to the task request.
[0066] Optionally, the device further comprises: An acquisition module is configured to obtain resource occupancy information of each task node in response to a service opening request of a virtual server to be opened; A determination module is configured to determine, from each task node, a bearer task node corresponding to the virtual server to be opened; The creation module is configured to create task information of the virtual server to be opened on the task-bearing node.
[0067] Optionally, the determination module is further configured to: According to the resource occupation information of each task node and the resource information of the virtual server to be opened, a task bearing node having shared resources with the virtual server to be opened is determined from each task node.
[0068] Corresponding to the above method embodiment, Fig. 9 FIG. 1 shows a schematic diagram of a task processing device applied to a task node according to an embodiment of the present application. Fig. 9 As shown, the device comprises: The receiving module 902 is configured to receive a task request sent by the logical node, wherein the task request is sent after the logical node responds to the task request sent by the target client, determines the target virtual server corresponding to the target client, and calls the exclusive resources of the target client; The calling module 904 calls the recorded shared resources in response to the task request.
[0069] Optionally, the calling module 904 is further configured to: The recorded shared resources are called, the task information corresponding to the target virtual server is executed, and the interactive subtasks between the target clients in the target task corresponding to the task request are executed.
[0070] Optionally, the device further comprises: The configuration module is configured to determine the number of clients corresponding to each logical node according to the resource information of each logical node.
[0071] Fig.10The structure block diagram of a computing device 1000 provided according to an embodiment of the present application is shown. The components of the computing device 1000 include but are not limited to a memory 1010 and a processor 1020. The processor 1020 is connected to the memory 1010 via a bus 1030, and the database 1050 is used to store data.
[0072] The computing device 1000 also includes an access device 1040 that enables the computing device 1000 to communicate via one or more networks 1060. Examples of these networks include PSTN (Public Switched Telephone Network), LAN (Local Area Network), WAN (Wide Area Network), PAN (Personal Area Network), or a combination of communication networks such as the Internet. The access device 1040 may include one or more of any type of network interface (e.g., NIC (Network Interface Controller)) wired or wireless, such as IEEE802.11 WLAN (Wireless Local Area Network) wireless interface, Wi-MAX (Worldwide Interoperability for Microwave Access) interface, Ethernet interface, USB (Universal Serial Bus) interface, cellular network interface, Bluetooth interface, NFC (Near Field Communication).
[0073] In one embodiment of the present application, the above components of the computing device 1000 and Fig.10 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig.10 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0074] The computing device 1000 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a PC (Personal Computer). The computing device 1000 may also be a mobile or stationary server.
[0075] The processor 1020 is used to execute computer executable instructions of the task processing method.
[0076] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned task processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned task processing method.
[0077] An embodiment of the present application further provides a computer-readable storage medium storing a computer program / instruction, which is used for a task processing method when executed by a processor.
[0078] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned task processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned task processing method.
[0079] An embodiment of the present application further provides a computer program product, including a computer program / instruction, which is used for a task processing method when executed by a processor.
[0080] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of the computer program product and the technical solution of the above-mentioned task processing method belong to the same concept, and the details not described in detail in the technical solution of the computer program product can be referred to the description of the technical solution of the above-mentioned task processing method.
[0081] The computer program / instruction includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, ROM (Read-Only Memory), RAM (Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0082] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0083] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0084] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A task processing method, characterized in that: A logical node applied to a server, the server comprising at least one logical node and at least one task node, each of the logical nodes correspondingly recording exclusive resources of each client in at least one virtual server, and each of the task nodes correspondingly recording shared resources required for interaction between clients in at least one virtual server; the method comprising: In response to a task request sent by a target client, calling an exclusive resource of the target client; The target virtual server corresponding to the target client is determined, and the task request is sent to the target task node corresponding to the target virtual server, so that the target task node calls the recorded shared resource in response to the task request.
2. The method according to claim 1, characterized in that Before calling the exclusive resource of the target client in response to the task request sent by the target client, the method further includes: In response to a request for opening a virtual server to be opened, obtaining resource occupancy information of each of the task nodes; According to the resource occupation information of each of the task nodes, determining the bearer task node corresponding to the virtual server to be opened from each of the task nodes; The task information of the virtual server to be opened is created on the task bearing node.
3. The method according to claim 2, characterized in that The step of determining, from the task nodes, a bearer task node corresponding to the to-be-enabled virtual server according to the resource occupation information of the task nodes, comprises: According to the resource occupation information of each of the task nodes and the resource information of the virtual server to be opened, a task bearing node having shared resources with the virtual server to be opened is determined from among the task nodes.
4. A task processing method, characterized in that: A task node applied to a server, the server comprising at least one logical node and at least one task node, each of the logical nodes correspondingly recording exclusive resources of a client of at least one virtual server, and each of the task nodes correspondingly recording shared resources required for interaction between clients of at least one virtual server; the method comprising: Receiving a task request sent by the logical node, wherein the task request is sent by the logical node in response to the task request sent by the target client, determining a target virtual server corresponding to the target client, and invoking an exclusive resource of the target client; In response to the task request, the recorded shared resource is called.
5. The method according to claim 4, characterized in that Each of the task nodes is provided with task information of at least one virtual server, and the task information is used to process interaction subtasks between the clients of the virtual server; The shared resources of the call record include: The recorded shared resource is called, the task information corresponding to the target virtual server is executed, and the interaction subtask between the target clients in the target task corresponding to the task request is executed.
6. A server, characterized in that: The server includes at least one logical node and at least one task node, each of the logical nodes correspondingly records exclusive resources of at least one virtual server client, and each of the task nodes correspondingly records shared resources required for interaction between at least one virtual server client; The logical node is used to call the exclusive resources of the target client in response to the task request sent by the target client; Determine a target virtual server corresponding to the target client, and send the task request to a target task node corresponding to the target virtual server; The target task node is used to call the recorded shared resource in response to the task request.
7. The server according to claim 6, characterized in that: The server also includes a configuration node; The configuration node is used to respond to a service opening request of a virtual server to be opened, obtain resource occupancy information of each of the task nodes; determine the host task node corresponding to the virtual server to be opened from each of the task nodes based on the resource occupancy information of each of the task nodes; and create task information of the virtual server to be opened on the host task node.
8. The server according to claim 6, characterized in that: The server also includes a configuration node; The configuration node is used to determine the number of clients corresponding to each of the logical nodes according to the resource information of each of the logical nodes.
9. A task processing method, characterized in that: Applied to a server, the server includes at least one logical node and at least one task node, each of the logical nodes records exclusive resources of a client of at least one virtual server, and each of the task nodes records shared resources required for interaction between clients of at least one virtual server; the method includes: The logical node calls the exclusive resources of the target client in response to the task request sent by the target client; The logic node determines the target virtual server corresponding to the target client, and sends the task request to the target task node corresponding to the target virtual server; The target task node calls the recorded shared resource in response to the task request.
10. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the method described in any one of claims 1 to 3 or the method described in any one of claims 4 to 5 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program / instruction, and when the computer program / instruction is executed by a processor, the method described in any one of claims 1 to 3 or the method described in any one of claims 4 to 5 is implemented.
12. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the method described in any one of claims 1 to 3 or the method described in any one of claims 4 to 5.