Data processing method, device and server in game
By determining the start date according to the preset retention deadline and the retention cycle in the game, calculate the recorded records associated with it, solve the problem of excessive calculation of retention indicators in the existing technology, and achieve efficient and accurate and accurate. Store calculation.
Patent Information
- Application Number
- CN202111361485.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-11-17
AI Technical Summary
The calculation volume of retention indicators in existing games has increased in a quadratic curve, resulting in low computing efficiency, high computing cluster load, and high error rate and crash rate.
At least one retention starting date is determined according to the preset retain deadline and retention cycle. Based on the retention records associated with the deadline for retention, the retention results corresponding to each retention start date are calculated. The results of the date reduce the calculation amount.
A significant reduction of the calculation of the retention indicators, increasing the calculation efficiency, reducing the load of the computing cluster, increasing the accuracy of calculation and reducing the collapse rate.
Smart Images

Figure CN114011082B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game technology, and in particular to a method, device and server for processing data in a game. Background Art
[0002] At present, existing games usually use a "point-to-point" method to calculate retention-related indicators. Specifically, first obtain the target date and retention period, and determine the corresponding retention date through the retention period. For example, if the target date is January 1, 2029 and the retention period is 3, then the retention date is determined to be January 3, 2029. Then calculate the online status of the character collection under the target date on the retention date to obtain retention-related indicators. However, as the target date increases and the retention period expands, the calculation amount of retention-related indicators will increase in a quadratic curve, that is, the calculation time complexity is a square time complexity O(n 2 ), which not only leads to low efficiency of retained computing, but also increases the computing load of the computing cluster, resulting in high error and crash rates. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a data processing method, device and server in the game, which can significantly reduce the calculation amount of retention indicators, thereby improving the efficiency of retention calculation, and also reduce the calculation load of the computing cluster, thereby significantly improving the accuracy of retention calculation and reducing the crash rate of the computing cluster.
[0004] In a first aspect, an embodiment of the present invention provides a method for processing data in a game, comprising: determining at least one retention start date based on a preset retention deadline and a retention period; determining a retention record associated with the retention deadline based on the retention deadline and each of the retention start dates; wherein the retention record includes at least a game date and a retained character identifier corresponding to a retained character; calculating a retention result corresponding to each of the retention start dates based on the retention records associated with the retention deadline; wherein the retention result includes the number of retention days and the number of retained characters.
[0005] In one embodiment, before the step of determining the retention record associated with the retention deadline based on the retention deadline and each of the retention start dates, the method includes: obtaining a game log; wherein the game log includes at least a game date, a player character identifier, and player behavior data; determining a retention character identifier corresponding to a target game date from the player character identifier based on the game log; and updating the retention character identifier corresponding to the target game date to a pre-established character retention details table; wherein the character retention details table includes a retention record corresponding to each game date, and the retention record includes a retention character identifier and a server identifier.
[0006] In one embodiment, the step of determining the retained character identifier corresponding to the target game date from the player character identifier based on the game log includes: using the target game date and specified behavior as filtering conditions, and determining the player character identifier in the game log that meets the filtering conditions as the retained character identifier corresponding to the target game date.
[0007] In one embodiment, the method further includes: for each retained record corresponding to the game date, deduplication processing is performed on the retained record according to the retained character identifier.
[0008] In one embodiment, the step of determining the retention record associated with the retention deadline based on the retention deadline and each of the retention start dates includes: searching for the retention record corresponding to the retention deadline in the role retention details table, and establishing a first table based on the retention records corresponding to the retention deadline; and searching for the retention record corresponding to each of the retention start dates; and establishing an association relationship between the first table and the retention record corresponding to each of the retention start dates.
[0009] In one embodiment, the step of establishing an association relationship between the first table and the retention records corresponding to each of the retention start dates includes: using the retention role identifier as an association condition, and establishing an association relationship between the first table and the retention records corresponding to each of the retention start dates by an internal association method.
[0010] In one embodiment, the step of calculating the retention result corresponding to each retention start date based on the retention records associated with the retention end date includes: establishing a second table based on each retention start date, and determining the number of retention days between each retention start date and the retention end date in the second table; and determining the number of retained roles corresponding to each retention start date based on the number of retention days and the retention records associated with the retention end date.
[0011] In one embodiment, the step of determining the number of retained roles corresponding to each retention start date based on the retention records associated with the retention days and the retention deadline includes: dividing the retention role identifiers associated with the retention deadline into identifier sets corresponding to each retention start date according to the retention start date, the retention days and the server identifier; and determining the number of retained roles corresponding to each retention start date by the number of retention role identifiers contained in each identifier set.
[0012] In one embodiment, the step of determining the number of retained role identifiers contained in each of the identifier sets as the number of retained roles corresponding to each of the retention start dates includes: deduplicating the retained role identifiers contained in each of the identifier sets; and determining the number of retained role identifiers contained in each of the identifier sets after the deduplication processing as the number of retained roles corresponding to each of the retention start dates.
[0013] In one embodiment, the method further includes: updating the retention results corresponding to each retention start date into a pre-established character retention theme table; wherein the character retention theme table includes the retention start date, the server identifier, the retention days and the number of retained characters.
[0014] In a second aspect, an embodiment of the present invention further provides an in-game data processing device, comprising: a start date determination module, used to determine at least one retention start date according to a preset retention deadline and a retention period; a record association module, used to determine a retention record associated with the retention deadline based on the retention deadline and each of the retention start dates; wherein the retention record includes at least a game date and a retention character identifier corresponding to the retained character; a result calculation module, used to calculate a retention result corresponding to each of the retention start dates according to the retention records associated with the retention deadline; wherein the retention result includes the number of retention days and the number of retained characters.
[0015] In a third aspect, an embodiment of the present invention further provides a server, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement any one of the methods provided in the first aspect.
[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement any one of the methods provided in the first aspect.
[0017] The embodiments of the present invention provide a method, device and server for processing data in a game. First, at least one retention start date is determined according to a preset retention deadline and a retention period. Then, based on the retention deadline and each of the retention start dates, a retention record associated with the retention deadline is determined (at least including the game date and the retention character identifier corresponding to the retention character). Finally, the retention result corresponding to each retention start date is calculated according to the retention record associated with the retention deadline (including the number of retention days and the number of retained characters). The above method can calculate the retention results corresponding to multiple retention start dates at one time based on the retention records associated with the retention deadline, compress the number of retention calculations to a linear complexity of O(n), significantly reduce the calculation amount of retention indicators, thereby improving the efficiency of retention calculations, and also reduce the calculation load of the computing cluster, thereby effectively improving the accuracy of retention calculations and reducing the crash rate of the computing cluster.
[0018] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0019] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A flowchart of a method for processing data in a game provided by an embodiment of the present invention;
[0022] Figure 2 A schematic flow chart of another method for processing data in a game provided by an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of the structure of a data processing device in a game provided by an embodiment of the present invention;
[0024] Figure 4 A schematic diagram of the structure of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] At present, existing games usually use a "point-to-point" method to calculate retention-related indicators, and calculate the retention matrix by splitting the target date and retention period into a one-to-one correspondence. For example, the retention matrix shown in Table 1 below needs to be calculated 3*4=12 times to complete the N-day retention calculation corresponding to each target date in Table 1. As the retention matrix continues to expand, its calculation will grow in a quadratic curve.
[0027] Table 1
[0028] 2-day retention 3-day retention 4-day retention 5-day retention 2099-01-01 2099-01-02 2099-01-03
[0029] Based on this, the present invention provides a data processing method, device and server for a game, which can significantly reduce the calculation amount of retention indicators, thereby improving the efficiency of retention calculations, and also reduce the computational load of the computing cluster, thereby significantly improving the accuracy of retention calculations and reducing the crash rate of the computing cluster.
[0030] To facilitate understanding of this embodiment, a data processing method for a game disclosed in an embodiment of the present invention is first described in detail. Figure 1 The flowchart of a method for processing data in a game is shown in FIG. 1 , and the method mainly includes the following steps S102 to S106:
[0031] Step S102, determining at least one retention start date according to the preset retention deadline and retention period. The retention deadline may also be referred to as the retention date, and the retention start date may also be referred to as the target date. In one embodiment, when date dt ends and the game log corresponding to date dt is stored in the offline data warehouse, the date dt may be determined as the retention deadline. Exemplarily, assuming that the retention period is x, the dates dt-x to dt-1 are all determined as the retention start dates. For example, x=3, the retention deadline is January 10, 2099, and the retention start dates include January 7, 2099, January 8, 2099, and January 9, 2099.
[0032] Step S104, based on the retention deadline and each of the retention start dates, determine the retention records associated with the retention deadline. Wherein, the retention record at least includes the game date and the retention role identifier corresponding to the retained character, and the retained character identifier is also the role identifier of the player character with the specified behavior, and the role identifier may include a role ID (Identity document, unique code) or an account ID, etc. The retention record may also include the server identifier of the server where the player character is located. In one embodiment, a character retention list may be pre-established, and the character retention list includes the retention records corresponding to each day, and then the retention records corresponding to the game date that matches the retention period and the retention deadline are selected. Exemplarily, assuming that the retention period is x, the retention records corresponding to the date dt-x to the date dt are all associated with the date dt.
[0033] Step S106, calculate the retention result corresponding to each retention start date according to the retention record associated with the retention deadline. The retention result includes the number of retention days and the number of retained characters. The number of retention days can be determined based on the date difference between the retention start date and the retention deadline. For example, if the date difference between the retention deadline January 10, 2099 and the retention start date January 9, 2099 is 1, then the number of retention days can be determined as: 2 days of retention. The number of retained characters is the number of player characters that have a specified behavior between the retention deadline January 10, 2099 and the retention start date January 9, 2099. In one embodiment, the number of retention days between each of the retention start dates and the retention deadline can be calculated first, and then the retention character identifiers in the retention records can be aggregated based on the number of retention days, the retention start date, and the server identifier to determine the number of retained characters corresponding to each retention start date.
[0034] The in-game data processing method provided by the embodiment of the present invention can calculate the retention results corresponding to multiple retention start dates at one time based on the retention records associated with the retention deadline, compressing the number of retention calculations to a linear complexity of O(n), significantly reducing the amount of calculation of retention indicators, thereby improving the retention calculation efficiency, and reducing the computing load of the computing cluster, thereby effectively improving the retention calculation accuracy and reducing the computing cluster crash rate.
[0035] In actual applications, before executing the step of determining the retention record associated with the retention deadline based on the retention deadline and each retention start date, the pre-established character retention details table may be updated. The character retention details table includes dimensions and player character identifiers. The dimensions include game date and server identifier, etc. The character retention details table is used to record the collection of characters that meet the retention conditions on that day. For example, when the player character has a specified behavior, it can be determined that the player character meets the retention conditions. For details, see steps 1 to 3 below:
[0036] Step 1, obtain the game log. The game log includes at least the game date, player character identification and player behavior data. In actual applications, the game will generate a game log when the game is running. The game log may include character login log, character logout log and other logs.
[0037] Step 2: Determine the retained character ID corresponding to the target game date from the player character ID based on the game log. The target game date is every day of the game. For example, when the date dt ends and the game log is stored in the offline data warehouse, the date dt can be used as the target game date, and the retained character ID corresponding to the date dt is determined.
[0038] In one embodiment, the target game date and the specified behavior can be used as screening conditions, and the player character identification that meets the screening conditions in the game log is determined as the retained character identification corresponding to the target game date. The specified behavior may include login behavior, logout behavior, and other behaviors that meet the definition of character retention, such as switching maps or item purchases. Optionally, the player character identification with the specified behavior within the date dt range can be screened out in the game log, and the player character identification is the retained character identification corresponding to the date dt.
[0039] Step 3, update the retained character identifier corresponding to the target game date to the pre-established character retention list. The character retention list includes a retention record corresponding to each game date, and the retention record includes a retained character identifier and a server identifier. For ease of understanding, an embodiment of the present invention provides an application example of updating the character retention list, taking date dt as an example: (1) filter out the player characters and related dimension information (including at least the player character identifier) with login behavior within the range of dt days from the character login log to form a set A; (2) filter out the player characters and related dimension information with logout behavior within the range of dt days from the character logout log, and add them to set A to form set B; (3) filter out the player characters and related dimension information that meet the character retention definition within the range of dt days from other logs, and add them to set B to form set C. Since some players hang up in the game in actual applications, resulting in no login or logout behavior within dt days, the player characters can be supplemented through other logs to improve the accuracy of the character retention list.
[0040] Taking into account that players may log in and out multiple times in a day, the retention records corresponding to each game date can also be deduplicated based on the retention character ID, so that the retention character ID only appears once in the retention records corresponding to the same game date.
[0041] On the basis of the above-mentioned embodiment, the embodiment of the present invention further provides an implementation method for determining the retention records associated with the retention deadline based on the retention deadline and each retention start date: (1) in the role retention details table, find the retention records corresponding to the retention deadline, and establish a first table based on the retention records corresponding to the retention deadline; and find the retention records corresponding to each retention start date; (2) establish an association relationship between the first table and the retention records corresponding to each retention start date. In one implementation, the retention role identifier can be used as an association condition, and an internal association method is used to establish an association relationship between the first table and the retention records corresponding to each retention start date. Exemplarily, assuming that the retention period is x, all the retention records corresponding to the date dt-x to the date dt-1 are taken out from the role retention details table. In addition, the first table (also referred to as the left table) can be established for the retention role identifier of the date dt, and the left table is respectively associated with the retention records corresponding to the date dt-x to the date dt-1. The association condition is the retention role identifier related field, and the association method adopts the internal association.
[0042] To facilitate understanding of the aforementioned step S106, the embodiment of the present invention further provides an implementation method for calculating the retention result corresponding to each retention start date according to the retention record associated with the retention end date, see the following steps a to b:
[0043] Step a, establish a second table based on each retention start date, and determine the number of retention days between each retention start date and the retention deadline in the second table. Among them, the second table can be called the right table, and the right side includes each retention start date, which is established based on the aforementioned retention period. For example, if the retention period is 30 days, the right table will be calculated from the retention deadline The range of 1 day to 29 days. In one embodiment, the date difference between the time variables of the left table and the right table can be calculated. For example, the difference between the date dt and the date dt-1 is 1, and the difference between the date dt and the date dt-x is x. At this time, the result set includes multiple master data, including: the right table date dt-x, the date difference x, and the retention role identification related fields, and the record means that the player with the retention start date dt-x has retention on his xth day.
[0044] Step b, based on the retention records associated with the retention days and the retention deadline, determine the number of retained roles corresponding to each retention start date. In one implementation, the number of retained roles corresponding to each retention start date can be determined according to the following steps b1 to b2:
[0045] Step b1, according to the retention start date, the number of retention days and the server ID, the retention role ID associated with the retention end date is divided into an ID set corresponding to each retention start date. In one embodiment, the above result table can be aggregated by combining the three dimensions of the right table date dt-x, the date difference x and the server ID. Specifically, the retention role IDs with the same right table date, the same date difference and the same server ID are stored in an ID collection, thereby obtaining an ID set corresponding to each right table date.
[0046] Step b2, the number of retained role identifiers contained in each identification set is determined as the number of retained roles corresponding to each retention start date. In the specific implementation, considering that some retained role identifiers may be repeated, the retained role identifiers contained in each identification set can be deduplicated, and the number of retained role identifiers contained in each identification set after deduplication is determined as the number of retained roles corresponding to each retention start date, such as shown in Table 2, assuming that the retention deadline is 2099-01-10, and the retention period is 4. The embodiment of the present invention uses the role retention data of the retention deadline dt to calculate the retention of the x-1th day of the retention start date dt-x, the retention of the xth day of the retention start date dt-x+1, until the retention of the 2nd day of the retention start date dt-1, and compresses the number of retention calculations to linear complexity O(n).
[0047] Table 2
[0048] Date on the left Dates on the right Date Difference server Number of roles 2099-01-10 2099-01-09 1 ALL y1 2099-01-10 2099-01-08 2 ALL y2 2099-01-10 2099-01-07 3 ALL y3 2099-01-10 2099-01-06 4 ALL y4
[0049] In one embodiment, a role retention subject table can be pre-established, including dimensions and fact items, wherein the dimensions include the retention start date and the server identifier, the dimension items are consistent with the dimension items of the aforementioned role retention details table, and the fact items include the day offset delta (that is, the aforementioned date difference) and the number of retained roles, indicating the number of retained roles on the delta day after the dimension date. On this basis, the embodiment of the present invention can also update the retention results corresponding to each retention start date to the pre-established role retention subject table. Exemplary, a retention matrix is shown in Table 3.
[0050] Table 3
[0051] 2-day retention 3-day retention 4-day retention 5-day retention 2099-01-09 Y1 2099-01-08 Y2 2099-01-07 Y3 2099-01-06 Y4
[0052] To facilitate understanding of the in-game data processing method provided in the aforementioned embodiment, the present invention further provides an application example of the in-game data processing method, see Figure 2 The flowchart of another method for processing data in a game is shown in FIG. 1 , and the method mainly includes the following steps S202 to S210:
[0053] Step S202, creating a role retention list.
[0054] Step S204, establishing a role retention theme table.
[0055] Step S206, when the date dt ends and the game log is stored in the offline data warehouse, the character retention list corresponding to the date dt is updated.
[0056] Step S208, calculating the retention results corresponding to multiple retention start dates according to the date dt and the retention period.
[0057] Step S210, updating the retention result corresponding to each retention start date to the role retention theme table.
[0058] In summary, the embodiments of the present invention can greatly save the computing resources and computing time of the cluster by extracting the commonalities of the retention matrix and designing a calculation method. From the perspective of stability, it can reduce the computing load of the computing cluster and reduce the probability of errors and crashes. From the perspective of efficiency, the shortening of the retention calculation time is conducive to generating corresponding reports earlier, or calculating more retention data in the same time, thereby providing more timely and rich data guidance for the decision-making layer.
[0059] For the in-game data processing method provided in the above embodiment, the present invention also provides an in-game data processing device, see Figure 3 The schematic diagram of the structure of a data processing device in a game shown in FIG. 1 mainly includes the following parts:
[0060] A start date determination module 302, configured to determine at least one retention start date according to a preset retention deadline and a retention period;
[0061] A record association module 304 is used to determine a retention record associated with the retention deadline based on the retention deadline and each of the retention start dates; wherein the retention record at least includes a game date corresponding to the retained character and a retained character identifier;
[0062] The result calculation module 306 is used to calculate the retention result corresponding to each retention start date according to the retention records associated with the retention end date; wherein the retention result includes the number of retention days and the number of retained roles.
[0063] The data processing device in the above-mentioned game provided by the embodiment of the present invention can calculate the retention results corresponding to multiple retention start dates at one time based on the retention records associated with the retention deadline, and compress the number of retention calculations to linear complexity O(n), which significantly reduces the calculation amount of retention indicators, thereby improving the retention calculation efficiency, and also reduces the computing load of the computing cluster, thereby effectively improving the retention calculation accuracy and reducing the computing cluster crash rate.
[0064] In one embodiment, the above-mentioned device also includes a first update module, which is used to: obtain a game log; wherein the game log includes at least a game date, a player character identifier and a player behavior data; based on the game log, determine the retained character identifier corresponding to the target game date from the player character identifier; update the retained character identifier corresponding to the target game date to a pre-established character retention details table; wherein the character retention details table includes a retention record corresponding to each game date, and the retention record includes a retained character identifier and a server identifier.
[0065] In one embodiment, the first updating module is further used to: use the target game date and the specified behavior as filtering conditions, and determine the player character identifiers in the game log that meet the filtering conditions as the retained character identifiers corresponding to the target game date.
[0066] In one embodiment, the first updating module is further used for: for the retained records corresponding to each game date, deduplication processing is performed on the retained records according to the retained character identifiers.
[0067] In one embodiment, the record association module 304 is also used to: search for retention records corresponding to the retention deadline in the role retention details table, and establish a first table based on the retention records corresponding to the retention deadline; and search for retention records corresponding to each retention start date; and establish an association relationship between the first table and the retention records corresponding to each retention start date.
[0068] In one implementation, the record association module 304 is further used to: use the retention role identifier as an association condition and use an internal association method to establish an association relationship between the first table and the retention record corresponding to each retention start date.
[0069] In one embodiment, the result calculation module 306 is also used to: establish a second table based on each retention start date, determine the number of retention days between each retention start date and the retention end date in the second table; based on the retention records associated with the number of retention days and the retention end date, determine the number of retained roles corresponding to each retention start date.
[0070] In one embodiment, the result calculation module 306 is also used to: divide the retention role identifiers associated with the retention deadline into identifier sets corresponding to each retention start date according to the retention start date, the number of retention days and the server identifier; and determine the number of retention roles corresponding to each retention start date by the number of retention role identifiers contained in each identifier set.
[0071] In one embodiment, the result calculation module 306 is further used to: perform deduplication processing on the retained role identifiers contained in each identifier set; and determine the number of retained role identifiers contained in each identifier set after deduplication processing as the number of retained roles corresponding to each retention start date.
[0072] In one embodiment, the above-mentioned device also includes a second updating device: updating the retention results corresponding to each retention start date into a pre-established character retention theme table; wherein the character retention theme table includes the retention start date, server identifier, retention days and the number of retained characters.
[0073] The device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0074] An embodiment of the present invention provides a server. Specifically, the server includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the method described in any one of the above embodiments is executed.
[0075] Figure 4 A structural diagram of a server provided in an embodiment of the present invention, the server 100 includes: a processor 40, a memory 41, a bus 42 and a communication interface 43, wherein the processor 40, the communication interface 43 and the memory 41 are connected via the bus 42; the processor 40 is used to execute an executable module stored in the memory 41, such as a computer program.
[0076] The memory 41 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 43 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used.
[0077] The bus 42 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0078] Among them, the memory 41 is used to store programs, and the processor 40 executes the program after receiving the execution instruction. The method executed by the device for flow process definition disclosed in any embodiment of the above-mentioned embodiment of the present invention can be applied to the processor 40 or implemented by the processor 40.
[0079] The processor 40 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 40. The above processor 40 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiments of the present invention can be directly embodied as a hardware decoding processor to execute, or can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 41, and the processor 40 reads the information in the memory 41 and completes the steps of the above method in combination with its hardware.
[0080] The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer-readable storage medium storing program code, and the instructions included in the program code can be used to execute the methods described in the previous method embodiments. The specific implementation can be referred to the previous method embodiments, which will not be repeated here.
[0081] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0082] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for processing data in a game, characterized in that: include: Determine at least one retention start date based on the preset retention deadline and retention period; Based on the retention deadline and each of the retention start dates, determining a retention record associated with the retention deadline; wherein the retention record includes at least a game date corresponding to the retained character and a retained character identifier; Calculating the retention result corresponding to each retention start date according to the retention record associated with the retention end date; wherein the retention result includes the number of retention days and the number of retained roles; Before the step of determining the retention record associated with the retention deadline based on the retention deadline and each retention start date, the method includes: obtaining a game log; wherein the game log includes at least a game date, a player character identifier, and player behavior data; determining a retention character identifier corresponding to a target game date from the player character identifier based on the game log; updating the retention character identifier corresponding to the target game date to a pre-established character retention list; wherein the character retention list includes a retention record corresponding to each game date, and the retention record includes a retention character identifier and a server identifier; The step of determining the retention record associated with the retention deadline based on the retention deadline and each retention start date includes: searching for the retention record corresponding to the retention deadline in the role retention details table, establishing a first table based on the retention records corresponding to the retention deadline; and searching for the retention record corresponding to each retention start date; and establishing an association relationship between the first table and the retention record corresponding to each retention start date.
2. The method according to claim 1, characterized in that The step of determining the retained character identifier corresponding to the target game date from the player character identifier based on the game log includes: The target game date and the designated behavior are used as screening conditions, and the player character identifiers in the game log that meet the screening conditions are determined as the retained character identifiers corresponding to the target game date.
3. The method according to claim 1, characterized in that The method further comprises: For each retained record corresponding to the game date, deduplication processing is performed on the retained record according to the retained character identifier.
4. The method according to claim 1, characterized in that The step of establishing an association relationship between the first table and each retention record corresponding to the retention start date includes: Taking the retention role identifier as the association condition, an association relationship between the first table and the retention record corresponding to each retention start date is established by an inner association method.
5. The method according to claim 1, characterized in that: The step of calculating the retention result corresponding to each retention start date according to the retention record associated with the retention end date includes: Establish a second table based on each of the retention start dates, and determine the number of retention days between each of the retention start dates and the retention end date in the second table; Based on the retention records associated with the retention days and the retention deadline, the number of retained roles corresponding to each retention start date is determined.
6. The method according to claim 5, characterized in that The step of determining the number of retained roles corresponding to each retention start date based on the retention records associated with the retention days and the retention deadline includes: According to the retention start date, the retention days and the server identifier, dividing the retention role identifier associated with the retention deadline into an identifier set corresponding to each retention start date; The number of the retained role identifiers contained in each identifier set is determined as the number of retained roles corresponding to each retention start date.
7. The method according to claim 6, characterized in that The step of determining the number of the retained role identifiers contained in each identifier set as the number of retained roles corresponding to each retention start date comprises: Deduplication processing is performed on the retained role identifiers contained in each of the identifier sets; The number of the retained role identifiers contained in each identifier set after the deduplication process is determined as the number of retained roles corresponding to each retention start date.
8. The method according to claim 1, characterized in that: The method further comprises: The retention result corresponding to each retention start date is updated into a pre-established role retention subject table; wherein the role retention subject table includes the retention start date, the server identifier, the retention days and the number of retained roles.
9. A data processing device in a game, characterized in that: include: A start date determination module, used to determine at least one retention start date according to a preset retention deadline and retention period; A record association module, used to determine the retention record associated with the retention deadline based on the retention deadline and each of the retention start dates; wherein the retention record at least includes a game date corresponding to the retained character and a retained character identifier; A result calculation module, used to calculate the retention result corresponding to each retention start date according to the retention record associated with the retention end date; wherein the retention result includes the number of retention days and the number of retained roles; It also includes a first update module, which is used to: obtain a game log; wherein the game log includes at least a game date, a player character identifier and player behavior data; determine a retained character identifier corresponding to a target game date from the player character identifier based on the game log; update the retained character identifier corresponding to the target game date to a pre-established character retention list; wherein the character retention list includes a retention record corresponding to each game date, and the retention record includes a retained character identifier and a server identifier; The record association module is specifically used for: searching for the retention records corresponding to the retention deadline in the role retention details table, and establishing a first table based on the retention records corresponding to the retention deadline; and searching for the retention records corresponding to each of the retention start dates; and establishing an association relationship between the first table and the retention records corresponding to each of the retention start dates.
10. A server, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Game log recording method and system
CN112402955A
Data processing method and device and computer equipment
CN112527803A