Method, Medium and Device for Managing Player Data
By using a combination of data slot sequences and metadata tables in player data management, the problems of data misalignment, low storage efficiency and system crash in the prior art are solved, efficient data access and automatic data coverage are achieved, and overall data management efficiency is improved.
Patent Information
- Application Number
- CN202210363537.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2042-04-08
AI Technical Summary
The prior art has the risk of data misalignment, low storage efficiency, reduced data value over time, and system crashes in player data management.
Using a combination of data slot sequence and metadata table, the server collects historical behavior data of the player character in the predetermined period, and judges whether there is a corresponding data block through the metadata table. If it exists, calculates the storage location and writes it to the data slot sequence; if it does not exist, builds the data block and stores it in the initial data slot to update the metadata table.
Improve the access and reading efficiency of player data. By controlling the length of the data slot sequence, newly written data automatically covers data with a longer storage time, optimizes data management efficiency and avoids system crashes.
Smart Images

Figure CN114733206B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of data processing and data structures, and particularly relates to a method, medium, and device for managing player data. Background Art
[0002] Existing online game programs are often designed to record the behavior logs of all player characters in the game program and select multiple player character behavior logs for subsequent data analysis and feature extraction in machine learning.
[0003] Traditional player data analysis focuses on the perspective of physical time, splitting and storing player data by natural days of physical time and then performing cross-comparative analysis. However, such comparative analysis is prone to misalignment. For example, if the recent 15 days are set as the data analysis interval, player A logs in every day within the recent 15 days, and player B only logs in for two days within the recent 15 days, then the overlapping part of the data of player A and player B only accounts for two-fifteenths of the overall data, and the data of player B is empty on other aligned dates. Obviously, the conclusion of the comparative analysis drawn in this case has a large deviation. On the other hand, as time flows, the value of data stored for a longer time becomes smaller. For example, the combat style of player A today is usually closer to that of yesterday, but compared with his combat style 1000 days ago, it is very likely to have obvious differences. Therefore, if we want to predict the combat style of player A tomorrow, we generally use the styles of today and yesterday to extract data features, rather than the style 1000 days ago. It can be seen that an efficient storage mechanism needs to be established for player data to meet various scenarios of player data utilization.
[0004] In an existing data storage system, when storing player data, one solution is to use physical-time-based partitioning to store the data of multiple players. For example, the player data generated by Player A and Player B on November 8, 2021 are both stored in the partition with partition = 2021 - 11 - 08. Based on this solution, if a certain partition is damaged, all the information of multiple players on the same day will be lost. It is neither possible to know whether a player logged in on that day nor whether the player generated player data on that day. Therefore, the life cycles of multiple players are disrupted. Another solution is to use hash partitioning to store the data of multiple players. Typically, for example, if the account suffixes of Player A and Player Z are a, and the account string suffix of Player B is n, then the data of A and Z will be stored in the partition with partition = a, while Player B will be stored in the partition with partition = n. Based on this solution, when deleting the player data with a longer storage time each time, it is necessary to scan all the data in the partition, consuming a large amount of resources. If the above deletion is not performed, the accumulated data volume will become larger and larger, and over time, it will cause the system to crash. In addition, regardless of which of the above solutions, when it is necessary to align the data of multiple players on the time axis, it is necessary to access all the partitions, separately retrieve the corresponding player data, and perform alignment sorting in memory, with both the space complexity and the time complexity being very high. It can be seen that the existing methods for managing player data in the prior art are difficult to achieve the expected efficiency. Summary of the Invention
[0005] To overcome the above-mentioned defects in the prior art, the present invention provides a method for managing player data, which includes:
[0006] The server-side collects the historical behavior data generated by the player character within a predetermined period.
[0007] According to the metadata table, it is judged whether there is a data block corresponding to the player character. The data block includes a data slot sequence formed by sequentially arranging a plurality of data slots.
[0008] If the result of the judgment is yes, calculate the storage location of the historical behavior data according to the existing pointer entry corresponding to the data block in the metadata table, write the historical behavior data into the target data slot determined according to the storage location in the data slot sequence, and update the existing pointer entry to record the operation information of the writing.
[0009] According to an aspect of the present invention, the method further includes: if the result of the judgment is no, construct the data block, store the historical behavior data in the initial data slot arranged at the head of the data slot sequence, and create a new pointer entry in the metadata table to record the operation information of the storage and the attribute information of the data block.
[0010] According to another aspect of the present invention, the step of calculating the storage location of the historical behavior data according to the existing pointer entry corresponding to the data block in the metadata table in the method includes: obtaining the data slot pointer of the data block and the storage address of the data block from the existing pointer entry; changing the pointing position of the data slot pointer in the data slot sequence according to a preset rule; determining the storage location according to the storage address and the pointing position of the data slot pointer.
[0011] According to another aspect of the present invention, the step of changing the pointing position of the data slot pointer in the data slot sequence according to a preset rule in the method includes: in the data slot sequence, taking a single data slot in the data slot sequence as a moving unit, moving the pointing position of the data slot pointer one bit towards the end of the data slot sequence. If the movement causes the pointing position of the data slot pointer to overflow from within the data slot sequence, set the data slot pointer to point to the first position of the data slot sequence.
[0012] According to another aspect of the present invention, the step of writing the historical behavior data into the target data slot determined according to the storage location in the data slot sequence includes: determining the write address of the historical behavior data according to the storage location; writing the historical behavior data into the write address to overwrite the data already stored in the target data slot.
[0013] According to another aspect of the present invention, the operation information written includes: information for recording the execution time of the write; information for recording the generation date of the historical behavior data; the value of the data slot pointer pointing to the target data slot.
[0014] According to another aspect of the present invention, the operation information stored includes: information for recording the execution time of the storage; information for recording the generation date of the historical behavior data; the value of the data slot pointer pointing to the initial data slot.
[0015] According to another aspect of the present invention, the historical behavior data includes: operation events generated by the player character in the game program and their statistical values; and / or activity events participated in by the player character in the game program and their statistical values; and / or logical events triggered by the player character in the game program and their statistical values.
[0016] According to another aspect of the present invention, the attribute information of the data block includes: information for backtracking and searching for the player character; the storage address of the data block.
[0017] According to another aspect of the present invention, the method further includes: receiving query information; finding out pointer entries matching the query information from the metadata table; obtaining the storage address of the corresponding target data block from the pointer entries, reading the target data block from the storage address and loading it into the memory; obtaining the data slot pointer of the target data block from the pointer entries, and at the data slot pointed to by the data slot pointer, splitting the global data slot sequence constituting the target data block into two parts to form a first data slot sequence and a second data slot sequence, wherein the tail element of the first data slot sequence is the data slot pointed to by the data slot pointer; splicing the tail of the second data slot sequence to the head of the first data slot sequence to obtain a reverse time-aligned data slot sequence.
[0018] According to another aspect of the present invention, the query information in the method includes a player account.
[0019] According to another aspect of the present invention, the predetermined period in the method is 24 hours.
[0020] In addition, the present invention provides one or more computer-readable media storing computer-executable instructions, and when the instructions are used by one or more computer devices, the one or more computer devices are caused to execute the method for managing player data as described above.
[0021] The present invention also provides a computer device, which includes a memory and a processor, wherein: the memory stores a computer program, and when the processor executes the computer program, the method for managing player data as described above is implemented.
[0022] The method for managing player data provided by the present invention uses data blocks including data slot sequences to store historical behavior data of different player characters, and uses a metadata table to manage and maintain the data blocks. Its advantages are: on the one hand, the efficiency of accessing and reading historical behavior data of player characters is improved; on the other hand, by controlling the length of the data slot sequence, newly written historical behavior data can automatically overwrite historical behavior data with a longer storage time, optimizing the management efficiency of global player character historical behavior data and avoiding system crashes caused by excessive global data. Based on the above scheme of the data slot sequence and the metadata table working together, when it is necessary to call historical behavior data of multiple player characters for analysis or feature extraction in the future, it is convenient to quickly achieve reverse alignment of historical behavior data of multiple player characters in a specific period. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Other features, objects, and advantages of the present invention will become more apparent by reading the detailed description of the non-limiting specific embodiments with reference to the following drawings:
[0024] Figure 1 is a schematic flowchart of a specific embodiment of the method for managing player data according to the present invention;
[0025] Figure 2 is Figure 1 a schematic flowchart of an alternative specific embodiment of step S310 shown;
[0026] Figure 3 is a schematic flowchart of an alternative specific embodiment of the method for managing player data according to the present invention;
[0027] Figure 4 is Figures 1 to 3 a schematic diagram of the data structure changes of each data object involved in the specific embodiment shown;
[0028] Figure 5 is a schematic flowchart of yet another alternative specific embodiment of the method for managing player data according to the present invention;
[0029] Figure 6 is Figure 5 a schematic diagram of the data structure changes of each data object involved in the specific embodiment shown;
[0030] Figure 7 is a schematic diagram of the structure of a typical computer device for implementing the specific embodiment of the method for managing player data according to the present invention.
[0031] The same or similar reference numerals in the drawings represent the same or similar components. Specific Embodiment
[0032] For a better understanding and explanation of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings. The present invention is not limited solely to these specific embodiments. On the contrary, modifications or equivalent replacements made to the present invention shall be covered within the scope of the claims of the present invention.
[0033] It should be noted that numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present invention can be implemented without these specific details. In the following multiple specific embodiments, well-known principles, structures, and components are not described in detail in order to highlight the gist of the present invention.
[0034] The present invention provides a method for managing player data. Please refer to Figure 1 , Figure 1 is a schematic flowchart of a specific embodiment of the method for managing player data according to the present invention. The method includes:
[0035] Step S100, the server collects the historical behavior data generated by the player character within a predetermined period;
[0036] Step S200, determine whether there is a data block corresponding to the player character according to the metadata table, and the data block includes a data slot sequence formed by arranging a plurality of data slots in sequence;
[0037] When the result of the judgment in step S200 is yes, execute steps S310 to S330:
[0038] Step S310, calculate the storage location of the historical behavior data according to the existing pointer entry corresponding to the data block in the metadata table;
[0039] Step S320, write the historical behavior data into the target data slot determined according to the storage location in the data slot sequence;
[0040] Step S330, update the existing pointer entry to record the operation information of the writing.
[0041] The following will describe Figure 1 each step in detail.
[0042] Specifically, in step S100, the server side refers to one or more server devices that provide online game services, and the player character refers to a virtual character within the program created or selected by the user of the online game program. In the online game program, various interaction operations and triggered events performed by the user on the player character are all objects recorded in the historical behavior data. Typically, the historical behavior data includes, but is not limited to: operation events generated by the player character in the game program (such as skill release events related to combat, teleportation events related to movement, etc.) and their statistical values, and / or activity events participated by the player character in the game program (such as in-game purchase events, lottery events, equipment synthesis events, etc.) and their statistical values, and / or logical events triggered by the player character in the game program (such as character death events, adding in-game friends events, game win events, etc.) and their statistical values. During the process of the user operating the player character to play the game normally, the amount of the historical behavior data increases correspondingly with the increase of the game duration. In order to avoid excessive data volume, it is necessary to limit the duration for collecting the historical behavior data, that is, in step S100, the server side collects the historical behavior data generated by the player character within a predetermined period. Typically, the predetermined period is usually set to 24 hours, and the starting time of this predetermined period is zero o'clock, and the ending time is zero o'clock of the next day. According to this setting, the historical behavior data collected by the server side in step S100 is all the historical behavior data generated by the player character within a natural day. In addition, if there are additional granularity requirements for the analysis and feature extraction of the historical behavior data, the length of the predetermined period can be adaptively selected, such as set to 12 hours or one week.
[0043] For better illustration Figure 1 please refer to Figure 4 for reference, Figure 4 which is Figures 1 to 3 a schematic diagram of the data structure changes of each data object involved in the specific implementation shown. When the predetermined period is determined, the server of the online game program often records the historical behavior data of all player characters who log in and play the game within the predetermined period, and finally obtains the global player data within the predetermined period. And the historical behavior data collected by the server side in step S100 is that generated by a single player character within the predetermined period. Therefore, the historical behavior data is usually obtained by splitting the global player data. As Figure 4 shown, assuming that there are 4 player characters who log in and play the game within the predetermined period, the global player data 20 can finally be split into historical behavior data corresponding to 4 different player characters, which are Figure 4 the historical behavior data 21 of player character 1, the historical behavior data 22 of player character 2, the historical behavior data 23 of player character 3, and the historical behavior data 24 of player character 4 shown in
[0044] In step S200, it is determined whether there is a data block corresponding to the player character in step S100 according to the metadata table. Among them, metadata is data that describes objects such as information resources or data. Obviously, an important function of metadata is to provide index mapping. And the metadata table is a table that records multiple metadata. When the unit metadata in the metadata table is established with the data block, and the unit metadata presets information associated with the player character, the metadata table can be used to perform a matching comparison with the player character to find the data block corresponding to the player character. In this specific embodiment, the unit metadata of the metadata table is implemented as a pointer entry, that is, each row of the metadata table corresponds to a pointer entry. The data structure for storing data in the data block needs to be specially set. Typically, the data block includes a data slot sequence formed by sequentially arranging multiple data slots. It should be specifically noted that both the data block and the data slot can be specified storage areas on the storage medium, and there is a correlation between them in the management logic of the file storage system. For example, the data block is a folder in the file storage system, and the data slot is a sub-folder created under the directory of the above folder, or a file stored in the above folder. The number of data slots included in the data block can be determined according to the expected amount of data to be stored. For example, when the predetermined period is selected as 24 hours, and it is desired to store all historical behavior data of the player character within one month, the number of data slots in the data block can be set to 30.
[0045] When the result of the judgment in step S200 is yes, it means that the data block corresponding to the player character has been found according to the metadata table, that is, the storage resource for storing the historical behavior data of the player character has been specified for the player character by creating a data block, and then steps S310 to S330 are further executed.
[0046] In step S310, the storage location of the historical behavior data is calculated according to the existing pointer entry corresponding to the data block in the metadata table. More specifically, it is calculated which data slot in the data slot sequence the historical behavior data is finally written into through the existing pointer entry. An optional specific implementation of step S310 is as Figure 2 shown Figure 2 FIG. shows a schematic flowchart of an optional specific implementation of step S310. Step S310 can further include the following steps:
[0047] Step S311, obtaining the data slot pointer and the storage address of the data block from the existing pointer entry;
[0048] Step S312: Change the pointing position of the data slot pointer in the data slot sequence according to a preset rule;
[0049] Step S313: Determine the storage position according to the storage address and the pointing position of the data slot pointer.
[0050] The existing pointer entry already exists in the metadata table before step S311 is executed. The existing pointer entry at least includes the data slot pointer of the data block and the storage address of the data block. Before step S312 is executed, the data slot pointer points to a specific data slot in the data slot sequence of the data block, which means that the previous write operation for the data block writes data into the specific data slot. After step S312 is executed, the pointing position of the data slot pointer in the data slot sequence is changed according to the preset rule, which means which data slot in the data slot sequence the historical behavior data collected in step S100 is specifically written into. Finally, in step S313, the storage position is determined according to the storage address and the pointing position of the data slot pointer. Obviously, after the storage address of the data block and the pointing position of the data slot pointer are both determined, the logical position where the historical behavior data is finally written can be determined.
[0051] Specifically, a preferred embodiment of step S312 can be implemented as the following steps: In the data slot sequence, using a single data slot in the data slot sequence as the moving unit, move the position pointed to by the data slot pointer one position towards the end of the data slot sequence. If the movement causes the position pointed to by the data slot pointer to overflow from the data slot sequence, set the data slot pointer to point to the first position of the data slot sequence. This can ensure that the data slot where the data is written this time is traceable relative to the data slot where the data was written last time.
[0052] Further, in step S320, write the historical behavior data into the target data slot determined according to the storage position in the data slot sequence. For this specific embodiment, the significance of executing step S310 is to determine that the storage position is the target data slot. If only the historical behavior data is written into the target data slot without any record, it means that the writing of the historical behavior data cannot be recorded, and when the historical behavior data of the next predetermined period needs to be written into the same data block, its storage position cannot be determined. Therefore, step S330 also needs to be executed, that is, update the existing pointer entry to record the operation information of the writing. Typically, the operation information of the writing includes but is not limited to: information for recording the execution time of the writing; information for recording the generation date of the historical behavior data; the value of the data slot pointer pointing to the target data slot.
[0053] Since the data block already exists, when the target data slot already stores data generated by the player character in other life cycles, a preferred embodiment of step S320 can be implemented as the following steps: determining the write address of the historical behavior data according to the storage location; writing the historical behavior data into the write address to overwrite the data already stored in the target data slot.
[0054] Those skilled in the art can understand that in other embodiments, if the data block does not exist, the steps of creating a data block and its subsequent steps should be considered. Please refer to Figure 3 , Figure 3 FIG. Figure 3 The optional specific embodiment shown is different from the specific embodiment shown in Figure 1 that this optional specific embodiment additionally includes the following steps:
[0055] When the result of the judgment in step S200 is negative, execute steps S410 to S430:
[0056] Step S410, constructing the data block;
[0057] Step S420, storing the historical behavior data in the initial data slot arranged at the head of the data slot sequence;
[0058] Step S430, creating a new pointer entry in the metadata table to record the storage operation information and the attribute information of the data block.
[0059] When the result of the judgment in step S200 is negative, it means that no data block corresponding to the player character can be found according to the metadata table, that is, no storage resource has been assigned to the player character by creating a data block, so steps S410 to S430 are further executed.
[0060] In step S410, the data block is created, which also includes a data slot sequence formed by sequentially arranging a plurality of data slots. Further, step S420 is executed to store the historical behavior data into the initial data slot arranged at the head of the data slot sequence. Similarly, in order to record the storage of the historical behavior data and facilitate determining the storage location when the historical behavior data of the next predetermined cycle needs to be written into the same data block, step S430 also needs to be executed to create a new pointer entry in the metadata table to record the operation information of the storage and the attribute information of the data block. Typically, the operation information of the storage includes, but is not limited to: information for recording the execution time of the storage; information for recording the generation date of the historical behavior data; the value of the data slot pointer pointing to the initial data slot. The attribute information of the data block includes, but is not limited to: information for backtracking and searching for the player character; the storage address of the data block.
[0061] To meet all the functions of the metadata table described above and ensure that the structure of a single pointer entry in the metadata table can simultaneously implement the recording functions of the existing pointer entry and the new pointer entry mentioned above. In a typical embodiment, a single pointer entry in the metadata table can be designed to have at least five column variables, namely the account of the player character (denoted as role), the data slot pointer (denoted as slot), the latest date (denoted as date), the update time (denoted as time), and the storage location (denoted as address). Among them, the account of the player character is used to backtrack and search for the player character, the data slot pointer is used to indicate which data slot in the data slot sequence the data block corresponding to the player character currently points to, the latest date is used to indicate the generation date of the historical behavior data, the update time is used to indicate the execution time of the writing in step S320 or the storage in step S420 (usually for verification and convenient for debugging errors), and the storage address of the data block is used to indicate the logical address of the data block (such as including IP address, port number, and physical addressing parameters). That is, a single pointer entry in the metadata table is an array containing a set of five variables: role / slot / date / time / address.
[0062] Based on the above design of the metadata table, please refer to Figure 4, understand the execution process of steps S100 to S330 in combination with the storage process of the historical behavior data 21 corresponding to the player character 1. According to the metadata table, the data block 30 corresponding to the player character 1 can be found. Denote the number of data slots included in the data block 30 as n. The data block 30 includes a data slot sequence formed by arranging 30 data slots from data slot 0 to data slot 29 in sequence. At this time, n = 30. Assume that the data slot pointer in the existing pointer entry corresponding to the data block 30 points to data slot 9 in this data slot sequence. Then the initial value of the slot variable is 9. In order to make the storage position of the historical behavior data 21 correspond to data slot 10 in the data block 30, set the following code logic for the slot variable to be executed in sequence:
[0063] slot = slot + 1; (The initial value of the slot variable is incremented by 1)
[0064] slot = slot % n; (The current value of the slot variable is taken modulo n)
[0065] It can be seen that based on this code logic, the pointing position of the data slot pointer moves in the direction of data slot 29 at the end of the data slot sequence with a single data slot as the moving unit. Its pointing position changes from the initial data slot 9 to data slot 10. Therefore, it is determined that the storage position of the historical behavior data 21 is data slot 10 in the data block 30. When the initial value of the slot variable is 29, there are no other data slots on the right side of data slot 29. The rightward movement of the pointing position of the prime number data slot pointer means that the pointing position of this data slot pointer overflows from within the data slot sequence. Then according to the code logic described above, the pointing position of the data slot pointer points back to data slot 0 at the head of the data slot sequence. In this way, when all n data slots are traversed and data is stored, the data slot where the data was first written will be cyclically called to store new data, that is, the data with the longest storage time is automatically overwritten by the latest data.
[0066] Please continue to refer to Figure 4 , understand the execution process of steps S100 to S430 in combination with the storage process of the historical behavior data 24 corresponding to the player character 4. Assume that the player character 4 logs in to the online game program for the first time. Obviously, according to the metadata table, the data block corresponding to the player character 4 cannot be found. At this time, a data block 40 corresponding to the player character 4 needs to be created. Similarly, denote the number of data slots included in the data block 40 as n. The data block 40 includes a data slot sequence formed by arranging 30 data slots from data slot 0 to data slot 29 in sequence. Set the following code logic for the slot variable to be executed in sequence:
[0067] slot = slot + 1; (The initial value of the slot variable is incremented by 1)
[0068] slot = slot % n; (The current value of the slot variable modulo n)
[0069] Based on the above code logic, in the metadata table, create a new pointer entry, and set the initial value of the slot variable of the new pointer entry to -1, then the historical behavior data 24 can be stored in the data slot 0 at the head of the data slot sequence. Since the storage address of the data block 40 is known when creating the data block 40, the storage address is also assigned to the variable address in the new pointer entry.
[0070] Please refer to Figure 5 , Figure 5 is a flowchart of another optional specific implementation manner of the method for managing player data according to the present invention. The difference from the specific implementation manner shown in Figure 3 is that in this optional specific implementation manner, the method for managing player data further includes the following steps:
[0071] Step S510, receiving query information;
[0072] Step S520, finding the pointer entry that matches the query information from the metadata table;
[0073] Step S530, obtaining the storage address of the target data block corresponding to the pointer entry, reading the target data block from the storage address and loading it into the memory;
[0074] Step S540, obtaining the data slot pointer of the target data block from the pointer entry, at the data slot pointed to by the data slot pointer, splitting the global data slot sequence constituting the target data block into two parts to form a first data slot sequence and a second data slot sequence, where the tail element of the first data slot sequence is the data slot pointed to by the data slot pointer;
[0075] Step S550, splicing the tail of the second data slot sequence to the head of the first data slot sequence to obtain a data slot sequence with reverse time alignment.
[0076] The terms and nouns appearing in this part have the same meanings as the same terms or nouns in the previous text. For example, the "metadata table", "data slot pointer", and "data slot sequence", etc. The above terms or nouns and their related working principles can be referred to the descriptions and explanations in the relevant parts of the previous text. For the sake of simplicity, they will not be repeated here. As Figure 5As shown, steps S510 to S550 can be executed after step S330 or after step S430. The present invention does not limit this. Specifically, the query information received in step S510 includes the player account, which refers to the unique ID of the player character in the online game program and can be used as a retrieval factor for retrieving the data block corresponding to the player character. In step S520, according to the query information, the pointer entry matching the query information can be found. Further, in step S530, the storage address of the corresponding target data block can be obtained from the pointer entry, and the target data block can be read from the storage address and loaded into the memory.
[0077] Combined with Figure 6 to illustrate steps S540 and S550, Figure 6 is Figure 5 a schematic diagram of the data structure changes of each data object involved in the specific implementation shown, Figure 6 The target data block 50 shown is also the target data block in step S530. The target data block 50 includes a data slot sequence formed by 30 data slots arranged in sequence from data slot 0 to data slot 29. The target data block 50 is loaded into the memory for further processing. Assume that the value of the slot variable in the pointer entry is 10, that is, the data slot pointer of the target data block 50 points to data slot 10. The data slot sequence is cut at data slot 10, forming a first data slot sequence 51 including data slots 0 to 10 and a second data slot sequence 52 including data slots 11 to 29. The tail element of the first data slot sequence 51 is data slot 10. Further, as Figure 5As shown, the tail of the second data slot 52 is spliced to the head of the first data slot 51, that is, the data slot 29 is placed in front of the data slot 0, obtaining a reverse-time-aligned data slot sequence 53. Before the above splicing, the data slot pointer points to the data slot 10. Since it has been elaborated above that the data slot pointed to by the data slot pointer is the data slot where data was last stored, this means that the data slots in the reverse-time-aligned data slot sequence 53 have been arranged in reverse order according to the data storage date. Relying on the data slot pointer, only one splicing is required to achieve the above reverse order arrangement. By performing steps S510 to S550 for different multiple target data blocks, the reverse-time alignment of the different multiple target data blocks can be achieved in memory, meeting the data alignment requirements for using the different multiple target data blocks as source data for downstream data analysis and machine learning. Those skilled in the art can understand that there is a unique correspondence between the target data block and the player, and the data slots in each target data block have been arranged in reverse order according to the data storage date, which enables the historical operation data of each player to be arranged in reverse order within a specific period according to the data storage date. After obtaining the target data block of player A and the target data block of player B, since both are internally ordered, the historical behavior data of player A and player B can be quickly reverse-aligned in the order of the most recent login day, the second most recent login day, until the nth most recent login day, so as to be placed together for comparison or analysis respectively.
[0078] It should be noted that although the operations of the method of the present invention are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. On the contrary, the order of the steps depicted in the flowchart can be changed. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0079] Please refer to Figure 7 , Figure 7It is a schematic structural diagram of a typical computer device for implementing a specific embodiment of the method for managing player data of the present invention. More specifically, the automated device for implementing the method for managing player data described above can be included as a part of the computer device. The computer device at least includes the following parts: CPU (Central Processing Unit) 501, RAM (Random Access Memory) 502, ROM (Read-Only Memory) 503, system bus 500, hard disk control unit 504, hard disk 505, human-computer interaction external device control unit 506, human-computer interaction external device 507, serial interface control unit 508, serial interface external device 509, parallel interface control unit 510, parallel interface external device 511, display device control unit 512, and display device 513. Among them, CPU 501, RAM 502, ROM 503, hard disk control unit 504, human-computer interaction external device control unit 506, serial interface control unit 508, parallel interface control unit 510, and display device control unit 512 are connected to the system bus 500 and communicate with each other through the system bus 500. In addition, the hard disk control unit 504 is connected to the hard disk 505; the human-computer interaction external device control unit 506 is connected to the human-computer interaction external device 507, typically the human-computer interaction external device is a mouse, trackball, touch screen, or keyboard; the serial interface control unit 508 is connected to the serial interface external device 509; the parallel interface control unit 510 is connected to the parallel interface external device 511; the display device control unit 512 is connected to the display device 513.
[0080] Figure 7 The described block diagram only shows the structure of a computer device that can implement various embodiments of the present invention, and is not a limitation on the practice environment of the present invention. In some cases, some devices in the computer device can be added or removed according to needs. For example, Figure 7 The shown device can remove the human-computer interaction external device 507 and the display device 513, and its specific implementation form is only a server that can be accessed by external devices. Of course Figure 7 The shown computer device can implement the running environment of the present invention alone, or can be connected to each other through a network to provide the running environment applicable to various specific embodiments of the present invention. For example, each module and / step of the present invention can be distributedly implemented in each interconnected computer device.
[0081] In addition, the present invention also discloses one or more computer-readable media storing computer-executable instructions, and when the instructions are used by one or more computer devices, the one or more computer devices are caused to execute various specific embodiments of the method for managing player data as described above. For example, Figure 1The method for managing player data as shown. The computer-readable medium can be any available medium accessible by a computer device, and includes volatile and non-volatile media, removable and non-removable media implemented by any method and technology to store information such as computer-readable instructions, data structures, program modules, or other data. Computer-readable media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disk (DVD) or other optical storage, cassette tapes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the required information and is accessible by a computing device. Any combination of the above should also be included within the scope of computer-readable media.
[0082] Correspondingly, the present invention also discloses a computer device, which includes a memory and a processor, wherein: the memory stores a computer program, and when the processor executes the computer program, it implements each specific implementation manner of the method for managing player data as described above, for example Figure 1 The method for managing player data as shown.
[0083] In the method for managing player data provided by the present invention, the part involving software logic can be implemented using programmable logic devices or can be implemented as a computer program product, which causes a computer to execute the above method. The computer program product includes a computer-readable storage medium, which contains a computer program logic or code part for implementing each step of the above method. The computer-readable storage medium can be a built-in medium installed in the computer or a removable medium detachable from the computer main body (such as a hot-pluggable storage device). The built-in medium includes, but is not limited to, rewritable non-volatile memories such as RAM, ROM, and hard disks. The removable medium includes, but is not limited to: optical storage media (such as CD-ROM and DVD), magneto-optical storage media (such as MO), magnetic storage media (such as magnetic tapes or external hard drives), media with built-in rewritable non-volatile memories (such as memory cards), and media with built-in ROM (such as ROM cartridges).
[0084] Those skilled in the art should understand that any computer system with an appropriate programming device can execute the steps of the method of the present invention included in the computer program product. Although most of the specific implementation manners described in this specification focus on software programs, alternative embodiments of implementing the method provided by the present invention in hardware are also within the scope of protection of the present invention.
[0085] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. All changes within the meaning and scope of the equivalent elements of the claims are encompassed by the present invention. Any reference signs in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the term "comprising" does not exclude other components, units or steps, and the singular does not exclude the plural. A plurality of components, units or devices stated in the claims can also be implemented by one component, unit or device through software or hardware.
[0086] The method for managing player data provided by the present invention uses a data block including a data slot sequence to store the historical behavior data of different player characters, and uses a metadata table to manage and maintain the data block. Its advantages are as follows: on the one hand, it improves the efficiency of accessing and reading the historical behavior data of player characters; on the other hand, by controlling the length of the data slot sequence, the newly written historical behavior data can automatically overwrite the historical behavior data with a longer storage time, optimizing the management efficiency of the historical behavior data of global player characters and avoiding system crashes caused by excessive global data. Based on the above scheme of the data slot sequence and the metadata table working together, when it is necessary to call the historical behavior data of multiple player characters for analysis or feature extraction in the future, it is convenient to quickly achieve the reverse alignment of the historical behavior data of multiple player characters at a specific period.
[0087] The above-disclosed are only some embodiments or specific implementation manners of the present invention, and cannot be used to limit the scope of the rights of the present invention. Equivalent changes made according to the claims of the present invention still fall within the scope covered by the present invention.
Claims
1. A method for managing player data, the method comprises: The server side collects historical behavior data generated by the player character within a predetermined period; Judging whether there is a data block corresponding to the player character according to the metadata table, the data block includes a data slot sequence formed by arranging a plurality of data slots in sequence; If the result of the judgment is yes, calculate the storage location of the historical behavior data according to the existing pointer entry corresponding to the data block in the metadata table, write the historical behavior data into the target data slot determined according to the storage location in the data slot sequence, and overwrite the data stored in the target data slot, and update the existing pointer entry to record the operation information of the writing.
2. The method according to claim 1, the method further comprises: If the result of the judgment is no, construct the data block, store the historical behavior data in the initial data slot arranged at the head of the data slot sequence, and create a new pointer entry in the metadata table to record the operation information of the storage and the attribute information of the data block.
3. The method according to claim 1, wherein, The step of calculating the storage location of the historical behavior data according to the existing pointer entry corresponding to the data block in the metadata table includes: Obtain the data slot pointer of the data block and the storage address of the data block from the existing pointer entry; Change the pointing position of the data slot pointer in the data slot sequence according to a preset rule; Determine the storage location according to the storage address and the pointing position of the data slot pointer.
4. The method according to claim 3, wherein, The step of changing the pointing position of the data slot pointer in the data slot sequence according to a preset rule includes: In the data slot sequence, taking a single data slot in the data slot sequence as a moving unit, move the position pointed by the data slot pointer one bit towards the tail end of the data slot sequence. If the movement causes the position pointed by the data slot pointer to overflow from the data slot sequence, set the data slot pointer to point to the head of the data slot sequence.
5. The method according to claim 1, wherein, The step of writing the historical behavior data into the target data slot determined according to the storage location in the data slot sequence includes: Determine the writing address of the historical behavior data according to the storage location; Write the historical behavior data into the writing address to overwrite the data stored in the target data slot.
6. The method according to claim 1, wherein, The operation information of the writing includes: Information for recording the execution time of the writing; Information for recording the generation date of the historical behavior data; The value of the data slot pointer pointing to the target data slot.
7. The method according to claim 2, wherein, The operation information of the storage includes: Information for recording the execution time of the storage; Information for recording the generation date of the historical behavior data; The value of the data slot pointer pointing to the initial data slot.
8. The method according to any one of claims 1, 2, 5, 6 or 7, wherein, The historical behavior data includes: operation events generated by the player character in the game program and their statistical values; and / or activity events participated by the player character in the game program and their statistical values; and / or logic events triggered by the player character in the game program and their statistical values.
9. The method according to claim 2, wherein, the attribute information of the data block includes: information for backtracking and searching for the player character; the storage address of the data block.
10. The method according to claim 1 or 2, the method further includes: receiving query information; finding out pointer entries matching the query information from the meta data table; obtaining the storage address of the corresponding target data block from the pointer entry, reading the target data block from the storage address and loading it into the memory; obtaining the data slot pointer of the target data block from the pointer entry, at the data slot pointed to by the data slot pointer, splitting the global data slot sequence constituting the target data block into two parts to form a first data slot sequence and a second data slot sequence, wherein the tail element of the first data slot sequence is the data slot pointed to by the data slot pointer; concatenating the tail of the second data slot sequence to the head of the first data slot sequence to obtain a data slot sequence with reverse time alignment.
11. The method according to claim 10, wherein: the query information includes the player account.
12. The method according to claim 1, wherein: the predetermined period is 24 hours.
13. One or more computer-readable media storing computer-executable instructions, the instructions when used by one or more computer devices cause the one or more computer devices to execute the player data management method according to any one of claims 1 to 12.
14. A computer device, the computer device includes a memory and a processor, wherein: the memory stores a computer program, and when the processor executes the computer program, it implements the player data management method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Data writing method and device, electronic equipment, and computer-readable storage medium
CN113625973A
Data processing method and device
CN113721862A