Method, device, equipment and storage medium for determining online time in a game

By determining the calculation type in the game and using pre-stored time data to quickly obtain online time data, the problems of low efficiency and waste of resources in the prior art calculation of virtual characters are solved, and fast and efficient online time data acquisition is achieved.

CN113996067BActive Publication Date: 2025-05-27NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111356557.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-16
Publication Date
2025-05-27
Estimated Expiration
2041-11-16

AI Technical Summary

Technical Problem

When calculating the online duration of virtual characters in a game, the prior art needs to recalculate according to a given time range, resulting in waste of log filtering, rearrangement recording and computing resources, which is less efficient.

Method used

By obtaining the identification and time range of the target virtual character, determining the calculation type is historical data reading or new data calculation, using pre-stored time data to quickly obtain online time data, and reducing dependence on the game log library.

Benefits of technology

Improve computing efficiency, reduce waste of computing resources, and achieve fast and efficient acquisition of online time data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113996067B_ABST
    Figure CN113996067B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for determining the online time in a game, belonging to the technical field of data storage. The method includes: obtaining the identifier of the target virtual character and the target time range; determining the target calculation type based on the target time range and the pre-stored time data, where the target calculation type includes: historical data reading or new data calculation, and the pre-stored time data includes: the historical login data of the target virtual character; if the target calculation type is new data calculation, obtaining the target login data of the target virtual character in the target time range from the game log library of the game; if the target calculation type is historical data reading, obtaining the target login data from the pre-stored time data; and determining the online time data of the target virtual character according to the target login data. The present application can obtain the online time data more quickly and efficiently, reducing the waste of computing resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technologies, and more particularly, to a method, apparatus, device, and storage medium for determining online time in a game. Background Art

[0002] In the game field, when calculating virtual rewards in a game or recording the game status of virtual characters in the game, etc., it is usually necessary to calculate the online duration of virtual characters.

[0003] In the prior art, game logs are stored in a real-time data warehouse. Given a time range, all login records and logout records of virtual characters within the time range are found, and the time difference, the number of logins and logouts, etc. are calculated.

[0004] However, in each calculation, it is necessary to recalculate the online duration of virtual characters within this time range according to the given time range. For games with a large amount of logs, each time log screening, record rearrangement, and then calculation are performed, it will waste a lot of time and computing resources, resulting in low efficiency and resource waste in the process of determining the online duration. Summary of the Invention

[0005] The purpose of this application is to provide a method, apparatus, device, and storage medium for determining online time in a game, which can obtain online time data more quickly and efficiently and reduce waste of computing resources.

[0006] The embodiments of this application are implemented as follows:

[0007] On the one hand, an embodiment of this application provides a method for determining online time in a game, including:

[0008] Obtain the identifier of the target virtual character and the target time range;

[0009] Based on the target time range and pre-stored time data, determine the target calculation type. The target calculation type includes: historical data reading or new data calculation. The pre-stored time data includes: historical login data of the target virtual character;

[0010] If the target calculation type is new data calculation, obtain the target login data of the target virtual character within the target time range from the game log library of the game;

[0011] If the target calculation type is historical data reading, obtain the target login data from the pre-stored time data;

[0012] Determine the online time data of the target virtual character according to the target login data.

[0013] Optionally, the pre-stored time data includes: a preset time interval and login data within the pre-stored time interval;

[0014] Obtaining target login data from the pre-stored time data includes:

[0015] Obtaining target login data from the pre-stored time data according to the target time range and the preset time interval.

[0016] Optionally, obtaining target login data from the pre-stored time data according to the target time range and the preset time interval includes:

[0017] If the target time range is equal to the preset time interval, the login data within the pre-stored time interval is used as the target login data.

[0018] Optionally, obtaining target login data from the pre-stored time data according to the target time range and the preset time interval includes:

[0019] If the target time range is less than the preset time interval, the login data corresponding to the target time range is filtered out from the login data within the pre-stored time interval to obtain the target login data.

[0020] Optionally, the method further includes:

[0021] Updating the preset time interval and the login data within the pre-stored time interval according to the target login data, the login time of the first login data in the target login data, and the logout time of the last login data.

[0022] Optionally, updating the preset time interval and the login data within the pre-stored time interval according to the target login data, the login time of the first login data in the target login data, and the logout time of the last login data includes:

[0023] Updating the start time in the preset time interval to the login time of the first login data in the login data;

[0024] Updating the end time in the preset time interval to the logout time of the last login data in the login data;

[0025] Deleting the login data within the pre-stored time interval and using the target login data as the login data within the new pre-stored time interval.

[0026] Optionally, determining the target calculation type based on the target time range and the pre-stored time data includes:

[0027] If the target time range is less than or equal to the time range corresponding to the pre-stored time data, determining the target calculation type as historical data reading; otherwise, determining the target calculation type as new data calculation.

[0028] Optionally, obtain the target login data of the target virtual character within the target time range from the game log library of the game, including:

[0029] Obtain at least one login data and at least one logout data within the target time range;

[0030] Perform data matching based on at least one login data and at least one logout data to obtain the target login data, where the target login data includes at least one set of login data, and each set of login data includes a login data and a logout data.

[0031] Optionally, perform data matching based on at least one login data and at least one logout data to obtain the target login data, including:

[0032] Use the login data at the first time point and the logout data at the second time point as a set of login data, where the first time point and the second time point are adjacent time points within the target time range;

[0033] Sort according to the login time of each set of login data to obtain the target login data.

[0034] Optionally, determine the online time data of the target virtual character according to the target login data, including:

[0035] Determine the indication type of the online time data, where the indication type includes: online duration, number of logins;

[0036] Determine the online time data according to the indication type and the target login data.

[0037] Optionally, determine the online time data according to the indication type and the target login data, including:

[0038] If the indication type is online duration, determine the duration of each login data in the target login data;

[0039] Cumulatively calculate the duration of each login data as the result of the online time data.

[0040] Optionally, determine the online time data according to the indication type and the target login data, including:

[0041] If the indication type is number of logins, determine the number of login data in the target login data;

[0042] Use the number of login data as the result of the online time data.

[0043] On the other hand, an embodiment of the present application provides a device for determining the online time in a game, including: an acquisition module, a determination module, a calculation module, and a result module;

[0044] An acquisition module for acquiring the identifier of a target virtual character and a target time range;

[0045] A determination module for determining a target calculation type based on the target time range and pre-stored time data, where the target calculation type includes: historical data reading or new data calculation, and the pre-stored time data includes: historical login data of the target virtual character;

[0046] A calculation module for, if the target calculation type is new data calculation, acquiring the target login data of the target virtual character within the target time range from the game log library of the game;

[0047] The calculation module is also used for, if the target calculation type is historical data reading, acquiring the target login data from the pre-stored time data;

[0048] A result module for determining the online time data of the target virtual character according to the target login data.

[0049] Optionally, the pre-stored time data includes: a preset time interval, and login data within the pre-stored time interval; the calculation module is specifically used for acquiring the target login data from the pre-stored time data according to the target time range and the preset time interval.

[0050] Optionally, the calculation module is also used for, if the target time range is equal to the preset time interval, using the login data within the pre-stored time interval as the target login data.

[0051] Optionally, the calculation module is also used for, if the target time range is less than the preset time interval, screening out the login data corresponding to the target time range from the login data within the pre-stored time interval to obtain the target login data.

[0052] Optionally, the calculation module is also used for updating the preset time interval and the login data within the pre-stored time interval according to the target login data, the login time of the first login data in the target login data, and the logout time of the last login data.

[0053] Optionally, the calculation module is specifically used for updating the start time in the preset time interval to the login time of the first login data in the login data; updating the end time in the preset time interval to the logout time of the last login data in the login data; deleting the login data within the pre-stored time interval, and using the target login data as the login data within the new pre-stored time interval.

[0054] Optionally, the determination module is specifically used for, if the target time range is less than or equal to the time range corresponding to the pre-stored time data, determining that the target calculation type is historical data reading, otherwise, determining that the target calculation type is new data calculation.

[0055] Optionally, the calculation module is further configured to obtain at least one login data and at least one logout data within a target time range; perform data matching based on the at least one login data and the at least one logout data to obtain target login data, where the target login data includes at least one set of login data, and each set of login data includes one login data and one logout data.

[0056] Optionally, the calculation module is specifically configured to use the login data at the first time point and the logout data at the second time point as a set of login data, where the first time point and the second time point are adjacent time points within the target time range; sort according to the login time of each set of login data to obtain the target login data.

[0057] Optionally, the result module is specifically configured to determine the indication type of the online time data, where the indication type includes: online duration, number of logins; determine the online time data according to the indication type and the target login data.

[0058] Optionally, the result module is specifically configured to, if the indication type is online duration, determine the duration of each login data in the target login data; cumulatively calculate the duration of each login data as the result of the online time data.

[0059] Optionally, the result module is further configured to, if the indication type is number of logins, determine the number of login data in the target login data; use the number of login data as the result of the online time data.

[0060] On the other hand, an embodiment of the present application provides a computer device, including: a memory and a processor, where the memory stores a computer program that can run on the processor, and when the processor executes the computer program, the steps of the method for determining the online time in the above game are implemented.

[0061] On the other hand, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for determining the online time in the above game are implemented.

[0062] The beneficial effects of the embodiments of the present application include:

[0063] In a method, apparatus, device, and storage medium for determining online time in a game provided by an embodiment of the present application, an identifier of a target virtual character and a target time range can be obtained; based on the target time range and pre-stored time data, a target calculation type is determined, and the target calculation type includes: historical data reading or new data calculation, and the pre-stored time data includes: historical login data of the target virtual character; if the target calculation type is new data calculation, target login data of the target virtual character within the target time range is obtained from the game log library of the game; if the target calculation type is historical data reading, the target login data is obtained from the pre-stored time data; the online time data of the target virtual character is determined according to the target login data. Among them, in the process of determining the online time data, it is possible to select to read from the determined historical data or obtain from the game log library according to the target calculation type. For the data that can be read from the historical data, the calculation of the online time data can be realized more quickly and simply, thereby improving the calculation efficiency and reducing the waste of calculation resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0065] Figure 1 It is a schematic flowchart of a method for determining online time in a game provided by an embodiment of the present application;

[0066] Figure 2 It is another schematic flowchart of a method for determining online time in a game provided by an embodiment of the present application;

[0067] Figure 3 It is yet another schematic flowchart of a method for determining online time in a game provided by an embodiment of the present application;

[0068] Figure 4 It is a schematic relationship diagram for determining a target calculation type in a game provided by an embodiment of the present application;

[0069] Figure 5 It is yet another schematic flowchart of a method for determining online time in a game provided by an embodiment of the present application;

[0070] Figure 6 It is a schematic relationship diagram for determining target login data in a game provided by an embodiment of the present application;

[0071] Figure 7 It is yet another schematic flowchart of a method for determining online time in a game provided by an embodiment of the present application;

[0072] Figure 8 Another flowchart of the method for determining the online time in the game provided by the embodiment of the present application;

[0073] Figure 9 Another flowchart of the method for determining the online time in the game provided by the embodiment of the present application;

[0074] Figure 10 Structural diagram of the device for determining the online time in the game provided by the embodiment of the present application;

[0075] Figure 11 Structural diagram of the computer device provided by the embodiment of the present application. Detailed implementation manners

[0076] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some but not all of the embodiments of the present application. Components of the embodiments of the present application generally described and illustrated in the figures herein may be arranged and designed in a variety of different configurations.

[0077] Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but is merely representative of selected embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.

[0078] It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.

[0079] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be construed as indicating or implying relative importance.

[0080] In one embodiment of the present application, the method for determining the online time in the game can run on a terminal device or a server. Among them, the terminal device can be a local terminal device. When the game display method runs on the server, the method can be implemented and executed based on a cloud interaction system, where the cloud interaction system includes a server and a client device.

[0081] In an optional implementation, various cloud applications, such as cloud games, can be run under the cloud interaction system. Taking cloud games as an example, cloud games refer to a game method based on cloud computing. In the operation mode of cloud games, the operating body of the game program and the main body of the game screen presentation are separated. The storage and operation of the game display method are completed on the cloud game server. The role of the client device is used for receiving and sending data and presenting the game screen. For example, the client device can be a display device with data transmission function close to the user side, such as a mobile terminal, a TV, a computer, a handheld computer, etc.; but the terminal device for information processing is a cloud game server in the cloud. When playing the game, the player operates the client device to send an operation instruction to the cloud game server. The cloud game server runs the game according to the operation instruction, encodes and compresses the game screen and other data, and returns it to the client device through the network. Finally, the client device decodes and outputs the game screen.

[0082] In an optional embodiment, the terminal device may be a local terminal device. Taking a game as an example, the local terminal device stores a game program and is used to present a game screen. The local terminal device is used to interact with the player through a graphical user interface, that is, the game program is downloaded and installed by an electronic device and run conventionally. The local terminal device may provide the graphical user interface to the player in a variety of ways, for example, it may be rendered and displayed on a display screen of the terminal, or provided to the player through a holographic projection. For example, the local terminal device may include a display screen and a processor, the display screen is used to present a graphical user interface, the graphical user interface includes a game screen, and the processor is used to run the game, generate a graphical user interface, and control the display of the graphical user interface on the display screen.

[0083] In a possible implementation, an embodiment of the present invention provides a method for determining online time in a game, providing a graphical user interface through a first terminal device, wherein the first terminal device can be the local terminal device mentioned above, or can be a client device in the cloud interaction system mentioned above.

[0084] It should be noted that in the prior art, each time a calculation is performed, the game log is traversed for query, so as to find the corresponding login record based on the time range of the required query, and then the online time data is calculated based on the corresponding login record, which is explained by taking the following Table 1 as an example.

[0085] Table 1

[0086] 0-T T - 2T 2T - 3T 3T - 4T First time First calculation Second time Second calculation Second calculation Third time Third calculation Third calculation Third calculation Fourth time Fourth calculation Fourth calculation Fourth calculation Fourth calculation

[0087] Optionally, the horizontal direction shown in Table 1 is a calculation process of online time data performed multiple times; the vertical direction is a time interval that needs to be calculated in each time calculation process.

[0088] For example, when calculating for the first time, the calculable time interval is 0 - T, and thus data within the time interval of 0 - T needs to be read from the game log; when calculating for the second time, the calculable time interval is 0 - T or T - 2T; when calculating for the third time, the calculable time interval is 0 - T, T - 2T or 2T - 3T; when calculating for the fourth time, the calculable time interval is 0 - T, T - 2T, 2T - 3T or 3T - 4T. No matter which interval is selected for calculation, data within the corresponding time interval needs to be read from the game log.

[0089] Since each time log screening, record rearrangement and then calculation are performed, it will waste a lot of time and computing resources, which results in low efficiency and resource waste in the process of determining the online duration.

[0090] However, the technical solution adopted in this application is different from the prior art, as shown in Table 2 specifically.

[0091] Table 2

[0092] T T to 2T 2T to 3T 3T to 4T First time First calculation Second time Historical data Second calculation Third time Historical data Historical data Third calculation Fourth time Historical data Historical data Historical data Fourth calculation

[0093] Optionally, the content represented horizontally and vertically in Table 2 is the same, which will not be elaborated here. The difference is that for the online time data calculated previously, corresponding storage can be performed, and historical data can be read from the corresponding storage repository, so that a large amount of reading from the game log can be avoided, and resource waste can be prevented.

[0094] For example, when calculating for the first time, the calculable time interval is 0 - T, and thus data within the time interval of 0 - T needs to be read from the game log; when calculating for the second time, the calculable time interval is 0 - T or T - 2T. If the calculable time interval of 0 - T is selected, historical data can be read; when calculating for the third time, the calculable time interval is 0 - T, T - 2T or 2T - 3T. If the calculable time interval of 0 - T or T - 2T is selected, historical data can be read; when calculating for the fourth time, the calculable time interval is 0 - T, T - 2T, 2T - 3T or 3T - 4T. If the calculable time interval of 0 - T, T - 2T or 2T - 3T is selected, historical data can be read.

[0095] Next, the specific implementation process of the method for determining the online time in the game provided in this application will be specifically explained.

[0096] Figure 1 For the flowchart of the method for determining the online time in the game provided in the embodiments of this application, please refer to Figure 1 , the method for determining the online time in the game includes:

[0097] S110: Obtain the identifier of the target virtual character and the target time range.

[0098] Optionally, the execution entity of this method can specifically be the aforementioned local terminal device, or a game server communicatively connected to the local terminal device, without specific limitation here.

[0099] The identifier of the target virtual character can be an account identifier. If there are multiple virtual characters under one account, it can also include the account identifier and the character identifier. If different characters can be allocated to different servers, the server identifier can also be added. The identifier settings can be specifically determined according to actual requirements.

[0100] For example: If the online time data to be obtained is for the online time of the account, it can be based on the account identifier; if the online time data to be obtained is for the online time of the virtual character, it can be based on the account identifier and the character identifier.

[0101] The target time range can be the time interval of the online time data to be obtained. For example, if the online time data for a certain day is to be obtained, the target time range is from 0:00 to 24:00 of this day.

[0102] S120: Determine the target calculation type based on the target time range and the pre-stored time data.

[0103] Among them, the target calculation type includes: historical data reading or new data calculation, and the pre-stored time data includes: the historical login data of the target virtual character.

[0104] Optionally, the pre-stored time data can include the historical login data of the target virtual character. This historical login data can specifically be the time interval where the recorded historical data is located. It can be determined based on the two time intervals to determine the corresponding target calculation type.

[0105] Among them, the historical data reading type can be the process of obtaining the target login data from the pre-stored database; the new data calculation type can be the process of obtaining the target login data from the game log library.

[0106] S130: If the target calculation type is new data calculation, obtain the target login data of the target virtual character in the target time range from the game log library of the game.

[0107] Optionally, when it is determined that the target calculation type is new data calculation, it can be determined that data needs to be obtained from the game log library. Then, the game log library can be traversed to find the login data within the corresponding target time range as the above-mentioned target login data.

[0108] S140: If the target calculation type is historical data reading, obtain the target login data from the pre-stored time data.

[0109] Optionally, the method step S140 can be two parallel schemes with the aforementioned S130. When it is determined that the target calculation type is historical data reading, it can be determined that it is necessary to read the pre-stored time data from a pre-configured database, and obtain the login data within the corresponding target time range from the pre-stored time data as the above-mentioned target login data.

[0110] S150: Determine the online time data of the target virtual character according to the target login data.

[0111] Optionally, after determining the target login data, calculations can be performed based on multiple data in the target login data to obtain the online time data of the target virtual character.

[0112] Among them, the online time data can be specifically set according to actual needs. For example: overall online duration, partial online duration, number of logins, online duration for each login, etc., which are not limited here.

[0113] In a method for determining online time in a game provided by an embodiment of the present application, the identifier of the target virtual character and the target time range can be obtained; based on the target time range and the pre-stored time data, the target calculation type is determined, and the target calculation type includes: historical data reading or new data calculation, and the pre-stored time data includes: historical login data of the target virtual character; if the target calculation type is new data calculation, obtain the target login data of the target virtual character in the target time range from the game log library of the game; if the target calculation type is historical data reading, obtain the target login data from the pre-stored time data; determine the online time data of the target virtual character according to the target login data. Among them, during the process of determining the online time data, it can be selected to read from the determined historical data or obtain from the game log library according to the target calculation type. For the data that can be read from the historical data, the calculation of the online time data can be realized more quickly and simply, thereby improving the calculation efficiency and reducing the waste of calculation resources.

[0114] Optionally, the pre-stored time data includes: a preset time interval, login data within the pre-stored time interval; obtaining the target login data from the pre-stored time data includes: obtaining the target login data from the pre-stored time data according to the target time range and the preset time interval.

[0115] Optionally, the pre-stored time data can be stored in two storage spaces respectively. Among them, the first storage space is used to store the above-mentioned preset time interval; the second storage space is used to store the login data within the above-mentioned pre-stored time interval.

[0116] Among them, the preset time interval can specifically be a time range, which can include a start time and an end time; the login data within the preset time interval can be multiple login data between the start time and the end time, such as: data such as character login and character logout, which are not limited here.

[0117] In the process of obtaining the target login data, it can be determined based on the target time range and the preset time interval, so as to obtain the target login data. For example: specifically, it can be determined according to the size relationship between the target time range and the preset time interval.

[0118] Next, based on the content included in the above-mentioned pre-stored time data, another specific implementation process of the method for determining the online time in the game provided in the embodiments of the present application will be explained.

[0119] Figure 2 For another flow chart of the method for determining the online time in the game provided in the embodiments of the present application, please refer to Figure 2 , according to the target time range and the preset time interval, obtain the target login data from the pre-stored time data, including:

[0120] If the target time range is equal to the preset time interval, S210: Use the login data within the pre-stored time interval as the target login data.

[0121] Optionally, the size relationship between the target time range and the preset time interval can be determined.

[0122] If the two time intervals are exactly equal, it can be determined that the target time range is equal to the preset time interval. In this case, the login data within the pre-stored time interval can be used as the target login data.

[0123] Optionally, according to the target time range and the preset time interval, obtain the target login data from the pre-stored time data, including:

[0124] If the target time range is less than the preset time interval, S120: Screen out the login data corresponding to the target time range from the login data within the pre-stored time interval to obtain the target login data.

[0125] If the target time range is less than the preset time interval, that is, the target time range is a part of the preset time interval, it can be determined that the target time range is less than the preset time interval. In this case, the login data within the pre-stored time interval can be screened, and the screened login data is used as the target login data.

[0126] Optionally, during the screening process, the login data whose start time and end time are both within the target time range can be used as the target login data.

[0127] In the method for determining the online time in the game provided by the embodiment of the present application, when the target time range is equal to the preset time interval, the login data within the pre-stored time interval can be used as the target login data; when the target time range is less than the preset time interval, the login data corresponding to the target time range can be screened out from the login data within the pre-stored time interval to obtain the target login data. Among them, by comparing the preset time interval with the target time range, a way to determine the target login data can be obtained more quickly and conveniently, and then the target login data can be obtained more quickly.

[0128] Optionally, the method further includes:

[0129] Updating the preset time interval and the login data within the pre-stored time interval according to the target login data, the login time of the first login data in the target login data, and the logout time of the last login data.

[0130] Among them, after obtaining the target login data, the pre-stored time data can be updated. Specifically, the preset time interval can be updated according to the login time of the first login data and the logout time of the last login data in the target login data; the login data within the pre-stored time interval can be updated according to the specific data content in the target login data.

[0131] Next, the specific implementation process of updating the pre-stored time data in the method for determining the online time in the game provided by the embodiment of the present application will be explained.

[0132] Figure 3 For another process schematic diagram of the method for determining the online time in the game provided by the embodiment of the present application, please refer to Figure 3 , updating the preset time interval and the login data within the pre-stored time interval according to the target login data, the login time of the first login data in the target login data, and the logout time of the last login data, includes:

[0133] S310: Update the start time in the preset time interval to the login time of the first login data in the login data.

[0134] Optionally, the target login data can be multiple login data sorted in chronological order. During the process of updating the preset time interval, the start time in the preset time interval can be updated to the login time of the first login data in the login data. That is, the start time recorded in the above first storage space is updated.

[0135] S320: Update the end time in the preset time interval to the logout time of the last login data in the login data.

[0136] Optionally, during the process of updating the preset time interval, the end time in the preset time interval can be updated to the logout time of the last login data in the login data. That is, the end time recorded in the first storage space mentioned above is updated.

[0137] S330: Delete the login data within the pre-stored time interval, and use the target login data as the login data within the new pre-stored time interval.

[0138] Optionally, after updating the above-mentioned preset time interval, the login data stored within the original preset time interval can be deleted, that is, the data in the second storage space mentioned above is deleted, and the target login data is used to replace it as the login data within the new pre-stored time interval, so as to realize the update of the login data within the pre-stored time interval. After the above update, the update of the pre-stored time data can be realized, and the first storage space and the second storage space are correspondingly updated after the update.

[0139] In the method for determining the online time in the game provided by the embodiments of the present application, the start time in the preset time interval can be updated to the login time of the first login data in the login data; the end time in the preset time interval can be updated to the logout time of the last login data in the login data; delete the login data within the pre-stored time interval, and use the target login data as the login data within the new pre-stored time interval. Among them, through the above update method, the update of the pre-stored time data can be realized, and further, the determination condition can be not fixed during the process of determining the target type, thereby increasing the diversity of the pre-stored time data.

[0140] Next, the specific schematic relationship of the target calculation type provided by the embodiments of the present application will be explained.

[0141] Figure 4 For the schematic diagram of the relationship for determining the target calculation type in the game provided by the embodiments of the present application, please refer to Figure 4 , based on the target time range and the pre-stored time data, determine the target calculation type, including: if the target time range is less than or equal to the time range corresponding to the pre-stored time data, determine that the target calculation type is historical data reading, otherwise, determine that the target calculation type is new data calculation.

[0142] Optionally, Figure 4 The figure shows the comparison process of the size of the target time range and the pre-stored time interval in the pre-stored time data. Figure 4 The figure shows a situation where the target time range is greater than the pre-stored time data. Among them, the start time of the target time range is time point 1, and the end time is time point 2; the start time of the pre-stored time interval in the pre-stored time data is time point 3, and the end time is time point 4.

[0143] Next, a specific implementation process of the method for determining the online time in the game provided in the embodiments of the present application will be specifically explained.

[0144] Figure 5 For another flowchart of the method for determining the online time in the game provided in the embodiments of the present application, please refer to Figure 5 , obtain the target login data of the target virtual character within the target time range from the game log library of the game, including:

[0145] S510: Obtain at least one login data and at least one logout data within the target time range.

[0146] Optionally, when it is determined that the target login data needs to be determined from the game logs, multiple login data and logout data within this range can be determined according to the target time range.

[0147] Optionally, during the recording process, in order to distinguish between login data and logout data, different identifiers can be used respectively. For example, "in" can be used for login data, and "out" can be used for logout data, and they are recorded and stored in the form of strings.

[0148] For example, the stored content can be ['x_001', 'in', '2099-01-01 12:00:00'], where "x_001" represents the identification information of the virtual character; "in" can represent login; "2099-01-01 12:00:00" can represent the corresponding time point.

[0149] S520: Perform data matching according to at least one login data and at least one logout data to obtain the target login data.

[0150] Among them, the target login data includes at least one set of login data, and each set of login data includes one login data and one logout data.

[0151] Optionally, after determining the login data and logout data, the login data and logout data can be matched to obtain a corresponding set of login data, and each login data includes one login data and one logout data.

[0152] Next, a schematic diagram of the data segment storage provided in the embodiments of the present application will be specifically explained.

[0153] Figure 6 For a schematic diagram of the relationship for determining the target login data in the game provided in the embodiments of the present application, please refer to Figure 6 , Figure 6It may include multiple login data and logout data, and these data can be arranged in chronological order. The grouped login data and logout data can form a set of login data, and the login duration can be calculated for each set of login data. In addition, other ungrouped data can be discarded and deleted.

[0154] For example, Figure 6 if the first data and the last data in are not grouped, they can be discarded; the second to fifth data are grouped and correspond to time point a, time point b, time point c, and time point d respectively. When calculating the duration of each login data, the time of the logout data can be subtracted from the time of the login data. For example, the duration of the first login data is time point b - time point a.

[0155] Next, a specific implementation process of the method for determining the online time in the game provided by the embodiment of the present application will be specifically explained.

[0156] Figure 7 For another schematic flowchart of the method for determining the online time in the game provided by the embodiment of the present application, please refer to Figure 7 , data matching is performed based on at least one login data and at least one logout data to obtain target login data, including:

[0157] S710: Take the login data at the first time point and the logout data at the second time point as a set of login data.

[0158] Among them, the first time point and the second time point are adjacent time points within the target time range.

[0159] Optionally, multiple data can be sorted in chronological order, and the login data and logout data at adjacent time points can be taken as a set of login data.

[0160] It should be noted that for each set of login data, the time of the login data is before the logout time, that is, the first time point should be before the second time point.

[0161] After determination, a set of login data can be obtained.

[0162] S720: Sort according to the login time of each set of login data to obtain the target login data.

[0163] Optionally, after obtaining multiple sets of login data in the above manner, they can be sorted in chronological order. For example, they can be sorted in the chronological order of the login time in each set of login data, and then the sorted target login data can be obtained.

[0164] Next, another specific implementation process of the method for determining the online time in the game provided by the embodiment of the present application will be specifically explained.

[0165] Figure 8 Another flowchart of the method for determining the online time in the game provided by the embodiment of the present application. Please refer to Figure 8 , and determine the online time data of the target virtual character according to the target login data, including:

[0166] S810: Determine the indication type of the online time data.

[0167] Among them, the indication type includes: online duration, number of logins.

[0168] Optionally, different indication types can be used for different online time data. The indication type can specifically refer to the result of the required online time data. For example, for the online duration, the result of the obtained online time data is a time length; for the number of logins, the result of the obtained online time data is a number of times.

[0169] S820: Determine the online time data according to the indication type and the target login data.

[0170] When determining the online time data, it can be jointly determined according to the indication type and the target login data.

[0171] Next, the specific implementation processes of determining the online time data based on different indication types in the method for determining the online time in the game provided by the embodiment of the present application will be explained separately.

[0172] Figure 9 Another flowchart of the method for determining the online time in the game provided by the embodiment of the present application. Please refer to Figure 9 , and determine the online time data according to the indication type and the target login data, including:

[0173] If the indication type is the online duration, S910: Determine the duration of each login data in the target login data.

[0174] Optionally, when it is determined that the indication type is the online duration, the duration of each login data can be determined. Among them, the duration of each login data can be obtained based on the time difference between the login time and the logout time.

[0175] S920: Cumulatively calculate the duration of each login data as the result of the online time data.

[0176] Optionally, the duration of each login data can be obtained, and these durations can be accumulated and calculated, and the obtained result is used as the result of the online time data.

[0177] For example, the target login data includes two pieces of login data. The duration of the first piece of login data is 120s, and the duration of the second piece of login data is 150s. Then the result of the online time data is the accumulated 270s.

[0178] Optionally, determining the online time data according to the indication type and the target login data includes:

[0179] If the indication type is the number of logins, S930: Determine the number of pieces of login data in the target login data.

[0180] Optionally, when it is determined that the indication type is the number of logins, the number of pieces of login data in the target login data can be determined.

[0181] S940: Use the number of pieces of login data as the result of the online time data.

[0182] Optionally, each piece of login data can be obtained, and the number of these pieces of login data can be calculated as the result of the online time data.

[0183] For example: The target login data includes two pieces of login data, then the result of the online time data is 2 times.

[0184] The following describes the corresponding devices, equipment, storage media, etc. for the method for determining the online time in the game provided by the present application for execution. For the specific implementation process and technical effects, refer to the above, and the following will not be elaborated.

[0185] Figure 10 The following is a schematic structural diagram of the device for determining the online time in the game provided by the embodiments of the present application. Please refer to Figure 10 , the device for determining the online time in the game includes: an acquisition module 100, a determination module 200, a calculation module 300, and a result module 400;

[0186] The acquisition module 100 is used to acquire the identifier of the target virtual character and the target time range;

[0187] The determination module 200 is used to determine the target calculation type based on the target time range and the pre-stored time data. The target calculation type includes: historical data reading or new data calculation. The pre-stored time data includes: the historical login data of the target virtual character;

[0188] The calculation module 300 is used to, if the target calculation type is new data calculation, acquire the target login data of the target virtual character in the target time range from the game log library of the game;

[0189] The calculation module 300 is further used to, if the target calculation type is historical data reading, acquire the target login data from the pre-stored time data;

[0190] A result module 400 is used to determine the online time data of a target virtual character according to the target login data.

[0191] Optionally, the pre-stored time data includes: a preset time interval and login data within the pre-stored time interval; a calculation module 300 is specifically configured to obtain the target login data from the pre-stored time data according to the target time range and the preset time interval.

[0192] Optionally, the calculation module 300 is further configured to, if the target time range is equal to the preset time interval, use the login data within the pre-stored time interval as the target login data.

[0193] Optionally, the calculation module 300 is further configured to, if the target time range is less than the preset time interval, screen out the login data corresponding to the target time range from the login data within the pre-stored time interval to obtain the target login data.

[0194] Optionally, the calculation module 300 is further configured to update the preset time interval and the login data within the pre-stored time interval according to the target login data, the login time of the first login data in the target login data, and the logout time of the last login data.

[0195] Optionally, the calculation module 300 is specifically configured to update the start time in the preset time interval to the login time of the first login data in the login data; update the end time in the preset time interval to the logout time of the last login data in the login data; delete the login data within the pre-stored time interval, and use the target login data as the login data within the new pre-stored time interval.

[0196] Optionally, the determination module 200 is specifically configured to, if the target time range is less than or equal to the time range corresponding to the pre-stored time data, determine that the target calculation type is historical data reading; otherwise, determine that the target calculation type is new data calculation.

[0197] Optionally, the calculation module 300 is further configured to obtain at least one login data and at least one logout data within the target time range; perform data matching according to the at least one login data and the at least one logout data to obtain the target login data, where the target login data includes at least one set of login data, and each set of login data includes a login data and a logout data.

[0198] Optionally, the calculation module 300 is specifically configured to use the login data at the first time point and the logout data at the second time point as a set of login data, where the first time point and the second time point are adjacent time points within the target time range; sort according to the login time of each set of login data to obtain the target login data.

[0199] Optionally, the result module 400 is specifically configured to determine the indication type of the online time data, where the indication type includes: online duration, number of logins; and determine the online time data according to the indication type and the target login data.

[0200] Optionally, the result module 400 is specifically configured to, if the indication type is online duration, determine the duration of each login data in the target login data; and cumulatively calculate the duration of each login data as the result of the online time data.

[0201] Optionally, the result module 400 is further configured to, if the indication type is number of logins, determine the number of login data in the target login data; and use the number of login data as the result of the online time data.

[0202] The above device is used to execute the method provided in the foregoing embodiment, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0203] The above modules may be one or more integrated circuits configured to implement the above method, for example: one or more application specific integrated circuits (ASICs), or, one or more microprocessors, or, one or more field programmable gate arrays (FPGAs), etc. Again, when a certain module above is implemented in the form of a processing element dispatching program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. Again, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0204] Figure 11 For the structural schematic diagram of the computer device provided by the embodiment of the present application, please refer to Figure 11 , the computer device includes: a memory 500 and a processor 600. A computer program that can run on the processor 600 is stored in the memory 500. When the processor 600 executes the computer program, the steps of the method for determining the online time in the above game are implemented.

[0205] Optionally, the computer device may specifically be the foregoing local terminal device or a game server connected to the local terminal device.

[0206] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for determining the online time in the above game are implemented.

[0207] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling, direct coupling, or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.

[0208] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0209] In addition, each functional unit in various embodiments of the present invention can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of a combination of hardware and software functional units.

[0210] The above-mentioned integrated units implemented in the form of software functional units can be stored in a computer-readable storage medium. The above-mentioned software functional units stored in a storage medium include several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to execute some steps of the methods in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (English: Read-Only Memory, abbreviated as: ROM), random access memories (English: Random Access Memory, abbreviated as: RAM), magnetic disks, or optical discs that can store program codes.

[0211] The above is only the specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0212] The above are only the preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, various modifications and variations can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application.

Claims

1. A method for determining the online time in a game, characterized in that, it includes: Obtain the identifier of the target virtual character and the target time range; Based on the target time range and the pre-stored time data, determine the target calculation type, where the target calculation type includes: historical data reading or new data calculation, and the pre-stored time data includes: the historical login data of the target virtual character, and the pre-stored time data is stored in a pre-configured database, and the pre-stored time data includes: a preset time interval, and the login data within the pre-stored time interval; If the target calculation type is new data calculation, obtain the target login data of the target virtual character within the target time range from the game log library of the game; If the target calculation type is historical data reading, obtain the target login data from the pre-stored time data; Determine the online time data of the target virtual character according to the target login data; The method further includes: Update the start time in the preset time interval to the login time of the first login data in the login data; Update the end time in the preset time interval to the logout time of the last login data in the login data; Delete the login data within the pre-stored time interval, and use the target login data as the login data within the new pre-stored time interval.

2. The method for determining the online time in a game according to claim 1, characterized in that, The obtaining the target login data from the pre-stored time data includes: According to the target time range and the preset time interval, obtain the target login data from the pre-stored time data.

3. The method for determining the online time in a game according to claim 2, characterized in that, The obtaining the target login data according to the target time range and the preset time interval includes: If the target time range is equal to the preset time interval, use the login data within the pre-stored time interval as the target login data.

4. The method for determining the online time in a game according to claim 2, characterized in that, The obtaining the target login data according to the target time range and the preset time interval includes: If the target time range is less than the preset time interval, screen out the login data corresponding to the target time range from the login data within the pre-stored time interval to obtain the target login data.

5. The method for determining the online time in a game according to any one of claims 1-4, characterized in that, The determining the target calculation type based on the target time range and the pre-stored time data includes: If the target time range is less than or equal to the time range corresponding to the pre-stored time data, determine that the target calculation type is the historical data reading, otherwise, determine that the target calculation type is the new data calculation.

6. The method for determining the online time in a game according to any one of claims 1-4, characterized in that, Obtaining the target login data of the target virtual character within the target time range from the game log library of the game includes: Obtaining at least one login data and at least one logout data within the target time range; Performing data matching based on at least one of the login data and at least one of the logout data to obtain the target login data, where the target login data includes at least one set of login data, and each set of the login data includes one login data and one logout data.

7. The method for determining the online time in the game according to claim 6, wherein, Performing data matching based on at least one of the login data and at least one of the logout data to obtain the target login data includes: Taking the login data at the first time point and the logout data at the second time point as a set of the login data, where the first time point and the second time point are adjacent time points within the target time range; Sorting according to the login time of each set of the login data to obtain the target login data.

8. The method for determining the online time in the game according to any one of claims 1 - 4, wherein, Determining the online time data of the target virtual character according to the target login data includes: Determining the indication type of the online time data, where the indication type includes: online duration, number of logins; Determining the online time data according to the indication type and the target login data.

9. The method for determining the online time in the game according to claim 8, wherein, Determining the online time data according to the indication type and the target login data includes: If the indication type is online duration, determining the duration of each login data in the target login data; Accumulatively calculating the duration of each login data as the result of the online time data.

10. The method for determining the online time in the game according to claim 8, wherein, Determining the online time data according to the indication type and the target login data includes: If the indication type is number of logins, determining the number of login data in the target login data; Taking the number of the login data as the result of the online time data.

11. A device for determining the online time in a game, wherein, including: An acquisition module, a determination module, a calculation module, and a result module; The acquisition module is used to acquire the identifier of the target virtual character and the target time range; The determination module is used to determine the target calculation type based on the target time range and the pre - stored time data, where the target calculation type includes: historical data reading or new data calculation, and the pre - stored time data includes: the historical login data of the target virtual character, the pre - stored time data is stored in a pre - configured database, and the pre - stored time data includes: a preset time interval, and the login data within the pre - stored time interval; The calculation module is used to, if the target calculation type is new data calculation, obtain the target login data of the target virtual character within the target time range from the game log library of the game; The calculation module is further configured to, if the target calculation type is historical data reading, obtain the target login data from the pre-stored time data; The result module is configured to determine the online time data of the target virtual character according to the target login data; The calculation module is further configured to update the start time in the preset time interval to the login time of the first login data in the login data; update the end time in the preset time interval to the logout time of the last login data in the login data; delete the login data within the pre-stored time interval, and use the target login data as the login data within the new pre-stored time interval.

12. A computer device characterized in that it includes: a memory and a processor, where a computer program that can run on the processor is stored in the memory, and when the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 above are implemented.

13. A computer-readable storage medium characterized in that a computer program is stored on the storage medium, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Virtual resource distribution method and device

    CN107115674A

  • Anti-addiction customized game recommendation method and system based on online time recognition

    CN111672129A