Method and system for counting visit volume

By using the authentication center and database in the microservice architecture to distinguish user identities and update visits, the problem of being unable to distinguish user visits in the existing technology is solved, and efficient visit statistics and diversified policy support are achieved.

CN112311901BActive Publication Date: 2024-09-27CENNAVI TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011325212.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-23
Publication Date
2024-09-27
Estimated Expiration
2040-11-23

AI Technical Summary

Technical Problem

The existing user visit statistics method cannot effectively distinguish logged-in users and guest users, and the statistics based on Nginx server and Zipkin system are inefficient and cannot support diverse access policies.

Method used

In the microservice architecture, service requests are received through the gateway, the authentication center is used to update the access volume based on user identity information, distinguish logged-in users and guest users, and store real-time access volume through the first database, and the persistent access volume is stored in the second database. Simplify the visit statistics process.

Benefits of technology

It implements visit statistics for users with different identities, supports diversified access strategies, improves the efficiency and accuracy of visit statistics, simplifies the statistical process, and enriches visit statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112311901B
    Figure CN112311901B
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and system for counting visits, which relates to the field of computer technology and can realize simple and effective counting of visits of specific users. The method comprises: receiving a first service request sent by a gateway; the first service request comprises user identity information; and updating the visit volume of the target user according to the user identity information. The present invention is used for counting user visits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for counting page views. Background Art

[0002] User visits refer to the number of times users visit a website in different time periods. By counting the number of user visits to a website, we can find the patterns of users visiting the website. Combining these patterns with the website's carrying capacity to determine the network's pre-expansion mechanism can ensure normal network access and improve the website's service quality.

[0003] Currently, statistics on user visits are mainly implemented through Nginx servers and Zipkin systems. However, the user visit statistics based on Nginx servers only include information such as user IP and access time, and cannot further distinguish visiting users; while the user visit statistics implemented by the Zipkin system consumes a lot of resources and is inefficient. Therefore, there is no simple and effective log analysis system to determine user visits and further distinguish user visits. Summary of the invention

[0004] The embodiments of the present invention provide a method and system for counting page views, which can simply and effectively count the page views of a specific user.

[0005] To achieve the above object, the embodiments of the present invention adopt the following technical solutions:

[0006] In a first aspect, a method for counting visits is provided, which is applied to a microservice architecture, wherein the microservice architecture includes a gateway, and the method includes: receiving a first service request sent by the gateway; the first service request includes user identity information; and updating the visit volume of a target user according to the user identity information.

[0007] In a second aspect, a visit volume statistics system is provided, which is applied to a microservice architecture. The microservice architecture includes a gateway. The system includes: a first receiving module, used to receive a first service request sent by the gateway; the first service request includes user identity information; an update module, used to update the visit volume of the target user according to the user identity information received by the first receiving module.

[0008] The access volume statistics method provided by the embodiment of the present invention is applied to a microservice architecture, and the microservice architecture includes a gateway. The method includes: receiving a first service request sent by the gateway; the first service request includes user identity information; and updating the access volume of the target user according to the user identity information. After the gateway in the microservice architecture receives the service request of the corresponding terminal, the access volume statistics method provided by the embodiment of the present invention can forward the service request to the access volume statistics system provided by this embodiment, and the access volume statistics system accumulates the number of corresponding user visits according to the user identity information in the service request. Since the service request here is a user request for a service in the microservice architecture, this embodiment does not need other statistical processes when counting the user's access volume according to the service request. The access volume statistics can be realized while receiving the service request, which simplifies the access volume statistics process; and in this embodiment, the access volume is counted according to the user identity information provided in the service request, so the access volume of users with different identities can be counted, enriching the access volume statistics data. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0010] Figure 1 A schematic diagram of a microservice architecture provided by an embodiment of the present invention;

[0011] Figure 2 One of the structural diagrams of a visit statistics system provided by an embodiment of the present invention;

[0012] Figure 3 One of the flow charts of a method for counting page views provided by an embodiment of the present invention;

[0013] Figure 4 A second flow chart of a method for counting page views provided by an embodiment of the present invention;

[0014] Figure 5 A third flow chart of a method for counting page views provided by an embodiment of the present invention;

[0015] Figure 6 A schematic diagram of hierarchical storage of access volume data provided by an embodiment of the present invention;

[0016] Figure 7 A fourth flow chart of a method for counting page views provided by an embodiment of the present invention;

[0017] Figure 8 A schematic diagram of an interface for querying user access volume provided by an embodiment of the present invention;

[0018] Fig. 9 One of the schematic diagrams for displaying user access volume provided by an embodiment of the present invention;

[0019] Fig.10 A second schematic diagram showing user access volume provided by an embodiment of the present invention;

[0020] Fig.11 A second structural diagram of a visit statistics system provided by an embodiment of the present invention;

[0021] Fig.12 A third structural diagram of a visit statistics system provided by an embodiment of the present invention;

[0022] Fig.13 A fourth structural diagram of a visit statistics system provided by an embodiment of the present invention;

[0023] Fig.14 A schematic diagram of the structure of another access statistics system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0025] It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0026] In order to clearly describe the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", etc. are used to distinguish the same items or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. are not limiting the quantity and execution order.

[0027] For network service systems such as websites and applications, their users can generally be divided into logged-in users and guest users. Network service systems can set different access policies according to the types of access users. For example, logged-in users can access the services in the website without restrictions, while guest users can only access the services in the website within a specified number of times. In this way, the rights and interests of logged-in users can be protected, and some illegal users can be restricted to ensure the smooth operation of the website. At present, the statistics of the visits to these network service systems can only determine the total visits based on information such as the user's Internet protocol (IP) and access time, but cannot distinguish between the visits of logged-in users and the visits of guest users. Therefore, the current visit statistics method cannot support the network service system to set a variety of access policies.

[0028] In view of the above problems, an embodiment of the present invention provides a method for counting visits, which is applied to a microservice architecture, such as Figure 1 As shown, the microservice architecture includes a gateway 10 , an authentication center 11 , a microservice 12 , a first database 13 , a second database 14 and a statistical service 15 .

[0029] The gateway 10 is used to send the service request to the authentication center after receiving the service request sent by the client. The service request here includes business information and user identity information, which is used to request the corresponding microservice to provide service.

[0030] The authentication center 11 stores user identity information. When the authentication center 11 receives a service request sent by the gateway 10, it can match the user identity information carried in the service request with the user identity information stored in itself. If the authentication center 11 stores user identity information that is consistent with the user identity information carried in the service request, the authentication is completed and the sender of the service request is determined to be a logged-in user; otherwise, the sender of the service request is a guest user. At this time, the authentication center 11 can return a response message to the gateway 10 according to the preset access policy, instructing the gateway 10 to send the service request to the corresponding microservice, and the corresponding microservice will provide the service.

[0031] It should be noted that the access policy here can be: if the sender of the service request is a logged-in user, the authentication center 11 can determine the number of visits of the logged-in user within a certain period of time. If the number of visits reaches a threshold, the service request will be rejected. If the number of visits does not reach the threshold, a response message will be returned to the gateway.

[0032] Similarly, when the sender of the service request is a guest user, the same access policy can also be implemented. The difference is that the threshold corresponding to the visit volume of the guest user here may be smaller than the threshold corresponding to the visit volume of the logged-in user, and the access policy of the guest user can also restrict the guest user from using certain microservices, etc. Of course, the above access policy is only exemplary, and technicians in this field can set different access policies for different types of users as needed.

[0033] Corresponding to the authentication center 11 determining the visit volume of the logged-in user or the guest user, the authentication center 11 can also be used to query the visit volume of the corresponding user from the first database 13 and / or the second database 14.

[0034] After the authentication center 11 returns a response message to the gateway 10 , the gateway 10 may also be used to send the service request to a corresponding microservice, such as the microservice 121 .

[0035] Microservice 12 may include multiple services, such as microservice 121, microservice 122, etc., and these microservices can provide corresponding services to the outside.

[0036] The first database 13 and the second database 14 are both used to store the user's access data. The difference is that the first database 13 is used to store the user's real-time access, where the real-time access refers to the access within the current time period, such as the access within the current two hours; the second database 14 is used to store the user's persistent access, where the persistent access refers to the access data before the current time period, such as the access data two hours before the current time.

[0037] The statistics service 15 is used to persist the real-time access data in the first database 13 to the second database 14. Here, when the statistics service 15 persists the access data, it can be every thirty minutes, and the access data of the first thirty minutes stored in the first database 13 is persisted to the second database 14. Of course, the thirty minutes mentioned above is only exemplary, and those skilled in the art can set the time interval for data persistence and the amount of data as needed.

[0038] It should be noted that the above only describes some of the functions of the various structures in the microservice architecture. In practice, these structures can also include other functions, which will not be described one by one here.

[0039] in accordance with Figure 1 The microservice architecture shown in Figure 2 As shown, an embodiment of the present invention provides a visit statistics system 20, including: an authentication center 201, a data storage module 202 and a data display module 203.

[0040] The authentication center 201 can be Figure 1 The authentication center shown has the same functions as Figure 1 The functions of the authentication centers shown are the same and will not be repeated here.

[0041] The data storage module 202 is used to store the pageview data of all users. Here, the data storage module 202 may include Figure 1 The first database and the second database shown in the figure can realize the separate storage of real-time access volume and persistent access volume. Of course, since the persistent access volume of the second database in the data storage module 202 is determined by the real-time access volume in the first database, the data storage module 202 also includes Figure 1 The statistical service shown is used to persist the real-time access volume in the first database to the second database.

[0042] It should be noted that the statistics of user visits by the authentication center 201 also need to be combined with the first database in the data storage module 202 to achieve the counting of user visits.

[0043] After completing the statistics of the number of visits of all users, the data display module 203 is used to display the change of the number of visits of a specific user in the form of a chart. Of course, the data display module 203 can also display the number of visits of a specific user at a specific time.

[0044] like Figure 3 As shown, an embodiment of the present invention provides a method for counting visits, which is applied to the above-mentioned microservice architecture, and the method includes:

[0045] S301: Receive a first service request sent by a gateway.

[0046] The first service request includes user identity information.

[0047] Specifically, the first service request here is used to request the corresponding microservice, and the user identity information is used to indicate the user's identity type, such as a logged-in user and a guest user, etc. The logged-in user here can be a user who has registered with the website, and the guest user can be a user who has not registered with the website.

[0048] When a logged-in user sends a first service request, the first service request may include the user type of the logged-in user and the user identity assigned to the user by the website; when a guest user sends a first service request, the first service request may include the user type of the guest user and the IP address of the guest user.

[0049] For example, if the user identity information included in the first service request is login:15, it means that the user sending the first service request is a logged-in user, and the user identity assigned to him by the website is 15; if the user identity information included in the first service request is visitor:192.168.11.1, it means that the user sending the first service request is a visitor user, and the corresponding IP address is 192.168.11.1.

[0050] It should be noted that the above classification of user identity types is only exemplary. In practice, those skilled in the art can set other different types of user identities as needed. The above website is also exemplary. In practice, the website here can also be other applications that provide microservices.

[0051] After the access statistics system receives the first data request, the reception and identification of the first service request can be performed by Figure 2 The authentication center implementation shown, since the authentication center stores the user's authentication data (such as registration information, and the user identity identifier assigned to the user by the website), after receiving the first service request, the authentication center can determine the user type of the user based on the authentication data stored in itself.

[0052] S302: Update the target user's visit volume according to the user identity information.

[0053] Specifically, after receiving the first service request, the authentication center can store the user identity information in the first service request in the form of a key-value pair to the first database, and update the value of the key-value pair already in the first database. The first database here can be Figure 2 The first database in the data storage module is shown.

[0054] Furthermore, the first database can store the visit records of different users in the form of key-value pairs. For example, login: 15 10 can indicate that the visit volume of logged-in user 15 is 10. When the authentication center stores the user identity information in the first service request to the first database, the key-value pair corresponding to the logged-in user is counted by 1. At this time, the key-value pair is: login: 15 11, indicating that the visit volume of logged-in user 15 is 11. For another example, visitor: 192.168.11.13 can indicate that the visit volume of guest user 192.168.11.1 is 3. When the authentication center stores the user identity information in the first service request to the first database, the key-value pair corresponding to the guest user is counted by 1. At this time, the key-value pair is: visitor: 192.168.11.1 4, indicating that the visit volume of guest user 192.168.11.1 is 4.

[0055] In one possible implementation, when a user visits a website for the first time, the authentication center stores the user identity information in the first service request in the first database, but fails to find the key-value pair corresponding to the user identity information. At this time, a new key-value pair can be created in the first database, and its count value is recorded as 1, such as login: 17 1, indicating that the number of visits by logged-in user 17 is 1.

[0056] It should be noted that the above-mentioned target user is the user corresponding to the user identity information in the first service request.

[0057] Optionally, the first service request may also include timestamp information and service information, such as Figure 4 As shown, step S302 may also be: updating the target user's access to the target service within the target time period according to the user identity information, the timestamp information and the service information.

[0058] Specifically, when the first service request only includes user identity information, the authentication center can only determine the cumulative number of visits of the corresponding target user through the first database; when the first service request also includes timestamp information and service information, the authentication center can also determine the number of visits of the target user to the target service within the target time period through the first database.

[0059] Furthermore, when the first service request also includes timestamp information and business information, the key-value pair key-value for storing the corresponding user access records in the first database can be: 2020110308:118:Login:15 3, indicating that the logged-in user 15 visited the 118 service for the third time at 08:00 on November 03, 2020; when the authentication center stores the user identity information, timestamp information and business information in the first service request to the first database, the key-value pair key-value count corresponding to the logged-in user is increased by 1. At this time, the key-value pair key-value is: 2020110308:118:Login:154, indicating that the logged-in user 15 visited the 118 service for the fourth time at 08:00 on November 03, 2020.

[0060] In one possible implementation, when a user visits a website for the first time, the authentication center stores the user identity information, timestamp information and business information in the first service request in the first database, but fails to find the key-value pair corresponding to the user identity information. At this time, a new key-value pair key-value can be created in the first database, and its count value is recorded as 1, such as 2020110308:118:Login:17 1, indicating that the logged-in user 17 visited the 118 service for the first time at 08:00 on November 3, 2020.

[0061] It should be noted that the above-mentioned target time period is used to indicate the hourly period in which the timestamp information is located. For example, if the timestamp information is 2020110308, the target time period refers to the time period from 08:00 on November 3, 2020 to 09:00 on November 3, 2020.

[0062] In a possible implementation, the first service request may also include only the user identity information and the timestamp information. In this case, step S302 further includes: updating the target user's visit volume in the target time period according to the user identity information and the timestamp information.

[0063] Specifically, when the first service request may only include user identity information and timestamp information, the authentication center can only count the number of visits of the target user in the target time period through the first database, but cannot count the number of visits to the target service. The authentication center can count the number of visits of the target user in the target time period by referring to the above-mentioned number of visits counting method, which will not be described in detail here.

[0064] Of course, the above implementations are only exemplary. When the first service request includes other information, those skilled in the art can also implement different counting requirements according to the corresponding information.

[0065] In the embodiment of the present invention, the access volume statistics system accumulates the corresponding user access times according to the user identity information in the service request. Since the service request here is a user request for a service in the microservice architecture, this embodiment no longer requires other statistical processes when counting the user's access volume according to the service request. The access volume statistics can be achieved while receiving the service request, which simplifies the access volume statistics process. In addition, in this embodiment, the access volume is counted according to the user identity information provided in the service request, so the access volume of users with different identities can be counted, enriching the access volume statistics data.

[0066] Optional, such as Figure 5 As shown, after step S302, the following further includes:

[0067] S303: Store the pageview data in the first time period into the first database.

[0068] The first time period includes the current time.

[0069] Specifically, after the authentication center counts the number of visits to the target customer through the first database, the number of visits data within the first time period can be stored in the first database. The first time period here can be the current two hours. For example, if the current time is 08:00 on November 3, 2020, the first time period is 06:00 on November 3, 2020 - 08:00 on November 3, 2020.

[0070] It should be noted that, in the embodiment of the present invention, the first database is used to cache the target user's short-term access data. In order to conveniently and quickly realize real-time query of the target user's access, the first database can be deployed in the computer memory to improve the response speed of access statistics.

[0071] S304: Store the pageview data in the second time period into the second database.

[0072] The second time period is a time period between the first time periods.

[0073] Specifically, the second database here can be Figure 2 The second database of the data storage module in the data storage module. If the first time period is from 06:00 on November 3, 2020 to 08:00 on November 3, 2020, the second time period can be the time period between 06:00 on November 3, 2020 and 08:00 on November 3, 2020.

[0074] Furthermore, storing the pageview data in the second database here actually means persisting the pageview data of the target user in the short term cached in the first database to the second database. This process can be performed by Figure 2 Implementation of statistical services in the data storage module.

[0075] It should be noted that when the statistics service persists the access data in the first database to the second database, only part of the access data in the first database can be persisted to the second database. For example, when the first time period is two hours, the statistics service can persist the access data within the preset time in the access data of these two hours to the second database. For example, if the first time period is 06:00 on November 3, 2020 to 08:00 on November 3, 2020, then the statistics service here can persist the access data from 06:00 on November 3, 2020 to 06:30 on November 3, 2020 to the second database, and the preset time is the first 30 minutes of the first time period; of course, the preset time here is only exemplary, and technicians in this field can set the first time period, the second time period and the preset time as needed, and this embodiment of the present invention is not limited to this.

[0076] In a possible implementation, the page views stored in the first database and the second database may be stored in a hierarchical manner. For example, the page views in the first database and the second database may be stored in three levels, such as: Figure 6 As shown, the access volume storage method may include primary access volume, secondary access volume and tertiary access volume, wherein the primary access volume may be global access volume, the secondary access volume may be organization-level access volume, the global access volume may be divided into multiple categories, such as first service access volume, second service access volume, etc., and the tertiary access volume may be user-level access volume, such as the access volume of the first user to the first service, etc. Of course, the hierarchical storage of the access volume in the first database and the second database is only exemplary, and those skilled in the art may also classify and store the access volume in other ways to facilitate subsequent access volume query.

[0077] In one possible implementation, the first database may be a database based on a remote dictionary service (Remote Dictionary Server, Redis), and the second database may be a database based on a search engine Elasticsearch. The first database can support a large number of data statistics services based on the high concurrency capability of Redis, and can quickly realize real-time counting of user visits based on the single-threaded mechanism of Redis. The second database can realize stable and reliable real-time search based on the capabilities of Elasticsearch, which is convenient for subsequent visit query services. Of course, the first database and the second database here are only preferred. In practice, the first database and the second database can also be other databases, which is not limited to the embodiments of the present invention.

[0078] Optionally, after completing the storage of the visit data, such as Figure 7 As shown, it also includes:

[0079] S401: Receive a first query request.

[0080] The first query request includes the third time period and user identity information.

[0081] Specifically, the first query request here can be the visit statistics system through Figure 2 The click instruction received by the data display module shown may also be other instructions.

[0082] Exemplarily, the data display module of the visit statistics system can provide the following Figure 8 The query page shown can query the number of visits in the corresponding time by setting the corresponding third time period; by clicking on different storage levels, it can query the number of visits of the target user or the number of visits of the target organization in the corresponding time.

[0083] The data display module here is only exemplary, and those skilled in the art may also display the receipt of the first query request in other ways.

[0084] S402: If the third time period is within the first time period, determine the visit volume of the target user from the first database according to the user identity information.

[0085] Specifically, since the first database only stores the pageview data within the first time period, when the pageview statistics system determines that the third time period is within the first time period, the pageview of the user corresponding to the user identity information can be queried from the first database.

[0086] Exemplarily, if the current time is 08:23 on November 3, 2020, the first time period is 06:00 on November 3, 2020-08:00 on November 3, 2020; if the third time period is 06:00 on November 3, 2020-07:00 on November 3, 2020, the visit statistics system can query the corresponding user's visits from the first database based on the user identity information.

[0087] S403: If the third time period is within the second time period, determine the target user's visit volume from the second database according to the user identity information.

[0088] Specifically, since the second database stores the pageview data of all times before the first time period, when the pageview statistics system determines that the third time period is within the second time period, the pageview of the user corresponding to the user identity information can be queried from the second database.

[0089] Exemplarily, if the current time is 08:23 on November 3, 2020, the first time period is 06:00 on November 3, 2020 to 08:00 on November 3, 2020, and the second time period is all time before 06:00 on November 3, 2020; if the third time period is 06:00 on November 2, 2020 to 01:00 on November 3, 2020, the visit statistics system can query the corresponding user's visits from the second database based on the user identity information.

[0090] S404: If the first sub-time period is in the first time period and the second sub-time period is in the second time period, determine the visit volume of the target user from the first database and the second database according to the user identity information.

[0091] The third time period includes a first sub-time period and a second sub-time period.

[0092] Specifically, the third time period here is composed of the first sub-time period and the second sub-time period. For example, if the third time period is 05:00 on November 3, 2020 to 08:00 on November 3, 2020, the first sub-time period can be 05:00 on November 3, 2020 to 06:00 on November 3, 2020, and the second sub-time period can be 06:00 on November 3, 2020 to 08:00 on November 3, 2020.

[0093] When the first sub-time period is in the first time period and the second sub-time period is in the second time period, since the page views of users corresponding to the first sub-time period are stored in the first database and the page views of users corresponding to the second sub-time period are stored in the second database, the page view statistics system needs to query the page views of the corresponding users from the first database and the second database respectively according to the user identity information.

[0094] Exemplarily, if the current time is 08:23 on November 3, 2020, the first time period is 06:00 on November 3, 2020 to 08:00 on November 3, 2020, and the second time period is all time before 06:00 on November 3, 2020; if the first sub-time period is 05:00 on November 3, 2020 to 06:00 on November 3, 2020, and the second sub-time period is 06:00 on November 3, 2020 to 08:00 on November 3, 2020, the visit statistics system queries the corresponding user's visits in the first sub-time period from the first database according to the user identity information, and queries the corresponding user's visits in the second sub-time period from the second database according to the user identity information.

[0095] It should be noted that when querying the user's access volume from the first database and / or the second database respectively according to the third time period, it is also necessary to query the access volume in the corresponding time period according to the third time period, rather than the access volume of the corresponding user in the entire first database and the access volume of the corresponding user in the entire second database. Since in this embodiment, the first database is preferably a database based on Redis, and the second database is preferably a database based on ElasticSearch, the first database can process query requests in batches to avoid performance degradation when a large number of query requests are initiated at the same time, and the second database can realize the aggregation of the access volume of each user for different time periods or different services.

[0096] In an optional implementation, the first query request may also include business information. In this case, the visit statistics system may query the target user's visits to the target business within the third time period based on the user identity information, the third time period and the business information. The specific process may refer to the above embodiment and will not be repeated here.

[0097] S405: Display the target user's visit volume in the third time period in a graphical form.

[0098] Specifically, the above query process can determine the number of visits of the target user in the third time period, and the number of visits to the target service by the target user in the third time period, etc. After determining these visits, the visit statistics system can Figure 2 The data display module shown renders these visits into corresponding chart forms for display.

[0099] For example, Fig. 9 As shown, the number of visits to the first service by the first target user from 02:00 on November 3, 2020 to 07:00 on November 3, 2020 is shown; optionally, the number of visits to the first service by the first target user from 02:00 on November 3, 2020 to 07:00 on November 3, 2020 can also be as follows Fig.10 Displayed in the manner shown.

[0100] Of course, the above-mentioned method of displaying the target user's visit volume is only exemplary, and those skilled in the art may also display the target user's visit volume in other ways, which is not limited to this embodiment of the invention.

[0101] It should be noted that when displaying the target user's page views in a chart, if the target user's page views in the third time period are not found, the page views may be displayed in the chart by filling in zeros.

[0102] The access volume statistics method provided by the embodiment of the present invention is applied to a microservice architecture, and the microservice architecture includes a gateway. The method includes: receiving a first service request sent by the gateway; the first service request includes user identity information; and updating the access volume of the target user according to the user identity information. After the gateway in the microservice architecture receives the service request of the corresponding terminal, the access volume statistics method provided by the embodiment of the present invention can forward the service request to the access volume statistics system provided by this embodiment, and the access volume statistics system accumulates the number of corresponding user visits according to the user identity information in the service request. Since the service request here is a user request for a service in the microservice architecture, this embodiment does not need other statistical processes when counting the user's access volume according to the service request. The access volume statistics can be realized while receiving the service request, which simplifies the access volume statistics process; and in this embodiment, the access volume is counted according to the user identity information provided in the service request, so the access volume of users with different identities can be counted, enriching the access volume statistics data.

[0103] like Fig.11 As shown, an embodiment of the present invention provides a visit statistics system 50, which is applied to a microservice architecture, including:

[0104] The first receiving module 501 is used to receive a first service request sent by a gateway; the first service request includes user identity information.

[0105] The updating module 502 is used to update the target user's visit amount according to the user identity information received by the first receiving module 501 .

[0106] Optionally, the first service request also includes timestamp information and business information.

[0107] The updating module 502 is further configured to update the target user's access volume to the target service within the target time period according to the user identity information, timestamp information and service information received by the first receiving module 501 .

[0108] Optional, such as Fig.12 As shown, the pageview statistics system 50 further includes a storage module 503 .

[0109] The storage module 503 is used to store the access data of the first time period into the first database; the first time period includes the current time.

[0110] The storage module 503 is further used to store the access data of the second time period into the second database; the second time period is the time period between the first time periods.

[0111] Optional, such as Fig.13 As shown, the pageview statistics system 50 further includes a second receiving module 504 , a query module 505 and a display module 506 .

[0112] The second receiving module 504 is used to receive a first query request; the first query request includes a third time period and user identity information.

[0113] The query module 505 is used to determine the visit volume of the target user from the first database according to the user identity information when the third time period received by the second receiving module 504 is within the first time period.

[0114] The query module 505 is further configured to determine the number of visits of the target user from the second database according to the user identity information when the third time period received by the second receiving module 504 is within the second time period.

[0115] The query module 505 is also used to determine the target user's visits from the first database and the second database according to the user identity information when the first sub-time period is in the first time period and the second sub-time period is in the second time period; the third time period includes the first sub-time period and the second sub-time period.

[0116] The display module 506 is used to display the number of visits of the target user in the third time period in the form of a chart.

[0117] The access volume statistics system provided by the embodiment of the present invention is applied to a microservice architecture, and the microservice architecture includes a gateway. The system includes: a first receiving module, which is used to receive a first service request sent by the gateway; the first service request includes user identity information; and an updating module, which is used to update the access volume of a target user according to the user identity information received by the first receiving module. After the gateway in the microservice architecture receives the service request of the corresponding terminal, the access volume statistics system provided by the embodiment of the present invention can receive the service request forwarded by the gateway, and accumulate the corresponding user access times according to the user identity information in the service request. Since the service request here is a user request for a service in the microservice architecture, this embodiment does not require other statistical processes when counting the user's access volume according to the service request. The access volume statistics can be realized while receiving the service request, which simplifies the access volume statistics process; and in this embodiment, the access volume is counted according to the user identity information provided in the service request, so the access volume of users with different identities can be counted, enriching the access volume statistics data.

[0118] like Fig.14 As shown, the embodiment of the present invention also provides another access statistics system, including a memory 61, a processor 62, a bus 63 and a communication interface 64; the memory 61 is used to store computer execution instructions, and the processor 62 is connected to the memory 61 through the bus 63; when the access statistics system is running, the processor 62 executes the computer execution instructions stored in the memory 61, so that the access statistics system executes the access statistics method provided in the above embodiment.

[0119] In a specific implementation, as an embodiment, the processor 62 (62-1 and 62-2) may include one or more CPUs, such as Fig.14 As an embodiment, the access statistics system may include multiple processors 62, such as Fig.14 62-1 and processor 62-2 are shown in FIG. Each CPU in these processors 62 may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor 62 here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0120] The memory 61 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 61 may exist independently and be connected to the processor 62 via a bus 63. The memory 61 may also be integrated with the processor 62.

[0121] In a specific implementation, the memory 61 is used to store the data in this application and the computer execution instructions corresponding to the software program for executing this application. The processor 62 can access various functions of the traffic statistics system by running or executing the software program stored in the memory 61 and calling the data stored in the memory 61.

[0122] The communication interface 64 uses any transceiver or other device for communicating with other devices or communication networks, such as control systems, radio access networks (RAN), wireless local area networks (WLAN), etc. The communication interface 64 may include a receiving unit to implement a receiving function, and a sending unit to implement a sending function.

[0123] The bus 63 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus 63 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0124] An embodiment of the present invention further provides a computer-readable storage medium, which includes computer-executable instructions. When the computer-executable instructions are executed on a computer, the computer executes the visit volume statistics method provided in the above embodiment.

[0125] The embodiment of the present invention further provides a computer program, which can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program can implement the visit volume statistics method provided in the above embodiment.

[0126] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented using software, the functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium may be any available medium that a general or special-purpose computer can access.

[0127] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0128] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be a physical unit or multiple physical units, that is, it may be located in one place, or it may be distributed in multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0129] In addition, each functional unit in each embodiment of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a ROM, a RAM, a disk, or an optical disk.

[0130] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for counting visits, applied to a microservice architecture, wherein the microservice architecture includes a gateway, characterized in that: include: receiving a first service request sent by the gateway; The first service request includes user identity information, where the user identity information is used to indicate a user identity type; Update the target user's visit amount according to the user identity information; storing the pageview data of a first time period into a first database; the first time period includes the current moment, the first database is used to cache the pageview data in a short period, and the first database is located in a computer memory; The access data of the second time period is stored in the second database, so that the data in the second time period is persisted in the second database; the second time period is the time period before the first time period, and the second database is located in the data storage module; Among them, in the first database and the second database, the storage levels of the access volume data include global level access volume, organization level access volume and user level access volume.

2. The method for counting visits according to claim 1, characterized in that: The first service request further includes timestamp information and service information, and the method further includes: The access volume of the target user to the target service within the target time period is updated according to the user identity information, the timestamp information and the service information.

3. The method for counting visits according to claim 1, characterized in that: After completing the storage of the pageview data, the method further includes: receiving a first query request; the first query request including a third time period and the user identity information; If the third time period is within the first time period, determining the visit volume of the target user from the first database according to the user identity information; If the third time period is within the second time period, determining the visit volume of the target user from the second database according to the user identity information; If the first sub-time period is in the first time period and the second sub-time period is in the second time period, the visit volume of the target user is determined from the first database and the second database according to the user identity information; the third time period includes the first sub-time period and the second sub-time period.

4. The method for counting visits according to claim 3, characterized in that: After determining the visit volume of the target user, the method further includes: The number of visits by the target user in the third time period is displayed in a graphical form.

5. A visit statistics system, applied to a microservice architecture, wherein the microservice architecture includes a gateway, characterized in that: include: A first receiving module, used for receiving a first service request sent by the gateway; The first service request includes user identity information, and the user identity information includes a user identity type; An updating module, used for updating the target user's visit amount according to the user identity information received by the first receiving module; A storage module, used for storing the pageview data of a first time period into a first database; the first time period includes the current moment, the first database is used for caching the pageview data in a short period, and the first database is located in a computer memory; The storage module is further used to store the access data of the second time period into the second database, so that the data in the second time period is persisted in the second database; the second time period is the time period before the first time period, and the second database is located in the data storage module; Among them, in the first database and the second database, the storage levels of the access volume data include global level access volume, organization level access volume and user level access volume.

6. The access statistics system according to claim 5, characterized in that: The first service request also includes timestamp information and business information. The updating module is further used to update the target user's access to the target business within the target time period according to the user identity information, timestamp information and business information received by the first receiving module.

7. The access statistics system according to claim 5, characterized in that: Also includes a second receiving module and a query module; The second receiving module is used to receive a first query request; the first query request includes a third time period and the user identity information; The query module is used to determine the visit volume of the target user from the first database according to the user identity information when the third time period received by the second receiving module is within the first time period; The query module is further configured to determine the number of visits of the target user from the second database according to the user identity information when the third time period received by the second receiving module is within the second time period; The query module is further used to determine the number of visits of the target user from the first database and the second database according to the user identity information when the first sub-time period is in the first time period and the second sub-time period is in the second time period; the third time period includes the first sub-time period and the second sub-time period.

8. The access statistics system according to claim 7, characterized in that: Also includes a display module; The display module is used to display the number of visits of the target user in the third time period in the form of a chart.