Game entity processing method, device, readable medium and electronic device
By determining the routing information of the target entity in the game engine and creating an entity after the routing node is successfully registered, the data inconsistency and logical errors caused by the same player creating game entities multiple times is solved, and the uniqueness and data consistency of entity creation are achieved.
Patent Information
- Application Number
- CN202211720696.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In a game scenario, creating multiple game entities by the same player leads to inconsistent data and logical errors.
By determining the routing information of the target entity to be created, selecting the target routing group, and sending a routing registration request to the group, confirming that the information is successfully registered with each routing node before creating the entity, avoiding repeated creation.
It effectively avoids repeated creation of game entities and ensures data consistency and logical correctness.
Smart Images

Figure CN115970292B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a method, apparatus, readable medium, and electronic device for processing game entities. Background Art
[0002] In a general game scenario, the same player usually creates and uses one game entity. If
[0003] the same player creates multiple game entities, it will cause the player to log in multiple times with one identity, that is, there are multiple game entities of the same type for the same player existing in the server at the same time. This may cause the player's data to be written by multiple entities in the database
[0004] competing with each other, resulting in problems such as data inconsistency and logical errors. Summary of the Invention
[0005] This Summary of the Invention section is provided to introduce concepts in a brief form. These concepts will be described in detail in the following Detailed Implementation section. This Summary of the Invention section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0006] In a first aspect, the present disclosure provides a method for processing game entities, the method including:
[0007] Determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier used to indicate a first game process to which the target entity belongs;
[0008] Determine a target routing group from multiple existing routing groups, where each of the routing groups includes at least one routing node;
[0009] Send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group; if it is determined that the first routing information has been successfully registered at each routing node of the target routing group, create the target entity in the first game process.
[0010] In a second aspect, the present disclosure provides a device for processing game entities, the device including:
[0011] A first determination module, configured to determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier used to indicate a first game process to which the target entity belongs;
[0012] A second determination module, configured to determine a target routing group from multiple existing routing groups, where each of the routing groups includes at least one routing node;
[0013] A routing registration module, configured to send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group;
[0014] An entity creation module, configured to create the target entity in the first game process if it is determined that the first routing information has been successfully registered at each routing node of the target routing group.
[0015] In a third aspect, the present disclosure provides a computer-readable medium, on which a computer program is stored, and when the program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.
[0016] In a fourth aspect, the present disclosure provides an electronic device, including:
[0017] A storage device, on which a computer program is stored;
[0018] A processing device, configured to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
[0019] Through the above technical solutions, for the target entity to be created, first determine the first routing information of the target entity, and then, determine the target routing group from multiple existing routing groups, and send a routing registration request carrying the first routing information to the target routing group, and further determine whether the first routing information can be successfully registered at each routing node of the target routing group, and, if it is determined that the first routing information has been successfully registered at each routing node of the target routing group, then create the target entity in the first game process. Thus, when creating the target entity, first confirm with the routing nodes in the target routing group that the first routing information of the target entity can be successfully registered on them, which is equivalent to querying whether the target entity already exists in the game engine, and, when it is determined that the first routing information has been successfully registered at each routing node of the target routing group, that is, when it is determined that the target entity does not exist in the game engine, then create the target entity in the first game process. In this way, by the success or failure of the registration of the first routing information at the routing nodes, it is known whether the target entity has been created, thereby effectively avoiding the repeated creation of game entities.
[0020] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation section. Description of the Drawings
[0021] In conjunction with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic and that the original components and elements are not necessarily drawn to scale. In the drawings:
[0022] Figure 1 is a flowchart of a game entity processing method provided according to an embodiment of the present disclosure;
[0023] Figure 2 is an exemplary flowchart of a step of determining whether the first routing information can be successfully registered at each routing node of the target routing group in the game entity processing method provided according to the present disclosure;
[0024] Figure 3 shows a processing flowchart in the case of concurrent registration in the game entity processing method provided by the present disclosure;
[0025] Figure 4 is a block diagram of a game entity processing device provided according to an embodiment of the present disclosure;
[0026] Figure 5 shows a schematic structural diagram of an electronic device suitable for implementing the embodiments of the present disclosure. Specific Embodiments
[0027] The embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.
[0028] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.
[0029] As used herein, the term "including" and its variants are open-ended, i.e., "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0030] It should be noted that concepts such as "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0031] It should be noted that the modifications of "one" and "multiple" mentioned in this disclosure are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly specified in the context, it should be understood as "one or more".
[0032] The names of the messages or information exchanged between multiple devices in the embodiments of this disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.
[0033] It can be understood that before using the technical solutions disclosed in the embodiments of this disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in this disclosure should be informed to users and the authorization of users should be obtained through appropriate means in accordance with relevant laws and regulations.
[0034] For example, when responding to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium that executes the operations of the technical solutions of this disclosure according to the prompt message.
[0035] As an optional but non-limiting implementation manner, the way of sending a prompt message to the user in response to receiving an active request from the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry selection controls for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0036] It can be understood that the above process of notifying and obtaining user authorization is only illustrative and does not limit the implementation manners of this disclosure. Other ways that meet relevant laws and regulations can also be applied to the implementation manners of this disclosure.
[0037] At the same time, it can be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related regulations.
[0038] As described in the background art, in a game scenario, for the same player, repeatedly creating game entities may cause problems in data and logic. Therefore, it is necessary to detect whether a game entity already exists when creating the game entity. In the related art, one way is to record the information of the created game entities through an external distributed storage (for example, redis), and remove the record when the game is destroyed. Before creating the game entity, query the distributed storage through a specific interface to determine whether the game entity already exists; the other way is to implement a globally single-point manager through the game business script, record the information of the created game entities, remove the record when the game entity is destroyed, and query through the manager before creating the game entity to determine whether the game entity already exists. However, in the first processing method above, it depends on the external distributed storage, the implementation is complex, and the management cost of operation and maintenance is increased; in the second processing method above, there is a single-point risk, that is, when the process where the manager is located crashes or the host where the manager is located goes down, the manager query method during the creation of the game entity becomes unavailable.
[0039] To solve the above technical problems, the present disclosure provides a game entity processing method, device, readable medium and electronic device to avoid duplicate creation of entities in the game.
[0040] Figure 1 It is a flowchart of a game entity processing method provided according to an embodiment of the present disclosure.
[0041] Exemplarily, the method provided by the present disclosure can be applied to a game engine. In the game engine provided by the present disclosure, the following settings may exist:
[0042] There are various types of processes in the game engine, which are responsible for different functions. Among them, the game process (i.e., the game process) carries the entities (i.e., entities) of the game and various business logics. There is no communication connection between game processes. The routing node (i.e., the router) is responsible for the communication transfer between game processes and records the information of the entities on the game process, mainly the routing information of the game process where the entity is located. Among them, there may be multiple routing nodes, and these routing nodes may be divided into multiple routing groups. The routing nodes within the same routing group can be connected to each other in pairs, and there is no connection between the routing nodes in different routing groups. The routing nodes belonging to the same routing group have the same routing group identifier (i.e., groupId), and the game process also has the information of the routing group to which the routing node belongs, so as to send the routing operation requests of the entity (such as routing registration requests, routing update requests, routing cancellation requests, etc.) to the specified routing node in the specified routing group. The routing information of a certain entity is only synchronized and kept consistent among the routing nodes within one routing group, and other routing groups do not have the routing information of this entity.
[0043] AsFigure 1 As shown, the method provided by the present disclosure may include Step 11 - Step 14.
[0044] In Step 11, determine the first routing information of the target entity to be created.
[0045] In Step 12, determine the target routing group from multiple existing routing groups.
[0046] In Step 13, send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group.
[0047] In Step 14, if it is determined that the first routing information has been successfully registered at each routing node of the target routing group, create the target entity in the first game process.
[0048] The first routing information, that is, the routing information corresponding to the target entity (i.e., the game entity to be created), at least includes the first game identifier used to indicate the first game process to which the target entity belongs. Usually, if the first game process needs to create a target entity, it will generate routing information (i.e., the first routing information) related to the target entity for subsequent routing registration.
[0049] Optionally, in addition to the game identifier indicating the game process where the game entity is located, the routing information of the game entity may further include at least one of the following:
[0050] Version information used to indicate the version number of the routing information;
[0051] Registration timestamp used to indicate the registration initiation time of the routing information;
[0052] Valid timestamp used to indicate the validity period of the routing information;
[0053] The starting service time of the game process where the game entity is located.
[0054] For the version information, the version number of the routing information increases unidirectionally, starting from 1. Whenever
[0055] After a routing operation, it increases by 1. For example, initially, when the game process sends a routing registration request, the version number of the routing information carried is 1. After that, if the routing information needs to be updated,
[0056] Then when a routing update request is sent for this routing information, the version number of the routing information carried will increase to 2.
[0057] For the valid timestamp, it is used to characterize the validity period of the routing information. Exemplarily, the valid
[0058] The time stamp can be the sum of the current time, the timeout duration allowed for entity migration, and the recovery timeout duration allowed for entity migration. When a modification conflict occurs due to concurrent requests, if the valid time stamp has not expired (i.e.,
[0059] the current time has not exceeded the valid period), modification of the routing information is not allowed.
[0060] For the startup time, in a scenario where a game process crashes, the routing node needs to clean up the routing information related to the entities on the crashed game process, and it is necessary to determine whether the current routing information is
[0061] registered by the crashed game process to avoid incorrect cleanup. That is, if the crashed game process is restarted and relevant routing information is registered on it, and the game identifier of the game process is
[0062] the same, then the routing information can be distinguished by the startup time of the game process at this time.
[0063] Based on the above definition of routing information, the content included in the first routing information of the target entity can be obtained by the same reasoning.
[0064] As described above, there are multiple routing groups in the game engine, and each routing group includes at least one 0 routing node. Optionally, one routing
[0065] group can be determined from the existing multiple routing groups through a hash algorithm as the target routing group.
[0066] In a possible situation, if the target routing group is determined from multiple routing groups through a hash algorithm, assuming that an entire routing group crashes, it is necessary to leave the crashed routing group blank in the records related to the routing group on other routing groups and game processes, that is, do not delete the placeholder of the crashed routing group in the routing group array. In this way, it can be ensured that the number of routing groups used by the hash algorithm
[0067] remains fixed, thereby ensuring the execution stability of determining the target routing group through the hash algorithm. During the crash of this routing group, requests sent to this routing group will all fail. After that, after the crashed routing group recovers, the relevant information in this routing group can be restored based on the routing information matching the game process and this routing group.
[0068]
[0069] After determining the target routing group via step 12, a routing registration request carrying the first routing information can be sent to the target routing group. This routing registration request is used to register the first routing information of the target entity with the routing nodes in the target routing group. After the routing registration request is sent to each routing node in the target routing group, determine whether the first routing information can be successfully registered with the routing nodes in the target routing group.
[0070] If the first routing information can be successfully registered with each routing node in the target routing group, it indicates that there is no game entity identical to the target entity currently created in the game engine. At this time, the target entity can be created in the first game process. If the first routing information cannot be successfully registered with each routing node in the target routing group, it indicates that there may already be a game entity identical to the target entity in the game engine currently, or a game entity identical to the target entity may be being created in the game engine currently. Therefore, it can be confirmed that the registration of the first routing information fails and the target entity cannot be created in the first game process.
[0071] Through the above technical solution, for the target entity to be created, first determine the first routing information of the target entity. Then, from the existing multiple routing groups, determine the target routing group and send a routing registration request carrying the first routing information to the target routing group. Furthermore, determine whether the first routing information can be successfully registered with each routing node in the target routing group, and if it is determined that the first routing information has been successfully registered with each routing node in the target routing group, create the target entity in the first game process. Thus, when creating the target entity, first confirm with the routing nodes in the target routing group that the first routing information of the target entity can be successfully registered on them, which is equivalent to querying whether the target entity already exists in the game engine. And when it is determined that the first routing information has been successfully registered with each routing node in the target routing group, that is, when it is determined that the target entity does not exist in the game engine, create the target entity in the first game process. In this way, through the success or failure of the registration of the first routing information in the routing nodes, it is known whether the target entity has been created, thereby effectively avoiding the repeated creation of game entities.
[0072] To enable those skilled in the art to better understand the game entity processing method provided by the present disclosure, the present disclosure will be described in more detail below in combination with the above steps.
[0073] In a possible implementation manner, step 13 may include the following steps, as Figure 2 shown:
[0074] In step 21, send a routing registration request to the target routing node in the target routing group, and determine whether the first routing information can be successfully registered with the target routing node in the target routing group;
[0075] In step 22, when it is determined that the first routing information can be successfully registered at the target routing node, the first routing information is stored in the target routing node;
[0076] In step 23, the routing registration request is forwarded to other routing nodes in the target routing group except the target routing node through the target routing node, and it is determined whether the first routing information can be successfully registered at each of the other routing nodes.
[0077] That is to say, in the present disclosure, when sending a routing registration request to the target routing group, the routing registration request is not directly sent to all routing nodes. Instead, a target routing node is first determined in the target routing group, and the routing registration request is first sent to this target routing node. When it is determined that the first routing information can be successfully registered at the target routing node, the routing registration request is then re-sent to other routing nodes in the target routing group through the target routing node, in an attempt to synchronize the first routing information to other routing nodes in the target routing group. Moreover, each of the other routing nodes will also determine whether the first routing information can be successfully registered. Thus, it is possible to determine the success or failure of the registration of the first routing information at the routing nodes in the target routing group.
[0078] Exemplarily, a routing node can be determined from multiple routing nodes in the target routing group through a hash algorithm as the target routing node.
[0079] In a possible implementation manner, in step 21, determining whether the first routing information can be successfully registered at the target routing node in the target routing group may include the following steps:
[0080] Determine whether there is a record of the first routing information corresponding to the target entity and within the validity period in the routing table of the target routing node;
[0081] If there is no record of the first routing information, it is determined that the first routing information can be successfully registered at the target routing node;
[0082] If there is a record of the first routing information, it is determined that the first routing information cannot be successfully registered at the target routing node.
[0083] The target routing node stores a routing table, which contains the routing information of the game entities created in the game engine, that is, the routing information that has been successfully registered in the routing node. It should be understood that since there are multiple routing groups in the game engine, the target routing node may only store the routing information of some of the created game entities, and the routing information of other created game entities is stored in the routing tables of other routing groups. Therefore, through the routing table of the target routing node, it can be determined whether there is routing information corresponding to the target entity and within the validity period, that is, the first routing information record (the routing information record is essentially the routing information stored in the routing node, so its definition and the information it contains can refer to the description of the routing information of the entity in the previous text and will not be elaborated here). Among them, corresponding to the target entity can be understood as that the entity identifier (ID) is the same as the target entity, and within the validity period can be understood as that the valid timestamp has not expired (if the valid timestamp has expired, it may be the residue of invalid routing information).
[0084] If there is no such first routing information record, it means that there is no game entity in the game engine that is the same as the target entity at present. Therefore, it can be determined that the first routing information can be successfully registered in the target routing node. On the contrary, if there is such a first routing information record, it means that there is already a game entity in the game engine that is the same as the target entity. Therefore, it can be determined that the first routing information cannot be successfully registered in the target routing node.
[0085] And in the case where it is determined that the first routing information cannot be successfully registered in the target routing node, since the goal of successfully registering the first routing information in each routing node of the target routing group cannot be achieved, there is no need to execute step 22 and step 23 anymore, that is, there is no need to forward the routing registration request to other routing nodes anymore.
[0086] In the case where it is determined that the first routing information can be successfully registered in the target routing node, the first routing information can be stored in the target routing node, that is, stored in the routing table of the target routing node. Furthermore, step 23 can be continued, and the routing registration request is forwarded to other routing nodes in the target routing group except the target routing node through the target routing node, and it is determined whether the first routing information can be successfully registered in each of the other routing nodes.
[0087] In a possible implementation manner, the following method can be used to determine whether the first routing information can be successfully registered in the specified routing node, where the specified routing node is a routing node in other routing nodes in the target routing group except the target routing node:
[0088] Determine whether there is a second routing information record corresponding to the target entity and within the validity period in the routing table of the specified routing node;
[0089] If there is no second routing information record, determine that the first routing information can be successfully registered at the specified routing node;
[0090] If there is a second routing information record, compare the priorities of the first routing information and the second routing information record;
[0091] If the priority of the first routing information is not higher than that of the second routing information record, determine that the first routing information cannot be successfully registered at the specified routing node;
[0092] If the priority of the first routing information is higher than that of the second routing information record, determine that the first routing information can be successfully registered at the specified routing node.
[0093] Among them, the method for determining whether there is a second routing information record is the same as the method for determining whether there is a first routing information record in the previous text, and will not be elaborated here.
[0094] If there is a second routing information record that meets the above conditions, the priorities of the first routing information and the second routing information record can be compared. Optionally, in the present disclosure, a comparison rule for comparing the priorities between routing information can be preset, and based on this comparison rule, it is easy to determine the priority comparison result of the first routing information and the second routing information record.
[0095] According to the definition of routing information in the previous text, the first routing information may further include first version information for indicating the version number of the first routing information and a first timestamp for indicating the registration initiation time of the first routing information, and the second routing information record may include a second game identifier for indicating the game process, second version information for indicating the version number of the second routing information record, and a second timestamp for indicating the registration initiation time of the second routing information record. In a possible implementation manner, comparing the priorities of the first routing information and the second routing information record may include the following steps:
[0096] Based on the preset comparison rule, compare the first routing information and the second routing information record to obtain the priority comparison result of the first routing information and the second routing information record;
[0097] Among them, comparing the first routing information and the second routing information record includes at least one of the following: comparing the first game identifier and the second game identifier, comparing the first version information and the second version information, and comparing the first timestamp and the second timestamp.
[0098] Exemplarily, if the pre-set comparison rule indicates that when the version numbers are the same, the routing information with a larger game identifier has a higher priority. If the first routing information includes a first game identifier game1, a first version information version1, and a first timestamp timestamp1, and the second routing information record includes a second game identifier game2, a second version information version2, and a second timestamp timestamp2, and if version1 = version2 and game1 > game2, based on the above comparison rule, the first routing information has a larger first game identifier and thus has a higher priority.
[0099] In an actual application scenario, the above comparison rule can be freely set according to the scenario requirements. The above comparison rule is only an example, and other available comparison rules are not elaborated in this disclosure.
[0100] Through the above method, the priority comparison result of the first routing information and the second routing information record can be obtained. If the priority of the first routing information is not higher than that of the second routing information record, it indicates that there are other concurrent registration requests in the game engine for creating game entities identical to the target entity, and the routing information carried by this concurrent registration request has a higher priority. The designated routing node will accept the routing registration of this concurrent registration request and reject the registration of the first routing information. Therefore, it can be determined that the first routing information cannot be successfully registered at the designated routing node. If the priority of the first routing information is higher than that of the second routing information record, it indicates that although there is a concurrent registration request in the game engine, the first routing information has a higher priority. The designated routing node will accept the registration of the first routing information and reject the registration of this concurrent registration request. Therefore, it can be determined that the first routing information can be successfully registered at the designated routing node.
[0101] Exemplarily, Figure 3 shows the processing flow chart in the case of concurrent registration in this disclosure. Exemplarily, the routing information can be represented by (v, g, t), where v represents the version information version, g represents the game identifier game, and t represents the registration timestamp timestamp. Based on Figure 3 it can be known that game process 1 registers the routing information (v1, g1, t1) of entity 1 with routing node 2, and game process 2 registers the routing information (v1, g2, t2) of entity 1 with routing node 1, thus forming a concurrent registration request for entity 1. Thereafter:
[0102] When game process 1 registers the routing information (v1, g1, t1) of entity 1 with routing node 2, there is no routing information record related to entity 1 in routing node 2. Therefore, the routing information (v1, g1, t1) is successfully registered in routing node 2;
[0103] Meanwhile, when game process 2 registers the routing information (v1, g2, t2) of entity 1 with routing node 1, there is no routing information record related to entity 1 in routing node 2. Therefore, the routing information (v1, g2, t2) is successfully registered in routing node 1;
[0104] After the routing information (v1, g1, t1) is successfully registered in routing node 2, routing node 2 forwards the routing information (v1, g1, t1) to routing node 1 and routing node 3;
[0105] After the routing information (v1, g2, t2) is successfully registered in routing node 1, routing node 1 forwards the routing information (v1, g2, t2) to node 2 and routing node 3;
[0106] When the routing information (v1, g1, t1) arrives at routing node 3, there is no routing record related to entity 1 in routing node 3 yet. Therefore, the routing information (v1, g1, t1) is successfully registered in routing node 3;
[0107] When the routing information (v1, g1, t1) arrives at routing node 1, there is already a routing information record (v1, g2, t2) in routing node 1. By comparing the priorities of (v1, g1, t1) and (v1, g2, t2), it is determined that (v1, g2, t2) has a higher priority. Therefore, the registration of the routing information (v1, g1, t1) in routing node 1 is rejected, the routing information (v1, g1, t1) fails to be registered in routing node 1, and the routing information related to the entity in routing node 1 remains (v1, g2, t2);
[0108] When the routing information (v1, g2, t2) arrives at routing nodes 2 and 3, there is already a routing information record (v1, g1, t1) in both of them. By comparing the priorities of (v1, g1, t1) and (v1, g2, t2), it is determined that (v1, g2, t2) has a higher priority. Therefore, the registration of the routing information (v1, g2, t2) in routing nodes 2 and 3 is accepted, the routing information of entity 1 in routing nodes 2 and 3 is changed from (v1, g1, t1) to (v1, g2, t2), the routing information (v1, g2, t2) is successfully registered in routing nodes 2 and 3, and the routing information related to the entity in routing node 1 is changed to (v1, g2, t2);
[0109] Routing nodes 1, 2, and 3 all store the routing information (v1, g2, t2) of entity 1. Entity 1 is successfully created in game process 2 and fails to be created in game process 1.
[0110] In a possible implementation, Figure 1Based on the steps shown above, the method provided by the present disclosure may further include the following steps:
[0111] After the step of sending a routing registration request carrying the first routing information to the target routing group, determine whether a routing change has occurred, where the routing change includes a change in the routing group and / or a change in the routing node;
[0112] If a routing change has occurred, return to the step of determining the target routing group from the existing multiple routing groups;
[0113] If no change has occurred, then perform the step of determining whether the first routing information can be successfully registered at each routing node of the target routing group.
[0114] During the process of sending a routing registration request to the target routing group, a routing change may occur, that is, a change in the routing group (for example, a new routing group is added in the game engine) or a change in the routing node (for example, a new routing node is added, or the routing group affiliation of the routing node is changed). In the case of a routing change, it is very likely that the determined target routing group (or the target routing node in the target routing group) will also change. Therefore, in the case of determining that a routing change has occurred, it is necessary to return to step 12 to re-determine the target routing group. Correspondingly, it is also necessary to re-determine the target routing node and continue to execute other steps provided by the present disclosure based on the new target routing group and the new target routing node. In this way, the situation of inconsistent routing information can be avoided. And, in the case of determining that no routing change has occurred, then perform the step of determining whether the first routing information can be successfully registered at each routing node of the target routing group in step 13.
[0115] In a possible implementation manner, Figure 1 Based on the steps shown above, the method provided by the present disclosure may further include the following steps:
[0116] In response to detecting that the target entity migrates from the first game process to the second game process, generate the second routing information corresponding to the target entity after migration;
[0117] Send a routing change request carrying the second routing information to the target routing group, where the routing change request is used to change the routing information of the target entity in the target routing group to the second routing information.
[0118] Wherein, the second routing information at least includes the third game identifier used to indicate the second game process. The composition of the second routing information can refer to the definition of the routing information of the game entity in the foregoing text and will not be elaborated here.
[0119] If the target entity migrates from the first game process to the second game process, resulting in a change in the routing information of the target entity, at this time, it is necessary to generate the second routing information according to the current routing situation of the target entity, and use the second routing information to update the routing information record of the target entity stored in the routing node to ensure the accuracy of the routing information of the target entity in the routing node. Therefore, it is necessary to send a routing change request carrying the second routing information to the target routing group to change the routing information of the target entity in the target routing group to the second routing information through the routing change request.
[0120] In a possible implementation manner, in addition to Figure 1 The steps shown are that the method provided by the present disclosure may further include the following steps:
[0121] If there is a routing node in the target routing group that fails to successfully register the first routing information, it is determined that the routing registration request fails to register;
[0122] In the case of registration failure, send a routing cancellation request to the target routing group, and the routing cancellation request is used to delete the first routing information from the target routing group.
[0123] In the case of determining that the routing request fails to register, the target entity cannot be created in the first game process. Therefore, the first routing information stored in the routing nodes in the target routing group that have already registered the first routing information cannot represent the actual routing situation of the target entity and belongs to error information. Therefore, it is necessary to send a routing cancellation request to the target routing group to delete the first routing information from the target routing group.
[0124] It should be noted that if the first routing request is saved in the routing node by replacing the routing information of the target entity previously recorded in the routing node, when deleting the first routing information, the previously recorded routing information of the target entity replaced in the routing node should also be restored.
[0125] In a possible implementation manner, the method provided by the present disclosure may further include the following steps:
[0126] For multiple existing routing groups, detect whether there are faulty routing groups or faulty routing nodes that have anomalies;
[0127] If there is a faulty routing group, restart the faulty routing group and restore the routing information in the faulty routing group using the routing information corresponding to each entity in the existing game processes;
[0128] If there is a faulty routing node, restart the faulty routing node and restore the routing information in the faulty routing node using the routing tables of the routing nodes in the routing group where the faulty routing node is located.
[0129] During the execution of each step of the present disclosure, the routing group or the routing node may encounter an exception. For example, the routing group crashes, or the routing node crashes, etc. In response to such a situation, if a faulty routing group with an exception is detected, after restarting the faulty routing group, the routing information in the faulty routing group can be restored using the routing information corresponding to each entity in the existing game processes. That is to say, obtain the routing information of the entities matching the faulty routing group from each game process in the game engine, and restore the routing tables of each routing node in the faulty routing group according to this routing information to ensure that the faulty routing group can work properly after restarting. If a faulty routing node with an exception is detected, after restarting the faulty routing node, the routing information in the faulty routing node can be restored using the routing tables of other routing nodes in the routing group where the faulty routing node is located to ensure that the faulty routing node can work properly after restarting. Optionally, if there are different routing information corresponding to the same entity in the routing information received by the faulty routing node, arbitration can be performed according to the version information, registration initiation time, etc. in the routing information to select one for storage. For example, select the routing information with a larger version number, select the routing information with a later registration initiation time, etc.
[0130] Figure 4 is a block diagram of a game entity processing device provided according to an embodiment of the present disclosure. As Figure 4 shown, the device 40 may include:
[0131] A first determination module 41, configured to determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier for indicating a first game process to which the target entity belongs;
[0132] A second determination module 42, configured to determine a target routing group from a plurality of existing routing groups, where each of the routing groups includes at least one routing node;
[0133] A routing registration module 43, configured to send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group;
[0134] An entity creation module 44, configured to create the target entity in the first game process if it is determined that the first routing information has been successfully registered at each routing node of the target routing group.
[0135] Optionally, the routing registration module 43 includes:
[0136] The first processing sub-module is used to send the routing registration request to the target routing node in the target routing group, and determine whether the first routing information can be successfully registered in the target routing node in the target routing group;
[0137] The storage sub-module is used to store the first routing information in the target routing node when it is determined that the first routing information can be successfully registered in the target routing node;
[0138] The second processing sub-module is used to forward the routing registration request to other routing nodes in the target routing group except the target routing node through the target routing node, and determine whether the first routing information can be successfully registered in each of the other routing nodes.
[0139] Optionally, the first processing sub-module is used to include:
[0140] The first determination sub-module is used to determine whether there is a record of the first routing information corresponding to the target entity and within the validity period in the routing table of the target routing node;
[0141] The second determination sub-module is used to determine that the first routing information can be successfully registered in the target routing node if there is no record of the first routing information;
[0142] The third determination sub-module is used to determine that the first routing information cannot be successfully registered in the target routing node if there is a record of the first routing information.
[0143] Optionally, the following sub-modules are used to determine whether the first routing information can be successfully registered in a specified routing node, where the specified routing node is a routing node among the other routing nodes:
[0144] The fourth determination sub-module is used to determine whether there is a record of the second routing information corresponding to the target entity and within the validity period in the routing table of the specified routing node;
[0145] The fifth determination sub-module is used to determine that the first routing information can be successfully registered in the specified routing node if there is no record of the second routing information;
[0146] The comparison sub-module is used to compare the priorities of the first routing information and the record of the second routing information if there is a record of the second routing information;
[0147] The sixth determination sub-module is used to determine that the first routing information cannot be successfully registered in the specified routing node if the priority of the first routing information is not higher than the priority of the record of the second routing information;
[0148] A seventh determination sub-module, configured to determine that the first routing information can be successfully registered at the specified routing node if the priority of the first routing information is higher than the priority recorded in the second routing information.
[0149] Optionally, the first routing information further includes first version information for indicating the version number of the first routing information and a first timestamp for indicating the registration initiation time of the first routing information, and the second routing information record includes a second game identifier for indicating the game process, second version information for indicating the version number of the second routing information record, and a second timestamp for indicating the registration initiation time of the second routing information record;
[0150] The comparison sub-module is configured to:
[0151] Based on a preset comparison rule, compare the first routing information with the second routing information record to obtain a priority comparison result of the first routing information and the second routing information record; wherein, the comparison of the first routing information with the second routing information record includes at least one of the following: comparing the first game identifier with the second game identifier, comparing the first version information with the second version information, and comparing the first timestamp with the second timestamp.
[0152] Optionally, the apparatus 40 further includes:
[0153] A third determination module, configured to determine whether a routing change occurs after the step of sending a routing registration request carrying the first routing information to the target routing group, where the routing change includes a change of the routing group and / or a change of the routing node;
[0154] If it is determined by the third determination module that the routing change occurs, return to the second determination module 42 to determine a target routing group from multiple existing routing groups;
[0155] If it is determined by the third determination module that the change does not occur, then determine whether the first routing information can be successfully registered at each routing node of the target routing group through the routing registration module 43.
[0156] Optionally, the apparatus 40 further includes:
[0157] An information generation module, configured to generate second routing information corresponding to the target entity after migration in response to detecting that the target entity migrates from the first game process to the second game process, where the second routing information at least includes a third game identifier for indicating the second game process;
[0158] A routing change module, configured to send a routing change request carrying the second routing information to the target routing group, where the routing change request is used to change the routing information of the target entity in the target routing group to the second routing information.
[0159] Optionally, the apparatus 40 further includes:
[0160] A fourth determination module, configured to determine that the routing registration request fails if there is a routing node in the target routing group that fails to successfully register the first routing information;
[0161] A routing cancellation module, configured to send a routing cancellation request to the target routing group in case of registration failure, where the routing cancellation request is used to delete the first routing information from the target routing group.
[0162] Optionally, the apparatus 40 further includes:
[0163] A detection module, configured to detect whether there is a faulty routing group or a faulty routing node with an anomaly for multiple existing routing groups;
[0164] A first recovery module, configured to restart the faulty routing group if there is the faulty routing group, and recover the routing information in the faulty routing group by using the routing information corresponding to each entity in the existing game processes;
[0165] A second recovery module, configured to restart the faulty routing node if there is the faulty routing node, and recover the routing information in the faulty routing node by using the routing tables of the routing nodes in the routing group where the faulty routing node is located.
[0166] Regarding the apparatus in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated herein.
[0167] Based on the same concept, the present disclosure further provides a non-transitory computer-readable medium, on which a computer program is stored, and when the program is executed by a processing device, the steps of the above game entity processing method are implemented.
[0168] Based on the same concept, the present disclosure further provides an electronic device, including: a storage device, on which a computer program is stored; a processing device, configured to execute the computer program in the storage device to implement the steps of the above game entity processing method.
[0169] Next, refer to Figure 5, which shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The illustrated electronic device is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0170] As Figure 5 shown, the electronic device 600 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which may perform various appropriate actions and processes according to the programs stored in the read-only memory (ROM) 602 or the programs loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.
[0171] Generally, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 5 the illustrated electronic device 600 has various devices, it should be understood that it is not required to implement or include all the illustrated devices. More or fewer devices may be alternatively implemented or included.
[0172] Particularly, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0173] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, in which the computer-readable program code is carried. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0174] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (e.g., the Internet), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0175] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; it can also exist separately without being assembled into the electronic device.
[0176] The above computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier for indicating a first game process to which the target entity belongs; determine a target routing group from a plurality of existing routing groups, where each routing group includes at least one routing node; send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group; if it is determined that the first routing information has been successfully registered at each routing node of the target routing group, create the target entity in the first game process.
[0177] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The programming languages include, but are not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0178] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in an order different from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0179] The modules involved in the embodiments described in this disclosure can be implemented in software or in hardware. Among them, the name of the module does not constitute a limitation to the module itself in some cases. For example, the first determination module can also be described as "the module for determining the first routing information of the target entity to be created".
[0180] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.
[0181] In the context of this disclosure, a machine-readable medium can 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. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disc read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0182] According to one or more embodiments of this disclosure, a method for processing game entities is provided, the method including:
[0183] Determine the first routing information of the target entity to be created, the first routing information at least including a first game identifier for indicating a first game process to which the target entity belongs;
[0184] Determine a target routing group from a plurality of existing routing groups, where each of the routing groups includes at least one routing node;
[0185] Send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group;
[0186] If it is determined that the first routing information has been successfully registered at each routing node of the target routing group, create the target entity in the first game process.
[0187] According to one or more embodiments of the present disclosure, a method for processing game entities is provided. Sending a routing registration request carrying the first routing information to the target routing group and determining whether the first routing information can be successfully registered at each routing node of the target routing group includes:
[0188] Sending the routing registration request to a target routing node in the target routing group and determining whether the first routing information can be successfully registered at the target routing node in the target routing group;
[0189] When it is determined that the first routing information can be successfully registered at the target routing node, storing the first routing information in the target routing node;
[0190] Forwarding the routing registration request to other routing nodes in the target routing group except the target routing node through the target routing node and determining whether the first routing information can be successfully registered at each of the other routing nodes.
[0191] According to one or more embodiments of the present disclosure, a method for processing game entities is provided. Determining whether the first routing information can be successfully registered at a target routing node in the target routing group includes:
[0192] Determining whether there is a record of the first routing information corresponding to the target entity and within the validity period in the routing table of the target routing node;
[0193] If there is no record of the first routing information, determining that the first routing information can be successfully registered at the target routing node;
[0194] If there is a record of the first routing information, determining that the first routing information cannot be successfully registered at the target routing node.
[0195] According to one or more embodiments of the present disclosure, a method for processing game entities is provided. Determining whether the first routing information can be successfully registered at a specified routing node in the following manner, where the specified routing node is a routing node among the other routing nodes:
[0196] Determining whether there is a record of the second routing information corresponding to the target entity and within the validity period in the routing table of the specified routing node;
[0197] If there is no record of the second routing information, determining that the first routing information can be successfully registered at the specified routing node;
[0198] If there is a record of the second routing information, comparing the priorities of the first routing information and the record of the second routing information;
[0199] If the priority of the first routing information is not higher than the priority recorded in the second routing information, it is determined that the first routing information cannot be successfully registered at the specified routing node;
[0200] If the priority of the first routing information is higher than the priority recorded in the second routing information, it is determined that the first routing information can be successfully registered at the specified routing node.
[0201] According to one or more embodiments of the present disclosure, a method for processing game entities is provided. The first routing information further includes first version information for indicating the version number of the first routing information and a first timestamp for indicating the registration initiation time of the first routing information. The second routing information record includes a second game identifier for indicating the game process, second version information for indicating the version number of the second routing information record, and a second timestamp for indicating the registration initiation time of the second routing information record;
[0202] The comparing the priorities of the first routing information and the second routing information record includes:
[0203] Based on a preset comparison rule, comparing the first routing information and the second routing information record to obtain a priority comparison result of the first routing information and the second routing information record;
[0204] Among them, the comparing the first routing information and the second routing information record includes at least one of the following: comparing the first game identifier and the second game identifier, comparing the first version information and the second version information, and comparing the first timestamp and the second timestamp.
[0205] According to one or more embodiments of the present disclosure, a method for processing game entities is provided. The method further includes:
[0206] After the step of sending a routing registration request carrying the first routing information to the target routing group, determine whether a routing change has occurred. The routing change includes a change in the routing group and / or a change in the routing node;
[0207] If the routing change occurs, return to the step of determining the target routing group from the existing multiple routing groups;
[0208] If the change has not occurred, then execute the step of determining whether the first routing information can be successfully registered at each routing node of the target routing group.
[0209] According to one or more embodiments of the present disclosure, a method for processing game entities is provided, and the method further includes:
[0210] In response to detecting that the target entity migrates from the first game process to the second game process, generate second routing information corresponding to the target entity after the migration, where the second routing information at least includes a third game identifier for indicating the second game process;
[0211] Send a routing change request carrying the second routing information to the target routing group, where the routing change request is used to change the routing information of the target entity in the target routing group to the second routing information.
[0212] According to one or more embodiments of the present disclosure, a method for processing game entities is provided, and the method further includes:
[0213] If there is a routing node in the target routing group that fails to successfully register the first routing information, determine that the routing registration request fails;
[0214] In the case of registration failure, send a routing cancellation request to the target routing group, where the routing cancellation request is used to delete the first routing information from the target routing group.
[0215] According to one or more embodiments of the present disclosure, a method for processing game entities is provided, and the method further includes:
[0216] For multiple existing routing groups, detect whether there is a faulty routing group or a faulty routing node that has an abnormality;
[0217] If there is the faulty routing group, restart the faulty routing group, and use the routing information corresponding to each entity in the existing game processes to restore the routing information in the faulty routing group;
[0218] If there is the faulty routing node, restart the faulty routing node, and use the routing tables of each routing node in the routing group where the faulty routing node is located to restore the routing information in the faulty routing node.
[0219] According to one or more embodiments of the present disclosure, a game entity processing device is provided, and the device includes:
[0220] A first determination module, configured to determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier for indicating a first game process to which the target entity belongs;
[0221] A second determination module, configured to determine a target routing group from multiple existing routing groups, where each of the routing groups includes at least one routing node;
[0222] A routing registration module, configured to send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group;
[0223] An entity creation module, configured to create the target entity in the first game process if it is determined that the first routing information has been successfully registered at each routing node of the target routing group.
[0224] According to one or more embodiments of the present disclosure, there is provided a computer-readable medium having a computer program stored thereon, and when the program is executed by a processing device, the steps of the game entity processing method provided in any embodiment of the present disclosure are implemented.
[0225] According to one or more embodiments of the present disclosure, there is provided an electronic device, including:
[0226] A storage device having a computer program stored thereon;
[0227] A processing device, configured to execute the computer program in the storage device to implement the steps of the game entity processing method provided in any embodiment of the present disclosure.
[0228] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features having similar functions disclosed in the present disclosure.
[0229] In addition, although the operations are depicted in a specific order, this should not be construed as requiring the operations to be performed in the specific order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0230] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method and will not be elaborated here.
Claims
1. A method for processing game entities, characterized in that, The method includes: Determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier for indicating a first game process to which the target entity belongs; Determine a target routing group from multiple existing routing groups, where each routing group includes at least one routing node; Send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group; If it is determined that the first routing information has been successfully registered at each routing node of the target routing group, create the target entity in the first game process; The sending a routing registration request carrying the first routing information to the target routing group and determining whether the first routing information can be successfully registered at each routing node of the target routing group includes: Send the routing registration request to a target routing node in the target routing group, and determine whether the first routing information can be successfully registered at the target routing node in the target routing group; When it is determined that the first routing information can be successfully registered at the target routing node, store the first routing information in the target routing node; Forward the routing registration request to other routing nodes in the target routing group except the target routing node through the target routing node, and determine whether the first routing information can be successfully registered at each of the other routing nodes.
2. The method according to claim 1, characterized in that The determining whether the first routing information can be successfully registered at the target routing node in the target routing group includes: Determine whether there is a record of the first routing information corresponding to the target entity and within the validity period in the routing table of the target routing node; If there is no record of the first routing information, determine that the first routing information can be successfully registered at the target routing node; If there is a record of the first routing information, determine that the first routing information cannot be successfully registered at the target routing node.
3. The method according to claim 1, wherein Determine whether the first routing information can be successfully registered at a specified routing node through the following method, where the specified routing node is a routing node among the other routing nodes: Determine whether there is a record of the second routing information corresponding to the target entity and within the validity period in the routing table of the specified routing node; If there is no record of the second routing information, determine that the first routing information can be successfully registered at the specified routing node; If there is a record of the second routing information, compare the priorities of the first routing information and the record of the second routing information; If the priority of the first routing information is not higher than the priority of the record of the second routing information, determine that the first routing information cannot be successfully registered at the specified routing node; If the priority of the first routing information is higher than the priority of the record of the second routing information, determine that the first routing information can be successfully registered at the specified routing node.
4. The method according to claim 3, wherein The first routing information further includes first version information for indicating the version number of the first routing information and a first timestamp for indicating the registration initiation time of the first routing information. The second routing information record includes a second game identifier for indicating the game process, second version information for indicating the version number of the second routing information record, and a second timestamp for indicating the registration initiation time of the second routing information record; Comparing the priorities of the first routing information and the second routing information record includes: Comparing the first routing information and the second routing information record based on a preset comparison rule to obtain a priority comparison result of the first routing information and the second routing information record; Among them, comparing the first routing information and the second routing information record includes at least one of the following: comparing the first game identifier and the second game identifier, comparing the first version information and the second version information, and comparing the first timestamp and the second timestamp.
5. The method according to claim 1, wherein The method further includes: After the step of sending a routing registration request carrying the first routing information to the target routing group, determining whether a routing change has occurred, where the routing change includes a change in the routing group and / or a change in the routing node; If the routing change occurs, return to the step of determining the target routing group from the existing multiple routing groups; If the change does not occur, then execute the step of determining whether the first routing information can be successfully registered on each routing node of the target routing group.
6. The method according to claim 1, wherein The method further includes: In response to detecting that the target entity migrates from the first game process to the second game process, generating second routing information corresponding to the target entity after migration, where the second routing information at least includes a third game identifier for indicating the second game process; Sending a routing change request carrying the second routing information to the target routing group, where the routing change request is used to change the routing information of the target entity in the target routing group to the second routing information.
7. The method according to claim 1, characterized in that The method further includes: If there is a routing node in the target routing group that cannot successfully register the first routing information, determining that the routing registration request fails; In the case of a registration failure, sending a routing cancellation request to the target routing group, where the routing cancellation request is used to delete the first routing information from the target routing group.
8. The method according to claim 1, characterized in that, The method further includes: For the existing multiple routing groups, detecting whether there is a faulty routing group or a faulty routing node that has an abnormality; If the faulty routing group exists, restarting the faulty routing group and restoring the routing information in the faulty routing group using the routing information corresponding to each entity in the existing game process; If the faulty routing node exists, restarting the faulty routing node and restoring the routing information in the faulty routing node using the routing tables of the routing nodes in the routing group where the faulty routing node is located.
9. A game entity processing device, characterized in that, The device includes: A first determination module, configured to determine first routing information of a target entity to be created, where the first routing information at least includes a first game identifier for indicating a first game process to which the target entity belongs; A second determination module, configured to determine a target routing group from a plurality of existing routing groups, where each of the routing groups includes at least one routing node; A routing registration module, configured to send a routing registration request carrying the first routing information to the target routing group, and determine whether the first routing information can be successfully registered at each routing node of the target routing group; An entity creation module, configured to create the target entity in the first game process if it is determined that the first routing information has been successfully registered at each routing node of the target routing group; The routing registration module includes: A first processing sub-module, configured to send the routing registration request to a target routing node in the target routing group, and determine whether the first routing information can be successfully registered at the target routing node in the target routing group; A storage sub-module, configured to store the first routing information in the target routing node if it is determined that the first routing information can be successfully registered at the target routing node; A second processing sub-module, configured to forward the routing registration request to other routing nodes in the target routing group except the target routing node through the target routing node, and determine whether the first routing information can be successfully registered at each of the other routing nodes.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by a processing device, the steps of the method according to any one of claims 1-8 are implemented.
11. An electronic device, characterized in that, Including: A storage device, on which a computer program is stored; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1-8.
Citation Information
Patent Citations
Online game acceleration method and system based on router and VPN (Virtual Private Network) servers
CN106730835A
Data transmission method and device
CN113473536A