Method and device for obtaining page access information
By performing deduplication and key-value storage on log data within multiple time windows, combined with stream computing and a distributed log system, the problem of inaccurate and slow page access information retrieval in existing technologies is solved, achieving fast and accurate page access information retrieval and improving data processing efficiency and real-time performance.
Patent Information
- Application Number
- CN202010348457.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-28
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2040-06-05
AI Technical Summary
Existing technologies are not accurate enough in obtaining page access information and are slow in processing speed. In particular, the process of obtaining the number of unique visitors and user number packets is cumbersome and cannot meet the requirements of real-time and accuracy.
By acquiring log data of the target page within multiple time windows, deduplicating the data, and storing unique visitor identifiers in the database using key-value storage, the system queries page access information based on the database's storage structure and performs real-time analysis using stream computing and a distributed log system.
It enables fast and accurate acquisition of page access information, improves data processing efficiency and hard disk utilization, ensures full utilization of memory resources, and enhances the real-time performance and accuracy of data processing.
Smart Images

Figure CN113568982B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a method, apparatus, device, and storage medium for obtaining page access information. Background Technology
[0002] With the advent of the big data era, an increasing number of system logs are being collected, transmitted, and stored. Stream computing is a new computing model based on log streams. During the log transmission phase, it performs real-time computation in memory to calculate statistical data for different groups in the logs, providing real-time data support for business decisions.
[0003] For example, by acquiring website access logs and using stream computing, page access information for different pages can be calculated, enabling website administrators to analyze user traffic and providing a data foundation for website management. However, in related technologies, the acquisition of page access information such as unique visitor counts or user ID packets is often not accurate enough, and the process is relatively cumbersome and slow. Summary of the Invention
[0004] This invention provides a method, apparatus, and storage medium for obtaining page access information, which can achieve fast and accurate acquisition of page access information.
[0005] The technical solution of this invention is implemented as follows:
[0006] This invention provides a method for obtaining page access information, including:
[0007] Obtain log data of the target page within a target time period containing at least two time windows, wherein the log data includes: unique visitor identifiers of the target page;
[0008] Based on the log data, the unique visitor identifiers within each time window are deduplicated to obtain the unique visitor identifiers of the target page within each time window.
[0009] Using the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, the independent visitor identifier of the target page within each time window is stored in the database using a key-value storage method;
[0010] Based on the storage structure of the database, the page access information of the target page is retrieved, and the page access information includes at least one of the following:
[0011] The number of unique visitors to the target page within the target time period, and the set of visitor identifiers to the target page within the target time period.
[0012] This invention provides a device for obtaining page access information, comprising:
[0013] The acquisition module is used to acquire log data of the target page within a target time period containing at least two time windows. The log data includes: unique visitor identifiers of the target page.
[0014] The execution module is used to perform deduplication processing on the unique visitor identifiers within each time window based on the log data, to obtain the unique visitor identifiers of the target page within each time window; using the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, the unique visitor identifiers of the target page within each time window are stored in the database using a key-value storage method; based on the storage structure of the database, the page access information of the target page is queried, and the page access information includes at least one of the following: the number of unique visitors corresponding to the target page within the target time period, and the set of visitor identifiers corresponding to the target page within the target time period.
[0015] In the above scheme, the acquisition module is further configured to acquire log data of the target page within a target time period comprising at least two time windows through a distributed log system. Correspondingly, the running module is further configured to send back the unique visitor identifiers of the target page within each time window to the distributed log system.
[0016] In the above scheme, the running module is also used to record the independent visitor identifiers of the target page in each time window based on the log data and using a stream computing method, so that the same independent visitor identifier is recorded only once in the same time window.
[0017] In the above scheme, the running module is further configured to store the independent visitor identifiers of the target page in each time window to the database, using the page identifier of the target page as the primary key, the visitor identifier as the subkey, and the access time or access order associated with the visitor identifier as the value.
[0018] In the above scheme, the running module is further configured to, when the page access information includes the number of unique visitors, query the database for the number of subkeys included in the primary key based on the storage structure of the database, and use the queried number as the number of unique visitors.
[0019] In the above scheme, the running module is further configured to, when the page access information includes the visitor identifier set, query at least one subkey included in the primary key from the database based on the storage structure of the database; obtain the visitor identifier corresponding to each of the queried subkeys, so as to obtain the visitor identifier set.
[0020] In the above scheme, the running module is further configured to, when the page access information includes the visitor identifier set, obtain log data of the target page within at least two consecutive new time windows, using the duration corresponding to the target time period as the size of the new time window; based on the log data of the target page within the at least two new time windows, perform deduplication processing on the independent visitor identifiers within each new time window to obtain the independent visitor identifiers of the target page within each new time window; store the independent visitor identifiers of the target page within each new time window to the database, so as to query the page access information of the target page based on the storage structure of the database.
[0021] In the above scheme, the device further includes: an output module, used to output the page access information of the target page obtained by query.
[0022] In the above scheme, the output module is further configured to send the visitor identifier set to present a download function item corresponding to the visitor identifier set. The download function item is configured to download the visitor identifier set when a trigger operation for the download function item is received.
[0023] This invention provides a computer-readable storage medium storing executable instructions, which, when executed by a processor, implement the method for obtaining page access information provided in this invention.
[0024] The embodiments of the present invention have the following beneficial effects:
[0025] By applying the above embodiments of the present invention, by deduplicating the unique visitor identifiers within each time window of the log data, unique visitor identifiers of the target page within each time window are obtained, thus achieving deduplication and data compression of log data within the target time period in the first stage. The deduplication results of the first stage are stored in the database using a key-value storage method, and then the page access information of the target page can be retrieved based on the database's storage structure, thus achieving accurate deduplication of log data within the target time period in the second stage and obtaining accurate page access information. At the same time, since the deduplication in the second stage utilizes a key-value database, that is, hard disk storage, hard disk utilization is improved, and memory resources are fully utilized, thereby improving data processing efficiency. Attached Figure Description
[0026] Figure 1 This is a schematic diagram illustrating the results of page access information obtained from a stream computing system in related technologies.
[0027] Figure 2 This is a schematic diagram illustrating an implementation scenario of the method for obtaining page access information provided in an embodiment of the present invention;
[0028] Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention;
[0029] Figure 4 This is a flowchart illustrating the method for obtaining page access information provided in an embodiment of the present invention;
[0030] Figure 5 This is a schematic diagram of the page access information query result presentation interface provided in an embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of an optional interaction flow for the method of obtaining page access information provided in an embodiment of the present invention;
[0032] Figure 7 This is a flowchart illustrating the method for obtaining page access information provided in an embodiment of the present invention;
[0033] Figure 8 This is a schematic diagram of the unique visitor identifier deduplication process based on a time window provided in an embodiment of the present invention;
[0034] Figure 9 This is a schematic diagram illustrating the precise deduplication of unique visitor identifiers based on key-value storage, provided in an embodiment of the present invention.
[0035] Figure 10 This is a schematic diagram of the access information result obtained based on the page access information acquisition method provided in the embodiments of the present invention;
[0036] Figure 11 This is a schematic diagram of the structure of the page access information acquisition device provided in the embodiment of the present invention. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on the present invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0038] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0040] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.
[0041] 1) A database (DB) can be simply viewed as an electronic filing cabinet—a place to store electronic files, where users can perform operations such as adding, querying, updating, and deleting data. A "database" is a collection of data stored together in a certain way, which can be shared by multiple users, has minimal redundancy, and is independent of application programs.
[0042] 2) A Database Management System (DBMS) is a computer software system designed to manage databases, generally possessing basic functions such as storage, retrieval, security, and backup. DBMSs can be classified according to the database model they support, such as relational databases and Extensible Markup Language (XML) databases; or according to the type of computer they support, such as server clusters and mobile phones; or according to the query language used, such as Structured Query Language (SQL) and XQuery; or according to performance priorities, such as maximum scale or maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMSs can cross categories, for example, simultaneously supporting multiple query languages.
[0043] 3) Big Data (BD) refers to data sets that cannot be captured, managed, and processed within a certain timeframe using conventional software tools. It represents massive, rapidly growing, and diverse information assets that require new processing models to achieve stronger decision-making, insightful discovery, and process optimization capabilities. With the advent of the cloud era, Big Data has attracted increasing attention. Big Data requires specialized technologies to effectively process large amounts of data within a tolerable timeframe. Technologies suitable for Big Data include massively parallel processing databases, data mining, distributed file systems, distributed databases, cloud computing platforms, the Internet, and scalable storage systems.
[0044] 4) Stream computing: It acquires massive amounts of data from different data sources in real time, analyzes and processes them in real time, and extracts valuable information from the data. It performs calculations on each incoming log during the log transmission phase, resulting in high timeliness.
[0045] 5) Page Views (PV): The number of web pages viewed by a visitor after entering a website. The PV value increases every time a page is opened.
[0046] 6) Unique Visitors (UV) refers to the number of users counted based on IP or Cookie. For the same page, whether a unique user opens it once or multiple times, the number of unique visitors only increases by one.
[0047] 7) User number package, user identifier set. Here, user identifier refers to the identifier used to identify the user's identity when logging in on the network, such as the user ID information used by the user when logging into WeChat and other software.
[0048] Stream computing, as a novel computing paradigm based on log streams, calculates statistical data for different groups of logs in real time during the log transmission phase through in-memory computation, providing real-time data support for business decisions. For example, through website access logs, stream computing tasks can calculate the page views and unique visitors for each webpage. However, calculating the number of unique visitors is a cardinality metric, a relatively complex indicator. Accurate cardinality metric requires storage space proportional to the total number of unique visitors. Therefore, in cases of large data volumes, stream computing requires a significant amount of system memory to complete this calculation.
[0049] In related technologies, the methods for calculating the number of unique visitors in stream computing are mainly divided into three categories:
[0050] First, utilize storage solutions that are extremely memory-efficient, such as the Bit-Map algorithm.
[0051] Second, adopt statistical algorithms based on probability theory, such as the HyperLogLog algorithm;
[0052] Third, statistical data can be supplemented directly through offline calculation;
[0053] 1) Similar to Bit-Map's in-memory computing method, this approach compresses memory usage. While it can accurately determine the number of unique visitors and user number packets, the compression ratio remains limited. It also fails to meet requirements when the data volume exceeds Bit-Map's storage limit; furthermore, such solutions generally have high system complexity.
[0054] 2) Probability-based approximation algorithms, essentially based on probabilistic principles, can solve memory usage issues but can only provide approximate values for the number of unique visitors. They are unsuitable for scenarios highly sensitive to numbers (such as commercial marketing) or requiring user contact information (such as real-time recommendations).
[0055] 3) Stream computing does not calculate the number of independent visitors; instead, it performs offline computation to compensate for the error. This results in significant delays in statistical data collection, negating the original real-time nature of stream computing and greatly diminishing the value of the calculation results. See also Figure 1 , Figure 1 This diagram illustrates the results of page access information obtained from a stream computing system in related technologies. Label 11 shows the page access count change curve for the target page within a target time period, and label 12 shows the unique visitor count change curve for the target page within the target time period. In related technologies, the data output by the stream computing system to the user is typically displayed as a real-time data curve, without providing precise unique visitor counts and corresponding visitor identifier sets. Based on the aforementioned stream computing system, users can only obtain information about the trajectory of page access information for the target page.
[0056] Based on this, embodiments of the present invention provide a method, apparatus, device, and storage medium for obtaining page access information, which can achieve accurate acquisition of page access information and has a fast processing speed.
[0057] First, the implementation scenario of the page access information acquisition method provided in this embodiment of the invention will be explained. See [link to relevant documentation]. Figure 2 , Figure 2 This is a schematic diagram of an implementation scenario of the page access information acquisition method provided in this embodiment of the invention. In order to support an exemplary application, terminal 400 (including terminal 400-1 to terminal 400-n) connects to server 100 through network 300. Network 300 can be a wide area network or a local area network, or a combination of the two, and data transmission is achieved using wireless or wired links.
[0058] In the above implementation scenario, application clients, such as game clients and social application clients, are set on terminals 400-2 to 400-n. When the application client runs, the application client sends corresponding log data to the server through the terminal, so that the server 100 can perform log data analysis on the target page in the application client based on the received log data to obtain page access information. Then, the server 100 sends the obtained page access information to the terminal corresponding to the administrator (i.e., terminal 400-1) for presentation.
[0059] Specifically, terminals 400-2 to 400-n are used to run application clients and send corresponding log data to server 100.
[0060] Server 100 is used to receive log data, obtain log data of the target page within a target time period containing at least two time windows, and based on the log data, perform deduplication on the unique visitor identifiers within each time window to obtain the unique visitor identifiers of the target page within each time window; using the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, store the unique visitor identifiers of the target page within each time window in the database using a key-value storage method; and based on the storage structure of the database, query the page access information of the target page.
[0061] Server 100 is also used to send page access information of the target page to terminal 400-1.
[0062] Terminal 400-1 is used to display page access information for the target page.
[0063] In practical applications, server 100 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminals can be smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, etc., but are not limited to these. Terminals and servers can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions on this connection.
[0064] The hardware structure of the electronic device for implementing the page access information acquisition method provided in this embodiment of the invention is described in detail below. The electronic device includes, but is not limited to, a server or a terminal. See also... Figure 3 , Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Figure 3 The illustrated electronic device 200 includes at least one processor 210, a memory 250, at least one network interface 220, and a user interface 230. The various components in the electronic device 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to implement communication between these components. In addition to a data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 3 The general labeled all buses as Bus System 240.
[0065] Processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0066] User interface 230 includes one or more output devices 231 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 230 also includes one or more input devices 232, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0067] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices physically located away from the processor 210.
[0068] The memory 250 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 250 described in this embodiment is intended to include any suitable type of memory.
[0069] In some embodiments, memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0070] Operating system 251 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0071] The network communication module 252 is used to reach other computing devices via one or more (wired or wireless) network interfaces 220, such as Bluetooth, WiFi, and Universal Serial Bus (USB).
[0072] Presentation module 253 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 231 (e.g., a display screen, a speaker, etc.) associated with user interface 230;
[0073] The input processing module 254 is used to detect and translate one or more user inputs or interactions from one or more input devices 232.
[0074] In some embodiments, the page access information acquisition device provided in this invention can be implemented in software. Figure 3 A page access information acquisition device 255 stored in memory 250 is shown. It can be software in the form of programs and plug-ins, including the following software modules: acquisition module 2551, running module 2552 and output module 2553. These modules are logical and can therefore be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.
[0075] In other embodiments, the page access information acquisition device provided in this embodiment of the invention can be implemented using a combination of hardware and software. As an example, the page access information acquisition device provided in this embodiment of the invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the page access information acquisition method provided in this embodiment of the invention. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0076] Based on the above description of the implementation scenarios and electronic devices of the page access information acquisition method of the present invention, the page access information acquisition method provided by the present invention will be described below. See also... Figure 4 , Figure 4 This is a flowchart illustrating a method for obtaining page access information provided in an embodiment of the present invention. In some embodiments, the method for obtaining page access information can be implemented by a server or a terminal alone, or by a server and a terminal working together. Taking server implementation as an example, the method for obtaining page access information provided in an embodiment of the present invention includes:
[0077] Step 401: The server retrieves log data for the target page within a target time period that includes at least two time windows.
[0078] Here, the target page can be a specific page within a specific application, such as the homepage of a game application; the log data refers to the log data transmitted from the terminal for the target page within the target time period, which may include the page identifier of the target page, such as the corresponding Uniform Resource Locator (URL), unique visitor identifier, specific user operation, log time, etc.; the number of time windows can be determined based on the size of the time windows and the duration of the target time period. The time windows are continuous and together constitute the target time period. Regarding the setting of the target time period length and the size of the time windows, since the size of the time window is directly proportional to the amount of data within the time window, the larger the time window is set, the more data is within the time window, and correspondingly, the compression ratio is greater and the system memory usage is smaller during subsequent compression. However, the more data is within the time window, the more timeliness of the calculation during deduplication will be reduced accordingly. Therefore, when setting the target time period and the size of the time window, it is necessary to set them according to the timeliness requirements of the business and the system memory size. For example, the length of the target time period is one day, and the time window size is 3 hours.
[0079] In practical applications, when a server receives a request to obtain access information for a target page, it parses the request to obtain the page identifier and the target time period, and then obtains the log data of the target page within the target time period consisting of at least two consecutive time windows.
[0080] In other embodiments, the server can also obtain log data of the target page within a target time period that includes at least two time windows through a distributed logging system.
[0081] Here, a distributed logging system is used to collect log data. For example, Kafka and RocketMQ systems have the characteristics of high throughput, high horizontal scalability, and real-time response to ensure that all log data for the target page can be collected completely, providing real-time data for real-time data analysis.
[0082] In practical applications, the server uses a distributed log system to collect log data for the target page within the target time period. Based on the size of the time window and the value of the target time period, the number of time windows is determined, and the log data is grouped into each time window according to the time corresponding to the time window, thus completing the collection of log data within the target time period containing at least two time windows.
[0083] For example, after receiving a request to retrieve access information for a target page, the server parses the request to obtain the target page's URL and the target time period, such as 9:00 AM to 2:00 PM on October 1, 2019. The time window size is set to one hour, thus dividing the target time period into five consecutive time windows. The server then collects log data from the target page within these five time windows using the distributed logging system Kafka.
[0084] Step 402: Based on the log data, the server performs deduplication on the unique visitor identifiers within each time window to obtain the unique visitor identifiers of the target page within each time window.
[0085] In some embodiments, the server can deduplicate unique visitor identifiers within each time window by using stream computing based on the log data to record unique visitor identifiers of the target page within each time window, so that the same unique visitor identifier is recorded only once within the same time window.
[0086] In practical applications, because users repeatedly browse a page, there may be multiple log entries associated with the same unique visitor identifier, and this log data is continuously and rapidly generated. To extract valuable page access information from this massive amount of log data, real-time computation is required. Based on the acquired log data, the server uses stream processing frameworks such as Storm and Flink to deduplicate unique visitor identifiers within each time window in real time. When multiple log entries associated with the same unique visitor identifier appear within the same time window, only that unique visitor identifier is recorded once. In this way, valid unique visitor records are extracted from each time window.
[0087] In some embodiments, after the server obtains the log data of the target page within the target time period through the distributed log system and obtains the unique visitor identifier of the target page within each time window, it can also send the unique visitor identifier of the target page within each time window back to the distributed log system.
[0088] In practical applications, after obtaining the unique visitor identifiers of the target page within each time window, the server can send back all the unique visitor identifiers corresponding to the page identifier as a record to the distributed log system.
[0089] For example, the server feeds the collected log data into the Storm streaming framework, recording unique visitor identifiers for the target page within each time window. If multiple log entries are associated with the same unique visitor identifier within the same time window, the server records that unique visitor identifier only once, thus deduplicating the unique visitor identifiers across time windows. The server then sends all unique visitor identifiers corresponding to a target page's page identifier back to the distributed log system as a single record for subsequent processing.
[0090] This invention compresses the original log data by deduplicating the unique visitor identifiers within each time window, thereby improving the system's processing speed and ensuring timely processing.
[0091] Step 403: The server uses the page identifier of the target page as the primary key and the visitor identifier as the subkey, and retrieves the value corresponding to the subkey. Using a key-value storage method, it stores the unique visitor identifier of the target page in each time window to the database.
[0092] Here, since the value corresponding to the subkey does not impose any restrictions on the acquisition of page visitor information, it can be a pre-set fixed value or an access parameter associated with the visitor identifier.
[0093] In some embodiments, the server may store the unique visitor identifiers of the target page in each time window to the database in the following manner: using the page identifier of the target page as the primary key, the visitor identifier as the subkey, and the access time or access order associated with the visitor identifier as the value, to store the unique visitor identifiers of the target page in each time window to the database.
[0094] Here, the access time or access order associated with the visitor identifier can be specifically limited according to the actual situation. For example, the access time can be the time when the unique visitor identifier accesses the target page, or the time when the server stores the unique visitor identifier in the database; the access order can be the order of the access windows corresponding to the unique visitor identifier, etc., but no specific limitation is made here.
[0095] In practical applications, although the server performs deduplication on unique visitor identifiers within each time window, multiple records with the same unique visitor identifier may still exist across different time windows. To obtain valid access information for the target page within the target time period, it is necessary to precisely deduplicate the unique visitor identifiers across multiple time windows corresponding to the target time period. The server uses a key-value storage database, such as LevelDB, with the target page's identifier as the primary key, the unique visitor identifier as the subkey, and the access time or access order associated with the unique visitor identifier as the parameter value. The unique visitor identifiers across multiple time windows corresponding to the target time period are then stored in the database. The specific key-value storage database used to store the unique visitor identifiers is not limited here.
[0096] As an example, the server uses LevelDB's key-value file storage structure, using the target page's URL as the primary key and the unique visitor identifier as the subkey. The parameter value is the time when the unique visitor identifier accesses the target page or a pre-set fixed value. The unique visitor identifier records corresponding to each time window after deduplication are stored in LevelDB.
[0097] Step 404: The server retrieves the page access information of the target page based on the database storage structure.
[0098] Here, page access information includes at least one of the following: the number of unique visitors to the target page within the target time period, and the set of visitor identifiers to the target page within the target time period.
[0099] In some embodiments, when the page access information includes the number of unique visitors, the server can obtain the page access information of the target page by querying it in the following manner:
[0100] Based on the storage structure of the database, the number of subkeys included in the primary key is queried from the database, and the queried number is used as the number of unique visitors.
[0101] In other embodiments, when the page access information includes the visitor identifier set, the server can also query the page access information of the target page in the following manner:
[0102] Based on the database's storage structure, query the database for at least one subkey included in the primary key; obtain the visitor identifiers corresponding to each subkey obtained from the query to get a set of visitor identifiers.
[0103] In practical applications, when the server uses key-value storage to store unique visitor identifiers within each time window, if the server queries the number of unique visitors corresponding to a certain page identifier, it can directly obtain the number of unique visitors corresponding to that page identifier by querying the number of subkeys included in the primary key corresponding to that page identifier; if the server queries the set of visitor identifiers corresponding to a certain page identifier, it can directly export all subkeys under the primary key corresponding to that page identifier to obtain the set of visitor identifiers corresponding to that page identifier.
[0104] Based on the database storage structure, this invention can accurately query the number of unique visitors and / or visitor identifier set of a target page within a target time period, thereby achieving precise page access data acquisition and improving the accuracy of information.
[0105] In some embodiments, after the server retrieves the page access information of the target page based on the database storage structure, it can also output the retrieved page access information of the target page.
[0106] In practical applications, after retrieving access information for a target page, the server can send the page access information to a designated terminal, or it can connect to a display device to output the query results of the target page's access information.
[0107] In some embodiments, when the page access information includes the visitor identifier set, the server can output the page access information of the queried target page in the following manner:
[0108] The server sends a set of visitor identifiers so that the terminal can display the download function item corresponding to the set of visitor identifiers.
[0109] Here, the download function item can be an icon or button representing the download function on the query results interface of the page access information presented by the terminal. It is used to provide a set of download visitor identifiers when a trigger operation for the download function item is received. The trigger operation for the download function item can be a single click, double click, or long press.
[0110] In practical applications, when a user wants to obtain the visitor identifier set for a target page, they can trigger the download function on the page access information interface displayed on the terminal to download the visitor identifier set corresponding to the target page. For example, see... Figure 5 , Figure 5 This is a schematic diagram of the page access information query result presentation interface provided in an embodiment of the present invention. Reference numeral 51 shows the download function item in the interface. After receiving the user's trigger operation on the download function item shown in reference numeral 52, the terminal downloads the visitor identifier set of the target page within that time period.
[0111] In other embodiments, after outputting the page access information of the target page obtained from the query, the server can continue to query page access information for the target page in the following manner:
[0112] When the page access information includes a set of visitor identifiers, the server uses the duration corresponding to the target time period as the size of the new time window, and obtains the log data of the target page within at least two consecutive new time windows. Based on the log data of the target page within at least two new time windows, the server performs deduplication on the unique visitor identifiers within each new time window to obtain the unique visitor identifiers of the target page within each new time window. The server stores the unique visitor identifiers of the target page within each new time window in the database, and retrieves the page access information of the target page based on the database's storage structure.
[0113] Here, the granularity of the new time window can be an integer multiple of the size of the target time period.
[0114] In practical applications, the server sets the duration corresponding to the target time period to an integer multiple of the size of the new time window. For example, if the user sets the target time period to one day, the length of the new time window is set to two days. The server obtains log data for the time periods corresponding to the two consecutive new time windows, i.e., four days. It obtains the visitor identifier sets for the first day and the second day, respectively. Based on the unique visitor identifiers, it performs deduplication on the visitor identifier sets for the first day and the second day. Then, it obtains the visitor identifier sets for the third day and the fourth day, and performs deduplication on the visitor identifier sets for the third day and the fourth day, respectively. This yields the unique visitor identifiers for the target page within each new time window, which are then stored in the database. Based on the database's storage structure, the server retrieves the page visitor information for these four days.
[0115] In this way, based on the set of visitor identifiers for the target time period that has already undergone deduplication, the length of the time window is expanded to obtain page access information of the target page over a longer period of time. This greatly reduces the amount of page access information within the corresponding time period in the new time window and improves the overall processing efficiency of the system.
[0116] The following continues to describe the method for obtaining page access information provided in the embodiments of the present invention. In some embodiments, the method for obtaining page access information may be implemented by a server or a terminal, or by a server and a terminal working together. Figure 6 This is a schematic diagram of an optional interaction flow for the method of obtaining page access information provided in an embodiment of the present invention. See [link / reference]. Figure 6 The method for obtaining page access information provided in this embodiment of the invention is implemented collaboratively by the terminal and the server.
[0117] Step 601: The terminal displays the information configuration interface of the corresponding target page.
[0118] Here, the information configuration interface includes an access information retrieval function;
[0119] Step 602: The terminal receives and presents the page parameters input based on the information configuration interface;
[0120] Here, the page parameters include: the time parameters corresponding to the target time period, the window size parameters corresponding to the time window, and the page access information parameters indicated by the access information retrieval command.
[0121] In some embodiments, the terminal can receive and present page parameters in text form entered by the user based on the text command input box by presenting a text command input box in the information configuration interface for the target page.
[0122] In practical applications, the terminal presents a text command input box in the information configuration interface for the target page. Users can input page parameters such as the time parameters corresponding to the target time period, the window size parameters corresponding to the time window, and the page access information parameters indicated by the access information retrieval command through the text command input box. After receiving the page parameters input by the user, the terminal displays the page parameters on the information configuration page so that the user can confirm the page parameters.
[0123] Step 603: In response to the trigger operation for the access information retrieval function item, the terminal generates an access information retrieval request based on the page parameters.
[0124] In practical applications, after the user confirms the page parameters, the access information retrieval function is triggered. The terminal responds to the user's triggering operation of the access information retrieval function by generating an access information retrieval request carrying the page parameters.
[0125] Step 604: The terminal sends an access information retrieval request carrying page parameters to the server.
[0126] Step 605: The server receives and parses the access information retrieval request, and obtains the log data of the target page within the target time period containing at least two time windows.
[0127] In practical applications, after receiving a request to retrieve page access information for a target page, the server parses the request to obtain the page parameters carried in the page access information retrieval instruction, thereby obtaining the log data of the target page within the target time period consisting of at least two consecutive time windows.
[0128] In some embodiments, the server may obtain log data of the target page within a target time period that includes at least two time windows through a distributed log system.
[0129] Here, a distributed logging system is used to collect log data. For example, Kafka and RocketMQ systems have the characteristics of high throughput, high horizontal scalability, and real-time response to ensure that all log data for the target page can be collected completely, providing real-time data for real-time data analysis.
[0130] In practical applications, the server uses a distributed log system to collect log data for the target page within the target time period. Based on the size of the time window and the value of the target time period, the number of time windows is determined, and the log data is grouped into each time window according to the time corresponding to the time window, thus completing the collection of log data within the target time period containing at least two time windows.
[0131] Step 606: Based on the log data, the server performs deduplication on the unique visitor identifiers within each time window to obtain the unique visitor identifiers for the target page within each time window.
[0132] In some embodiments, the server may also deduplicate the unique visitor identifiers within each time window by: based on the log data, using stream computing, recording the unique visitor identifiers of the target page within each time window, so that the same unique visitor identifier is recorded only once within the same time window.
[0133] In practical applications, because users repeatedly browse a page, there may be multiple log entries associated with the same unique visitor identifier, and this log data is continuously and rapidly generated. To extract valuable page access information from this massive amount of log data, real-time computation is required. Based on the acquired log data, the server uses stream processing frameworks such as Storm and Flink to deduplicate unique visitor identifiers within each time window in real time. When multiple log entries associated with the same unique visitor identifier appear within the same time window, only that unique visitor identifier is recorded once. In this way, valid unique visitor records are extracted from each time window.
[0134] In some embodiments, after the server obtains the log data of the target page within the target time period through the distributed log system and obtains the unique visitor identifier of the target page within each time window, it can also send the unique visitor identifier of the target page within each time window back to the distributed log system.
[0135] Step 607: The server uses the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtains the value corresponding to the subkey. Using a key-value storage method, the server stores the unique visitor identifiers of the target page in each time window to the database.
[0136] Here, since the value corresponding to the subkey does not impose any restrictions on the acquisition of page visitor information, it can be a pre-set fixed value or an access parameter associated with the visitor identifier.
[0137] In some embodiments, the server may store unique visitor identifiers for the target page within each time window in the database in the following manner:
[0138] The server stores the unique visitor identifiers of the target page in each time window in the database, using the page identifier of the target page as the primary key, the visitor identifier as the subkey, and the access time or access order associated with the visitor identifier as the value.
[0139] Here, the access time or access order associated with the visitor identifier can be specifically limited according to the actual situation. For example, the access time can be the time when the unique visitor identifier accesses the target page, or the time when the server stores the unique visitor identifier in the database; the access order can be the order of the access windows corresponding to the unique visitor identifier, etc., but no specific limitation is made here.
[0140] Step 608: The server retrieves the page access information of the target page based on the database storage structure.
[0141] Here, page access information includes at least one of the following: the number of unique visitors to the target page within the target time period, and the set of visitor identifiers to the target page within the target time period.
[0142] In some embodiments, when the page access information includes the number of unique visitors, the server can obtain the page access information of the target page by querying it in the following manner:
[0143] Based on the storage structure of the database, the number of subkeys included in the primary key is queried from the database, and the queried number is used as the number of unique visitors.
[0144] In other embodiments, when the page access information includes the visitor identifier set, the server can also query the page access information of the target page in the following manner:
[0145] Based on the database's storage structure, query the database for at least one subkey included in the primary key; obtain the visitor identifiers corresponding to each subkey obtained from the query to get a set of visitor identifiers.
[0146] In practical applications, when the server uses key-value storage to store unique visitor identifiers within each time window, if the server queries the number of unique visitors corresponding to a certain page identifier, it can directly obtain the number of unique visitors corresponding to that page identifier by querying the number of subkeys included in the primary key corresponding to that page identifier; if the server queries the set of visitor identifiers corresponding to a certain page identifier, it can directly export all subkeys under the primary key corresponding to that page identifier to obtain the set of visitor identifiers corresponding to that page identifier.
[0147] Step 609: The server returns the retrieved page access information to the terminal.
[0148] Step 610: The terminal presents the page access information of the target page returned by the server to the user.
[0149] In practical applications, after receiving the query results sent by the server, the terminal displays the access information of the target page within the target time period to the user through the query results interface of the page access information.
[0150] In some embodiments, when the page access information includes the visitor identifier set, the terminal may also present a download function item corresponding to the visitor identifier set.
[0151] Here, the download function item is used to download the visitor identifier set when a trigger operation for the download function item is received. It can be an icon or button representing the download function on the page access information interface presented by the terminal; the trigger operation for the download function item can be a single click, double click, or long press, etc.
[0152] In other embodiments, after obtaining the page access information for the target page, the server can continue to query page access information for the target page in the following manner:
[0153] When the page access information includes a set of visitor identifiers, the server uses the duration corresponding to an integer multiple of the target time period as the size of the new time window, and obtains the log data of the target page within at least two consecutive new time windows; based on the log data of the target page within at least two new time windows, it performs deduplication processing on the unique visitor identifiers within each new time window to obtain the unique visitor identifiers of the target page within each new time window; it stores the unique visitor identifiers of the target page within each new time window in the database, and uses the database's storage structure to query the page access information of the target page.
[0154] In practical applications, the server sets the duration corresponding to the target time period to an integer multiple of the size of the new time window. For example, if the user sets the target time period to one day, the length of the new time window is set to two days.
[0155] In this way, based on the set of visitor identifiers for the target time period that has already undergone deduplication, the length of the time window is expanded to obtain page access information of the target page over a longer period of time. This greatly reduces the amount of page access information within the corresponding time period in the new time window and improves the overall processing efficiency of the system.
[0156] The following example, using the calculation of unique visitors to a game's official website page, illustrates an exemplary application of this invention in a real-world scenario.
[0157] See Figure 7 , Figure 7 This is a flowchart illustrating the method for obtaining page access information provided in an embodiment of the present invention.
[0158] Step 701: The server retrieves log data for the target page within a target time period that includes at least two time windows.
[0159] Here, the target page can be a specific page in a specific application, such as the homepage of a game application; the log data is the log data of the target page transmitted by the terminal within the target time period, which can include the page identifier of the target page, such as the URL corresponding to the page, unique visitor identifier, user specific operation, log time, etc.; the number of time windows can be determined according to the size of the time windows and the length of the target time period. The time windows are continuous and together form the target time period. The size of the target time period and the size of the time windows can be set according to actual needs. For example, the length of the target time period is one day and the size of the time windows is 3 hours.
[0160] In practical applications, when a server receives a request to obtain access information for a target page, it parses the request to obtain the page identifier and the target time period, and then obtains the log data of the target page within the target time period consisting of at least two consecutive time windows.
[0161] In some embodiments, the server may obtain log data of the target page within a target time period that includes at least two time windows through a distributed log system.
[0162] Here, a distributed logging system is used to collect log data. For example, Kafka and RocketMQ systems have the characteristics of high throughput, high horizontal scalability, and real-time response to ensure that all log data for the target page can be collected completely, providing real-time data for real-time data analysis.
[0163] As an example, after the terminal presents the access information retrieval interface, the user can input an access information retrieval command for the game's official website page through the access information retrieval interface. The access information retrieval command carries page parameters such as the page identifier URL of the game's official website page and the target time period. After receiving the access information retrieval command for the game's official website page, the terminal sends a page access information retrieval request carrying the page parameters to the server. The server receives and parses the access information retrieval request to obtain the page parameters, and then obtains the raw log data of the game's official website page within the target time period consisting of at least two consecutive time windows through the high-speed log queue Kafka. Here, the raw log data includes the page identifier URL of the game's official website page, the user's QQ number, the log time, etc.
[0164] Step 702: Based on the log data, the server performs deduplication on the unique visitor identifiers within each time window to obtain the unique visitor identifiers of the target page within each time window.
[0165] In some embodiments, the server can deduplicate unique visitor identifiers within each time window by using a stream computing method based on the log data to record unique visitor identifiers of the target page within each time window, so that the same unique visitor identifier is recorded only once within the same time window.
[0166] In practical applications, because users repeatedly browse a page, there may be multiple log entries associated with the same unique visitor identifier, and this log data is continuously and rapidly generated. To extract valuable page access information from this massive amount of log data, real-time computation is required. Based on the acquired log data, the server uses stream processing frameworks such as Storm and Flink to deduplicate unique visitor identifiers within each time window in real time. When multiple log entries associated with the same unique visitor identifier appear within the same time window, only that unique visitor identifier is recorded once. In this way, valid unique visitor records are extracted from each time window. Here, the amount of unique visitor records after deduplication in each time window is compressed by a certain proportion compared to the original log data volume in each time window. For example, see Table 1, which shows the relationship between time window size and compression ratio.
[0167] Table 1
[0168] Time window size (s) Compression ratio (%) 30s 90.21% 45s 91.14% 60s 93.61% 120s 96.12%
[0169] As shown in Table 1, there is a generally positive correlation between the time window size and the compression ratio of the original log data. That is, the larger the time window, the higher the compression ratio, but the corresponding computational timeliness will decrease. Therefore, the time window size needs to be determined by comprehensively considering business requirements (timeliness) and system memory size to achieve an optimal balance.
[0170] In other embodiments, after the server obtains the log data of the target page within the target time period through the distributed log system and obtains the unique visitor identifier of the target page within each time window, it can also send the unique visitor identifier of the target page within each time window back to the distributed log system.
[0171] In practical applications, after obtaining the unique visitor identifiers of the target page within each time window, the server can send back all the unique visitor identifiers corresponding to the page identifier as a record to the distributed log system.
[0172] For example, the server feeds the collected log data into the Storm streaming framework, recording the QQ numbers of users on the game's official website page within each time window. When multiple log entries are associated with the same user's QQ number within the same time window, the terminal only records that user's QQ number once, thus deduplicating the QQ numbers across time windows. The server then sends all user QQ numbers corresponding to a single page identifier URL back to the distributed logging system Kafka as a single record, thereby compressing the original log data.
[0173] For example, see Figure 8 , Figure 8 This is a schematic diagram of the deduplication process for unique visitor identifiers based on a time window provided in an embodiment of the present invention. Label 81 shows 20 original logs for two URLs; label 82 shows a time window in which the server divides the original logs into two groups according to the URL within the time window, and a single QQ will only be recorded once for a URL; label 83 shows two records sent back from the stream computing memory to Kafka.
[0174] Step 703: The server uses the page identifier of the target page as the primary key and the visitor identifier as the subkey, and retrieves the value corresponding to the subkey. Using a key-value storage method, it stores the unique visitor identifier of the target page in each time window to the database.
[0175] Here, since the value corresponding to the subkey does not impose any restrictions on the acquisition of page visitor information, it can be a pre-set fixed value or an access parameter associated with the visitor identifier.
[0176] In some embodiments, the server may store the unique visitor identifiers of the target page in each time window to the database in the following manner: the server stores the unique visitor identifiers of the target page in each time window to the database with the page identifier of the target page as the primary key, the visitor identifier as the subkey, and the access time or access order associated with the visitor identifier as the value.
[0177] In practical applications, although the server performs deduplication on unique visitor identifiers within each time window, multiple records with the same unique visitor identifier may still exist across different time windows. To obtain valid access information for the target page within the target time period, the server also needs to precisely deduplicate unique visitor identifiers across multiple time windows corresponding to the target time period. The server uses a key-value storage database, such as LevelDB, with the target page's identifier as the primary key, the unique visitor identifier as the subkey, and the access time or access order associated with the unique visitor identifier as parameter values to store unique visitor identifiers across multiple time windows corresponding to the target time period in the database. The specific key-value storage database used to store unique visitor identifiers is not limited here.
[0178] For example, the server uses LevelDB's key-value file storage structure, using the URL of the game's official website as the primary key, the user's QQ number as the secondary key, and the value as the time the user's QQ number was inserted, or a pre-defined fixed value. The server stores the user's QQ number records corresponding to the URLs of the game's official website within each time window stored in Kafka in LevelDB.
[0179] For example, see Figure 9 , Figure 9 This is a schematic diagram illustrating precise deduplication of unique visitor identifiers based on key-value storage, as provided in this embodiment of the invention. Label 91 shows the user QQ number records corresponding to the page identifier URLs within each time window stored in Kafka; label 92 shows the LevelDB storage structure; label 93 shows the primary key, i.e., the page identifier URL of the game's official website page; label 94 shows the subkey, i.e., the user's QQ number; and label 95 shows the parameter value, i.e., the time the user's QQ number was inserted. In this way, the user QQ number records corresponding to the page identifier URLs of the game's official website page within each time window stored in Kafka are stored in LevelDB. Thus, the server completes precise deduplication of unique visitor identifiers.
[0180] Step 704: The server retrieves the page access information of the target page based on the database storage structure.
[0181] Here, page access information includes at least one of the following: the number of unique visitors to the target page within the target time period, and the set of visitor identifiers to the target page within the target time period.
[0182] In some embodiments, when the page access information includes the number of unique visitors, the server can obtain the page access information of the target page by querying the number of subkeys included in the primary key from the database based on the storage structure of the database, and using the obtained number as the number of unique visitors.
[0183] In other embodiments, when the page access information includes the visitor identifier set, the server can also query the page access information of the target page in the following way: based on the storage structure of the database, query at least one subkey included in the primary key from the database; obtain the visitor identifiers corresponding to each subkey obtained from the query to obtain the visitor identifier set.
[0184] In practical applications, when using a key-value storage method, when the server queries the number of unique visitors corresponding to a specific page identifier, it can directly obtain the number of unique visitors corresponding to that page identifier by querying the number of subkeys included in the primary key of that page identifier. When the server queries the set of visitor identifiers corresponding to a specific page identifier, it can directly export all subkeys under the primary key of that page identifier to obtain the set of visitor identifiers corresponding to that page identifier.
[0185] Step 705: The server outputs the page access information of the target page obtained from the query.
[0186] In practical applications, after retrieving access information for a target page, the server can send the page access information to a designated terminal, or it can connect to a display device to output the query results of the target page's access information.
[0187] In some embodiments, when the page access information includes the visitor identifier set, the server can output the page access information of the queried target page in the following manner:
[0188] The server sends a set of visitor identifiers so that the terminal can display the download function item corresponding to the set of visitor identifiers.
[0189] Here, the download function item can be an icon or button representing the download function on the query results interface of the page access information presented by the terminal. It is used to provide a set of download visitor identifiers when a trigger operation for the download function item is received. The trigger operation for the download function item can be a single click, double click, or long press.
[0190] In other embodiments, after outputting the page access information of the target page obtained from the query, the server can continue to query page access information for the target page in the following manner:
[0191] When the page access information includes a set of visitor identifiers, the server uses the duration corresponding to an integer multiple of the target time period as the size of the new time window, and obtains the log data of the target page within at least two consecutive new time windows. Based on the log data of the target page within at least two new time windows, the server performs deduplication on the unique visitor identifiers within each new time window to obtain the unique visitor identifiers of the target page within each new time window. The server stores the unique visitor identifiers of the target page within each new time window in the database, and retrieves the page access information of the target page based on the database's storage structure.
[0192] Here, the granularity of the new time window can be an integer multiple of the size of the target time period.
[0193] In practical applications, the server sets the duration corresponding to an integer multiple of the target time period as the size of the new time window. For example, if the user sets the target time period to one day, the length of the new time window is set to two days.
[0194] In this way, based on the set of visitor identifiers for the target time period that has already undergone deduplication, the length of the time window is expanded to obtain page access information of the target page over a longer period of time. This greatly reduces the amount of page access information within the corresponding time period in the new time window and improves the overall processing efficiency of the system.
[0195] The method for obtaining page access information provided in this embodiment of the invention can also be implemented by a terminal. In practical applications, if the method is implemented by a terminal, the terminal can have a page access information acquisition client. The user can start the page access information acquisition client and input a page access information acquisition command for the target page to obtain the access information of the target page. After obtaining the page access information for the target page, the client presents the corresponding page access information to the user. For example, see [link to example]. Figure 10 , Figure 10 This is a schematic diagram of the access information results obtained based on the page access information acquisition method provided in this embodiment of the invention. In the diagram, label 101 indicates the number of unique visitors to the target page within a set time period; label 102 indicates a download function icon, which allows users to download the set of visitor identifiers for the target page within the set time period by triggering the download function icon shown in label 102.
[0196] In the entire system computation process, in addition to the stream computing framework itself, a high-speed distributed log system and a disk index database are also required. In the page access information acquisition method provided in this embodiment, Kafka can be selected as the high-speed distributed log system. Since Kafka can support millions of data writes per second, it provides high-speed assurance for the return of results after the first-stage deduplication process. For the second-stage precise deduplication, which is essentially a random disk write and deduplication process, LevelDB can be used in conjunction with solid-state drive writing, greatly improving random input / output performance. Deduplication of newly added content in hundreds of millions of user number packets can be completed in seconds. Here, we do not specifically limit the high-speed distributed log system and disk index database to be selected, as long as the log system and index database meet the component requirements of the solution.
[0197] In general, by reasonably controlling the balance between the time window size and the original log compression ratio, and by selecting a suitable high-speed distributed log system and disk index database, it is possible to obtain accurate unique visitor counts and corresponding visitor identifier sets through stream computing.
[0198] The following description continues with the page access information acquisition device 255 provided in the embodiments of the present invention. In some embodiments, the page access information acquisition device can be implemented as a software module, see [link to documentation]. Figure 11 , Figure 11 This is a schematic diagram of the structure of the page access information acquisition device 255 provided in an embodiment of the present invention. The page access information acquisition device 255 provided in an embodiment of the present invention includes:
[0199] Acquisition module 2551 is configured to, in response to an access information acquisition instruction for a target page, acquire log data of the target page within a target time period comprising at least two time windows, wherein the log data includes: unique visitor identifiers of the target page.
[0200] The running module 2552 is used to perform deduplication processing on the unique visitor identifiers within each time window based on the log data, to obtain the unique visitor identifiers of the target page within each time window; using the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, the unique visitor identifiers of the target page within each time window are stored in the database using a key-value storage method; based on the storage structure of the database, the page access information of the target page is queried, and the page access information includes at least one of the following: the number of unique visitors corresponding to the target page within the target time period, and the set of visitor identifiers corresponding to the target page within the target time period.
[0201] In some embodiments, the acquisition module 2551 is further configured to acquire log data of the target page within a target time period comprising at least two time windows via a distributed log system. Correspondingly, the running module 2552 is further configured to send back the unique visitor identifiers of the target page within each time window to the distributed log system.
[0202] In some embodiments, the running module 2552 is further configured to record the independent visitor identifiers of the target page within each time window based on the log data using a stream computing method, so that the same independent visitor identifier is recorded only once within the same time window.
[0203] In some embodiments, the running module 2552 is further configured to store the independent visitor identifiers of the target page within each time window to the database, using the page identifier of the target page as the primary key, the visitor identifier as the subkey, and the access time or access order associated with the visitor identifier as the value.
[0204] In some embodiments, the running module 2552 is further configured to, when the page access information includes the number of unique visitors, query the database based on the storage structure of the database for the number of subkeys included in the primary key, and use the queried number as the number of unique visitors.
[0205] In some embodiments, the running module 2552 is further configured to, when the page access information includes the visitor identifier set, query at least one subkey included in the primary key from the database based on the storage structure of the database; obtain the visitor identifier corresponding to each of the queried subkeys to obtain the visitor identifier set.
[0206] In some embodiments, the apparatus further includes an output module 2553, configured to output page access information of the target page obtained through querying.
[0207] In some embodiments, the output module 2553 is further configured to send the visitor identifier set to present a download function item corresponding to the visitor identifier set, wherein the download function item is configured to download the visitor identifier set when a trigger operation for the download function item is received.
[0208] In some embodiments, the running module 2552 is further configured to: when the page access information includes the visitor identifier set, obtain log data of the target page within at least two consecutive new time windows, using the duration corresponding to the target time period as the size of the new time window; based on the log data of the target page within the at least two new time windows, perform deduplication processing on the unique visitor identifiers within each new time window to obtain the unique visitor identifiers of the target page within each new time window; and store the unique visitor identifiers of the target page within each new time window to the database, so as to query the page access information of the target page based on the storage structure of the database.
[0209] This invention provides a computer-readable storage medium storing executable instructions, wherein the executable instructions, when executed by a processor, will cause the processor to execute the page access information acquisition method provided in this invention.
[0210] In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0211] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0212] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0213] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0214] In summary, the page access information acquisition method provided by the embodiments of the present invention can achieve accurate page access data acquisition, improve the accuracy of page access information, and has a fast processing speed, ensuring timely processing.
[0215] The above description is merely an embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of the present invention are included within the scope of protection of the present invention.
Claims
1. A method for obtaining page access information, characterized in that, The method includes: Obtain log data of the target page within a target time period containing at least two time windows, wherein the log data includes unique visitor identifiers of the target page; Based on the log data, the unique visitor identifiers within each time window are deduplicated to obtain the unique visitor identifiers of the target page within each time window. Using the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, the independent visitor identifier of the target page within each time window is stored in the database using a key-value storage method; Based on the storage structure of the database, the page access information of the target page is retrieved, and the page access information includes at least one of the following: The number of unique visitors to the target page within the target time period, and the set of visitor identifiers to the target page within the target time period.
2. The method as described in claim 1, characterized in that, The step of obtaining the log data of the target page within a target time period containing at least two time windows includes: The target page's log data within a target time period containing at least two time windows is obtained through a distributed logging system. After obtaining the unique visitor identifiers of the target page within each of the time windows, the method further includes: The unique visitor identifiers of the target page within each time window will be sent back to the distributed log system.
3. The method as described in claim 1, characterized in that, The step of deduplicating unique visitor identifiers within each time window based on the log data includes: Based on the log data, a stream computing method is used to record the unique visitor identifiers of the target page within each time window, so that the same unique visitor identifier is recorded only once within the same time window.
4. The method as described in claim 1, characterized in that, The process of storing the unique visitor identifiers of the target page within each time window in the database using the page identifier of the target page as the primary key, the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, employing a key-value storage method, includes: Using the page identifier of the target page as the primary key, the visitor identifier as the subkey, and the access time or access order associated with the visitor identifier as the value, the independent visitor identifier of the target page within each time window is stored in the database using a key-value storage method.
5. The method as described in claim 1, characterized in that, The process of retrieving page access information for the target page based on the storage structure of the database includes: When the page access information includes the number of unique visitors, based on the storage structure of the database, the number of subkeys included in the primary key is queried from the database, and the queried number is used as the number of unique visitors.
6. The method as described in claim 1, characterized in that, The process of retrieving page access information for the target page based on the storage structure of the database includes: When the page access information includes the visitor identifier set, based on the storage structure of the database, at least one subkey included in the primary key is queried from the database; Obtain the visitor identifiers corresponding to each of the subkeys obtained from the query to obtain the visitor identifier set.
7. The method as described in claim 1, characterized in that, After obtaining the page access information of the target page based on the storage structure of the database, the method further includes: When the page access information includes the visitor identifier set, the length of the new time window is taken as an integer multiple of the target time period, and log data of the target page within at least two consecutive new time windows is obtained. Based on the log data of the target page within the at least two new time windows, the unique visitor identifiers within each new time window are deduplicated to obtain the unique visitor identifiers of the target page within each new time window. The unique visitor identifiers of the target page within each new time window are stored in the database, so that the page access information of the target page can be retrieved based on the storage structure of the database.
8. The method as described in claim 1, characterized in that, After obtaining the page access information of the target page based on the storage structure of the database, the method further includes: Output the page access information of the target page obtained from the query.
9. The method as described in claim 8, characterized in that, When the page access information includes the visitor identifier set, the page access information of the target page obtained by the output query includes: Send the visitor identifier set to present a download function item corresponding to the visitor identifier set. The download function item is used to download the visitor identifier set when a trigger operation is received for the download function item.
10. A device for acquiring page access information, characterized in that, The device includes: The acquisition module is used to acquire log data of the target page within a target time period containing at least two time windows. The log data includes: unique visitor identifiers of the target page. The running module is used to perform deduplication processing on the unique visitor identifiers in each time window based on the log data, so as to obtain the unique visitor identifiers of the target page in each time window. In addition, using the page identifier of the target page as the primary key and the visitor identifier as the subkey, and obtaining the value corresponding to the subkey, the independent visitor identifier of the target page within each time window is stored in the database using a key-value storage method; Furthermore, based on the storage structure of the database, the page access information of the target page is obtained by querying, and the page access information includes at least one of the following: the number of unique visitors corresponding to the target page within the target time period, and the set of visitor identifiers corresponding to the target page within the target time period.
Citation Information
Patent Citations
Web page content statistical method and system based on distributed file storage
CN103729479A
Unique visitor statistical method and device
CN108900619A