Game data binding processing method and device, electronic equipment and storage medium

CN122412047BActive Publication Date: 2026-10-20GUANGZHOU YIYU NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610511664.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-17
Publication Date
2026-10-20
Estimated Expiration
2046-04-17

AI Technical Summary

Technical Problem

[0004]但是,本申请发明人在游戏项目开发过程中发现:相关技术对游戏数据的绑定操作通常只能绑定单一数据,无法绑定嵌套数据,也无法做到多数据同时绑定,因此相关技术的绑定处理方法,数据绑定的适用性差,也降低了游戏开发效率

Benefits of technology

在本申请中,响应于包含绑定对象的数据绑定请求,获取所述绑定对象关联的游戏数据;调用预先创建的绑定器执行代理函数;根据所述代理函数在执行过程中对至少一个游戏数据的访问行为,为所述绑定对象和所述游戏数据构建数据绑定关系,以使所述游戏数据发生变化时,基于所述数据绑定关系更新对应的绑定对象。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122412047B_ABST
    Figure CN122412047B_ABST
Patent Text Reader

Abstract

The application relates to a game data binding processing method and device, electronic equipment and a storage medium. The method comprises the following steps: in response to a data binding request containing a binding object, obtaining game data associated with the binding object; calling a pre-created binder to execute a proxy function; according to the access behavior of at least one game data in the execution process of the proxy function, constructing a data binding relationship for the binding object and the game data, so that when the game data changes, the corresponding binding object is updated based on the data binding relationship. The scheme provided by the application can significantly improve the applicability of game data binding and the game development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software development and design technology, and in particular to methods, devices, electronic devices and storage media for game data binding processing. Background Technology

[0002] As the gaming market continues to expand and game genres become increasingly diverse, the complexity of the data that gaming systems need to process also increases.

[0003] Unity, a widely used cross-platform game engine, is primarily used for developing 2D games, 3D games, and real-time interactive content. Currently, game development frameworks based on the Unity game engine involve binding game data, such as binding UI (User Interface) data.

[0004] However, the inventors of this application discovered during the game project development process that: related technologies can usually only bind single data, cannot bind nested data, and cannot bind multiple data at the same time. Therefore, the binding processing methods of related technologies have poor applicability of data binding and reduce game development efficiency. Summary of the Invention

[0005] To address or partially address the problems existing in related technologies, this application provides a game data binding processing method, apparatus, electronic device, and storage medium, which can improve the applicability of game data binding and the efficiency of game development.

[0006] The first aspect of this application provides a game data binding processing method, including: In response to a data binding request containing a bound object, obtain the game data associated with the bound object; Invoke the pre-created binder to execute the proxy function; Based on the proxy function's access to at least one piece of game data during execution, a data binding relationship is established between the bound object and the game data, so that when the game data changes, the corresponding bound object is updated based on the data binding relationship.

[0007] In one instance, the creation process of the binder is as follows: Predefined callback functions and calculation functions for processing the bound object and the game data; Create a binding function and configure the parameter structure of the binding function so that the binding function receives the callback function and the calculation function according to the parameter structure; Configure the binding function to the binder to complete the creation of the binder.

[0008] In one instance, the invocation of a pre-created binder to execute a proxy function includes: Invoke a pre-configured binder, which is used to create a proxy function based on the callback function and the compute function in the binding function; When the binder enters the observer state, the proxy function is executed.

[0009] In one instance, establishing a data binding relationship between the bound object and the game data based on the proxy function's access to at least one piece of game data during execution includes: Based on the proxy function's access behavior to game data during execution, the currently accessed game data is determined. Record the dependencies between the proxy function and at least one currently accessed game data; According to the dependency relationship, the proxy function is stored in the callback list corresponding to the currently accessed game data, thereby generating a data binding relationship between the bound object and the game data; The data binding relationship includes one-to-one binding relationship and / or one-to-many binding relationship.

[0010] In one instance, the binder includes a parent binder and multiple child binders that inherit from the parent binder, with a one-to-many association between the parent binder and the child binders; The method further includes: When the parent binder performs the destruction task, it recursively calls the destruction function corresponding to each child binder to clear the data binding relationship corresponding to each child binder.

[0011] In one instance, updating the corresponding bound object based on the data binding relationship includes: Based on the data binding relationship, determine the proxy function associated with the changed game data; The updated game data is obtained through the calculation function of the proxy function, and the callback function of the proxy function is called to update the corresponding bound object.

[0012] In one instance, the data binding request includes a response pattern label, and the method further includes: If the response mode label is a synchronous execution label, then the proxy function is executed immediately; If the response mode label is an asynchronous execution label, then the proxy function is added to the task queue, and each proxy function in the task queue is executed in batches.

[0013] A second aspect of this application provides a game data binding processing apparatus, comprising: The data binding request module is used to respond to a data binding request containing a binding object and obtain the game data associated with the binding object; The binder invocation module is used to invoke pre-created binders to execute proxy functions; The data binding processing module is used to construct a data binding relationship between the binding object and the game data based on the access behavior of the proxy function to at least one piece of game data during the execution process, so that when the game data changes, the corresponding binding object is updated based on the data binding relationship.

[0014] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.

[0015] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.

[0016] The fifth aspect of this application provides a computer program product comprising computer instructions that, when executed by a processor, implement the method described above.

[0017] The technical solution provided in this application may include the following beneficial results: In this application, in response to a data binding request containing a binding object, game data associated with the binding object is obtained; a pre-created binder is invoked to execute a proxy function; and a data binding relationship is constructed between the binding object and the game data based on the access behavior of the proxy function to at least one piece of game data during execution, so that when the game data changes, the corresponding binding object is updated based on the data binding relationship.

[0018] Compared with related technologies, the technical solution of this application is as follows: by calling a pre-created binder to execute a proxy function, the access behavior of the proxy function to game data is automatically recorded. Based on the access behavior, data binding relationships are generated efficiently and accurately. If multiple game data are accessed during execution, a dependency relationship can be formed with multiple game data, that is, it supports the establishment of binding relationships for nested data. This process not only reduces the amount of code that developers write manually, but also can directly drive the update of the binding object based on the data binding relationship, realize the automatic transmission process from data changes to the update of the binding object, effectively reduce the degree of code redundancy, and thus significantly improve the applicability of game data binding and game development efficiency.

[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0020] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.

[0021] Figure 1 This is a flowchart illustrating a game data binding processing method according to an embodiment of this application; Figure 2 This is another flowchart illustrating a game data binding processing method according to an embodiment of this application; Figure 3 This is a schematic diagram of the binder structure shown in an embodiment of this application; Figure 4 This is a schematic diagram of the binding process shown in the embodiments of this application; Figure 5 This is a schematic diagram of the structure of a responsive object shown in an embodiment of this application; Figure 6 This is a schematic diagram of the game data processing flow shown in the embodiments of this application; Figure 7 This is a schematic diagram of the UI interface binding process shown in the embodiments of this application; Figure 8 This is a schematic diagram of a game business architecture based on data binding relationships, as shown in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a game data binding processing device shown in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation

[0022] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.

[0023] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0024] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0025] As the gaming market continues to expand and game genres become increasingly diverse, the complexity of the data that gaming systems need to process also increases.

[0026] Unity, a widely used cross-platform game engine, is primarily used for developing 2D games, 3D games, and real-time interactive content. Currently, game development frameworks based on the Unity engine involve binding game data, such as UI (User Interface) data.

[0027] However, the inventors of this application discovered during the game project development process that: related technologies can usually only bind single data, cannot bind nested data, and cannot bind multiple data at the same time. Therefore, the binding processing methods of related technologies have poor applicability of data binding and reduce game development efficiency.

[0028] To address the aforementioned issues, this application provides a game data binding processing method that can significantly improve the applicability of game data binding and the efficiency of game development.

[0029] In this embodiment of the application, the game data binding processing method can run on a terminal device, which includes, but is not limited to, hardware devices with data display and data processing capabilities such as tablets, smartphones, and computers.

[0030] The terminal device can act as a client, which has the game application installed and provides a UI interface for displaying game content and receiving user input.

[0031] It should be understood that the game data binding processing method of this application can run on both the client side and the server side. When the game data binding processing method is applied to the client side, the game data binding processing logic is executed directly by the client locally, and the game screen is rendered based on the local execution result. When the game processing method is applied to the server side, the game data binding processing logic is executed by the server, and the processing result is sent to the client via the network. After receiving the processing result, the client renders the game screen.

[0032] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.

[0033] Figure 1 This is a flowchart illustrating the game data binding processing method shown in the embodiments of this application.

[0034] See Figure 1 It includes at least the following steps: Step 101: In response to a data binding request containing a bound object, obtain the game data associated with the bound object.

[0035] In this embodiment, the device terminal provides a UI interface, which includes various game interfaces, such as the main game interface, inventory interface, and mail interface. This application determines at least one bound object in the game interface and one or more game data associated with the bound object by responding to a data binding request from at least one game interface.

[0036] Optionally, a data binding request refers to a request used to perform data binding operations on at least one bound object in the game interface. In this application, the data binding request can be actively triggered by the developer, or the automatic triggering conditions can be set in advance. For example, the developer can actively initiate a data binding request during the game screen design phase, or the game system can automatically trigger a data binding request during the UI interface initialization phase.

[0037] The bound object refers to the game element or business logic identified from the game interface that is related to the data binding request. Examples include game items, character text components, game data display windows, game settings controls, task completion logic, experience leveling-up logic, etc.

[0038] Each bound object corresponds to one or more types of game data, thereby reflecting the game status.

[0039] The game data associated with a bound object refers to the data that is related to the display content or business logic of the bound object.

[0040] As an example, if the bound object is a text component displaying character attributes, its associated game data may include the character's health, level, attack power, etc. If the bound object is a component displaying item information for a player's account, its associated game data may include item name, item quantity, etc.

[0041] Step 102: Invoke the pre-created binder to execute the proxy function.

[0042] In this embodiment of the application, a binder for handling data binding relationships is pre-created. When a data binding request is received, the binder is called and its configured proxy function is used to access the associated game data, thereby automatically collecting dependencies.

[0043] Optionally, a binder refers to a container that manages the association between the UI interface and game data. The binder is configured by the developer to generate data binding relationships by executing a proxy function and based on the access behavior of the proxy function to game data during execution.

[0044] Step 103: Based on the proxy function's access behavior to at least one piece of game data during execution, construct a data binding relationship between the bound object and the game data, so that when the game data changes, the corresponding bound object is updated based on the data binding relationship.

[0045] In this embodiment, a data binding relationship can be established between the bound object and the game data based on the access behavior of the proxy function to at least one piece of game data during execution. When a change in the game data is detected, the corresponding bound object is updated based on the data binding relationship.

[0046] Optionally, access behavior refers to the act of reading and calling game data during the execution of a proxy function. For example, proxy function A reads game data 1, game data 2, and game data 3 sequentially during execution.

[0047] Data binding refers to the dependency relationship between game data and proxy functions established based on the proxy functions' access to game data, with a one-to-one correspondence between the proxy functions and the bound objects in the game screen. When game data changes, the proxy function is triggered based on the data binding relationship, thereby driving the update of the bound objects. For example, there is a one-to-many association between proxy function A and game data 1, game data 2, and game data 3.

[0048] If changes to game data are detected, the corresponding bound objects can be accurately updated through data binding relationships, thereby avoiding the need for developers to manually maintain the UI interface and business logic, thus reducing development costs and improving game development efficiency.

[0049] It is understandable that after the processing of steps 101 to 103, the game data, proxy functions, and bound objects are deeply bound together. Therefore, as long as the game data changes, the corresponding proxy function can be efficiently called based on the data binding relationship, thereby locating the corresponding bound object and updating the bound object in a targeted manner according to the changed game data, avoiding invalid updates to unchanged data.

[0050] As an example, changes to game data include, but are not limited to, the addition, deletion, and modification of attribute values, data states, or other game content. Examples include changes to character attribute values, increases or decreases in item quantities, and updates to game quest status.

[0051] As another example, when there are multiple proxy functions to be executed, the proxy functions to be executed can be scheduled, such as executing them in a preset order or adding multiple proxy functions to the task queue for batch execution, in order to improve the performance of game data processing.

[0052] In this embodiment, in response to a data binding request containing a bound object, game data associated with the bound object is obtained; a pre-created binder is invoked to execute a proxy function; based on the access behavior of the proxy function to at least one piece of game data during execution, a data binding relationship is constructed between the bound object and the game data, so that when the game data changes, the corresponding bound object is updated based on the data binding relationship.

[0053] Compared with related technologies, the technical solution of this application is as follows: by calling a pre-created binder to execute a proxy function, the access behavior of the proxy function to game data is automatically recorded. Based on the access behavior, data binding relationships are generated efficiently and accurately. If multiple game data are accessed during execution, a dependency relationship can be formed with multiple game data, that is, it supports the establishment of binding relationships for nested data. This process not only reduces the amount of code that developers write manually, but also can directly drive the update of the binding object based on the data binding relationship, realize the automatic transmission process from data changes to the update of the binding object, effectively reduce the degree of code redundancy, and thus significantly improve the applicability of game data binding and game development efficiency.

[0054] Figure 2 This is another flowchart illustrating a game data binding processing method in an embodiment of this application. Figure 2 relatively Figure 1 The technical solutions of the embodiments of this application are described in more detail.

[0055] Step 201: Create the binder in advance.

[0056] In this embodiment of the application, the developer can pre-create a binder during the game development stage. The binder can bind several game data to game elements or business logic in the UI interface to generate data binding relationships.

[0057] The process of creating a binder includes at least the following: S1 is a predefined set of callback and calculation functions for handling bound objects and game data.

[0058] S2, create a binding function and configure its parameter structure so that the binding function receives callback functions and computation functions according to the parameter structure.

[0059] S3, configure the binding function to the binder, and complete the creation of the binder.

[0060] In this context, a callback function is a function that the game application executes to update data when game data changes, with the bound object serving as the target of the callback function. In this application, the callback function is stored in a base class of a custom data structure. When game data changes, the callback function can be called from the base class to locate the bound object.

[0061] A calculation function is a function used to calculate game data, such as attribute values.

[0062] A binding function is a function used to generate a proxy function. In this application, the parameter structure of the binding function can be pre-configured, such as a parameter structure of {callback function; computed function; response mode label}.

[0063] As an optional example, see reference Figure 3 , Figure 3 This is a schematic diagram of the binder structure shown in an embodiment of this application. The binder of this application includes a parent binder and multiple child binders that inherit from the parent binder. There is a one-to-many relationship between the parent binder and the child binders. In other words, a parent binder can be associated with multiple child binders, thereby forming a tree-like binding container with the parent binder as the root node and the child binders as child nodes.

[0064] It is worth noting that, in addition to being child nodes of the parent binder, each child binder can also be associated with lower-level binders as needed, thus forming a multi-level tree structure and achieving hierarchical management of data binding relationships.

[0065] By designing a multi-level tree structure, each child binder is independent and does not interfere with each other, thereby completely separating data, presentation, and logic, that is, achieving complete decoupling.

[0066] As an example, such as Figure 3As shown, multiple child binders are created under the parent binder corresponding to the game interface: child binder 1, child binder 2, and child binder 3. Child binder 1 is associated with binder object 1 (backpack component), child binder 2 is associated with binder object 2 (mail component), and child binder 3 is associated with binder object 3 (timer component). Further, child binder 1 is associated with its sub-binder 1-1, and child binder 2 is associated with its sub-binder 2-1. Sub-binder 1-1 is associated with items in the backpack component, and sub-binder 2-1 is associated with the list in the mail component. During the data binding process, dependencies are automatically collected through each level of binder, forming a binding tree.

[0067] refer to Figure 4 , Figure 4 This is a schematic diagram of the binding process shown in the embodiments of this application.

[0068] After the binder is created and invoked, it first enters the observer state, where it listens for and records the execution results of the computation function. Then, it uses a proxy interception mechanism to determine the game data that the computation function depends on. Next, it registers triggers to listen for dependencies. Once the dependencies are collected, the binder exits the observer state and performs its first update operation, updating the bound object through a callback function to ensure that the bound object is consistent with the current game data.

[0069] If the game interface is closed, the parent binder's destruction task is automatically triggered, calling the corresponding destruction function of the parent binder to perform the destruction operation, so as to quickly clear its associated data binding relationship. The destruction functions of each child binder are automatically and recursively called to synchronously clean up the data binding relationship stored in the child binders. This avoids developers from manually cleaning up data binding relationships, reduces the risk of memory leaks caused by missing unbinding data, and helps improve the stability of the game application and the efficiency of game development.

[0070] Different resource release operations are performed for different types of binders. For example, for data listener binders, a listener removal operation can be performed, while for timed binders, a timer stop operation can be performed.

[0071] As can be seen, the binding container of this application can realize the unified creation and centralized destruction of data binding relationships, ensuring that the lifecycle of data binding relationships is consistent with that of the bound objects.

[0072] Step 202: In response to a data binding request containing a bound object, obtain the game data associated with the bound object.

[0073] In game development scenarios such as building or maintaining game interfaces, the game system of this application can respond to a data binding request containing a bound object to instruct the data binding operation to be performed on the bound object.

[0074] refer to Figure 5 and Figure 6 , Figure 5 This is a schematic diagram of the structure of a responsive object shown in an embodiment of this application. Figure 6 This is a schematic diagram of the game data processing flow shown in an embodiment of this application.

[0075] To enable game data to respond automatically, this application can declare the data class or data object storing game data as a reactive object, thereby giving the data within it responsiveness.

[0076] As an optional example, a base class for a custom data structure can be defined in advance, which provides the data storage structure and data access interface, and the data class that stores game data can inherit from the base class of the custom data structure.

[0077] The data storage structure can be a dictionary, used to store game data indexed by keys. The data access interface includes a get method (Get function), a set method (Set function), and a storage method. The Get function includes interfaces for integers, floating-point numbers, and strings, used to retrieve game data of the corresponding data type according to the key, thereby recording the dependencies between game data. The Set function updates the corresponding game data by key. When a change in game data is detected, it triggers the binding function associated with that game data, driving the associated binding object to update.

[0078] In practical applications, game data can come from servers. Servers distribute service data over the network, and server data and local configuration data are merged to generate model data. The model data is then split into responsive values ​​and responsive lists using a responsive mechanism and used in the UI.

[0079] By separating game data from bound objects through a reactive mechanism, the same game data can be shared by multiple bound objects, and the destruction of bound objects can also be avoided from affecting data storage, thus reducing data coupling.

[0080] Step 203: Invoke the pre-created binder to execute the proxy function.

[0081] Invoke the pre-configured binder, which is used to create a proxy function based on the callback function and compute function in the binder function. When the binder enters the observer state, the proxy function is executed.

[0082] Step 204: Based on the proxy function's access behavior to at least one piece of game data during execution, establish a data binding relationship between the bound object and the game data.

[0083] During the data binding relationship establishment phase, the binder enters an observation state. First, a proxy function is created, and the callback function and calculation function from the binding function are stored in the proxy function. Then, the proxy function is executed to obtain the proxy function's access behavior to the game data. Finally, based on the proxy function's access behavior to the game data, the data binding relationship between the proxy function and the game data is established.

[0084] As an optional example, the process of building a data binding relationship between the bound object and the game data based on the access behavior of the proxy function to at least one piece of game data during execution includes: determining the currently accessed game data based on the access behavior of the proxy function to the game data during execution, recording the dependency relationship between the proxy function and at least one piece of currently accessed game data, storing the proxy function in the callback list corresponding to the currently accessed game data according to the dependency relationship, and generating a data binding relationship between the bound object and the game data.

[0085] In this application, externally registered callback functions and computation functions can be stored as closures within a proxy function. The proxy function executes once immediately after creation, automatically calling the stored computation function to access the corresponding game data. For example, the data currently being accessed might be character attributes, inventory list, or mail data.

[0086] During the access process, the proxy function that is currently accessing game data is identified and recorded by combining the observation state of the Get function and the binder. This proxy function is then stored in the callback list maintained by the currently accessed game data, thereby establishing a data binding relationship. This means that the proxy function is logically dependent on the currently accessed game data. Whenever the game data changes, the proxy function will automatically trigger the execution of the update.

[0087] It is understandable that since the calculation function can access multiple game data during execution, and the access behavior occurs and is recorded layer by layer, a proxy function can actually form a dependency relationship with multiple game data. This dependency relationship can extend to each level of the nested structure based on the access path, that is, it supports binding data with arbitrary depth of nesting.

[0088] Furthermore, the proxy function establishes an association with the corresponding binding object when it is created. Therefore, when executing the proxy function, there is no need to look up the binding object separately, and the update operation of the target binding object can be completed quickly.

[0089] Correspondingly, data binding relationships include one-to-one binding relationships and / or one-to-many binding relationships.

[0090] If a proxy function accesses only a single piece of game data during the computation process, then the proxy function has a one-to-one binding relationship with that piece of game data.

[0091] If a proxy function accesses multiple game data during computation, it will be registered in the callback lists of multiple game data, thus forming a one-to-many binding relationship. For example, a UI interface may depend on character attributes, inventory data, and mail data simultaneously. If any one of these changes, the same proxy function will be re-executed and the bound object will be updated.

[0092] As an example, the UI is the game inventory interface, and the bound object is a text component used to display the item quantity. Correspondingly, the game data associated with the text component is the item quantity data. During the data binding relationship establishment phase, a proxy function is created using the binding function. The proxy function accesses the item quantity data during execution, thereby establishing a dependency relationship between the item quantity data and the proxy function, and the proxy function is stored in the callback list corresponding to the item quantity data.

[0093] Step 205: When a change in game data is detected, determine the proxy function associated with the changed game data based on the data binding relationship.

[0094] The game data is assigned a value using the `Set` function. The current value is then compared to the new value to be updated. If the current value and the new value are inconsistent, the game data is considered to have changed, triggering an update task. In response to the data update task, the delegate function corresponding to the changed game data is determined from the callback list based on the data binding relationship.

[0095] As an optional example, in addition to storing the game data in a dictionary of a custom data structure as key-value pairs, this application can also store it in a list of a custom data structure in the form of a combination of structured data.

[0096] Furthermore, this application responsibly encapsulates game data in lists and dictionaries, enabling them to detect data changes. Therefore, in application, the `Set` function can be used to determine if elements in the dictionary and list have been added, deleted, or modified. If any of these changes occur, a data update task is automatically triggered, updating the associated bound objects.

[0097] Step 206: Obtain the updated game data through the calculation function of the proxy function, and call the callback function of the proxy function to update the corresponding bound object.

[0098] In this embodiment, the latest game data result is calculated through the calculation function in the proxy function, and then the game data result is passed as an input parameter to the callback function. The callback function updates the corresponding bound object according to the data result.

[0099] For example, when the bound object is a text component that displays a character's combat power, the calculation function can be used to obtain character level data, equipment attribute data, and gem bonus data, and calculate the character's combat power value based on the above data. The callback function can update the displayed content of the text component according to the calculated character combat power value.

[0100] The data binding request in this application carries a response mode tag. Based on the response mode tag, the proxy function can be executed synchronously or asynchronously. If the response mode tag is for synchronous execution, the proxy function is executed immediately; if the response mode tag is for asynchronous execution, the proxy function is added to the task queue, and each proxy function in the task queue is executed in batches.

[0101] The response mode label refers to the identification information that indicates the execution mode of the proxy function, used to distinguish whether the current data update task is executed synchronously or asynchronously.

[0102] The Synchronous Execution tag is used to indicate that after a change in game data is detected, the proxy function associated with the game data should be executed immediately without waiting for scheduling in the task queue, thereby achieving real-time updates of the bound object.

[0103] The asynchronous execution tag is used to indicate that after a change in game data is detected, the corresponding proxy function is added to the task queue and executed sequentially or in parallel according to a preset scheduling strategy. This reduces the performance overhead caused by frequent updates while ensuring the correctness of the update.

[0104] As an optional example, this application can configure a scheduler to manage proxy functions, which provides a hash table. During the binding process in the binder, callback functions are saved to the scheduler's hash table. The scheduler's execution function is then registered with the UI's update function. For synchronous execution, the scheduler can be executed directly in the binder; for asynchronous execution, the scheduler is automatically executed each time an update function is triggered, achieving batch execution. Furthermore, the scheduler can process functions in the hash table frame by frame, executing only a portion of the callback functions in each frame. This avoids performance degradation caused by executing too many tasks in a single frame and improves system stability.

[0105] For example, when a player consumes an item, the `Set` function is executed to retrieve the value of item A before the update (100) and after the update (95). Since these two values ​​are inconsistent, it's determined that the quantity of item A has changed, automatically triggering an update task. In response to the update task, based on the data binding relationship, the associated delegate function is retrieved from the callback list corresponding to the item quantity data and executed. During the execution of the delegate function, the item quantity data is reread, and the display content of the text component is updated to show the latest quantity of item A as 95. This achieves automatic transmission of game data changes to updates, eliminating the need for developers to manually maintain the update logic and thus improving development efficiency.

[0106] To clearly and intuitively understand the game data binding processing method of this application embodiment, the following uses interface update as an example to explain the entire process in detail.

[0107] refer to Figure 7 , Figure 7 This is a schematic diagram of the UI interface binding process shown in the embodiments of this application.

[0108] During the UI initialization phase, an instance is created on the UI side. The binder initiates data binding operations on game elements (such as text) within the UI. During binding, the binder further creates proxy functions. When a proxy function accesses data, it triggers a data read operation, automatically collecting the dependencies between the current proxy function and the accessed data. When data changes, a notification mechanism is automatically triggered, transmitting the changed data to all proxy functions that depend on it. Upon receiving the data change notification, the proxy functions drive the game elements in the UI to update. At the end of its lifecycle or when the UI is destroyed, the binder's destruction process is automatically triggered. The binder then performs a unified cleanup of the proxy functions it manages and related data binding relationships, recursively releasing sub-binding relationships, thus completing the entire binding lifecycle.

[0109] refer to Figure 8 , Figure 8 This is a schematic diagram of a game business architecture based on data binding relationships, as shown in an embodiment of this application.

[0110] In actual game operations, users can issue operation commands to the game system through clicks, swipes, or other interactive behaviors, which are then passed to the logic layer for processing. After receiving the operation commands, the logic layer requests data via the network and sends the request results to the reactive model in the data center for management. When the data in the reactive model changes, it enters the reactive update phase, which is processed sequentially through three internal components: observer, trigger, and scheduler, binding or updating data based on the binder.

[0111] In this embodiment, a binder is pre-created; in response to a data binding request containing a binding object, game data associated with the binding object is obtained; the pre-created binder is invoked to execute a proxy function; based on the access behavior of the proxy function to at least one piece of game data during execution, a data binding relationship is constructed between the binding object and the game data, so that when the game data changes, the proxy function associated with the changed game data is determined based on the data binding relationship; the updated game data is obtained through the calculation function of the proxy function, and the callback function of the proxy function is invoked to update the corresponding binding object.

[0112] Compared with related technologies, the technical solution of this application is as follows: by calling a pre-created binder to execute a proxy function, the access behavior of the proxy function to game data is automatically recorded. Based on the access behavior, data binding relationships are generated efficiently and accurately. If multiple game data are accessed during execution, a dependency relationship can be formed with multiple game data, that is, it supports the establishment of binding relationships for nested data. This process not only reduces the amount of code that developers write manually, but also can directly drive the update of the binding object based on the data binding relationship, realize the automatic transmission process from data changes to the update of the binding object, effectively reduce the degree of code redundancy, and thus significantly improve the applicability of game data binding and game development efficiency.

[0113] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a game data processing device, an electronic device, and corresponding embodiments.

[0114] Figure 9 This is a schematic diagram of the structure of a game data binding processing device shown in an embodiment of this application.

[0115] See Figure 9 A game data binding processing device, comprising: The data binding request module 901 is used to respond to a data binding request containing a binding object and obtain the game data associated with the binding object; The binder invocation module 902 is used to invoke a pre-created binder to execute a proxy function. The data binding processing module 903 is used to construct a data binding relationship between the binding object and the game data based on the access behavior of the proxy function to at least one piece of game data during the execution process, so that when the game data changes, the corresponding binding object is updated based on the data binding relationship.

[0116] In one instance, the binder is created as follows: Predefined callback and calculation functions for handling bound objects and game data; Create a binding function and configure its parameter structure so that the binding function receives callback functions and computation functions according to the parameter structure; Configure the binding function to the binder to complete the binder creation.

[0117] In one instance, the binder calls module 902 for: Invokes a pre-configured binder, which is used to create a proxy function based on the callback function and compute function in the binder function; When the binder enters the observer state, the proxy function is executed.

[0118] In one instance, the data binding processing module 903 is used for: Based on the proxy function's access behavior to game data during execution, determine the currently accessed game data; Record the dependencies between the proxy function and at least one currently accessed game data; Based on the dependency relationship, the proxy function is stored in the callback list corresponding to the currently accessed game data, generating a data binding relationship between the bound object and the game data; Data binding relationships include one-to-one binding relationships and / or one-to-many binding relationships.

[0119] In one instance, a binder includes a parent binder and multiple child binders that inherit from the parent binder, with a one-to-many relationship between the parent binder and the child binders; The device also includes: The destruction module is used to recursively call the destruction functions of each child binder when the parent binder performs a destruction task, thereby clearing the data binding relationships of each child binder.

[0120] In one instance, the data binding processing module 903 is used for: Based on data binding relationships, determine the proxy functions associated with the changed game data; The updated game data is obtained through the computation function of the proxy function, and the callback function of the proxy function is called to update the corresponding bound object.

[0121] In one instance, the data binding request includes a response pattern label, and the device also includes: The execution module is used to immediately execute the proxy function if the response mode label is synchronous execution; if the response mode label is asynchronous execution, the proxy function is added to the task queue and each proxy function in the task queue is executed in batches.

[0122] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.

[0123] Figure 10This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.

[0124] See Figure 10 The electronic device 1000 includes a memory 1010 and a processor 1020.

[0125] The processor 1020 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0126] Memory 1010 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by processor 1020 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 1010 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 1010 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.

[0127] The memory 1010 stores executable code, which, when processed by the processor 1020, can cause the processor 1020 to execute part or all of the methods described above.

[0128] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.

[0129] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) that, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.

[0130] This application also provides a computer program product, which includes computer instructions that, when executed by a processor, implement the method described above.

[0131] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for binding game data, characterized in that, include: In response to a data binding request containing a bound object, obtain the game data associated with the bound object; Invoke the pre-created binder to execute the proxy function; Based on the proxy function's access to at least one piece of game data during execution, a data binding relationship is established between the bound object and the game data, so that when the game data changes, the corresponding bound object is updated based on the data binding relationship. The creation process of the binder is as follows: predefine callback functions and calculation functions for processing the bound object and the game data; create the binding function and configure the parameter structure of the binding function so that the binding function receives the callback function and the calculation function according to the parameter structure; configure the binding function to the binder to complete the creation of the binder; The step of invoking a pre-created binder to execute a proxy function includes: invoking a pre-configured binder, which is used to create a proxy function based on the callback function and the computed function in the binder function; and executing the proxy function when the binder enters an observation state. The step of constructing a data binding relationship between the bound object and the game data based on the access behavior of the proxy function to at least one piece of game data during execution includes: determining the currently accessed game data based on the access behavior of the proxy function to game data during execution; recording the dependency relationship between the proxy function and at least one piece of currently accessed game data; storing the proxy function in the callback list corresponding to the currently accessed game data according to the dependency relationship, thereby generating a data binding relationship between the bound object and the game data.

2. The method according to claim 1, characterized in that, The data binding relationships include one-to-one binding relationships and / or one-to-many binding relationships.

3. The method according to claim 1 or 2, characterized in that, The binder includes a parent binder and multiple child binders that inherit from the parent binder, and there is a one-to-many association relationship between the parent binder and the child binders; The method further includes: When the parent binder performs the destruction task, it recursively calls the destruction function corresponding to each child binder to clear the data binding relationship corresponding to each child binder.

4. The method according to claim 1, characterized in that, The updating of the corresponding bound object based on the data binding relationship includes: Based on the data binding relationship, determine the proxy function associated with the changed game data; The updated game data is obtained through the calculation function of the proxy function, and the callback function of the proxy function is called to update the corresponding bound object.

5. The method according to claim 1, characterized in that, The data binding request includes a response pattern tag, and the method further includes: If the response mode label is a synchronous execution label, then the proxy function is executed immediately; If the response mode label is an asynchronous execution label, then the proxy function is added to the task queue, and each proxy function in the task queue is executed in batches.

6. A game data binding processing device, characterized in that, include: The data binding request module is used to respond to a data binding request containing a binding object and obtain the game data associated with the binding object; The binder invocation module is used to invoke pre-created binders to execute proxy functions; A data binding processing module is used to construct a data binding relationship between the binding object and the game data based on the access behavior of the proxy function to at least one piece of game data during the execution of the game data, so that when the game data changes, the corresponding binding object is updated based on the data binding relationship. The creation process of the binder is as follows: predefine callback functions and calculation functions for processing the bound object and the game data; create the binding function and configure the parameter structure of the binding function so that the binding function receives the callback function and the calculation function according to the parameter structure; configure the binding function to the binder to complete the creation of the binder; The binder invocation module is used to invoke a pre-configured binder, which is used to create a proxy function based on the callback function and calculation function in the binding function; when the binder enters the observation state, the proxy function is executed. The data binding processing module is configured to: determine the currently accessed game data based on the access behavior of the proxy function to game data during execution; record the dependency relationship between the proxy function and at least one currently accessed game data; store the proxy function in the callback list corresponding to the currently accessed game data according to the dependency relationship, and generate a data binding relationship between the binding object and the game data.

7. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, It stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Data binding method and device, storage medium and equipment

    CN108845856A

  • Interface data binding method for Unity

    CN110704051A