Address-based event distribution method and apparatus, electronic device, and storage medium

CN116943144BActive Publication Date: 2026-09-08NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310835026.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2026-09-08
Estimated Expiration
2043-07-07

AI Technical Summary

Technical Problem

在处理函数注册的相关技术中,事件分发器中对于注册的处理函数是以数组方式存储的,当事件发生时表现为依次调用处理函数,导致函数调用开销过大,容易造成服务器的崩溃

Benefits of technology

[0014] In this embodiment of the invention, the event address of the triggered target event is obtained by responding to the triggering command of the target event. The event address can be generated based on the parameter order and parameter values ​​of the event parameters of the target event. The generated event address and the corresponding processing function are pre-stored in the event dispatcher. At this time, the processing function associated with the target event can be obtained based on the event address, and the corresponding processing function can be called to process the triggered target event accordingly, thereby realizing the event distribution. By calling the processing function related to a triggered target event based on the event address, the total number of event processing function calls is reduced, and the problem of slow or even unresponsive server response is solved by reducing the number of times the event processing function is called, thus improving the efficiency of event distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116943144B_ABST
    Figure CN116943144B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an address-based event distribution method and device, electronic equipment and a storage medium. The method comprises: in response to a trigger instruction of a target event, obtaining an event address of the target event; the event address is generated based on a parameter order and a parameter value of an event parameter of the target event, and the event address is associated with a processing function of the target event and registered; the processing function registered in association is obtained according to the event address, and the processing function is called to perform corresponding processing on the target event. By calling the processing function associated with a triggered target event based on the event address, the total amount of event processing function calls is reduced, and the number of event processing function calls is reduced, thereby solving the problem of slow or even no response of the server, and improving the efficiency of event distribution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and in particular to an address-based event distribution method, an address-based event distribution device, a corresponding electronic device, and a corresponding computer-readable storage medium. Background Technology

[0002] In online game servers, events that happen within the game are usually called events, such as receiving a quest, clicking on a quest, completing a quest, entering a scene, etc. There are many types of these events, which can result in as many as tens of thousands of events occurring per minute on a game server.

[0003] For event handling, the main approach involves pre-registering the relevant event handling functions into the event dispatcher. This allows the dispatcher to call the corresponding handling function when an event occurs. However, in the technology related to handling function registration, the event dispatcher stores the registered handling functions in an array. When an event occurs, these functions are called sequentially, leading to excessive function call overhead and potentially causing server crashes. Summary of the Invention

[0004] In view of the above problems, embodiments of the present invention are proposed to provide an address-based event distribution method, an address-based event distribution device, a corresponding electronic device, and a corresponding computer-readable storage medium to overcome or at least partially solve the above problems.

[0005] This invention discloses an address-based event dispatch method, the method comprising:

[0006] In response to the triggering command of the target event, the event address of the target event is obtained; the event address is generated based on the parameter order and parameter value of the event parameters of the target event, and the event address is associated with the processing function of the target event and registered.

[0007] Obtain the associated registered processing function based on the event address, and call the processing function to process the target event accordingly.

[0008] This invention also discloses an address-based event distribution device, the device comprising:

[0009] The event address acquisition module is used to respond to the triggering command of the target event and acquire the event address of the target event; the event address is generated based on the parameter order and parameter value of the event parameters of the target event, and the event address is associated with the processing function of the target event.

[0010] The processing function call module is used to obtain the associated registered processing function based on the event address, and call the processing function to process the target event accordingly.

[0011] This invention also discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements any of the address-based event dispatch methods described above.

[0012] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the address-based event dispatch methods described above.

[0013] The embodiments of the present invention have the following advantages:

[0014] In this embodiment of the invention, the event address of the triggered target event is obtained by responding to the triggering command of the target event. The event address can be generated based on the parameter order and parameter values ​​of the event parameters of the target event. The generated event address and the corresponding processing function are pre-stored in the event dispatcher. At this time, the processing function associated with the target event can be obtained based on the event address, and the corresponding processing function can be called to process the triggered target event accordingly, thereby realizing the event distribution. By calling the processing function related to a triggered target event based on the event address, the total number of event processing function calls is reduced, and the problem of slow or even unresponsive server response is solved by reducing the number of times the event processing function is called, thus improving the efficiency of event distribution. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the steps of an embodiment of an address-based event dispatching method according to the present invention.

[0016] Figure 2 This is a flowchart illustrating the steps of another embodiment of the address-based event distribution method of the present invention;

[0017] Figure 3 This is a schematic diagram of an application scenario for address-based event distribution provided in an embodiment of the present invention;

[0018] Figure 4 This is a structural block diagram of an embodiment of an address-based event distribution device according to the present invention. Detailed Implementation

[0019] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0020] The main process for handling events involves pre-registering the relevant event handling functions into the event dispatcher. This allows the event dispatcher to call the corresponding handling function to perform the appropriate processing when an event occurs, which is known as event dispatching.

[0021] In the related technologies for registering handler functions, the event dispatcher stores the registered handler functions in an array, as shown in Table 1 below:

[0022] Event handling function 2 Event handling function 3 ……

[0023] Table 1

[0024] When an event occurs, the processing functions are called sequentially, such as time processing function 1, time processing function 2, time processing function 3, etc. For example, assuming the game server generates 300,000 events per minute, and the average number of processing functions for these events is 50, then the game server needs to make 15 million function calls per minute. The excessive function call overhead can easily overwhelm the server, causing the game server to take too long to respond to requests, or even become unresponsive, which is detrimental to the normal operation of the online game.

[0025] This invention reduces the total number of event handling function calls by calling the relevant processing function of a triggered target event based on the event address. By reducing the number of times the event handling function is called, the problem of slow server response or even no response is solved, thereby improving the efficiency of event distribution.

[0026] Reference Figure 1 The diagram illustrates a flowchart of an embodiment of an address-based event dispatch method according to the present invention, which may specifically include the following steps:

[0027] Step 101: Respond to the trigger command of the target event and obtain the event address of the target event;

[0028] In online game servers, events that occur within the game are called events. Events can be of many types, including but not limited to events such as obtaining a quest, clicking on a quest, completing a quest, entering a scene, and leveling up.

[0029] A target event refers to one or more game events triggered by a player. It can be any or some of the game events that may occur during the game, or any or some of the preset game events that are registered with the event dispatcher in advance.

[0030] Trigger commands are primarily generated based on player actions towards target events. This manifests as the game client generating corresponding triggers based on player responses to specific game events, such as receiving a quest, clicking a quest, completing a quest, entering a scene, or leveling up. In other words, the generation of a trigger command signifies the occurrence of an event. In practical applications, the game client can send the generated trigger command for the target event to the game server, allowing the server to respond and perform logical processing of the target event.

[0031] The game server's logical processing of the triggered target event is manifested in calling the corresponding processing function to perform the appropriate processing on the target event.

[0032] In some embodiments of the present invention, in order to reduce the total number of event handling function calls, the handling functions related to the target event can be associated and registered based on the event address when the target event is registered to the event dispatcher in advance. Based on the associated and registered event address, only the handling function of a certain task ID or a certain type of task is considered. By reducing the number of event handling function calls, the problem of slow server response or even no response is solved, thereby improving the efficiency of event dispatch.

[0033] Event addresses allow subsequent calls to handler functions to focus only on those related to the target event. When a game server responds to the trigger command of a target event, it can obtain the event address of the target event so that it can subsequently call the corresponding handler function based on the obtained event address, thereby reducing the total number of event handler function calls.

[0034] The event address is mainly generated based on the parameter order and parameter values ​​of the target event's event parameters. The event address and the target event's handling function can be associated and registered in the event dispatcher. When an event is registered, an event handling function can correspond to at most one event address. If an event handling function needs to follow two or more event addresses, that is, the same event handling function needs to be associated and registered with two or more event addresses, it can be achieved by having two or more event handling functions correspond to each event address respectively.

[0035] It should be noted that, typically, a gameplay mode that focuses on one event can register the event handling function to the event dispatcher. When multiple gameplay modes focus on the same event and the same event address, each gameplay mode needs to independently register its own event handling function. This embodiment of the invention does not impose any restrictions on this.

[0036] Step 102: Obtain the associated registered processing function based on the event address, and call the processing function to process the target event accordingly.

[0037] The event address of the target event and the processing function of the target event are registered in the event dispatcher. In some embodiments of the present invention, the game server can obtain the associated registered processing function based on the event address and call the obtained processing function to process the target event accordingly, so as to realize the event dispatcher's distribution and processing of the target event.

[0038] In practical applications, the distribution and processing of target events is carried out by the game server in response to the triggering instructions of the target events. The triggering instructions are generated by the player through the game client when triggering the target events, such as obtaining a task, clicking a task, completing a task, entering a scene, or leveling up. After the game server calls the processing function in response to the target event, the game client can present the processing results based on the processing function to the player. For example, if the player triggers an obtaining a task event, after calling the corresponding processing function for obtaining a task event, the game client's game interface can present the task obtaining process and the obtained task result to the player. Similarly, if the player triggers a player leveling up event, after calling the corresponding processing function for player leveling up event, the game client's game interface can present the player leveling up process and the player leveling up result, etc. This embodiment of the invention does not impose any limitations on this.

[0039] In this embodiment of the invention, the event address of the triggered target event is obtained by responding to the triggering command of the target event. The event address can be generated based on the parameter order and parameter values ​​of the event parameters of the target event. The generated event address and the corresponding processing function are pre-stored in the event dispatcher. At this time, the processing function associated with the target event can be obtained based on the event address, and the corresponding processing function can be called to process the triggered target event accordingly, thereby realizing the event distribution. By calling the processing function related to a triggered target event based on the event address, the total number of event processing function calls is reduced, and the problem of slow or even unresponsive server response is solved by reducing the number of times the event processing function is called, thus improving the efficiency of event distribution.

[0040] Reference Figure 2 The diagram illustrates a flowchart of another embodiment of the address-based event dispatch method of the present invention, which may specifically include the following steps:

[0041] Step 201: Generate event addresses for preset game events;

[0042] In this embodiment of the invention, in order to reduce the total number of event handling function calls, when registering the preset game event to the event dispatcher, the handling functions related to the preset game event can be associated and registered based on the event address. Based on the associated and registered event address, only the handling function of a certain task ID or a certain type of task is considered. By reducing the number of event handling function calls, the problem of slow server response or even no response is solved, thereby improving the efficiency of event distribution.

[0043] Among them, the preset game events can be all game events that may occur during the game, and can include events of various types, such as obtaining a task, clicking on a task, completing a task, entering a scene, and leveling up.

[0044] In some embodiments of the present invention, in order to associate the event address and processing function of the preset game event when registering the preset game event, the event address of the preset game event can first be constructed, that is, the event address of the preset game event can be generated.

[0045] In a game server, for each type of event, the number of event parameters, the numerical type of the event parameters, and the representative meaning of the event parameters are fixed. That is, different event trigger functions exist for different event types. The event parameters contained in different event trigger functions may be the same or different. Generally speaking, among the multiple event parameters contained in a certain event trigger function, there may be one or two event parameters that are the same as those in other trigger functions. However, there is no other event trigger function that has all the event parameters contained in a certain event trigger function and the order of the event parameters is exactly the same. The definition of event types and event parameters can be determined mainly according to the actual needs of the application. This embodiment of the invention does not impose any restrictions on this.

[0046] Therefore, the creation of event addresses can be mainly achieved by obtaining the event trigger functions of preset game events, and then implementing the process based on the obtained event trigger functions. Each type of event has its own independent event address.

[0047] Specifically, different event types have different event trigger functions. The event types of preset game events can be obtained, and then the event trigger functions of each game event can be obtained based on each event type. The obtained event trigger functions can contain at least one event parameter. At this time, the parameter order and parameter value of each event parameter can be obtained, and the event address for the preset game event can be generated based on the parameter order and parameter value of each event parameter.

[0048] In practical applications, the event parameters used to construct the event address must be simple numeric types, not complex data types. In this case, the numeric types of each event parameter can be obtained, and at least one target event parameter whose numeric type satisfies a preset numeric type can be identified. The preset numeric type is a simple numeric type, such as integer, string, or boolean. Then, at least one target event parameter whose numeric type satisfies the preset numeric type can be responded to. The parameter order and parameter value of each target event parameter that satisfies the preset numeric type can be obtained. Using the parameter order and parameter value of each target event parameter, the event address for the preset game event can be generated.

[0049] The parameter order can be used to indicate the position of the event parameter in the corresponding event triggering function.

[0050] When generating an event address using the parameter order and values ​​of the target event parameters, the event address can be created using characters not used to represent the event parameters as separators between the parameter order and values. As an example, the character used as a separator could be a colon.

[0051] For example, let's take the task completion event as an example of the preset game event types, and assume its event trigger function is as follows:

[0052] FinishTaskEvent(UserObj,TaskId,TaskType)

[0053] In this context, UserObj refers to the player object, TaskId refers to the task ID, and TaskType is the task type. The first parameter of this type of event is the numeric type of UserObj, which is a complex data type and cannot be used to form event parameters; the second parameter TaskId and the third parameter TaskType are simple numeric types and can be used to form the event address.

[0054] When an event with TaskId of 12345 and TaskType of 10 occurs, two event addresses can be generated:

[0055] In "2:12345", the 2 before the colon indicates that it is the second parameter, that is, the parameter order is 2, and the 12345 after the colon indicates that it is the value of the second parameter; and in "3:10", the 3 before the colon indicates that it is the third parameter, that is, the parameter order is 3, and the 10 after the colon indicates that it is the value of the third parameter.

[0056] Therefore, when calling the event handling function in the previous example, you only need to look for the handling function with event addresses "2:12345" and "3:10" in the event dispatcher.

[0057] Step 202: Obtain the processing function of the preset game event, and register the event address of the preset game event and the processing function of the preset game event with the event dispatcher;

[0058] The processing function is used to implement the logical processing of the triggered event, and the event dispatcher is used to perform event dispatch operations when a game event occurs. The event dispatch operation is manifested as a call to the processing function. Specifically, the execution of the event dispatch operation is based on registering preset game events with the event dispatcher.

[0059] After constructing the event address for each preset game event based on the parameter order and parameter value, when registering the preset game event with the event dispatcher, the event address and the preset game event processing function can be obtained after acquiring the processing function of the preset game event.

[0060] In one embodiment of the present invention, the associated registration of event address and processing function is manifested in that when a preset game event is registered to the event dispatcher, the event address of the preset game event and the processing function of the preset game event can be associated and stored.

[0061] Specifically, when registering a preset game event to the event dispatcher, the event registration table EventFuncTable of the preset game event can be obtained. Then, the event address of the preset game event and the processing function of the preset game event can be associated and stored in the event registration table EventFuncTable of the preset game event.

[0062] For example, taking the aforementioned task completion event as an example, assume that the event address registered by gameplay A and gameplay B is "3:10", and their event handling functions are AFunc and B Func respectively; the event address registered by gameplay C is "2:12345", and its event handling function is C Func; the event address registered by gameplay D is "2:56789", and its event handling function is DFunc.

[0063] Therefore, when registering the association between the event address and the handler function, the data in EventFuncTable after registration can be represented as follows:

[0064]

[0065] When an event is registered, an event handler function can correspond to at most one event address. If an event handler function needs to follow two or more event addresses, that is, the same event handler function needs to be associated with two or more event addresses for registration, it can be achieved by having two or more event handler functions correspond to each event address respectively.

[0066] It should be noted that, typically, a gameplay mode that focuses on one event can register the event handling function to the event dispatcher. When multiple gameplay modes focus on the same event and the same event address, each gameplay mode needs to independently register its own event handling function. This embodiment of the invention does not impose any restrictions on this.

[0067] Step 203: Respond to the triggering command of the target event, obtain the event address of the target event, and process the target event accordingly by calling the processing function registered with the target event.

[0068] In practical applications, when players trigger target events through the game client, such as receiving a quest, clicking a quest, completing a quest, entering a scene, or leveling up, they can generate trigger commands for the target event and send the generated trigger commands to the game server so that the game server can respond to the trigger commands and perform logical processing of the target event.

[0069] The target event refers to one or more game events triggered by the player. It can be any one or some of the game events that may occur during the game, that is, any one or some of the preset game events that are registered to the event dispatcher in advance.

[0070] The game server's logical processing of the triggered target event is manifested in calling the corresponding processing function to perform the appropriate processing on the target event.

[0071] In some embodiments of the present invention, in order to reduce the total number of event handling function calls, when the game server responds to the triggering instruction of the target event, it can obtain the event address of the target event and call the corresponding handling function based on the obtained event address. Based on the associated registered event address, it only focuses on the handling function of a certain task ID or a certain type of task. By reducing the number of event handling function calls, the problem of slow server response or even no response is solved, thereby improving the efficiency of event distribution.

[0072] Specifically, during the game server's response to the trigger command, the process of obtaining the event address of the target event can be represented as obtaining the event trigger function of the target event. The obtained event trigger function contains at least one event parameter. At this time, the event address of the target event can be generated based on the parameter order and parameter value of the at least one event parameter. The specific process of constructing the event address can be referred to the foregoing content, and will not be elaborated here in this embodiment of the invention.

[0073] During the process of the game server responding to the trigger command, the process of calling the processing function of the target event can be represented as responding to the target event address that has an associated registered processing function in at least one event address, obtaining the target processing function corresponding to the target event address, and calling the target processing function to process the target event accordingly.

[0074] In practical applications, the distribution and processing of target events is carried out by the game server in response to the triggering instructions of the target events. The triggering instructions are generated by the player through the game client when triggering the target events, such as obtaining a task, clicking a task, completing a task, entering a scene, or leveling up. After the game server calls the processing function in response to the target event, the game client can present the processing results based on the processing function to the player. For example, if the player triggers an obtaining a task event, after calling the corresponding processing function for obtaining a task event, the game client's game interface can present the task obtaining process and the obtained task result to the player. Similarly, if the player triggers a player leveling up event, after calling the corresponding processing function for player leveling up event, the game client's game interface can present the player leveling up process and the player leveling up result, etc. This embodiment of the invention does not impose any limitations on this.

[0075] For example, when a target event occurs, a few event addresses can be generated based on the actual parameters of the target event. Then, a small number of corresponding processing functions can be found and called based on these event addresses. Taking the aforementioned task completion event as an example, its event triggering function is as follows:

[0076] FinishTaskEvent(UserObj,TaskId,TaskType)

[0077] In this context, UserObj refers to the player object, TaskId refers to the task ID, and TaskType is the task type. The first parameter of this type of event is the numeric type of UserObj, which is a complex data type and cannot be used to form event parameters; the second parameter TaskId and the third parameter TaskType are simple numeric types and can be used to form the event address.

[0078] Assuming TaskId is 54321 and TaskType is 11, then the two event addresses of the current event can be "2:12345" and "3:11". Taking the data in the EventFuncTable above as an example, all the registered function data are as follows:

[0079]

[0080]

[0081] Therefore, the first event address "2:12345" has only one event handler function, CFunc, which is called. The second event address "3:11" has no event handler function. This means that when the event is triggered, the event dispatcher only calls the handler function CFunc registered with the event address "2:12345," and does not need to call other handler functions registered without being associated with the event address. This reduces the number of times event handler functions are called, thereby solving the problem of slow server response or even no response, and improving the efficiency of event dispatch.

[0082] In this embodiment of the invention, by calling the processing function related to a triggered target event based on the event address, the total number of event processing function calls is reduced, and by reducing the number of times the event processing function is called, the problem of slow server response or even no response is solved, thereby improving the efficiency of event distribution.

[0083] Reference Figure 3 This diagram illustrates an application scenario of address-based event distribution provided by an embodiment of the present invention, involving a game client 310 and a game server 311. The game server 311 uses a game engine architecture, and the specific execution object of event distribution can be the event dispatcher 31 of the game engine.

[0084] In this application scenario, when players trigger events through the game client 310, such as receiving a task, clicking a task, completing a task, entering a scene, or leveling up, they can generate trigger commands for the event and send the generated trigger commands to the game server 311 so that the game server 312 can respond to the trigger commands and realize the logical processing of the target event.

[0085] The game server 311 handles the triggered events logically by calling the corresponding processing function to process the target event.

[0086] To reduce the total number of event handling function calls, event-related handling functions can be associated with each other based on the event address when the event is registered to the event dispatcher 31. Based on the associated event address, only the handling function of a certain task ID or a certain type of task is considered. By reducing the number of event handling function calls, the problem of slow or even no server response can be solved, thereby improving the efficiency of event dispatch.

[0087] At this point, when game server 311 responds to the event trigger command, it can obtain the event address and call the corresponding processing function based on the obtained event address.

[0088] During the execution of the game engine program, when an event occurs, an event address is generated based on the actual parameters of the event, and then the corresponding processing function is found based on the event address. This process is usually limited. The result presented to the player in the game client 310 is the processing result of the triggered event, which typically manifests as a game scene presented to the user after processing based on the event function. For example, assuming the player triggers a quest acquisition event, after calling the corresponding processing function for the quest acquisition event, the game client's game interface can present the quest acquisition process and the acquired quest result to the player. Similarly, assuming the player triggers a player level-up event, after calling the corresponding processing function for the player level-up event, the game client's game interface can present the player's level-up process and the level-up result, etc. This embodiment of the invention does not impose any limitations on this.

[0089] It should be noted that the specific process of constructing the event address, the specific process of registering the event based on the event address, and the specific process of distributing the event based on the event address can be referred to the relevant content in the foregoing method embodiment section, and will not be repeated here in the embodiments of the present invention.

[0090] In this embodiment of the invention, by calling the processing function related to a triggered target event based on the event address, the total number of event processing function calls is reduced, and by reducing the number of times the event processing function is called, the problem of slow server response or even no response is solved, thereby improving the efficiency of event distribution.

[0091] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0092] Reference Figure 4 The diagram illustrates a structural block diagram of an address-based event distribution device according to an embodiment of the present invention, which may specifically include the following modules:

[0093] The event address acquisition module 401 is used to respond to the triggering command of the target event and acquire the event address of the target event; the event address is generated based on the parameter order and parameter value of the event parameters of the target event, and the event address is associated with the processing function of the target event.

[0094] The processing function call module 402 is used to obtain the associated registered processing function according to the event address, and call the processing function to process the target event accordingly.

[0095] In one embodiment of the present invention, the event address acquisition module 401 may include the following sub-modules:

[0096] The event triggering function acquisition submodule is used to acquire the event triggering function of the target event; the event triggering function contains at least one event parameter;

[0097] The event address generation submodule is used to generate the event address of the target event based on the parameter order and parameter value of the at least one event parameter.

[0098] In one embodiment of the present invention, the event address includes at least one event address; the processing function call module 402 may include the following sub-modules:

[0099] The processing function call submodule is used to respond to the target event address of the at least one event address that has an associated registered processing function, obtain the target processing function corresponding to the target event address, and call the target processing function to process the target event accordingly.

[0100] In one embodiment of the present invention, before the triggering instruction for the target event, the address-based event distribution device provided in this embodiment may further include the following modules:

[0101] The event address generation module is used to generate event addresses for preset game events and obtain the processing functions for the preset game events;

[0102] The event registration module is used to associate and register the event address of the preset game event and the processing function of the preset game event with the event dispatcher; the event dispatcher is used to perform event dispatching operations when the game event occurs.

[0103] In one embodiment of the present invention, the event address generation module may include the following sub-modules:

[0104] The event trigger function acquisition submodule is used to acquire the event trigger function of the preset game event; the event trigger function contains at least one event parameter;

[0105] The parameter information acquisition submodule is used to obtain the parameter order and parameter value of each event parameter;

[0106] The event address generation submodule is used to generate event addresses for preset game events based on the parameter order and parameter values ​​of each event parameter.

[0107] In one embodiment of the present invention, the parameter order is used to indicate the position of the event parameter in the corresponding event triggering function; the event address generation submodule may include the following units:

[0108] The numeric type acquisition unit is used to obtain the numeric type of each event parameter;

[0109] The parameter information acquisition unit is used to respond to at least one target event parameter among multiple event parameters whose numerical type satisfies a preset numerical type, and to acquire the parameter order and parameter value of each target event parameter.

[0110] The event address generation unit is used to generate an event address for a preset game event by using the parameter order and parameter value of each target event parameter.

[0111] In one embodiment of the present invention, the event registration module may include the following sub-modules:

[0112] The associated storage submodule is used to register the preset game event to the event dispatcher and associate the event address of the preset game event with the processing function of the preset game event.

[0113] In this embodiment of the invention, the address-based event distribution device obtains the event address of the triggered target event by responding to the triggering command of the target event. The event address can be generated based on the parameter order and parameter values ​​of the event parameters of the target event, and the generated event address and the corresponding processing function are pre-stored in the event distributor. At this time, the processing function associated with the target event can be obtained based on the event address, and the corresponding processing function can be called to process the triggered target event accordingly, thereby realizing event distribution. By calling the processing function related to a triggered target event based on the event address, the total number of event processing function calls is reduced, and the number of event processing function calls is reduced, thereby solving the problem of slow server response or even no response, and improving the efficiency of event distribution.

[0114] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0115] This invention also provides an electronic device, comprising:

[0116] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described address-based event dispatch method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0117] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described address-based event dispatch method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0118] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0119] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0120] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0121] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0123] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0124] Finally, 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, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0125] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0126] The foregoing has provided a detailed description of an address-based event distribution method, an address-based event distribution device, a corresponding electronic device, and a corresponding computer-readable storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An address-based event dispatch method, characterized in that, The method includes: In response to the triggering command of the target event, the event address of the target event is obtained; the event address is generated based on the parameter order and parameter value of the event parameters of the target event, and the event address is associated with the processing function of the target event and registered. Obtain the associated registered processing function based on the event address, and call the processing function to process the target event accordingly.

2. The method according to claim 1, characterized in that, The triggering instruction for the target event, and obtaining the event address of the target event, include: Obtain the event triggering function for the target event; the event triggering function contains at least one event parameter; The event address of the target event is generated based on the parameter order and parameter value of the at least one event parameter.

3. The method according to claim 1, characterized in that, The event address includes at least one event address; the step of obtaining the associated registered processing function based on the event address and calling the processing function to process the target event accordingly includes: In response to the existence of a target event address associated with a registered processing function in at least one event address, the target processing function corresponding to the target event address is obtained, and the target processing function is called to process the target event accordingly.

4. The method according to any one of claims 1 to 3, characterized in that, Prior to the triggering instruction for the target event, the following is also included: Generate an event address for a preset game event and obtain the processing function for the preset game event; The event address of the preset game event and the processing function of the preset game event are associated and registered with the event dispatcher; the event dispatcher is used to perform event dispatching operations when a game event occurs.

5. The method according to claim 4, characterized in that, The generation of event addresses for preset game events includes: Obtain the event trigger function for the preset game event; the event trigger function contains at least one event parameter; Obtain the parameter order and parameter value of each event parameter; Based on the parameter order and parameter value of each event parameter, an event address for a preset game event is generated.

6. The method according to claim 5, characterized in that, The parameter order is used to indicate the position of the event parameter in the corresponding event triggering function; The step of generating an event address for a preset game event based on the parameter order and parameter value of each event parameter includes: Get the numeric type of each event parameter; Respond to at least one target event parameter whose numeric type satisfies a preset numeric type among multiple event parameters, and obtain the parameter order and parameter value of each target event parameter; Using the parameter order and parameter values ​​of each target event parameter, an event address for a preset game event is generated.

7. The method according to claim 4, characterized in that, The step of associating and registering the event address and the processing function of the preset game event with the event dispatcher includes: The preset game events are registered to the event dispatcher, and the event addresses and processing functions of the preset game events are associated and stored together.

8. An address-based event distribution device, characterized in that, The device includes: The event address acquisition module is used to respond to the triggering command of the target event and acquire the event address of the target event; the event address is generated based on the parameter order and parameter value of the event parameters of the target event, and the event address is associated with the processing function of the target event. The processing function call module is used to obtain the associated registered processing function based on the event address, and call the processing function to process the target event accordingly.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the address-based event dispatch method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the address-based event dispatch method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Game system and method for controlling game system, game server device therefor, and game device therefor

    CA2585765A1

  • Event processing method in system and related devices

    CN112084044A