Game data cutting method and device, storage medium and terminal

By using the SwiftCDC algorithm to read game data in 4-byte units and calculate hash values ​​to divide it into blocks, metadata is generated to store data block information. This solves the problem of slow query speed and resource waste caused by frequent game data version updates, and achieves efficient game data processing.

CN119280835APending Publication Date: 2025-01-10BEIJING PERFECT WORLD SOFTWARE TECH DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311177590.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-12
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In existing technologies, frequent updates to game data versions lead to slow query speeds and wasted system resources, reducing the efficiency of game data processing.

Method used

The SwiftCDC algorithm is used to read game data in 4-byte units, calculate hash values, and cut the data under preset cutting conditions. The generated metadata stores data block information and version identifiers, thus achieving accurate cutting of game data.

Benefits of technology

It improved the efficiency of game data query, saved system resources, and enhanced the efficiency of game data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119280835A_ABST
    Figure CN119280835A_ABST
Patent Text Reader

Abstract

The invention discloses a game data cutting method and device, a storage medium and a terminal, relates to the technical field of game development, and mainly aims at solving the problem that existing game data processing efficiency is low. The method mainly comprises the steps that game data are obtained, and the format of the game data is binary; reading a processing object in the game data according to a preset sliding window length, and determining a hash value of the processing object; under the condition that the hash value is matched with a preset cutting condition, cutting is carried out based on the data position of the processing object, a data block used for updating metadata is obtained, and at least one piece of data block information of the game data and data block identifiers of different game data versions are stored in the metadata.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of game development technology, and in particular to a game data cutting method and device, a storage medium, and a terminal. Background Art

[0002] With the rapid development of large-scale online games, game data versions are frequently replaced. Among them, a large number of different versions of game data require high-demand resource management, such as storage through cutting, to meet the operational needs of different users for game data.

[0003] Currently, the existing cutting of different versions of game data is usually based on querying the stored game data in the storage space in turn. However, due to the large number of updated game data versions, the query speed of massive data will be too slow, which will affect the speed of retrieving game data, waste a lot of system resources, and greatly reduce the efficiency of game data processing. Summary of the invention

[0004] In view of this, the present invention provides a game data cutting method and device, a storage medium, and a terminal, the main purpose of which is to solve the problem of low efficiency in existing game data processing.

[0005] According to one aspect of the present invention, a game data cutting method is provided, comprising:

[0006] Acquire game data, where the format of the game data is binary;

[0007] Reading a processing object in the game data according to a preset sliding window length, and determining a hash value of the processing object;

[0008] Under the condition that the hash value matches a preset cutting condition, cutting is performed based on the data position of the processing object to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions.

[0009] Furthermore, the preset sliding window length is a 4-byte unit length.

[0010] Further, the cutting based on the data position of the processing object under the condition that the hash value matches a preset cutting condition includes:

[0011] Dividing the hash value by a preset prime number object to obtain a calculation result;

[0012] Under the condition that the calculation result is equal to the preset cutting value, the data position of the processing object is determined, and the processing object is cut at the data position according to the preset data block size to obtain the data block, and the preset prime number object corresponds to different game data versions.

[0013] Further, reading the processing object in the game data according to the preset sliding window length includes:

[0014] Under the condition that the data length of the game data matches the hash operation length, filtering the non-cut data in the game data according to a preset data block minimum value, the preset data block minimum value is greater than or equal to a unit length of 128 kilobytes;

[0015] The game data for filtering the non-cut data is read according to a preset sliding window length to determine the processing object.

[0016] Furthermore, the method further comprises:

[0017] When the total length of the plurality of non-cut data is greater than a preset data block maximum value, the plurality of non-cut data are determined as the processing objects for hash value calculation, and the preset data block maximum value is less than or equal to 1 megabyte unit length.

[0018] Furthermore, the method further comprises:

[0019] Under the condition that the hash value does not match the preset cutting condition, the next processing object in the game data is read according to the preset sliding window length, and the updated hash value of the next processing object is calculated to cut the next processing object under the condition that the updated hash value matches the preset cutting condition.

[0020] Further, the updating and storing the cut data blocks into the metadata includes:

[0021] Under the condition that the data block identifier of the data block is the same as the data block identifier stored in the metadata, determining that the update storage of the data block is completed;

[0022] Under the condition that the data block identifier of the data block is different from the data block identifier stored in the metadata, the data block is stored at the end of the storage data chain corresponding to the metadata, and the data block identifier and data block information of the data block are added to the metadata.

[0023] Furthermore, the data block information includes data block hash values, data block sizes, and data block storage locations corresponding to different data block identifiers, and the method further includes:

[0024] Under the condition that the size of the data block matches a preset query threshold, retrieving a target data block corresponding to a target version of the game data from the data block storage location;

[0025] When the hash value of the target data block matches the data block hash value, the target data block is output.

[0026] According to another aspect of the present invention, there is provided a game data cutting device, comprising:

[0027] An acquisition module, used for acquiring game data, wherein the game data is in a binary format;

[0028] A determination module, configured to read a processing object in the game data according to a preset sliding window length, and determine a hash value of the processing object;

[0029] A cutting module is used to cut based on the data position of the processing object under the condition that the hash value matches the preset cutting condition to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions.

[0030] Furthermore, the preset sliding window length is a 4-byte unit length.

[0031] Furthermore, the cutting module comprises:

[0032] A calculation unit, used for dividing the hash value by a preset prime number object to obtain a calculation result;

[0033] The cutting unit is used to determine the data position of the processing object under the condition that the calculation result is equal to the preset cutting value, and cut the processing object at the data position according to the preset data block size to obtain the data block, and the preset prime number object corresponds to different game data versions.

[0034] Furthermore, the determining module includes:

[0035] A filtering unit, configured to filter the non-cut data in the game data according to a preset data block minimum value under the condition that the data length of the game data matches the hash operation length, and the preset data block minimum value is greater than or equal to a unit length of 128 kilobytes;

[0036] A reading unit is used to read the game data after filtering the non-cut data according to a preset sliding window length to determine the processing object.

[0037] Further,

[0038] The determination module is also used to determine the multiple non-cut data as the processing objects for hash value calculation when the total data length of the multiple non-cut data is greater than the preset data block maximum value, and the preset data block maximum value is less than or equal to 1 megabyte unit length.

[0039] Furthermore, the device also includes:

[0040] A reading module is used to read the next processing object in the game data according to the preset sliding window length under the condition that the hash value does not match the preset cutting condition, and calculate the updated hash value of the next processing object, so as to cut the next processing object under the condition that the updated hash value matches the preset cutting condition.

[0041] Furthermore, the cutting module is also used to determine that the data block has completed update storage under the condition that the data block identifier of the data block is the same as the data block identifier stored in the metadata; under the condition that the data block identifier of the data block is different from the data block identifier stored in the metadata, store the data block at the end of the storage data chain corresponding to the metadata, and add the data block identifier and data block information of the data block in the metadata.

[0042] Furthermore, the device also includes:

[0043] A retrieving module, configured to retrieve a target data block corresponding to a target version of the game data from the data block storage location under the condition that the size of the data block matches a preset query threshold;

[0044] An output module is used to output the target data block when the hash value of the target data block matches the hash value of the data block.

[0045] According to another aspect of the present invention, a storage medium is provided, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute operations corresponding to the above-mentioned game data cutting method.

[0046] According to another aspect of the present invention, there is provided a terminal, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0047] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned game data cutting method.

[0048] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0049] The present invention provides a game data cutting method and device, a storage medium, and a terminal. Compared with the prior art, the embodiments of the present invention obtain game data, wherein the format of the game data is binary; read a processing object in the game data according to a preset sliding window length, and determine a hash value of the processing object; and cut the data based on the data position of the processing object under the condition that the hash value matches a preset cutting condition to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions, thereby achieving accurate cutting of the game data, greatly reducing the low query efficiency caused by frequent data version updates, saving a large amount of game system resources, and thus improving the processing efficiency of the game data.

[0050] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0052] Figure 1 A flowchart of a game data cutting method provided by an embodiment of the present invention is shown;

[0053] Figure 2 A block diagram of a game data cutting device provided by an embodiment of the present invention is shown;

[0054] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0055] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0056] The embodiment of the present invention provides a game data cutting method, such as Figure 1 As shown, the method includes:

[0057] 101. Get game data.

[0058] In the embodiment of the present invention, the current execution end may be a server end or execution terminal for game development, such as a cloud server, etc., so as to obtain game data. Among them, the game in the embodiment of the present invention may be a large-scale online multiplayer control game, or a small stand-alone control game, etc., which is not specifically limited in the embodiment of the present invention. In the process of game development, the game data that can be obtained by the current execution end include, but are not limited to, game scene data and game character data developed by developers for game content, and behavior data generated by game players performing control operations in the game, etc., which are not specifically limited in the embodiment of the present invention.

[0059] It should be noted that when the current execution end obtains the game data, it can be after the game data version is updated, or it can be obtained in real time when the game data version is updated. At this time, the game data in binary format is obtained.

[0060] 102. Read a processing object in the game data according to a preset sliding window length, and determine a hash value of the processing object.

[0061] In the embodiment of the present invention, after the current execution end obtains the game data, it reads the processing object in the game data based on the preset sliding window length, so as to use the processing object as the data to be cut and perform hash value calculation. Among them, the preset sliding window length is preferably a 4-byte unit length, that is, 4 bits. At this time, the current execution end reads the game data in sequence according to the length of 4 bits, for example, reads the binary game data corresponding to byte1, byte2, byte3, and byte4 respectively as the processing object, and when the data segmentation of the processing object of the 4-byte length is completed, the next set of data is read according to the preset sliding window length, that is, the binary game data corresponding to byte2, byte3, byte4, and byte5 are read as the next processing object, and so on. The embodiment of the present invention does not make specific limitations. In addition, after the current execution end determines the processing object, it calculates the hash value of the processing object. Specifically, when calculating the hash value, it can be calculated in combination with the 4-byte length read above, for example, hash = ((byte[i]*31+byte[i+1])*31+byte[i+2])*31+byte[i+3], i is the byte position, and the value 31 is the hash value calculation coefficient of the preferred configuration, which is not specifically limited in the embodiment of the present invention.

[0062] It should be noted that in the embodiment of the present invention, since the sliding window length configured by the existing QuickCDC, FastCDC, RapidCDC and other algorithms is usually 32-48 bytes in length, and the current execution end can configure the preset sliding window length as 4 bytes in length through the SwiftCDC algorithm, the suitability of the segmentation point can be greatly increased when judging the segmentation conditions, thereby improving the management efficiency of the data block. Among them, SwiftCDC is a binary file segmentation algorithm with the advantages of fast calculation speed, large cutting data blocks, and high cutting accuracy. It is used to cut a large binary file into several small files so that incremental updates can be realized in the game project management warehouse, thereby improving the processing efficiency of the game data as a resource management after the game data is cut based on the SwiftCDC algorithm.

[0063] 103. Under the condition that the hash value matches a preset cutting condition, cutting is performed based on the data position of the processing object to obtain a data block for updating metadata.

[0064] In the embodiment of the present invention, after the current execution end calculates the hash value of the processing object as the data to be cut, it matches the preset cutting condition. When matching the preset cutting condition, the data is cut according to the data position of the processing object to obtain the cut data block. At this time, the cut data block also generates a data block identifier and data block information at the same time, so that the data block update is stored in the metadata, so that when querying different versions of game data, it can be queried and retrieved from the metadata. Among them, the metadata stores at least one data block information of the game data and the data block identifiers of different game data versions. The data block information includes the data block hash value, data block size, and data block storage location corresponding to the different data block identifiers, so as to query the game data of the corresponding game version based on the data block information and data block identifiers in the metadata. Management operations such as querying. In addition, the metadata can be a text file (such as JSON, XML or YAML format) or a binary format file, which is not specifically limited in the embodiment of the present invention. In a specific embodiment, the metadata is an unencrypted metafile consisting of several lines, where if the line starts with b, it means that this line records block information, i.e., the hash, ID, storage location and size of the block; if the line starts with v, it means that this line records version information, i.e., the version number of the version, and the version number indicates which data blocks it is composed of (such as data block identifiers), which is not specifically limited in the embodiment of the present invention.

[0065] In another embodiment of the present invention, for further explanation and limitation, the step of performing cutting based on the data position of the processing object under the condition that the hash value matches the preset cutting condition includes:

[0066] Dividing the hash value by a preset prime number object to obtain a calculation result;

[0067] Under the condition that the operation result is equal to the preset cutting value, the data position of the processing object is determined, and the processing object is cut at the data position according to the preset data block size to obtain the data block.

[0068] In order to determine the optimal data cutting point, thereby improving the accuracy and efficiency of cutting the game data, the preset cutting condition configured by the current execution end can be to compare the operation result obtained by calculating the hash value with the preset cutting value. Wherein, when performing the operation based on the hash value, the operation result is obtained by dividing the hash value with the preset prime number object, such as the hash value y divided by the preset prime number object 373612 to obtain the operation result a. At this time, the preset cutting value is a pre-configured integer value, that is, the operation result a is an integer, or the hash value y can be divided by 373612, as the cutting condition for cutting the processing object, the embodiment of the present invention does not make specific restrictions. In addition, in the embodiment of the present invention, after the current execution end determines the optimal cutting point, the data position of the processing object to be cut is determined, so that the processing object is cut according to the preset data block size to obtain the cut data block. Wherein, the preset data block size can be divided into the cutting range by setting the maximum value and the minimum value, such as the preset data block size is 128k-1M, and the embodiment of the present invention does not make specific restrictions. At the same time, the data position is used to characterize the position of the processing object as the data to be cut in the game data, so as to cut according to the preset data block size based on this data position as the starting point to obtain at least one data block, which is not specifically limited in the embodiment of the present invention.

[0069] It should be noted that when the current execution end performs the division operation between the hash value and the preset prime number object, the predetermined preset prime number object corresponds to different game data versions, such as game data version a, the preset prime number object is 373612, and game data version b, the preset prime number object is 1662647, and the embodiment of the present invention does not specifically limit it. In addition, in the embodiment of the present invention, for the latest game data version, the preset prime number object is preferably 373612, and the embodiment of the present invention does not specifically limit it.

[0070] In another embodiment of the present invention, for further explanation and limitation, the step of reading the processing object in the game data according to the preset sliding window length includes:

[0071] Under the condition that the data length of the game data matches the hash operation length, filtering the non-cut data in the game data according to a preset data block minimum value;

[0072] The game data for filtering the non-cut data is read according to a preset sliding window length to determine the processing object.

[0073] In order to improve the accuracy of determining the processing object as the data to be cut, so as to meet the judgment of the optimal cutting point based on the processing object, when the current execution end reads the processing object according to the preset sliding window length, it first compares the data length of the game data with the hash operation length to ensure that the read processing object can calculate the hash value. Among them, the hash operation length can be determined based on the reading requirement or the data block hash value calculation requirement, and the embodiment of the present invention does not make specific limitations. When the data length of the game data matches the hash operation length, it means that the processing object read out based on this game data can perform a hash value calculation, and then the non-cutting data can be filtered according to the preset data block minimum value to ensure the reuse rate of the data block and avoid repeated cutting of the game data that can constitute the minimum data block unit. Among them, the preset data block minimum value is greater than or equal to 128 kilobytes in unit length, that is, the current execution end sets a minimum value of a data block. When there are already cut data blocks or uncut data that are smaller than the minimum value of the data block in the game data, the data block or the cut data will not be cut (that is, these data or data blocks will be filtered). If the processing object read in the game data is a data block larger than the minimum value of the data block, it will still be cut according to the data block, that is, the game data of the filtered non-cut data is read according to the preset sliding window length. The setting of the corresponding preset data block minimum value in the embodiment of the present invention is not specifically limited.

[0074] In another embodiment of the present invention, for further explanation and limitation, the steps further include:

[0075] When the total length of the plurality of non-cut data is greater than the preset data block maximum value, the plurality of non-cut data are determined as the processing objects to perform hash value calculation.

[0076] In order to improve the accuracy of determining the processing object to be cut as data to be cut, so as to meet the judgment of the optimal cutting point based on the processing object, after determining the non-cutting data, the current execution end can also compare the total length of multiple non-cutting data with the preset data block maximum value, so as to directly cut when the total length of the data is greater than the preset data block maximum value. Specifically, when the total value of the data length of multiple non-cutting data counted by the current execution end is greater than the preset data block maximum value, it means that there are too many non-cutting data and the data is too long. In order to facilitate the resource management of game data, even as a single non-cutting data, it is still necessary to combine multiple non-cutting data and determine them as processing objects to be cut, so as to calculate the hash value and then cut. Among them, the preset data block maximum value is less than or equal to 1 megabyte unit length, that is, the current execution end sets the maximum value of a data block and counts the data lengths of multiple non-cutting data that have been determined. When the total value of the data length is greater than the preset data block maximum value, it means that multiple non-cutting data have occupied too many storage resources. Therefore, multiple non-cutting data are directly combined and used as processing objects for forced cutting, thereby improving the flexibility and efficiency of game data cutting. In the embodiment of the present invention, the preset data block maximum value is not specifically limited.

[0077] In another embodiment of the present invention, for further explanation and limitation, the steps further include:

[0078] Under the condition that the hash value does not match the preset cutting condition, the next processing object in the game data is read according to the preset sliding window length, and the updated hash value of the next processing object is calculated to cut the next processing object under the condition that the updated hash value matches the preset cutting condition.

[0079] In order to effectively cut all game data, after determining the processing object, the current execution end determines whether the hash value of the processing object matches the preset cutting condition to determine whether to read the next processing object. Specifically, if the hash value of the processing object does not match the preset cutting condition, it means that the processing object cannot be cut. Therefore, the current execution end slides and reads the next processing object according to the preset sliding window length. For example, after reading the binary game data corresponding to byte1, byte2, byte3, and byte4 as the processing object a according to the 4-bit length, the hash value of the processing object a is calculated, and based on this hash value divided by the preset prime number object is 373612, the calculation result does not match the preset cutting condition, which means that the processing object is not cut, and then the binary game data corresponding to byte2, byte3, byte4, and byte5 are read according to the sliding window length of 4 bits as the next processing object to recalculate the hash value of the next processing object and cut it when the preset cutting condition is met. In addition, the preset sliding window length is configured as 4 bits by the current execution end to determine the block size with the best balance, improve the data block compression speed, and achieve high efficiency in reading different versions of game data.

[0080] In another embodiment of the present invention, for further explanation and limitation, the step of updating and storing the cut data blocks into the metadata includes:

[0081] Under the condition that the data block identifier of the data block is the same as the data block identifier stored in the metadata, determining that the update storage of the data block is completed;

[0082] Under the condition that the data block identifier of the data block is different from the data block identifier stored in the metadata, the data block is stored at the end of the storage data chain corresponding to the metadata, and the data block identifier and data block information of the data block are added to the metadata.

[0083] In order to achieve efficient management of different versions of game data and meet the flexible processing requirements of game data, the current execution end stores the data block information and data block identification of the cut data block in the metadata, so that the corresponding data block can be queried from the metadata at any time based on the version query request and then the game data can be retrieved. Specifically, when the current execution end stores the data block information and data block identification in the metadata, it first determines whether the cut data block already exists in the metadata, that is, it can be compared one by one through the data block identification to see whether there is the same data block information. If there is, it means that the cut data block has been updated to the metadata. At this time, the current execution end determines that the data block update storage is completed. If there is no same data block identification, it means that the data block information and data block identification of the split data block are not stored in the metadata. Therefore, the current execution end stores the data block at the end of the storage data chain corresponding to the metadata, and adds the data block identification and data block information of the data block in the metadata. Among them, the storage data chain can be a separate storage space for storing data blocks, or it can be a data file corresponding to the metadata, and then the data block is stored at the end of the storage data chain, which is not specifically limited in the embodiment of the present invention. At the same time, data block identifiers and data block information are added to the metadata. Since the data block information includes the data block hash value, data block size, and data block storage location corresponding to different data block identifiers, the data version of different game data can be reflected by the data block identifier, and the storage status of different versions of game data can be reflected by the data block information, thereby improving the effectiveness of game data management.

[0084] In addition, the stored data blocks are obtained by splicing together several small data blocks, thereby avoiding read-write conflicts. Since the computing system cannot perform "read" and "write" operations on a data file at the same time. The current execution end stores the data blocks at the end of the storage data chain corresponding to the metadata, which can greatly limit the reading to not include the tail data blocks, that is, the data blocks being written are not read during reading, thereby avoiding read-write conflicts.

[0085] In another embodiment of the present invention, for further explanation and limitation, the steps further include:

[0086] Under the condition that the size of the data block matches a preset query threshold, retrieving a target data block corresponding to a target version of the game data from the data block storage location;

[0087] When the hash value of the target data block matches the data block hash value, the target data block is output.

[0088] In order to achieve the purpose of searching for different versions of game data based on metadata, the current execution end can compare the data block size with the pre-configured query threshold. If it matches the preset query threshold, it means that the corresponding data block can be retrieved for query and reading. Therefore, the current execution end retrieves the corresponding target data block of the target version according to the data block storage location. Among them, the target version can be carried and obtained by triggering a data version query request, and can also be carried and obtained based on a preset query instruction. The embodiment of the present invention does not make specific limitations. After the target data block is retrieved, in order to ensure the queryability of the data block, the current execution end calculates the hash value of the target data block and compares it with the data block hash value in the data block information. If they are the same, it means that the target data block can be retrieved for query and output. The embodiment of the present invention does not make specific limitations.

[0089] In a specific implementation scenario, when a modified image is uploaded again as game data, the new image can be split into data blocks to calculate the hash value SHA-1 of the data block. At this time, if the metadata file already contains the hash value SHA-1 of this data block, there is no need to submit and store this data block. At the same time, the new data block and the data blocks that the metadata file is composed of can be read through the metadata file to restore the current version of the game data.

[0090] In another specific implementation scenario, the current execution end can cut game data in different formats, including but not limited to PSD, TGA, ZBrush, SP, Blend, etc., which is not specifically limited in the embodiment of the present invention. For example, for game data in PSD format, after cutting the game data of version 1, 75 data blocks are obtained, and after cutting the game data of version 2, 94 data blocks are obtained, of which 37 data blocks can be reused, which greatly reduces the average compression time consumption and improves the data reuse rate.

[0091] In another specific implementation scenario, for a 4G PSD format game data, it is cut and compressed into a 2G file according to the first data version, and the average compression time for a 1G file is 120 seconds. After the second and third data versions are cut and compressed into 200M files, the average compression time for a 1G file is 74 seconds, and the average decompression time is 15 seconds, which greatly reduces the average time consumption for data compression, and the reuse rate reaches 60%, improving the data reuse rate.

[0092] The embodiment of the present invention provides a game data cutting method. Compared with the prior art, the embodiment of the present invention obtains game data, wherein the format of the game data is binary; reads a processing object in the game data according to a preset sliding window length, and determines a hash value of the processing object; and cuts the game data based on the data position of the processing object under the condition that the hash value matches a preset cutting condition, so as to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions, thereby achieving accurate cutting of the game data, greatly reducing the low query efficiency caused by frequent data version updates, saving a large amount of game system resources, and thus improving the processing efficiency of the game data.

[0093] Furthermore, as a response to the above Figure 1 The embodiment of the present invention provides a game data cutting device, such as Figure 2 As shown, the device comprises:

[0094] An acquisition module 21 is used to acquire game data, wherein the game data is in a binary format;

[0095] A determination module 22, configured to read a processing object in the game data according to a preset sliding window length, and determine a hash value of the processing object;

[0096] The cutting module 23 is used to cut based on the data position of the processing object under the condition that the hash value matches the preset cutting condition, so as to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions.

[0097] Furthermore, the preset sliding window length is a 4-byte unit length.

[0098] Furthermore, the cutting module comprises:

[0099] A calculation unit, used for dividing the hash value by a preset prime number object to obtain a calculation result;

[0100] The cutting unit is used to determine the data position of the processing object under the condition that the calculation result is equal to the preset cutting value, and cut the processing object at the data position according to the preset data block size to obtain the data block, and the preset prime number object corresponds to different game data versions.

[0101] Furthermore, the determining module includes:

[0102] A filtering unit, configured to filter the non-cut data in the game data according to a preset data block minimum value under the condition that the data length of the game data matches the hash operation length, and the preset data block minimum value is greater than or equal to a unit length of 128 kilobytes;

[0103] A reading unit is used to read the game data after filtering the non-cut data according to a preset sliding window length to determine the processing object.

[0104] Further,

[0105] The determination module is also used to determine the multiple non-cut data as the processing objects for hash value calculation when the total data length of the multiple non-cut data is greater than the preset data block maximum value, and the preset data block maximum value is less than or equal to 1 megabyte unit length.

[0106] Furthermore, the device also includes:

[0107] A reading module is used to read the next processing object in the game data according to the preset sliding window length under the condition that the hash value does not match the preset cutting condition, and calculate the updated hash value of the next processing object, so as to cut the next processing object under the condition that the updated hash value matches the preset cutting condition.

[0108] Furthermore, the cutting module is also used to determine that the data block has completed update storage under the condition that the data block identifier of the data block is the same as the data block identifier stored in the metadata; under the condition that the data block identifier of the data block is different from the data block identifier stored in the metadata, store the data block at the end of the storage data chain corresponding to the metadata, and add the data block identifier and data block information of the data block in the metadata.

[0109] Furthermore, the device also includes:

[0110] A retrieving module, configured to retrieve a target data block corresponding to a target version of the game data from the data block storage location under the condition that the size of the data block matches a preset query threshold;

[0111] An output module is used to output the target data block when the hash value of the target data block matches the hash value of the data block.

[0112] An embodiment of the present invention provides a game data cutting device. Compared with the prior art, the embodiment of the present invention obtains game data, wherein the format of the game data is binary; reads a processing object in the game data according to a preset sliding window length, and determines a hash value of the processing object; and cuts the data based on the data position of the processing object under the condition that the hash value matches a preset cutting condition to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions, thereby achieving accurate cutting of the game data, greatly reducing the low query efficiency caused by frequent data version updates, saving a large amount of game system resources, and thus improving the processing efficiency of the game data.

[0113] According to an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the game data cutting method in any of the above method embodiments.

[0114] Figure 3 A schematic diagram of the structure of a terminal provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the terminal.

[0115] like Figure 3 As shown, the terminal may include: a processor (processor) 302 , a communication interface (Communications Interface) 304 , a memory (memory) 306 , and a communication bus 308 .

[0116] The processor 302 , the communication interface 304 , and the memory 306 communicate with each other via the communication bus 308 .

[0117] The communication interface 304 is used to communicate with other devices such as clients or other servers.

[0118] The processor 302 is used to execute the program 310, and specifically can execute the relevant steps in the above-mentioned game data cutting method embodiment.

[0119] Specifically, the program 310 may include program codes, which include computer operation instructions.

[0120] The processor 302 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiment of the present invention. The one or more processors included in the terminal may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0121] The memory 306 is used to store the program 310. The memory 306 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0122] The program 310 may be specifically configured to enable the processor 302 to perform the following operations:

[0123] Acquire game data, where the format of the game data is binary;

[0124] Reading a processing object in the game data according to a preset sliding window length, and determining a hash value of the processing object;

[0125] Under the condition that the hash value matches a preset cutting condition, cutting is performed based on the data position of the processing object to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions.

[0126] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A game data cutting method, characterized in that: include: Acquire game data, where the format of the game data is binary; Reading a processing object in the game data according to a preset sliding window length, and determining a hash value of the processing object; Under the condition that the hash value matches a preset cutting condition, cutting is performed based on the data position of the processing object to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions.

2. The method according to claim 1, characterized in that The preset sliding window length is 4 bytes in unit length.

3. The method according to claim 2, characterized in that The cutting based on the data position of the processing object under the condition that the hash value matches the preset cutting condition includes: Dividing the hash value by a preset prime number object to obtain a calculation result; Under the condition that the calculation result is equal to the preset cutting value, the data position of the processing object is determined, and the processing object is cut at the data position according to the preset data block size to obtain the data block, and the preset prime number object corresponds to different game data versions.

4. The method according to claim 3, characterized in that: The reading of the processing object in the game data according to the preset sliding window length comprises: Under the condition that the data length of the game data matches the hash operation length, filtering the non-cut data in the game data according to a preset data block minimum value, the preset data block minimum value is greater than or equal to a unit length of 128 kilobytes; The game data for filtering the non-cut data is read according to a preset sliding window length to determine the processing object.

5. The method according to claim 3, characterized in that: The method further comprises: When the total length of the plurality of non-cut data is greater than a preset data block maximum value, the plurality of non-cut data are determined as the processing objects for hash value calculation, and the preset data block maximum value is less than or equal to 1 megabyte unit length.

6. The method according to claim 4 or 5, characterized in that: The method further comprises: Under the condition that the hash value does not match the preset cutting condition, the next processing object in the game data is read according to the preset sliding window length, and the updated hash value of the next processing object is calculated to cut the next processing object under the condition that the updated hash value matches the preset cutting condition.

7. The method according to claim 1, characterized in that The step of updating and storing the cut data blocks into the metadata includes: Under the condition that the data block identifier of the data block is the same as the data block identifier stored in the metadata, determining that the update storage of the data block is completed; Under the condition that the data block identifier of the data block is different from the data block identifier stored in the metadata, the data block is stored at the end of the storage data chain corresponding to the metadata, and the data block identifier and data block information of the data block are added to the metadata.

8. The method according to any one of claims 1 to 7, characterized in that: The data block information includes data block hash values, data block sizes, and data block storage locations corresponding to different data block identifiers. The method further includes: Under the condition that the size of the data block matches a preset query threshold, retrieving a target data block corresponding to a target version of the game data from the data block storage location; When the hash value of the target data block matches the data block hash value, the target data block is output.

9. A game data cutting device, characterized in that: include: An acquisition module, used for acquiring game data, wherein the game data is in a binary format; A determination module, configured to read a processing object in the game data according to a preset sliding window length, and determine a hash value of the processing object; A cutting module is used to cut based on the data position of the processing object under the condition that the hash value matches the preset cutting condition to obtain a data block for updating metadata, wherein the metadata stores at least one data block information of the game data and data block identifiers of different game data versions.

10. A storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to execute an operation corresponding to the game data cutting method as described in any one of claims 1-8.

11. A terminal, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the game data cutting method as described in any one of claims 1-8.