Online user number counting method, device and electronic equipment
By receiving and processing online logs from various servers, determining common statistical periods and dimensions, and calculating the sum of online users, the problem of the inability to integrate online users from multiple servers was solved, enabling a comprehensive analysis of the game's online status.
Patent Information
- Application Number
- CN202111511583.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2041-12-06
AI Technical Summary
Existing technology cannot effectively integrate online player statistics from multiple servers, resulting in an inability to comprehensively analyze the game's online situation.
By receiving online logs from each target server, extracting key information, determining common statistical periods and dimensions, filtering data, calculating the sum of online users for each server during that period, and establishing an online fact table for overall trend analysis.
It enables comprehensive statistics on the number of online players across multiple servers, providing full-scale online trend analysis capabilities and supporting improvements to game online performance.
Smart Images

Figure CN114238242B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of online user counting technology, and in particular to an online user counting method, apparatus, and electronic device. Background Technology
[0002] Currently, the number of online players for each game character is counted by their respective servers. The client-side game servers periodically send their online status data to a log collection system. The log collection system then plots corresponding points on a visualization interface based on the time and data of each server's online status, and connects these points with a smooth curve to create an online trend graph. This allows users to view the online trend of characters for each server, but it cannot reflect the overall online status of characters across multiple servers, hindering the analysis and improvement of the game's online performance. Summary of the Invention
[0003] The purpose of this application is to provide a method, apparatus, and electronic device for counting online users, in order to alleviate the technical problem of being unable to analyze the overall online status of multiple servers.
[0004] In a first aspect, embodiments of this application provide a method for counting online users, the method comprising:
[0005] Receive online logs corresponding to each target server, and extract key information from the online logs; wherein, the key information is used to characterize the number of online users corresponding to each target server at each log time.
[0006] The common statistical period and common statistical dimension are determined based on the key information of each target server, wherein each target server has a corresponding time interval between adjacent log times, and the common statistical period is the longest time interval among the target servers;
[0007] The key information is filtered based on the public statistical dimensions to determine the set of data to be collected, wherein the set of data to be collected includes each target server to be counted and the key information to be counted corresponding to each target server to be counted;
[0008] The sum of the number of online users for each target server in the public statistical period is calculated based on the set of statistics to be collected.
[0009] In one possible implementation, prior to the step of calculating the sum of online users for each target server in the public statistical period based on the set of statistics to be counted, the method further includes:
[0010] The duration to be calculated is determined based on the log time of each target server, and the duration to be calculated is divided into multiple common statistical periods.
[0011] In one possible implementation, the step of calculating the sum of the number of online users for each target server in the public statistical period based on the set of data to be counted includes:
[0012] Based on the set of data to be collected for each target server, calculate the average number of online users for each target server during the public statistical period.
[0013] The sum of the average values corresponding to each target server to be counted is used to determine the total number of online users in the public statistical period.
[0014] In one possible implementation, the step of receiving online logs corresponding to each target server and extracting key information from the online logs includes:
[0015] The system receives online logs from each target server through a log collection system.
[0016] By filtering out dirty data from the online logs, key information corresponding to each target server is extracted.
[0017] In one possible implementation, the method further includes:
[0018] The key information is loaded into an offline data warehouse, and the sum of the number of online users for each target server to be counted in the public statistical period is calculated offline based on the key information in the offline data warehouse.
[0019] In one possible implementation, the key information includes any one or more of the following: log time, server ID, number of online users at the log time, server version, activity version, and date.
[0020] In one possible implementation, the steps of determining the common statistical period and common statistical dimensions based on the key information of each target server include:
[0021] Based on the key information, determine the time interval range between adjacent log moments of each target server;
[0022] A common statistical period is determined based on the longest time interval, so that each target server calculates the number of online users according to the common statistical period.
[0023] In one possible implementation, the step of determining the common statistical period and common statistical dimension based on the key information of each target server further includes:
[0024] Based on preset business requirements, one or more key information items are selected as common statistical dimensions so that each target server can calculate the number of online users according to the common statistical dimensions.
[0025] In one possible implementation, the method further includes:
[0026] The public statistical dimensions are used as online fact fields to establish an online fact table for each target server.
[0027] In one possible implementation, the step of filtering the key information based on the common statistical dimensions to determine the set of statistical data includes:
[0028] Filter out target servers that do not meet the common statistical dimensions to obtain the target servers to be statistically analyzed.
[0029] Filter out the part of the key information corresponding to the target server to be counted that does not meet the common statistical dimension to obtain the key information to be counted.
[0030] The set of statistical data to be collected is determined based on the target server to be counted and the key information to be counted.
[0031] In one possible implementation, the common statistical dimensions include the duration to be calculated, the server ID, and outliers.
[0032] In one possible implementation, the method further includes: recording the sum of the number of online users of each target server to be counted during the public statistical period in the online fact table, according to the online fact field.
[0033] Secondly, embodiments of the present invention also provide an online user counting device, the device comprising:
[0034] The extraction module receives online logs corresponding to each target server and extracts key information from the online logs; wherein, the key information is used to characterize the number of online users corresponding to each target server at each log time.
[0035] The determination module determines a common statistical period and a common statistical dimension based on the key information of each target server, wherein each target server has a corresponding time interval between adjacent log times, and the common statistical period is the longest time interval among the target servers;
[0036] The filtering module filters the key information based on the common statistical dimensions to determine the set of data to be collected, wherein the set of data to be collected includes each target server to be counted and the key information to be counted corresponding to each target server to be counted;
[0037] The calculation module calculates the sum of the number of online users for each target server in the public statistical period based on the set of statistical data to be collected.
[0038] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method described in the first aspect above.
[0039] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-executable instructions, which, when invoked and executed by a processor, cause the processor to perform the method described in the first aspect above.
[0040] This application provides an online user counting method, apparatus, and electronic device. Based on the different log reporting times and frequencies of each target server, the longest interval between log times among the target servers is defined as the common statistical period. After filtering the key information corresponding to each target server according to the common statistical dimension, the sum of the online users of each server to be counted in the common statistical period can be obtained, so as to facilitate the analysis of the online trend of each server after merging.
[0041] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0042] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0043] Figure 1 This diagram illustrates the trend of online users on a traditional branch server.
[0044] Figure 2 A flowchart illustrating an online user counting method provided in this application embodiment;
[0045] Figure 3 This is a schematic diagram of the structure of an online user counting device provided in an embodiment of this application;
[0046] Figure 4A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0048] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this application, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0049] Currently, online trends are typically visualized by plotting points based on the log timestamps reported by each server and the corresponding number of online users, with the log timestamps on the x-axis and the number of online users on the y-axis, and then connecting them with a smooth curve.
[0050] like Figure 1 As shown, the horizontal axis represents time (in minutes), and the vertical axis represents the number of online users. Solid and circular dots represent two different sub-servers, A and B. Each server can generate its corresponding online user trend curve. At the first minute of the log, both servers have online users: server A has 18 online users, and server B has 15. At this point, the online users of the two servers can be added together. However, data for server A is missing at the third minute, and data for server B is missing at the fourth minute. Therefore, it is impossible to obtain a comprehensive statistical analysis of the online users of the two sub-servers, or an overall trend in online users.
[0051] Based on this, embodiments of this application provide a method, apparatus, and electronic device for counting online users, which can alleviate the technical problem of not being able to perform overall statistics on the number of online users across multiple servers.
[0052] The embodiments of this application will be further described below with reference to the accompanying drawings.
[0053] Figure 2 This is a flowchart illustrating an online user counting method provided in an embodiment of this application. The method is applied to a server; it should be noted that this server can be understood as a main server or a management server used to manage various sub-servers. Figure 2 As shown, the method includes:
[0054] Step S102: Receive the online logs corresponding to each target server and extract key information from the online logs.
[0055] The key information is used to characterize the number of online users on the target server at each log point in time. The target server is the sub-server initially selected to participate in the online user statistics; the online log is uploaded to this server by each target server at a preset time point, used to record the basic information and online status of its corresponding target server. The online log may contain some invalid data or data that is not useful for subsequent statistics. Key information for subsequent calculations is extracted from the online log.
[0056] It should be noted that the target server can be understood as a client game server. For a game, there may be multiple server-side components. This embodiment of the invention can comprehensively count the number of online players on each server-side component of the game.
[0057] Step S104: Determine the common statistical period and common statistical dimensions based on the key information of each target server.
[0058] Each target server has a corresponding time interval between adjacent log times, and the common statistical period is the longest time interval among the target servers.
[0059] It should be noted that the key information is extracted from online logs, and each target server has its own online logs; therefore, each target server has corresponding key information. The log reporting time (the time when the online log is reported) and reporting frequency (the time interval between two adjacent log reports) may differ for each target server.
[0060] For example, in this step, the longest time interval between log times for each target server is taken as the common statistical period. This common statistical period means that all target servers count the number of online users according to this period.
[0061] Step S106: Filter key information based on common statistical dimensions to determine the set of statistical data to be collected.
[0062] The set of data to be collected includes each target server to be counted and the corresponding key information to be counted for each target server. The common statistical dimension refers to the online user count for all target servers according to this dimension. It should be noted that the set of data to be collected is obtained by filtering out target servers that do not meet the common statistical dimension and the non-compliant information portions of the key information.
[0063] Step S108: Calculate the sum of the number of online users for each target server during the public statistical period based on the set of data to be collected.
[0064] The set of data to be collected includes the number of online users corresponding to each target server. Based on this filtered set of data to be collected, the number of online users of each target server in the common statistical period can be summed to obtain the overall online user trend statistics for each server.
[0065] In a preferred embodiment of practical application, based on the different log reporting times and frequencies of each target server, the period with the longest interval between log times among the target servers is defined as the common statistical period. After filtering the key information corresponding to each target server according to the common statistical dimension, the sum of the online users of each server to be counted in the common statistical period can be obtained, so as to facilitate the analysis of the online trend of each server after merging.
[0066] In some embodiments, online logs may be pre-processed to obtain key information that is more convenient for subsequent statistical applications. This step S102 further includes:
[0067] Step 1.1): Receive online logs sent by each target server through the log collection system.
[0068] The log collection system receives online logs from various target servers and sends them to the current server, where they can be collected and stored in the current server's distributed file system.
[0069] Step 1.2) Filter dirty data from online logs and extract key information corresponding to each target server.
[0070] For example, dirty data with incorrect log format or incomplete records can be filtered out, and then key data can be extracted from the filtered logs. This key information includes any one or more of the following: log time, server ID, number of online users at the time of the log entry, server version, activity version, and date.
[0071] In some embodiments, the current server can also calculate the online trends of each server offline. Based on the foregoing embodiments, the method further includes:
[0072] Step 2.1) Load the key information into the offline data warehouse, and calculate the sum of the number of online users of each target server to be counted in the public statistical period based on the key information in the offline data warehouse.
[0073] It should be noted that the current server can calculate the sum of the number of online users of each target server in the public statistical period based on the key information stored in the offline data warehouse, even when the server is offline.
[0074] In some embodiments, the public statistical period is determined based on key information. This step S104 includes:
[0075] Step 3.1) Determine the time interval between adjacent log moments for each target server based on the key information.
[0076] Among them, servers with different IDs may have different log sending periods, that is, the time interval between adjacent log moments is not the same. Assume that the time interval between adjacent log moments of each server is q1, q2...qn respectively.
[0077] Step 3.2) Determine the common statistical period based on the longest time interval so that each target server calculates the number of online users according to the common statistical period.
[0078] It should be noted that the common statistical period d can satisfy d>=max(q1,q2,...qn).
[0079] In some embodiments, public statistical dimensions may also be determined based on this key information. Step S104 further includes:
[0080] Step 4.1) Select one or more key information items as common statistical dimensions according to the preset business requirements, so that each target server can calculate the number of online users according to the common statistical dimensions.
[0081] For example, a required dimension can be selected from the key information as a common statistical dimension according to preset business needs. For instance, the common statistical dimension may include: server ID + server version, or server ID + date + activity version. However, the common statistical dimension cannot be server ID + different client versions, because the key information does not record relevant information about client versions.
[0082] In some embodiments, to more intuitively illustrate and display the number of online users on each server, the method further includes:
[0083] Step 5.1) Use the common statistical dimensions as online fact fields to build an online fact table for each target server.
[0084] It should be noted that common statistical dimensions can be used as online fact fields (table headers) to create an online fact table for each target server. For example, if the common statistical dimensions include date, log time, server ID, server version, and activity version, the online fact table is shown in Table 1 below:
[0085] Table 1
[0086] date time server ID Server version Event Version Online users
[0087] In some embodiments, the target server and its corresponding key information can be filtered according to common statistical dimensions to obtain online user trend statistics that meet business needs. Step S106 in the foregoing embodiments can be implemented in the following ways, specifically including:
[0088] Step 6.1) Filter out the target servers that do not meet the common statistical dimensions to obtain the target servers to be statistically analyzed.
[0089] The public statistical dimensions include the duration to be calculated, server ID, and outliers.
[0090] Step 6.2) Filter out the parts of the key information corresponding to the target server that do not meet the common statistical dimensions to obtain the key information to be counted.
[0091] For example, if the calculation period is the first 3 days, that is, only the online count of days 1-3 is calculated, then the key information outside these 3 days will be filtered out; since the log data contains some development and debugging data, if the ID range of the production server is 100-150, then servers outside this ID range should be removed; if a server has a maximum capacity of 2000 people, and a data record shows an online count of 200 million, this data is an outlier and deviates significantly from the normal value range, then this data will be removed.
[0092] Step 6.3) Determine the set of statistical data to be collected based on the target server and key information to be collected.
[0093] Specifically, the filtered target servers to be counted and the key information that meets the requirements are added to the set of data to be counted.
[0094] In some embodiments, the total time required to count online users may be relatively long. To more accurately analyze the overall online trend of each server during the entire required counting period, the method further includes the following step before step S108:
[0095] Step 7.1) Determine the duration to be calculated based on the log time of each target server, and divide the duration to be calculated into multiple common statistical periods.
[0096] The calculation duration can be preset by the user according to business needs, or it can be determined based on the log times of each target server. For example, if the log times of target server 1 are distributed from 9:00 to 12:00; the log times of target server 2 are distributed from 8:30 to 12:00; and the log times of target server 3 are distributed from 7:30 to 12:30, then the calculation duration can be selected to cover the range of log times of the most target servers, that is, from 7:30 to 12:30.
[0097] It should be noted that if the public statistical period is 3 minutes, then the time to be calculated from 7:30 to 12:30 will be divided into 3-minute intervals.
[0098] For example, if a 24-hour day is divided into 5-minute intervals according to a common statistical cycle, then log times such as 00:05:00, 00:10:00, and 00:15:00 will be generated.
[0099] In some embodiments, the sum of the number of online users on each server is calculated for each divided public statistical period, thereby obtaining the sum of the number of online users on each server for the entire statistical duration. For example, for calculating the sum of the number of online users for each public statistical period, step S108 further includes:
[0100] Step 8.1): Based on the set of data to be collected for each target server to be counted, calculate the average number of online users for each target server during the public statistical period.
[0101] Step 8.2) Based on the sum of the average values corresponding to each target server to be counted, determine the sum of the online users in the common statistical period.
[0102] For example, within the 0-3 minute interval, server A has one record: 20 online users at 2 minutes and 0 seconds. Therefore, the average online user count for server A within the 0-3 minute interval is 20. Server B has two records: 12 online users at 1 minute and 0 seconds and 16 online users at 3 minutes and 0 seconds. Therefore, the average online user count for server B within the 0-3 minute interval is (12+16) / 2 = 14. The data before calculation is shown in Table 2 below.
[0103] Table 2
[0104] time 0:01:00 0:02:00 0:03:00 0:04:00 0:05:00 0:06:00 Server A / 20 / / 22 / Server B 12 / 16 / 16 / A+B Do not add Do not add Do not add Do not add 38 Do not add
[0105] For minutes 1, 2, and 3 in Table 1 above, since servers A and B do not have corresponding online counts at that time in their logs, the online counts cannot be directly added together when viewing the overall situation of servers A and B. After calculation, the data is transformed into the form shown in Table 3 below:
[0106] Table 3
[0107]
[0108] In this way, the online counts of different servers at different log times are converted into online counts within the same time interval, and non-additive online data is converted into additive data, thus solving the problem of accumulating the online counts of multiple servers at different times.
[0109] In some embodiments, to further facilitate intuitive analysis of the online count of each server after statistics, the aforementioned method further includes: recording the sum of the online users of each target server to be counted in the online fact table according to the online fact field.
[0110] It should be noted that the online counts corresponding to the same dimension item (table header) can be averaged and aggregated and recorded in Table 1 above. This makes it easier for users to analyze the online trends of users of this game and make improvements to the game.
[0111] Figure 3 A schematic diagram of an online user counting device is provided. This device can be applied to a server, which can be understood as a main server or a management server used to manage various sub-servers. Figure 3 As shown, the online user counting device 300 includes:
[0112] The extraction module 301 is used to receive the online logs corresponding to each target server and extract key information from the online logs; wherein, the key information is used to characterize the number of online users corresponding to each log time of the target server;
[0113] The determining module 302 is used to determine the common statistical period and common statistical dimension based on the key information of each target server, wherein each target server has a corresponding time interval between adjacent log times, and the common statistical period is the longest time interval between the target servers.
[0114] The filtering module 303 is used to filter the key information based on the common statistical dimensions to determine the set of data to be counted, wherein the set of data to be counted includes each target server to be counted and the key information to be counted corresponding to each target server to be counted;
[0115] The calculation module 304 is used to calculate the sum of the number of online users of each target server to be counted in the public statistical period based on the set of statistical data to be counted.
[0116] In some embodiments, the calculation module 304 is further specifically configured to, before the step of calculating the sum of the number of online users of each target server in the public statistical period based on the set of statistics to be counted, determine the duration to be counted based on the log time of each target server, and divide the duration to be counted into multiple public statistical periods.
[0117] In some embodiments, the calculation module 304 is further specifically configured to: calculate the average number of online users of each target server in the public statistical period based on the set of data to be collected for each target server; and determine the sum of the online users in the public statistical period based on the sum of the average numbers for each target server.
[0118] In some embodiments, the extraction module 301 is further configured to receive online logs sent by each target server through a log collection system; filter dirty data in the online logs; and extract key information corresponding to each target server.
[0119] In some embodiments, the calculation module 304 is further specifically used to load the key information into an offline data warehouse, and to calculate offline the sum of the number of online users of each target server to be counted in the public statistical period based on the key information in the offline data warehouse.
[0120] In some embodiments, the key information includes any one or more of the following: log time, server ID, number of online users at the log time, server version, activity version, and date.
[0121] In some embodiments, the determining module 302 is further configured to: determine the time interval between adjacent log times of each target server based on the key information; and determine a common statistical period based on the longest time interval, so that each target server calculates the number of online users according to the common statistical period.
[0122] In some embodiments, the determining module 302 is further configured to select one or more items from the key information as common statistical dimensions according to preset business requirements, so that each target server calculates the number of online users according to the common statistical dimensions.
[0123] In some embodiments, a table creation module is also included, which uses the common statistical dimensions as online fact fields to create an online fact table for each of the target servers.
[0124] In some embodiments, the filtering module 303 is further specifically used to: filter target servers that do not meet the common statistical dimensions to obtain target servers to be counted; filter out some information in the key information corresponding to the target servers to be counted that does not meet the common statistical dimensions to obtain key information to be counted; and determine a set of data to be counted based on the target servers to be counted and the key information to be counted.
[0125] In some embodiments, the public statistical dimensions include the duration to be calculated, the server ID, and outliers.
[0126] In some embodiments, the table creation module is further configured to record the sum of the number of online users of each target server to be counted during the public statistical period in the online fact table according to the online fact field.
[0127] The online user counting device provided in this application embodiment has the same technical features as the online user counting method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0128] An electronic device provided in this application embodiment, such as Figure 4 As shown, the electronic device 400 includes a memory 401 and a processor 402. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the steps of the method provided in the above embodiments.
[0129] See Figure 4 The electronic device also includes a bus 403 and a communication interface 404. The processor 402, the communication interface 404 and the memory 401 are connected through the bus 403. The processor 402 is used to execute executable modules, such as computer programs, stored in the memory 401.
[0130] The memory 401 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 404 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network.
[0131] Bus 403 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0132] The memory 401 is used to store programs. After receiving an execution instruction, the processor 402 executes the program. The method executed by the apparatus defined by the process disclosed in any of the preceding embodiments of this application can be applied to the processor 402 or implemented by the processor 402.
[0133] Processor 402 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 402 or by instructions in software form. The processor 402 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 gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 401, and processor 402 reads the information from memory 401 and, in conjunction with its hardware, completes the steps of the above method.
[0134] Corresponding to the above-described online user counting method, this application embodiment also provides a computer-readable storage medium storing computer-executable instructions. When the computer-executable instructions are invoked and executed by a processor, the computer-executable instructions cause the processor to perform the steps of the above-described online user counting method.
[0135] The online user counting device provided in this application embodiment can be specific hardware on a device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this application embodiment are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0136] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0137] For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0139] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0140] If the aforementioned functions are implemented as 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 this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the online user counting method described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0141] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0142] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application.
Claims
1. A method for counting online users, characterized in that, The method includes: Receive online logs corresponding to each target server, and extract key information from the online logs; wherein, the key information is used to characterize the number of online users corresponding to each target server at each log time. The common statistical period and common statistical dimension are determined based on the key information of each target server, wherein each target server has a corresponding time interval between adjacent log times, and the common statistical period is the longest time interval among the target servers; The key information is filtered based on the public statistical dimensions to determine the set of data to be collected, wherein the set of data to be collected includes each target server to be counted and the key information to be counted corresponding to each target server to be counted; The sum of the number of online users of each target server to be counted during the public statistical period is calculated based on the set of data to be counted. The key information includes any one or more of the following: log time, server ID, number of online users at the log time, server version, activity version, and date; The steps for determining the common statistical period and common statistical dimensions based on the key information of each target server include: Based on the key information, determine the time interval range between adjacent log moments of each target server; A common statistical period is determined based on the longest time interval, so that each target server calculates the number of online users according to the common statistical period; The reporting frequencies of each target server, which represent the log time of online log reporting and the time interval between adjacent log times, are different.
2. The method according to claim 1, characterized in that, Before the step of calculating the sum of online users for each target server in the public statistical period based on the set of data to be counted, the method further includes: The duration to be calculated is determined based on the log time of each target server, and the duration to be calculated is divided into multiple common statistical periods.
3. The method according to claim 1, characterized in that, The step of calculating the sum of online users for each target server in the public statistical period based on the set of data to be counted includes: Based on the set of data to be collected for each target server, calculate the average number of online users for each target server during the public statistical period. The sum of the average values corresponding to each target server to be counted is used to determine the total number of online users in the public statistical period.
4. The method according to claim 1, characterized in that, The steps of receiving online logs corresponding to each target server and extracting key information from the online logs include: The system receives online logs from each target server through a log collection system. By filtering out dirty data from the online logs, key information corresponding to each target server is extracted.
5. The method according to claim 4, characterized in that, The method further includes: The key information is loaded into an offline data warehouse, and the sum of the number of online users for each target server to be counted in the public statistical period is calculated offline based on the key information in the offline data warehouse.
6. The method according to claim 1, characterized in that, The steps of determining the common statistical period and common statistical dimensions based on the key information of each target server also include: Based on preset business requirements, one or more key information items are selected as common statistical dimensions so that each target server can calculate the number of online users according to the common statistical dimensions.
7. The method according to claim 6, characterized in that, The method further includes: The public statistical dimensions are used as online fact fields to establish an online fact table for each target server.
8. The method according to claim 6, characterized in that, The steps of filtering the key information based on the aforementioned public statistical dimensions to determine the set of statistical data to be collected include: Filter out target servers that do not meet the common statistical dimensions to obtain the target servers to be statistically analyzed. Filter out the part of the key information corresponding to the target server to be counted that does not meet the common statistical dimension to obtain the key information to be counted. The set of statistical data to be collected is determined based on the target server to be counted and the key information to be counted.
9. The method according to claim 8, characterized in that, The public statistical dimensions include the duration to be calculated, server ID, and outliers.
10. The method according to claim 7, characterized in that, The method further includes: recording the sum of the number of online users of each target server to be counted during the public statistical period in the online fact table according to the online fact field.
11. An online user counting device, characterized in that, The device includes: The extraction module receives online logs corresponding to each target server and extracts key information from the online logs; wherein, the key information is used to characterize the number of online users corresponding to each target server at each log time. The determination module determines a common statistical period and a common statistical dimension based on the key information of each target server, wherein each target server has a corresponding time interval between adjacent log times, and the common statistical period is the longest time interval among the target servers; The filtering module filters the key information based on the common statistical dimensions to determine the set of data to be collected, wherein the set of data to be collected includes each target server to be counted and the key information to be counted corresponding to each target server to be counted; The calculation module calculates the sum of the number of online users for each target server in the public statistical period based on the set of statistical data to be collected; The key information includes any one or more of the following: log time, server ID, number of online users at the log time, server version, activity version, and date; The determination module determines the time interval between adjacent log times for each target server based on the key information; and determines a common statistical period based on the longest time interval, so that each target server calculates the number of online users according to the common statistical period. The reporting frequencies of each target server, which represent the log time of online log reporting and the time interval between adjacent log times, are different.
12. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 9.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when invoked and executed by a processor, cause the processor to perform the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Processing system, method and device for user access data and storage medium
CN112035415A
System and method for totaling number of accesses
JP2007299035A