Object processing method, computing device, storage medium and computer program product

By hashing the object resource information in the Unity persistence system, obtaining the object index and storing it to the target data storage unit, the problem of excessive memory usage of the Unity persistence system is solved, and data writing efficiency and memory optimization are improved.

CN120067049APending Publication Date: 2025-05-30ZHUHAI KINGSOFT ONLINE GAME TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510156256.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

When handling large-scale, resource-intensive projects, the Unity persistence system consumes too much memory, resulting in a reduced write efficiency and affecting game performance.

Method used

By responding to object operation instructions, the sub-object resource information and file information of the target object are determined, and the object index is obtained by hashing processing, the target data storage unit is determined from multiple data storage units, and the resource information and file information are stored in the unit.

Benefits of technology

It improves the efficiency of data writing, optimizes memory usage, reduces fragmentation, and improves the overall performance of the game.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120067049A_ABST
    Figure CN120067049A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of computers, in particular to an object processing method, computing equipment, a storage medium and a computer program product.The object processing method comprises the steps that in response to an object operation instruction for a target object, object resource information and object resource file information of sub-objects contained in the target object are determined; performing hash processing on the object resource information to obtain an object index of the sub-object; and determining a target data storage unit corresponding to the object index from a plurality of data storage units, and storing the object resource information and the object resource file information to the target data storage unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification relate to the field of computer technologies, and particularly to an object processing method, a computing device, a storage medium, and a computer program product. Background Art

[0002] The Unity persistence system is the core mechanism inside the Unity engine for saving and managing various Object data. It can store the runtime data of a target object through the Unity persistence system, thereby ensuring the normal operation of the target object. The target object can be, for example, a game or other application. However, with the growth of the complexity and scale of various games and applications, the memory occupancy of this Unity persistence system has become a significant problem. For example, when the target object is a game, when the number of game resources used in the game increases, the memory occupancy will also increase accordingly, further resulting in poor writing efficiency when writing game data. An effective technical solution is urgently needed to solve the above problems. Summary of the Invention

[0003] In view of this, the embodiments of this specification provide an object processing method. One or more embodiments of this specification also relate to an object processing device, a computing device, a computer-readable storage medium, and a computer program product to solve the technical defects existing in the prior art.

[0004] According to the first aspect of the embodiments of this specification, an object processing method is provided, including: Responding to an object operation instruction for a target object, determining the object resource information and object resource file information of the sub-objects included in the target object; Performing a hashing process on the object resource information to obtain the object index of the sub-object; Determining, from multiple data storage units, the target data storage unit corresponding to the object index, and storing the object resource information and the object resource file information into the target data storage unit.

[0005] According to the second aspect of the embodiments of this specification, an object processing device is provided, including: A determination module configured to respond to an object operation instruction for a target object and determine the object resource information and object resource file information of the sub-objects included in the target object; A processing module configured to perform a hashing process on the object resource information to obtain the object index of the sub-object; A storage module, configured to determine a target data storage unit corresponding to the object index from multiple data storage units, and store the object resource information and the object resource file information into the target data storage unit.

[0006] According to a third aspect of the embodiments of the present specification, there is provided a computing device, including: A memory and a processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, the steps of the above object processing method are implemented.

[0007] According to a fourth aspect of the embodiments of the present specification, there is provided a computer-readable storage medium, which stores computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above object processing method are implemented.

[0008] According to a fifth aspect of the embodiments of the present specification, there is provided a computer program product, including computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the above object processing method are implemented.

[0009] An embodiment of the present specification provides an object processing method, including: in response to an object operation instruction for a target object, determining object resource information and object resource file information of sub-objects included in the target object; performing a hashing process on the object resource information to obtain an object index of the sub-object; determining a target data storage unit corresponding to the object index from multiple data storage units, and storing the object resource information and the object resource file information into the target data storage unit.

[0010] In the above method, after responding to an object operation instruction for a target object, object resource information and object resource file information of sub-objects included in the target object are determined, and a hashing process is performed on the object resource information to obtain an object index corresponding to the object resource information. The corresponding target data storage unit is determined from multiple data storage units through the object index, and the object resource information and the object resource file information are stored into the target data storage unit, thereby realizing data writing, and improving data writing efficiency and optimizing memory by finding the target data storage unit through the object index. Description of the Drawings Figure 1 is a flowchart of an object processing method provided by an embodiment of the present specification; Figure 2(a) is a schematic diagram of a preset hashing algorithm in an object processing method provided by an embodiment of the present specification; Figure 2(b) is a schematic diagram of multi-level hashing in an object processing method provided by an embodiment of this specification; Figure 2(c) is a schematic diagram of the multi-level hashing and bucket sorting process in an object processing method provided by an embodiment of this specification; Figure 3 is a schematic diagram of data addressing in an object processing method provided by an embodiment of this specification; Figure 4 is a schematic diagram of memory reorganization in an object processing method provided by an embodiment of this specification; Figure 5 is a schematic structural diagram of an object processing apparatus provided by an embodiment of this specification; Figure 6 is a structural block diagram of a computing device provided by an embodiment of this specification. Detailed implementation manners

[0011] In the following description, numerous specific details are set forth in order to provide a thorough understanding of this specification. However, this specification can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of this specification. Therefore, this specification is not limited by the specific implementations disclosed below.

[0012] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a", "the", and "said" used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and encompasses any or all possible combinations of one or more of the associated listed items.

[0013] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".

[0014] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0015] First, the noun terms involved in one or more embodiments of this specification are explained.

[0016] Unity engine: It is a widely used cross-platform game development and real-time 3D content creation platform. It is not limited to game development and is also applied in multiple fields such as virtual reality (VR), augmented reality (AR), architectural visualization, and film and television animation.

[0017] Unity persistence system: The persistence system refers to the function of implementing the saving and loading of game states or application data in Unity, ensuring that progress, settings, or other important information can still be retained after the player closes and reopens the game.

[0018] Object data: It is the base class of all built-in and custom object types, providing some common functions and properties such as name, hideFlags, etc.

[0019] NPC: Non-Player Character. A non-player character refers to a character in a game that is not directly controlled by the player and is usually driven by an AI algorithm to interact according to a preset behavior pattern or logic.

[0020] Instance ID: The instance ID is the unique identifier owned by an Object instance that exists at runtime.

[0021] Object ID: The object ID is a globally unique integer value used to identify a specific type of resource file. It is not for object instances at runtime but refers to the resource files themselves such as prefabs, materials, textures, etc.

[0022] PHF: Perfect Hash Function. A perfect hash function generates a unique index for a given set of keys, but there may be some unused slots.

[0023] MPHF: Minimal Perfect Hash Function. A minimal perfect hash function generates a unique and compact index for a given set of keys, ensuring that there are no unused slots.

[0024] In practical applications, the Unity persistence system serves as the core mechanism within the Unity engine for saving and managing various Object data. It maintains a special data structure at the engine's underlying level, which is responsible for preserving the bidirectional mapping relationship between object IDs and the instance IDs after loading. This design ensures that objects in resource files and object instances created during runtime can be efficiently searched for each other, which is crucial for maintaining the normal operation of games and other applications. The persistence system is an important part of the Unity engine, and it supports the effective management and use of various types of resources, from scenes, prefabs to materials, textures, etc.

[0025] However, as the complexity and scale of games grow, especially for resource-intensive game projects (such as large PC or console games), the memory footprint of the persistence system has become a significant issue. The specific manifestations are as follows: High memory consumption: When the number of resources used in the game increases and the number of instantiated Objects grows, the memory occupied by the persistence system will also increase accordingly. This is mainly because each loaded resource and instance needs to retain its ID mapping information in the persistence system. Impact in extreme cases: In some cases, such as in large open-world games or games with a large amount of dynamic content, the memory footprint of the persistence system may reach 200MB or even more, which poses a challenge to the overall performance of the game. Impact of the amount of resource loading: The memory footprint of the persistence system is directly proportional to the amount of resources actually loaded during the game process. This means that in large game projects, as the development progresses and more content is added, the memory pressure will continue to increase, and ultimately it may become one of the key bottlenecks restricting game optimization and technical implementation.

[0026] In summary, although the Unity persistence system provides strong support for resource management and object reference, when dealing with large-scale, resource-intensive projects, how to effectively control its memory footprint has become an important issue that developers need to face. This pain point not only affects the development efficiency of the project but may also have a negative impact on the quality of the final product and the user experience. Therefore, exploring effective solutions to reduce the memory overhead of the persistence system has become an urgent problem to be solved in the current game development field.

[0027] In this specification, an object processing method is provided. This specification also relates to an object processing device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail one by one in the following embodiments.

[0028] See Figure 1 , Figure 1The figure shows a flowchart of an object processing method provided according to an embodiment of this specification, which specifically includes the following steps.

[0029] Step 102: In response to an object operation instruction for a target object, determine the object resource information and object resource file information of the sub-objects included in the target object.

[0030] Among them, the target object can be understood as an object running based on the Unity engine, such as a game or other application. For ease of understanding, in the embodiments of this specification, the target object is taken as an example of a game. Then, the object operation instruction can be understood as an operation instruction for the target game, such as entering the game scene of the target game, starting a game battle, etc. Then, the sub-objects included in the target object can be understood as game objects included in the target game, such as items placed in the game scene, NPCs in the game scene, etc. For example, after the user operates the game character to enter the game scene, during the game scene loading process, the items placed in the game scene and the NPCs in the game scene will be loaded. Then, both the object resource information and the object resource file information can be understood as game running data. The object resource information can be understood as the instance ID of the sub-object, and the object resource file information can be understood as the object ID of the resource file of the sub-object. For example, when an item placed in the game scene is loaded, the instance ID and the object ID will be loaded. The persistence system of the Unity engine can maintain a data structure that saves the bidirectional mapping relationship between the object ID and the instance ID. The instance ID is used as the key in the key-value pair, and the object ID is used as the value in the key-value pair.

[0031] Specifically, in response to a game operation instruction for the target game, load the instance ID and object ID of the game objects in the target game.

[0032] In practical applications, the game user can log in to the target game through the client. The server of the target game receives the game operation instruction sent by the game user through the client and creates the instance ID and object ID of the game object corresponding to the game operation instruction.

[0033] Step 104: Perform a hash processing on the object resource information to obtain the object index of the sub-object.

[0034] Among them, the object index of the sub-object, the object resource information, and the object resource file information can form a variant sparse hash data structure, which is used to transform the memory of the Unity persistence system.

[0035] In practical applications, this variant sparse hash data structure uses linear probing technology.

[0036] Specifically, the hashing of the object resource information to obtain the object index of the sub-object includes: Hashing the object resource information according to a preset hashing algorithm, mapping the object resource information to an object index, and using the object index as the object index of the sub-object.

[0037] Among them, the preset hashing algorithm can be understood as a hashing function used to perform hashing calculations on object resource information. In practical applications, the preset hashing algorithm includes, but is not limited to, the PHF hashing function and the MPHF hashing function. The object index can be understood as a unique integer index.

[0038] Specifically, according to the hashing function, the object resource information (i.e., the instance ID) can be hashed, mapped to a unique integer index, and the integer index is used as the object index of the sub-object.

[0039] In practical applications, Fig. 2(a) shows a schematic diagram of a preset hashing algorithm in an object processing method provided according to an embodiment of the present specification. As shown in the figure, Key Set S is a set of key-value sets, representing the key values to be hashed. HashTable T is a hash table for storing the hashed results. The PHF hashing function ensures that each key value is uniquely mapped to a slot in the hash table without collision. The size (m) of the hash table can be greater than the size (n) of the key-value set. Therefore, there may be some idle slots. The MPHF hashing function not only ensures that each key value is uniquely mapped to a slot in the hash table, but also the size of the hash table is exactly equal to the size of the key-value set. Therefore, there are no idle slots in the hash table and all slots are utilized.

[0040] Furthermore, the mapping of the object index can also be based on multiple hashing functions. Fig. 2(b) shows a schematic diagram of multi-level hashing in an object processing method provided according to an embodiment of the present specification. As shown in the figure, the key-value set can be mapped to different buckets (i.e., subsequent data storage units) through multiple hashing functions. Specifically, for each key, an initial hashing function (h_{10}) can be applied to map the key to an intermediate bucket. Further, other hashing functions (h_{11}) and (h_{12}) can be applied to distribute these keys in a finer-grained manner so that the number of keys in each bucket tends to be balanced. This technique is usually used to reduce hash collisions and improve the search efficiency. Among them, Key Set is a set of key-value sets, representing the key values to be hashed. Hash Functions (h 10 , h 11 , h 12) are different hash functions used to map key values to different buckets. Each hash function (hi) maps the set of key values to a specific set of buckets. Buckets (B) are the buckets that store the key values. The buckets are divided into two parts, each mapped by a different hash function. BucketDistribution is the height of each bucket, indicating the number of key values stored in that bucket. By using different hash functions, the key values are evenly distributed among the buckets to reduce collisions. Specifically, in the first-level hash (h 10 ), the set of key values is mapped to a set of buckets by the hash function (h10), reducing collisions and controlling complexity. These buckets range from 0 to (n - 1), and the height of each bucket indicates the number of key values in that bucket. In the second-level hash (h 11 and h 12 ), the set of key values is mapped to another set of buckets by the hash functions (h11) and (h12). These buckets range from 0 to (b - 1) and are divided into two parts B1 and B2, where (p1) and (p2) are the break points indicating the ranges mapped by different hash functions. By using multiple hash functions, the key values can be more evenly distributed among different buckets, and further refined to evenly distribute the keys, thus reducing collisions. Different hash functions can help balance the load in different buckets, ensuring that no single bucket is overcrowded. Multilevel hashing can further refine and optimize the distribution of key values.

[0041] Figure 2(c) shows a schematic diagram of the multi-level hashing and bucket sorting process in an object processing method provided according to an embodiment of this specification. Among them, Buckets (B) is a group of buckets, and each bucket stores a certain number of key values. The buckets range from (B_0) to (B_{b - 1}), where (b) is the number of buckets. The height of each bucket represents the number of key values stored in that bucket. The Bucket Sequence arranges the buckets in order through a sorting operation (i.e., sort). The sorted bucket sequence ranges from (B_{0,0}) to (B_{0,b - 1}), representing the sorted bucket sequence. The Hash Table (T) is the finally generated hash table used to store and look up key values. Specifically, the set of key values is distributed into multiple buckets. The height of each bucket represents the number of key values in that bucket. The buckets are sorted in a certain order (usually the number of key values or the result of a specific hash function). Generally, the buckets containing fewer keys can be processed preferentially. By sorting the buckets, the lookup process in subsequent steps can be optimized. The sorted bucket sequence ranges from (B_{0,0}) to (B_{0,b - 1}), representing the sorted bucket sequence. The final hash table is constructed according to the sorted bucket sequence. The hash table (T) is used to efficiently store and look up key values. Specifically, the hash table can be gradually filled in the order of the sorted bucket sequence. For example, keys can be sequentially extracted from the sorted buckets and inserted into the hash table, ensuring that each key can find a unique position. Further, in the case of conflicts found during the process of inserting keys into the hash table, the mapping of the current key can be modified until all keys can be placed in the hash table without conflicts. On the premise of not generating conflicts, the index of each key is stored in an array. By adjusting the hash function or changing the order of key insertion, it is ensured that all keys have their own independent storage positions.

[0042] In summary, by performing a hash calculation on the object resource information according to the hash function, the object resource information can be mapped to a unique object index, which further facilitates subsequent determination of a suitable target data storage unit for data writing based on the object index, and avoids data writing conflicts.

[0043] Step 106: Determine the target data storage unit corresponding to the object index from multiple data storage units, and store the object resource information and the object resource file information into the target data storage unit.

[0044] Among them, the data storage unit can be understood as a unit in the memory used to store data of the target object. For example, it can be a data storage slot or a bucket for data storage. This specification does not make any limitations in this regard.

[0045] Specifically, when storing a data structure containing object resource information and object resource file information in a data storage unit, the target data storage unit corresponding to the index can be determined from multiple data storage units according to the object index, and the keys and values in the data structure are respectively stored in the target data storage unit.

[0046] In practical applications, refer to Figure 3 , Figure 3 which shows a schematic diagram of data addressing in an object processing method provided according to an embodiment of the present specification, as Figure 3As shown, a perfect hash array (P) can be used to store the index corresponding to each key. Each index points to the offset of a value, and the corresponding value can be found through the offset. The offset and the value buffer can be used for efficient management and access of the stored data. By directly accessing the offset table and the data buffer, key-value pairs can be retrieved and updated in constant time, making it applicable to systems that require low-latency queries and large-scale key sets. Keys: These are the key values to be stored, including "Hello", "Make", "Perfect", "Foo", and "Hello". Index (i.e., object index): This is an array where each element corresponds to the hash value of a key. Each key is mapped to a unique index position through a perfect hash function. Value offset: This is an array that stores the position offset of the value corresponding to each key in the ValueBuffer. For example, the value offset corresponding to the key with index 0 is 0, and the value offset corresponding to the key with index 1 is 16, and so on. Value Buffer: This is a continuous memory area used to store the values corresponding to all keys. The values are stored in the order of their offsets in the Value offset array. Specifically, for the key "Hello": It is mapped to index position 0 through the perfect hash function. The corresponding value offset is 0, indicating that the value starts from the beginning of the Value Buffer. The value is "PHF Great again!". For the key "Make": It is mapped to index position 1 through the perfect hash function. The corresponding value offset is 16, indicating that the value starts from the 16th position of the Value Buffer. The value is "Bar". For the key "Perfect": It is mapped to index position 2 through the perfect hash function. The corresponding value offset is 16, indicating that the value starts from the 16th position of the ValueBuffer. The value is "World". For the key "Foo": It is mapped to index position 4 through the perfect hash function. The corresponding value offset is 25, indicating that the value starts from the 25th position of the Value Buffer. The value is "World". For the key "Hello": It is mapped to index position 6 through the perfect hash function. The corresponding value offset is 34, indicating that the value starts from the 34th position of the ValueBuffer. The value is "Hash". By constructing and using a perfect hash function, efficient and collision-free key lookups are achieved, enabling fast-response large-scale data processing.

[0047] In practical applications, the basic implementation process of a perfect hash function is as follows. Initial key set: Keys = {K1, K2, K3, K4, K5}; during the initial hash and bucket allocation process, using the initial hash function h_0, the keys are allocated to buckets: Bucket 1: {K1, K3}, Bucket 2: {K2}, Bucket 3: {K4, K5}; sort the buckets by size, and the processing order after sorting is: Bucket 2, Bucket 1, Bucket 3; construct the hash table: initialize an empty hash table [_, _, _, _, _], and during the insertion process: insert K2 from Bucket 2: Hash table: [K2, _, _, _, _], insert K1, K3 from Bucket 1: Hash table: [K2, K1, K3, _, _], insert K4, K5 from Bucket 3: Hash table: [K2, K1, K3, K4, K5]. The minimum perfect hash mapping is completed, and each key has a unique index with no conflicts.

[0048] In specific implementation, storing the object resource information and the object resource file information into the target data storage unit includes: Writing the object resource information and the object resource file information into the target data storage unit in the form of key-value pairs.

[0049] Specifically, the object resource information can be used as the key and the object resource file information can be used as the value to be written into the target data storage unit, so as to maintain the two-way mapping relationship between the object ID and the instance ID of the created sub-object.

[0050] In an embodiment of this specification, it further includes: At preset time intervals, according to preset sorting rules, sort the multiple data storage units to obtain sorted data storage units, so as to determine the target data storage unit from the sorted data storage units.

[0051] Among them, the preset time interval can be understood as a pre-set time interval for memory sorting. For example, the preset time interval can be 10 minutes, 1 hour, or 1 day, etc., and this specification embodiment does not limit this. The preset sorting rules can be understood as the rules for memory sorting.

[0052] In specific implementation, the preset sorting rules can be to perform memory sorting according to the storage status of the data storage units, and the specific implementation method is as follows: Sorting the multiple data storage units according to the preset sorting rules to obtain sorted data storage units includes: Determine the free data storage units and the occupied data storage units among the multiple data storage units; Arrange the free data storage units and the occupied data storage units separately to obtain the sorted data storage units.

[0053] Specifically, it is possible to sort multiple data storage units in memory, determine the free data storage units and the occupied data storage units from the multiple data storage units, and arrange the free data storage units and the occupied data storage units separately, so that when writing a data structure containing object resource information and object resource file information into the target data storage unit, it can be continuously written into the free data storage units.

[0054] In practical applications, refer to Figure 4 , Figure 4 shows a schematic diagram of memory sorting in an object processing method provided according to an embodiment of this specification. Among them, Empty indicates that the data storage unit is not occupied, Key1, Key2, Key3, Key4 are the currently stored keys, Val1, Val2, Val3, Val4 are the values corresponding to the keys, and Del indicates that the data storage unit has stored data but has been deleted. This layout can use open addressing to handle conflicts, that is, when an insertion collision occurs, it will explore the next possible empty space to place the new element, which allows new variants of sparse hash data structures to efficiently utilize memory while maintaining good lookup performance. As shown in (a) of Figure 4 , before memory sorting, the free data storage units and the occupied data storage units can be arranged in a mixed manner, as shown in (b) of Figure 4 , after memory sorting, the free data storage units and the occupied data storage units can be arranged separately.

[0055] In summary, by combining the space compression strategy, arranging the free data storage units and the occupied data storage units separately, the data can be continuously written into the free data storage units, thereby reducing the fragmentation of data writing, and further retaining the lookup performance while compressing memory.

[0056] Further, the determining of the target data storage unit corresponding to the object index from the multiple data storage units includes: Determine the target data storage unit corresponding to the object index from the free data storage units included in the multiple data storage units.

[0057] Then, when determining the target data storage unit corresponding to the object index, the target data storage unit corresponding to the object index can be determined from the free data storage units to achieve subsequent writing of data.

[0058] Specifically, when looking up the corresponding target data storage unit according to the object index, the target data storage unit corresponding to the object index can be determined from the free data storage units.

[0059] In practical applications, the target object contains multiple sub-objects; The method further includes: Successively writing the object resource information and object resource file information of each sub-object among the multiple sub-objects into the free data storage unit.

[0060] Specifically, when it is determined that multiple sub-objects in the target object need to be loaded, after determining the object resource information and object resource file information of each sub-object, the object resource information and object resource file information of each sub-object can be successively written into the free data storage unit. This realizes continuous writing of data into the free data storage unit, thereby reducing the fragmentation of data writing, further compressing memory while retaining the search performance.

[0061] In addition, the multiple data storage units are arranged in the memory, and the method further includes: When the memory capacity of the memory reaches the preset memory capacity threshold, stop allocating the target data storage unit from the multiple data storage units.

[0062] Among them, the preset memory capacity threshold can be understood as the upper limit value of the memory capacity set in advance.

[0063] In practical applications, a specialization-related memory structure allocation mechanism can be used to alleviate the use of previous data slots (i.e., data storage units). The specific mechanism is to use a local linked list and a bitmap to manage conflicts, greatly reducing slot hash conflicts. When reaching a specific capacity upper limit (i.e., the preset memory capacity threshold), no more allocation is performed. This greatly reduces the reallocation caused by conflicts, thereby improving memory utilization and maintaining an upper limit value of the memory capacity that cannot be exceeded, effectively solving the problem of excessive persistent memory caused by a large number of resources in large game projects.

[0064] At the same time, appropriate data layout techniques are also used to reduce persistent data memory. By moving elements from positions with shorter distances, the filling rate of the table is balanced, and an internal marked data version number is used. When designing, the heat of the data is considered, the access rate is statistically analyzed, and high-frequency data is stored centrally.

[0065] In summary, in the above method, after responding to an object operation instruction for a target object, the object resource information and object resource file information of the sub-objects included in the target object are determined, the object resource information is hashed to obtain an object index corresponding to the object resource information, the corresponding target data storage unit is determined from multiple data storage units through the object index, and the object resource information and object resource file information are stored in the target data storage unit, thereby realizing data writing, and improving data writing efficiency and optimizing memory by finding the target data storage unit through the object index.

[0066] Corresponding to the above method embodiment, this specification also provides an object processing device embodiment. Figure 5 The structural schematic diagram of an object processing device provided by an embodiment of this specification is shown. As Figure 5 shown, the device includes: A determination module 502, configured to determine the object resource information and object resource file information of the sub-objects included in the target object in response to an object operation instruction for the target object; A processing module 504, configured to hash the object resource information to obtain an object index of the sub-object; A storage module 506, configured to determine a target data storage unit corresponding to the object index from multiple data storage units, and store the object resource information and the object resource file information in the target data storage unit.

[0067] In an optional embodiment, the processing module 504 is further configured to: Hash the object resource information according to a preset hashing algorithm, map the object resource information to an object index, and use the object index as the object index of the sub-object.

[0068] In an optional embodiment, the storage module 506 is further configured to: Write the object resource information and the object resource file information into the target data storage unit in the form of key-value pairs.

[0069] In an optional embodiment, the storage module 506 is further configured to: Arrange the multiple data storage units according to a preset arrangement rule at preset time intervals to obtain arranged data storage units, so as to determine the target data storage unit from the arranged data storage units.

[0070] In an optional embodiment, the storage module 506 is further configured to: Determine the free data storage units and the occupied data storage units among the multiple data storage units; Arrange the free data storage units and the occupied data storage units respectively to obtain the sorted data storage units.

[0071] In an optional embodiment, the storage module 506 is further configured to: Determine the target data storage unit corresponding to the object index from the free data storage units included in the multiple data storage units.

[0072] In an optional embodiment, the target object includes multiple sub-objects; The storage module 506 is further configured to: Continuously write the object resource information and the object resource file information of each sub-object among the multiple sub-objects into the free data storage units.

[0073] In an optional embodiment, the multiple data storage units are arranged in the memory; The storage module 506 is further configured to: When the memory capacity of the memory reaches a preset memory capacity threshold, stop allocating the target data storage unit from the multiple data storage units.

[0074] The above device, after responding to an object operation instruction for a target object, determines the object resource information and the object resource file information of the sub-objects included in the target object, performs a hash process on the object resource information to obtain an object index corresponding to the object resource information, determines a corresponding target data storage unit from multiple data storage units through the object index, and stores the object resource information and the object resource file information in the target data storage unit, realizes data writing, and improves data writing efficiency and optimizes the memory by the method of finding the target data storage unit through the object index.

[0075] The above is a schematic solution of an object processing device in this embodiment. It should be noted that the technical solution of the object processing device and the technical solution of the above object processing method belong to the same concept. For the details not described in the technical solution of the object processing device, reference can be made to the description of the technical solution of the above object processing method.

[0076] Figure 6 FIG. shows a structural block diagram of a computing device 600 according to an embodiment of the present specification. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 through a bus 630, and a database 650 is used to store data.

[0077] The computing device 600 further includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interfaces (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, Worldwide Interoperability for Microwave Access (Wi-MAX) interface, Ethernet interface, Universal Serial Bus (USB) interface, cellular network interface, Bluetooth interface, Near Field Communication (NFC) interface, and so on.

[0078] In one embodiment of the present application, the above components of the computing device 600 and Figure 6 other components not shown may also be connected to each other, for example, via a bus. It should be understood that Figure 6 the block diagram of the computing device shown is for illustrative purposes only and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.

[0079] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 600 can also be a mobile or stationary server.

[0080] Among them, the processor 620 is used to execute the following computer program / instructions, and when the computer program / instructions are executed by the processor, the steps of the above object processing method are implemented.

[0081] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiment of the computing device, since it is basically similar to the embodiment of the object processing method, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the embodiment of the object processing method.

[0082] An embodiment of this specification also provides a computer-readable storage medium storing computer programs / instructions, which when executed by a processor implement the steps of the above object processing method.

[0083] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiment of the computer-readable storage medium, since it is basically similar to the embodiment of the object processing method, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the embodiment of the object processing method.

[0084] An embodiment of this specification also provides a computer program product including computer programs / instructions, which when executed by a processor implement the steps of the above object processing method.

[0085] The above is a schematic solution of a computer program product of this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the above object processing method belong to the same concept. For the details not described in detail in the technical solution of the computer program product, reference can be made to the description of the technical solution of the above object processing method.

[0086] The above describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0087] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, external hard drives, magnetic disks, optical discs, computer memories, read-only memories (ROMs), random access memories (RAMs), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0088] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of this specification are not limited by the described order of actions, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of this specification.

[0089] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0090] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The alternative embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the embodiments of this specification, so that those skilled in the art can understand and utilize this specification well. This specification is only limited by the claims and their full scope and equivalents.

Claims

1. An object processing method, comprising: In response to an object operation instruction for a target object, determining object resource information and object resource file information of a sub-object contained in the target object; Performing hash processing on the object resource information to obtain the object index of the sub-object; A target data storage unit corresponding to the object index is determined from a plurality of data storage units, and the object resource information and the object resource file information are stored in the target data storage unit.

2. According to the method of claim 1, the step of performing hash processing on the object resource information to obtain the object index of the sub-object comprises: The object resource information is hashed according to a preset hash algorithm, the object resource information is mapped to an object index, and the object index is used as the object index of the sub-object.

3. The method according to claim 1 or 2, wherein storing the object resource information and the object resource file information in the target data storage unit comprises: The object resource information and the object resource file information are written into the target data storage unit in the form of key-value pairs.

4. The method according to claim 1 or 2, further comprising: At preset time intervals and according to preset sorting rules, the plurality of data storage units are sorted to obtain sorted data storage units, so that the target data storage unit is determined from the sorted data storage units.

5. The method according to claim 4, wherein the step of sorting the plurality of data storage units according to a preset sorting rule to obtain sorted data storage units comprises: Determine an idle data storage unit and an occupied data storage unit among the plurality of data storage units; The idle data storage units and the occupied data storage units are arranged respectively to obtain sorted data storage units.

6. The method according to claim 5, wherein determining the target data storage unit corresponding to the object index from the plurality of data storage units comprises: A target data storage unit corresponding to the object index is determined from the idle data storage units included in the plurality of data storage units.

7. The method according to claim 5, wherein the target object includes a plurality of sub-objects; The method further comprises: The object resource information and the object resource file information of each of the plurality of sub-objects are continuously written into the idle data storage unit.

8. The method according to claim 1 or 2, wherein the plurality of data storage units are arranged in a memory, and the method further comprises: When the memory capacity of the memory reaches a preset memory capacity threshold, the allocation of the target data storage unit from the multiple data storage units is stopped.

9. A computing device comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer program / instructions are executed by the processor, the steps of the method according to any one of claims 1 to 8 are implemented.

10. A computer-readable storage medium storing a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the steps of the method according to any one of claims 1 to 8.

11. A computer program product, comprising a computer program / instruction, which implements the steps of the method according to any one of claims 1 to 8 when executed by a processor.