Data caching method, data management server, recommendation system, and storage medium
By setting up multiple service groups in the service cluster, and based on the hit information and active user relationships, the user data cache hit rate is improved, solving the problem of low user data query efficiency in cloud services and realizing efficient recommendation of recommendation data.
Patent Information
- Application Number
- CN202310302269.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-20
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2043-03-20
AI Technical Summary
In existing technologies, cloud services suffer from low user data cache hit rates when querying user data, which affects the efficiency of recommendation and querying.
By setting up multiple service groups in the service cluster, and based on the user data cache hit information and active user relationships, the user data cache hit rate of each service group can be controlled to cache the user data of the corresponding active users.
This improved the efficiency of user data retrieval, thereby enhancing the efficiency of recommendation data and optimizing the overall user data cache hit rate of cloud services.
Smart Images

Figure CN116467349B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the field of data storage, and in particular to a data caching method, a data management server, a recommendation system and a storage medium. BACKGROUND
[0002] With the development of cloud computing, a data recommender can store recommendation data by using a cloud service and accurately recommend matching recommendation data for a user by using the cloud service. When determining the recommendation data matching the user, the user data of the user needs to be queried, and therefore how to provide a technical solution to improve the query efficiency of the user data and further provide support for improving the recommendation efficiency of the recommendation data has become a technical problem to be solved by those skilled in the art. SUMMARY
[0003] In view of this, embodiments of the present application provide a data caching method, a data management server, a recommendation system and a storage medium. In the case of caching user data, the cache hit rate of the user data is improved, thereby improving the query efficiency of the user data. Since the user data can be used to determine the recommendation data matching the user, embodiments of the present application can provide support for improving the recommendation efficiency of the recommendation data in the case of improving the cache hit rate of the user data.
[0004] To achieve the above object, embodiments of the present application provide the following technical solutions.
[0005] In a first aspect, embodiments of the present application provide a data caching method, comprising:
[0006] determining hit information of user data caching of a plurality of service groups in a set time period; wherein one service group is used to query user data for a corresponding user group, different service groups correspond to different user groups, and user data caching of one service group is used to cache user data of part of users in the corresponding user group, and user data cached by user data caching of different service groups is different;
[0007] determining active users of user data caching of the plurality of service groups in the set time period according to the hit information of user data caching of the plurality of service groups in the set time period;
[0008] controlling each service group to cache user data of the corresponding active users in the user data caching according to the corresponding relationship between the service group and the user group.
[0009] In a second aspect, embodiments of the present application provide a data management server, comprising at least one memory and at least one processor, the memory stores one or more computer executable instructions, and the processor invokes the one or more computer executable instructions to execute the data caching method as described in the first aspect.
[0010] In a third aspect, the embodiments of the present application provide a recommendation system, comprising a traffic distributor, a service cluster, a data management server, and a recommendation data query service; the data management server is the data management server in the second aspect above;
[0011] The traffic distributor is configured to distribute user traffic to corresponding service groups in the service cluster according to the correspondence between user groups and service groups.
[0012] The service cluster comprises a plurality of service groups, one service group is configured to query user data for corresponding user groups, different service groups correspond to different user groups, and the user data cache of one service group is configured to cache user data of part of users in the corresponding user group, and the user data cached by the user data cache of different service groups is different; wherein one service group comprises a plurality of services configured to query user data.
[0013] After receiving the user traffic distributed by the traffic distributor, the service group queries corresponding user data of the user, and delivers the queried user data to the recommendation data query service; the user data queried by the service group is cached in the user data cache of the service group or stored in the user database.
[0014] The recommendation data query service is configured to determine user group data corresponding to the user data according to the user data delivered by the service group, and recommend recommendation data corresponding to the determined user group data to the user.
[0015] In a fourth aspect, the embodiments of the present application provide a storage medium, the storage medium stores one or more computer executable instructions, the one or more computer executable instructions are executed to implement the data caching method in the first aspect above.
[0016] In a fifth aspect, the embodiments of the present application provide a computer program, the computer program is executed to implement the data caching method in the first aspect above.
[0017] The data caching method provided by the embodiments of the present application can set multiple service groups, and one service group queries user data for a corresponding user group, and the user groups corresponding to different service groups are different, and user data caching for part of users in the corresponding user groups is performed in each service group; thus, the embodiments of the present application can determine the hit information of the user data caching of the multiple service groups in a set time period, and thus determine the active users of the user data caching of the multiple service groups in the set time period as a whole according to the hit information; further, according to the corresponding relationship between the service groups and the user groups, the user data of the corresponding active users is cached in the user data caching of each service group, so that the user data caching of each service group can cache the user data of the globally active users in the corresponding user groups, thereby improving the cache hit rate of the user data caching of the multiple service groups as a whole; since the user data can be used to determine the recommended data matched with the user, the embodiments of the present application can improve the hit rate of the user data caching, improve the query efficiency of the user data, and thus provide support for improving the recommendation efficiency of the recommended data.
[0018] It can be seen that the embodiments of the present application determine the active users of the user data caching of the multiple service groups in the set time period by using the hit information of the user data caching of the multiple service groups in the set time period, and thus the active users determined by the embodiments of the present application are the globally active users of the user data caching of the multiple service groups in the set time period as a whole, so that the embodiments of the present application can improve the user data caching hit rate of the multiple service groups in a certain time as a whole, so that the user data caching hit rate of the cloud service as a whole is improved, the query efficiency of the user data is improved as a whole, and thus effective support is provided for improving the recommendation efficiency of the recommended data. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions of the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0020] Figure 1A An example diagram of a recommendation process for creative script data.
[0021] Figure 1B Another example diagram of a recommendation process for creative script data.
[0022] Figure 2 An example diagram of the architecture of the data recommendation system provided by the embodiments of the present application.
[0023] Figure 3A flowchart of the data caching method provided by the embodiments of the present application.
[0024] Figure 4 An example diagram for obtaining hit information of multiple service groups.
[0025] Figure 5 An example diagram for determining service groups of user data of active users to be cached.
[0026] Figure 6 Another flowchart of the data caching method provided by the embodiments of the present application.
[0027] Figure 7 A block diagram of the data caching apparatus provided by the embodiments of the present application.
[0028] Figure 8 A block diagram of the data management server provided by the embodiments of the present application. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0030] Product marketing and other fields need to accurately recommend matching recommendation data for users. The recommendation data, such as creative script data, mainly uses text, sound, image, video, etc. as carriers for dissemination, and is script content data for promoting and popularizing products and services.
[0031] The recommendation data recommended for users needs to match user data such as user features, and based on users with similar or identical features, user groups can be formed, so that the data recommendation party can pre-prepare different user group data and make recommendation data corresponding to different user group data, wherein one user group data can be a collection of user data with similar or identical features. In one example, a creative script distributor markets and popularizes products and services, and the creative script distributor can make creative script data for different user groups, and the user features corresponding to different user groups are different, and the user features within one user group are similar or identical; that is, the creative script distributor can pre-prepare user groups (the user groups correspond to user groups) facing different feature users according to tags, and make creative script data corresponding to different user groups.
[0032] In the process of recommending the recommendation data to the user by using the cloud service, the cloud service can query the user data corresponding to the user when there is user traffic, and then determine the user group data corresponding to the user data, and recommend the recommendation data corresponding to the determined user group data to the user.
[0033] Taking the recommendation of creative script data to the user as an example, Figure 1A An example of a recommendation process of creative script data is shown in the example, Figure 1A As shown, when there is user traffic (for example, when the user accesses an application page or a website page), the cloud service 100 can determine and push the recommendation data to the user based on the user traffic delivered by the client 200; the cloud service 100 is provided with a service 110 for querying user data, and a recommendation data query service 120 for querying recommendation data; wherein the service 110 can be used to query the user characteristics of the user (the user characteristics are an example of the user data), and the user characteristics queried by the service 110 can be delivered to the recommendation data query service 120; the recommendation data query service 120 can determine the user group data corresponding to the user characteristics, and recommend the creative script data corresponding to the determined user group data to the user, so that the user can watch the matching creative script data when accessing the application page or the website page.
[0034] It can be seen that when determining the recommendation data (for example, creative script data) for the user, the user data (for example, user characteristics) of the user needs to be determined first, and therefore the query efficiency of the user data is crucial to the efficiency of determining the recommendation data. Based on this, the cloud service can cache the user data, thereby improving the query efficiency of the user data and improving the determination efficiency of the recommendation data.
[0035] In one example, taking the recommendation of creative script data to the user as an example, Figure 1B An example of another recommendation process of creative script data is shown in the example, Figure 1B As shown, the service 110 can cache part of the user characteristics through a data caching medium such as memory, and the user characteristics are an example of the user data, and the cached user data can be regarded as a user data cache 111; thereby, when there is user traffic, the service 110 can query whether there is user corresponding user characteristics in the user data cache 111; if yes, the user characteristics can be directly queried; if not, the service 110 can query the user corresponding user characteristics through a user characteristic library (the user characteristic library can be regarded as an example of a user database for storing user data); and then the user characteristics queried by the service 110 can be delivered to the recommendation data query service 120, the recommendation data query service 120 can determine the user group data corresponding to the user characteristics, and recommend the creative script data corresponding to the determined user group data to the user.
[0036] In the case of caching user data by cloud services, the cache hit rate of user data is crucial for the query efficiency of user data and has a significant impact on the recommendation efficiency of recommendation data. Therefore, improving the cache hit rate of user data can support the improvement of the recommendation efficiency of recommendation data.
[0037] However, when the service querying user data uses data cache media such as memory, the capacity of the data cache media such as memory that can be used by a single service is limited, which leads to limited cacheable user data, affecting the cache hit rate, and further affecting the QPS (Queries Per Second) and RT (Response Time) of cloud service recommendation data. It should be noted that the service querying user data can be regarded as a server or a virtual machine or a container service component running in a server as a service of a cloud service platform, and therefore the capacity of the data cache media such as memory that can be used by a single service corresponds to the capacity of the data cache media such as memory of the server where the service is located.
[0038] Based on this, the embodiments of the present application provide an improved data caching scheme. In the case of caching user data, the embodiments of the present application can improve the cache hit rate of user data, thereby improving the query efficiency of user data. Based on the fact that user data can be used to query recommendation data matched with the user, the embodiments of the present application can provide support for improving the recommendation efficiency of recommendation data in the case of improving the cache hit rate of user data.
[0039] As an optional implementation, Figure 2 An exemplary architecture example diagram of a data recommendation system provided by the embodiments of the present application is shown, which can be deployed on the side of cloud services, such as Figure 2 As shown, the architecture of the data recommendation system provided by the embodiments of the present application can include a traffic distributor 210, a service cluster 220, a data management server 230, and a recommendation data query service 120.
[0040] The service cluster 220 can include a plurality of service groups 1 to n (n is the number of service groups, which can be set according to actual conditions), and one service group can include a plurality of services for querying user data. The number of services in each service group can be set according to actual conditions, and the embodiments of the present application are not limited thereto. The number of services in different service groups can be the same or different. Figure 2 For ease of illustration, it is illustrated that one service group includes two services.
[0041] In combination with Figure 2As shown, each service can cache user data, and the services in the same service group cache the same user data, and the services in different service groups cache different user data (that is, the user data cached by different service groups is different); for example, the services in service group 1 can have the same user data cache 201, and so on, and the services in service group n can have the same user data cache 20n. In an optional implementation example, one service group can be implemented by a single server or a server group formed by multiple servers; when a service group is implemented by a single server, the services in the service group can be optional service components such as virtual machines or containers running on the server.
[0042] Optionally, the embodiments of the present application set multiple service groups in the service cluster, and the services in the same service group cache the same user data, and the services in different service groups cache different user data, the purpose of which is to cache as much user data as possible in the service cluster, and to improve the possibility of caching all user data as the cluster expands.
[0043] In an optional implementation, the user identifier can uniquely identify a user, and the user identifiers of different users are different, so that the services in the service group can cache the user identifier and the user data corresponding to the user identifier when caching user data. For example, the user data cache caches the user identifier and the user data corresponding to the user identifier. The user identifier can be a device identifier (such as a device number) of a terminal device used by the user, or a user account or other index information that can uniquely identify a user.
[0044] In the architecture of the data recommendation system provided by the embodiments of the present application, different service groups can query user data for different user groups, and one user group can be a set formed by multiple user identifiers, and the user identifiers in different user groups are different. Based on this, the embodiments of the present application can pre-set the correspondence between the service groups and the user groups, and record it in the traffic distributor 210; so that when there is user traffic, the traffic distributor 210 can determine the service group that queries the user data for the user according to the user group to which the user belongs and the correspondence between the service groups and the user groups; and then distribute the user traffic to the corresponding service group for processing. Optionally, the traffic distributor 210 can be regarded as a server or a service component on the cloud service side for implementing traffic distribution.
[0045] In one example, assuming that 600 users are divided into 3 groups, one group has 200 users, in the case of distinguishing users by user identifier, the first user group can record user identifiers 1-200, the second user group can record user identifiers 201-400, and the third user group can record user identifiers 301-600; further assuming that 3 service groups are set in the service cluster, in an optional implementation, the first user group can be set to correspond to the first service group (i.e., the first service group is responsible for querying user data corresponding to user identifiers 1-200), the second user group can be set to correspond to the second service group (i.e., the second service group is responsible for querying user data corresponding to user identifiers 201-400), and the third user group can be set to correspond to the third service group (i.e., the third service group is responsible for querying user data corresponding to user identifiers 401-600). It should be noted that in the case of recommending data to users, the scale of users is generally large, and the number of user identifiers is also large. The above example is only a simple example for ease of illustration, which should not limit the present application.
[0046] After obtaining the user traffic forwarded by the traffic distributor 210, the service group can query whether the user data cache hits. For example, the user data cache in the service group can cache user identifiers and user data corresponding to the user identifiers; based on the user identifier carried by the user traffic, the service group can determine whether the user data cache caches user data corresponding to the user identifier carried by the user traffic; if yes, it is determined that the user data cache hits; if no, it is determined that the user data cache misses. When processing user traffic, each service group can record the user identifier hit by the user data cache. For example, the service group can record the user identifier hit by the user data cache in the log.
[0047] After querying the user data (which can be queried in the user data cache of the service group, or can be queried from the user database in the case of user data cache miss), the service group can deliver the queried user data to the recommendation data query service 120. Thus, the recommendation data query service 120 can determine user group data corresponding to the user data according to the user data delivered by the service group, and recommend the recommendation data corresponding to the determined user group data to the user. Optionally, the recommendation data query service 120 can be regarded as a server or service component on the cloud service side for querying recommendation data.
[0048] In the case that the service group queries user data for the corresponding user group, in order to improve the hit rate of the user data cache of the service group, an embodiment of the present application can set a data management server 230; the data management server 230 can determine the active users of the user data cache of the plurality of service groups in the set time period based on the hit information of the user data cache of the plurality of service groups in the set time period, so as to cache the user data of the corresponding active users in the user data cache of each service group, thereby improving the overall hit rate of the user data cache of the plurality of service groups.
[0049] As an optional implementation, Figure 3 An exemplary optional flowchart of the data caching method provided by the embodiment of the present application is shown, and the method flow can be implemented by the data management server, which is described with reference to Figure 3 The method flow can include the following steps.
[0050] In step S310, the hit information of the user data cache of the plurality of service groups in the set time period is determined; wherein one service group is used to query user data for the corresponding user group, and the user groups corresponding to different service groups are different.
[0051] As described above, the service cluster includes a plurality of service groups, one service group is used to query user data for the corresponding user group, and the user groups corresponding to different service groups are different; and the user data cache of one service group is used to cache the user data of part of the users in the corresponding user group, and the user data cached by the user data cache of different service groups is different. Further, in an optional implementation, one service group can include a plurality of services for querying user data, and the services in the same service group have the same user data cache.
[0052] It should be noted that one user group can include a plurality of users, the users in different user groups are different, and the users are uniquely identified by user identifiers (i.e., the user identifier is used to uniquely identify the user).
[0053] As an optional implementation, the service group can query the user data based on the user traffic distributed by the traffic distributor; at this time, the service group can determine whether the user data cache has the user data corresponding to the user, so that the service group can record a hit record (for example, record the hit user identifier) when the user data cache has the user data corresponding to the user. In an optional implementation, the service group can record the hit record in the log, for example, the service group can record the user identifier hit by the user data cache in the log through the hit record. Therefore, the embodiment of the application can collect the logs of each service group, and select the hit record of the user data cache of each service group in a set time period from the logs of each service group, so as to obtain the hit record of the user data cache of the plurality of service groups in the set time period, wherein one hit record records one user identifier hit by the user data cache of one service group; further, according to the hit record of the user data cache of each service group in the set time period, the user identifier hit by the user data cache of the plurality of service groups in the set time period and the hit number of the user identifier are determined, so as to obtain the hit information of the user data cache of the plurality of service groups in the set time period.
[0054] For ease of illustration, Figure 4 An example diagram for obtaining the hit information of the plurality of service groups is exemplarily shown as Figure 4 As shown in the figure, taking n service groups as an example, the data management server can collect the logs of the n service groups respectively, the log of one service group records the hit record of the user data cache of the service group, and one hit record records one user identifier hit by the user data cache of the service group; therefore, the data management server can select the hit record of the user data cache of each service group in a set time period from the logs of each service group; for example, the hit record 401 of the user data cache of the service group 1 in the set time period records the user identifier hit by the user data cache of the service group 1 in the set time period each time; the hit record 402 of the user data cache of the service group 2 in the set time period records the user identifier hit by the user data cache of the service group 2 in the set time period each time; and so on, the hit record 40n of the user data cache of the service group n in the set time period records the user identifier hit by the user data cache of the service group n in the set time period each time.
[0055] Thus, the data management server can cache the user data of each service group according to the hit record (e.g., hit records 401-40n) of the set time period, count the user identifiers of the user data of the plurality of service groups cached in the set time period and the hit times of the user identifiers, and obtain the user identifiers of the user data of the plurality of service groups (e.g., n service groups) cached in the set time period and the hit times of the user identifiers, i.e., obtain the hit information of the user data of the plurality of service groups (e.g., n service groups) cached in the set time period.
[0056] In step S311, according to the hit information, the active users of the user data of the plurality of service groups cached in the set time period are determined.
[0057] In an optional implementation, the embodiment of the present application can determine the active users of the set time period on the global overall level of the user data of the plurality of service groups cached in the set time period according to the hit information of the user data of the plurality of service groups cached in the set time period. Optionally, the hit information of the user data of the plurality of service groups cached in the set time period can include the user identifiers of the user data of the plurality of service groups cached in the set time period and the hit times of the user identifiers; thus, the embodiment of the present application can sort the user identifiers of the user data of the plurality of service groups cached in the set time period according to the hit times of the user identifiers, and take the user identifiers in the set sorting range as the user identifiers of the active users, so as to determine the active users of the user data of the plurality of service groups cached in the set time period. For example, in the case of ascending sorting, the user identifiers before the set sorting order are taken as the user identifiers of the active users. As an optional implementation, when the set sorting range is defined, the embodiment of the present application can be determined based on the user data cache capacity that can be cached by the user data cache of the plurality of service groups.
[0058] In step S312, according to the corresponding relationship between the service groups and the user groups, the user data of the corresponding active users is cached in the user data cache by each service group.
[0059] Since one service group is used to query the user data of the corresponding user group, and the user data cache of one service group is responsible for caching the user data of part of the users in the corresponding user group, after the active users of the user data of the plurality of service groups cached in the set time period globally overall are determined, the embodiment of the present application can determine the service group corresponding to the active user (e.g., determine the service group corresponding to the user group where the active user is located) based on the user group corresponding to the service group for any active user, so as to control the service group corresponding to the active user to cache the user data of the active user in the user data cache.
[0060] That is, for any active user, the embodiment of the application needs to determine the target service group corresponding to the target user group where the active user is based on the correspondence between the service group and the user group, and take the target service group corresponding to the target user group as the service group for caching the user data of the active user, so as to control the target service group to cache the user data of the active user in the user data cache.
[0061] Optionally, for any active user, the data management server can pass the user identifier of the active user to the target service group after determining the target service group corresponding to the target user group where the active user is, so that the target service group caches the user data corresponding to the user identifier of the active user in the user data cache, thereby realizing the control of the target service group to cache the user data of the corresponding active user in the user data cache. For example, the result of determining the active user by the data management server can be written back to the corresponding service group, so that the service group can cache the user data of the corresponding active user in the user data cache.
[0062] In one implementation example, Figure 5 An example is shown to determine the service group where the user data of the active user is cached, as shown in Figure 5 As shown, assuming that there are m active users, which are active users 501 to 50m, for the active user 501, the data management server can determine the user group where the active user 501 is (for example, determine the user group containing the user identifier of the active user based on the user identifier of the active user), and assume that the user group where the active user 501 is is user group 511. Further, based on the correspondence between the service group and the user group, the embodiment of the application can determine the service group corresponding to the user group 511, and assume that the service group corresponding to the user group 511 is service group 1. Then the embodiment of the application can determine that the user data cache of the service group 1 is responsible for caching the user data of the active user 501. Further, the embodiment of the application can cache the user data of the active user 501 in the user data cache of the service group 1 (for example, cache the user identifier of the active user 501 and the corresponding user data in the user data cache of the service group 1). Each active user can be determined in the same way to determine the service group for caching the user data, so as to realize the caching of the user data in the service group corresponding to each active user.
[0063] In an optional implementation, based on the fact that one service group includes multiple services, the embodiment of the application can control the user data cache of each service in the service group to cache the user data of the active user after determining the service group corresponding to the active user.
[0064] The data caching method provided by the embodiments of the present application can set multiple service groups, and one service group queries user data for a corresponding user group, and the user groups corresponding to different service groups are different, and user data caches are set in each service group to cache user data of part of users in the corresponding user group; thus, the embodiments of the present application can determine the hit information of the user data caches of the multiple service groups in a set time period, and thus determine the active users of the user data caches of the multiple service groups in the set time period as a whole according to the hit information; further, according to the corresponding relationship between the service groups and the user groups, the user data of the corresponding active users is cached in the user data cache of each service group, so that the user data cache of each service group can cache the user data of the globally active users in the corresponding user group, thereby improving the cache hit rate of the user data cache of the multiple service groups as a whole; since the user data can be used to determine the recommended data matched with the user, the embodiments of the present application can improve the hit rate of the user data cache, improve the query efficiency of the user data, and provide support for improving the recommendation efficiency of the recommended data.
[0065] It can be seen that the embodiments of the present application determine the active users of the user data caches of the multiple service groups in the set time period by using the hit information of the user data caches of the multiple service groups in the set time period, and thus the active users determined by the embodiments of the present application are the globally active users of the user data caches of the multiple service groups in the set time period as a whole, so that the embodiments of the present application can improve the user data cache hit rate of the multiple service groups in a certain time as a whole, so that the user data cache hit rate of the cloud service as a whole is improved, and further effective support is provided for improving the recommendation efficiency of the recommended data.
[0066] In further optional implementations, the embodiments of the present application can distinguish the active users into real-time hot active users and quasi real-time hot active users; the user data of the real-time hot active users can be referred to as real-time hot user data, and the user data of the quasi real-time hot active users can be referred to as quasi real-time hot user data. The difference between the real-time hot active users and the quasi real-time hot active users lies in that the time periods for determining the real-time hot active users and the quasi real-time hot active users are different; for example, the time period for determining the real-time hot active users is shorter than the time period for determining the quasi real-time hot active users.
[0067] For ease of description, the embodiments of the present application can refer to the real-time hot active users as first-type active users, and the time period for determining the first-type active users as a first set time period; refer to the quasi real-time hot active users as second-type active users, and the time period for determining the second-type active users as a second set time period; and the first set time period is shorter than the second set time period. Optionally, Figure 6An exemplary another optional flow chart of the data caching method provided by the embodiments of the present application is shown in FIG. 6. Referring to FIG. 6, the method flow can include the following steps. Figure 6 The method flow can include the following steps.
[0068] In step S610, the user data caching of the plurality of service groups in a first hit information of a first set time period and in a second hit information of a second set time period is determined; the first set time period is shorter than the second set time period.
[0069] In the embodiments of the present application, the user data caching of the plurality of service groups in the first hit information of the first set time period can be used to determine the first type of active users, and the user data caching of the plurality of service groups in the second hit information of the second set time period can be used to determine the second type of active users. Wherein, the first set time period is shorter than the second set time period, that is, the active period of the first type of active users is shorter than the active period of the second type of active users; by distinguishing the first type of active users and the second type of active users, the embodiments of the present application can consider the active users of the user data caching of the plurality of service groups in the overall shorter period (such as the burst user traffic corresponding to the shorter period), and the active users of the user data caching of the plurality of service groups in the overall longer period (such as the user traffic continuously accessed in the longer period), so as to take into account the burst user traffic in the shorter period and the continuous user traffic in the longer period of the plurality of service groups as a whole, balance the cache hit situation of the burst users frequently accessing in a shorter time and the cache hit situation of the users continuously accessing for a long time, and realize balancing the overall performance of the user data caching of the plurality of service groups when facing different types of user traffic. In one example, the time length of the first set time period can be less than one day (such as the time length of the first set time period is half a day, etc.), and the time length of the second set time period can be greater than one day (such as the time length of the second set time period is 3 days, etc.).
[0070] In an optional implementation, the embodiments of the present application can collect logs of each service group; from the logs of each service group, hit records of the user data caching of each service group in the first set time period are selected and summarized; according to the hit records of the user data caching of each service group in the first set time period, user identifiers of the user data caching of the plurality of service groups in the first set time period and the hit times of the user identifiers are determined, so as to obtain the first hit information of the user data caching of the plurality of service groups in the first set time period.
[0071] In an optional implementation, the embodiment of the present application can collect logs of each service group; from the logs of each service group, select and aggregate the hit records of the user data cache of each service group in the second set time period; and according to the hit records of the user data cache of each service group in the second set time period, determine the user identifiers and the hit times of the user identifiers of the user data cache of the multiple service groups in the second set time period, to obtain the second hit information of the user data cache of the multiple service groups in the second set time period.
[0072] In step S611, according to the first hit information, determine the first type of active users of the multiple service groups in the first set time period; and according to the second hit information, determine the second type of active users of the multiple service groups in the second set time period; wherein the sum of the number of the first type of active users and the second type of active users corresponds to the cache capacity of the user data cache of the multiple service groups.
[0073] In the embodiment of the present application, the user data cache of the service group needs to cache the user data of the first type of active users and the user data of the second type of active users, and therefore for the multiple service groups as a whole, the sum of the number of the first type of active users and the second type of active users determined by the embodiment of the present application should correspond to the cache capacity of the user data cache of the multiple service groups. For example, the sum of the user data amount of the first type of active users and the second type of active users matches the cache capacity of the user data cache of the multiple service groups. In an implementation example, in the case of setting the total number of active users (the user data amount of the set total number of active users matches the cache capacity of the user data cache of the multiple service groups), the embodiment of the present application can define the proportion of the first type of active users in the set total number of active users, and the proportion of the second type of active users in the set total number of active users; the proportions of the first type of active users and the second type of active users in the set total number of active users can be determined according to actual conditions, and the embodiment of the present application is not limited thereto.
[0074] As an optional implementation of determining the first type of active users, the first type of active users can be determined based on first hit information of user data cache of the plurality of service groups in a first set time period, wherein the first hit information of user data cache of the plurality of service groups in the first set time period comprises user identifiers hit by user data cache of the plurality of service groups in the first set time period and hit times of the user identifiers. Thus, based on the first hit information of user data cache of the plurality of service groups in the first set time period, the embodiments of the present application can sort the user identifiers hit by user data cache of the plurality of service groups in the first set time period according to the hit times of the user identifiers, and take the user identifiers in a first set sorting range as the user identifiers of the first type of active users. For example, the user identifiers of the first type of active users are the user identifiers in the first set sorting range after sorting the first hit information of user data cache of the plurality of service groups in the first set time period according to the hit times of the user identifiers.
[0075] As an optional implementation of determining the second type of active users, the second type of active users can be determined based on second hit information of user data cache of the plurality of service groups in a second set time period, wherein the second hit information of user data cache of the plurality of service groups in the second set time period comprises user identifiers hit by user data cache of the plurality of service groups in the second set time period and hit times of the user identifiers. Thus, based on the second hit information of user data cache of the plurality of service groups in the second set time period, the embodiments of the present application can sort the user identifiers hit by user data cache of the plurality of service groups in the second set time period according to the hit times of the user identifiers, and take the user identifiers in a second set sorting range as the user identifiers of the second type of active users. For example, the user identifiers of the second type of active users are the user identifiers in the second set sorting range after sorting the second hit information of user data cache of the plurality of service groups in the second set time period according to the hit times of the user identifiers.
[0076] Optionally, the sum of the user data amount of the first type of active users and the second type of active users matches the cache capacity of the user data cache of the plurality of service groups; the total number of the user identifiers in the first set ranking range and the second set ranking range corresponds to the set total number of active users; and the user data amount of the set total number of active users matches the cache capacity of the user data cache of the plurality of service groups, so that the user data of the first type of active users and the second type of active users determined by the embodiments of the present application can be cached in the user data cache of the plurality of service groups. It should be noted that, in the case that the user data amount of the set total number of active users matches the cache capacity of the user data cache of the plurality of service groups, the number of the first type of active users and the number of the second type of active users can be determined according to actual conditions, such as defining the proportion of the first type of active users in the total number of active users and the proportion of the second type of active users in the total number of active users according to actual conditions, and the embodiments of the present application are not limited thereto.
[0077] In step S612, according to the correspondence between the service groups and the user groups, the user data of the corresponding first type of active users and the user data of the corresponding second type of active users are cached in the user data cache by the respective service groups.
[0078] After determining that the user data cache of the plurality of service groups caches the first type of active users in the first set time period and the second type of active users in the second set time period, the embodiments of the present application can control the service group corresponding to the user group of the first type of active users to cache the user data of the first type of active users in the user data cache, and control the service group corresponding to the user group of the second type of active users to cache the user data of the second type of active users in the user data cache. For example, the user data of the first type of active users is cached in the user data cache of the service group corresponding to the user group, and the user data of the second type of active users is cached in the user data cache of the service group corresponding to the user group.
[0079] Optionally, for any first type of active user, the embodiments of the present application can determine the target service group corresponding to the target user group where the first type of active user is located based on the correspondence between the service groups and the user groups, and control the target service group to cache the user data of the first type of active user in the user data cache. In one implementation example, after determining the target service group corresponding to the target user group where the first type of active user is located, the data management server can pass the user identifier of the first type of active user to the target service group, so that the target service group caches the user data corresponding to the user identifier of the first type of active user in the user data cache.
[0080] Optionally, for any second-type active user, the embodiment of the present application can determine the target service group corresponding to the target user group in which the second-type active user is located based on the correspondence between the service groups and the user groups, and control the target service group to cache the user data of the second-type active user in the user data cache. In one implementation example, after determining the target service group corresponding to the target user group in which the second-type active user is located, the data management server can pass the user identifier of the second-type active user to the target service group, so that the target service group caches the user data corresponding to the user identifier of the second-type active user in the user data cache.
[0081] The embodiment of the present application determines the first-type active users in the overall first set time period and the second-type active users in the overall second set time period based on the user data caching of the plurality of service groups, and caches the user data of the first-type active users and the second-type active users in the user data cache of the corresponding service groups, respectively. This can make the user data caching of the plurality of service groups take into account the cache hit rate of the short-term burst user traffic of the cloud service and the cache hit rate of the long-term continuous user traffic. For example, the cache hit rate of the burst user hotspot traffic is guaranteed. For example, through the caching of the user data of the second-type active users, accidental / burst active user fluctuations of a single service can be avoided; for example, the situation that the cache hit rate temporarily rises but then sharply drops due to the caching of accidental / burst active user data of a single service. Therefore, the embodiment of the present application can balance the cache hit rate of the burst user frequent access in a short time and the cache hit rate of the user long-term continuous access, balance the overall performance of the user data caching of the plurality of service groups in the face of different types of user traffic, thereby overall improving the hit rate of the user data caching of the plurality of service groups, and further providing effective support for improving the recommendation efficiency of the recommended data.
[0082] The data caching device provided by the embodiment of the present application is introduced below. The data caching device described below can be regarded as a functional module required to be set by the data management server to implement the data caching method provided by the embodiment of the present application. The content described below can be mutually corresponding and referred to with the content described above.
[0083] As an optional implementation, Figure 7 An optional block diagram of the data caching device provided by the embodiment of the present application is exemplarily shown. The device can be applied to a data management server, and the device is described with reference to Figure 7 The device can include:
[0084] The hit information determination module 710 is configured to determine hit information of user data caching of a plurality of service groups in a set time period; wherein one service group is configured to query user data for a corresponding user group, different service groups correspond to different user groups, and user data caching of one service group is configured to cache user data of part of users in the corresponding user group, and user data cached by user data caching of different service groups is different;
[0085] The active user determination module 711 is configured to determine active users of the plurality of service groups in the set time period according to the hit information of user data caching of the plurality of service groups in the set time period.
[0086] The cache writing module 712 is configured to control each service group to cache user data of a corresponding active user in the user data cache according to a corresponding relationship between the service group and the user group.
[0087] Optionally, the user data cache caches user identifiers and user data corresponding to the user identifiers, wherein the user identifiers are configured to uniquely identify users; and the hit information of user data caching of the plurality of service groups in the set time period comprises user identifiers hit by user data caching of the plurality of service groups in the set time period and hit times of the user identifiers.
[0088] Correspondingly, the active user determination module 711 is configured to determine active users of the plurality of service groups in the set time period according to the hit information of user data caching of the plurality of service groups in the set time period, comprising:
[0089] sorting the user identifiers hit by user data caching of the plurality of service groups in the set time period according to the hit times of the user identifiers;
[0090] taking the user identifiers in a set sorting range as user identifiers of the active users.
[0091] Optionally, the cache writing module 712 is configured to control each service group to cache user data of a corresponding active user in the user data cache according to a corresponding relationship between the service group and the user group, comprising:
[0092] for any active user, determining a target service group corresponding to a target user group in which the active user is located based on the corresponding relationship between the service group and the user group, and controlling the target service group to cache user data of the active user in the user data cache.
[0093] Optionally, the hit information determination module 710 is configured to determine the hit information of user data caching of the plurality of service groups in the set time period, comprising:
[0094] collecting logs of the service groups, wherein the logs of a service group record hit records of the user data cache of the service group, and each hit record records a user identifier of a hit of the user data cache of the service group;
[0095] selecting, from the logs of the service groups, hit records of the user data cache of the service groups within a set time period;
[0096] determining, according to the hit records of the user data cache of the service groups within the set time period, user identifiers of hits of the user data cache of the service groups within the set time period and hit times of the user identifiers, to obtain hit information of the user data cache of the service groups within the set time period.
[0097] Optionally, the active users include first-type active users and second-type active users; the set time period includes a first set time period for determining the first-type active users and a second set time period for determining the second-type active users, and the first set time period is shorter than the second set time period; wherein a sum of user data amounts of the first-type active users and the second-type active users matches a cache capacity of the user data cache of the service groups.
[0098] Optionally, the first-type active users are determined based on first hit information of the user data cache of the service groups within the first set time period, wherein the first hit information of the user data cache of the service groups within the first set time period includes user identifiers of hits of the user data cache of the service groups within the first set time period and hit times of the user identifiers.
[0099] The second-type active users are determined based on second hit information of the user data cache of the service groups within the second set time period, wherein the second hit information of the user data cache of the service groups within the second set time period includes user identifiers of hits of the user data cache of the service groups within the second set time period and hit times of the user identifiers.
[0100] Optionally, the user identifiers of the first-type active users are user identifiers that are within a first set sorting range after sorting, according to the hit times, of the user identifiers in the first hit information of the user data cache of the service groups within the first set time period.
[0101] The user identifiers of the second-type active users are user identifiers that are within a second set sorting range after sorting, according to the hit times, of the user identifiers in the second hit information of the user data cache of the service groups within the second set time period.
[0102] The total number of the user identifiers in the first set ranking range and the user identifiers in the second set ranking range corresponds to the set total active user number; and the user data amount of the set total active user number matches the cache capacity of the user data cache of the plurality of service groups.
[0103] For the first type of active user, the user data of the first type of active user is cached in the user data cache of the service group corresponding to the user group; and for the second type of active user, the user data of the second type of active user is cached in the user data cache of the service group corresponding to the user group.
[0104] The data management server provided in the embodiments of the present application can set the data cache device to implement the data cache method provided in the embodiments of the present application. In an implementation example, the data management server has at least a log collection function and a hot data determination function.
[0105] The log collection function can be used to collect logs of the plurality of service groups to determine the hit information of the user data cache of the plurality of service groups in a set time period. For example, the log collection function can be used to collect logs of the plurality of service groups to determine the first hit information of the user data cache of the plurality of service groups in a first set time period and the second hit information of the user data cache of the plurality of service groups in a second set time period.
[0106] The hot data determination function can be used to determine the active user of the user data cache of the plurality of service groups in a set time period based on the hit information of the user data cache of the plurality of service groups in the set time period, and control the user data of the corresponding active user to be cached in the user data cache by each service group according to the corresponding relationship between the service group and the user group. Optionally, in the case of distinguishing the first type of active user and the second type of active user, the hot data determination function should have the ability to determine the first type of active user and the second type of active user, and the related content can be referred to the description of the foregoing part.
[0107] In an optional architecture implementation of the data management server, Figure 8 An optional block diagram of the data management server provided in the embodiments of the present application is shown as follows. Figure 8 As shown in the figure, the data management server can include at least one processor 81, at least one communication interface 82, at least one memory 83 and at least one communication bus 84.
[0108] In the embodiments of the present application, the number of the processor 81, the communication interface 82, the memory 83 and the communication bus 84 is at least one, and the processor 81, the communication interface 82 and the memory 83 complete the communication among each other through the communication bus 84.
[0109] Optionally, the communication interface 82 can be an interface of a communication module for network communication.
[0110] Optionally, the processor 81 can be a CPU, a GPU (Graphics Processing Unit), an NPU (Neural Processing Unit), an FPGA (Field Programmable Gate Array), a TPU (Tensor Processing Unit), an AI chip, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application, etc.
[0111] The memory 83 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.
[0112] The memory 83 stores one or more computer executable instructions, and the processor 81 invokes the one or more computer executable instructions to execute the data caching method provided by the embodiments of the present application.
[0113] The embodiments of the present application also provide a recommendation system, which combines the data caching method provided by the embodiments of the present application. Figure 2 As shown in the figure, the recommendation system can include a traffic distributor, a service cluster, a data management server, and a recommendation data query service.
[0114] The traffic distributor is configured to distribute user traffic to a corresponding service group in the service cluster according to the correspondence between the user group and the service group.
[0115] The service cluster includes a plurality of service groups, one service group queries user data for a corresponding user group, different service groups correspond to different user groups, and the user data cache of one service group is used to cache user data of part of the users in the corresponding user group, and the user data cached by the user data caches of different service groups are different; wherein one service group includes a plurality of services for querying user data.
[0116] After receiving the user traffic distributed by the traffic distributor, the service group queries the user data corresponding to the user, and delivers the queried user data to the recommendation data query service; the user data queried by the service group is cached in the user data cache of the service group or stored in the user database.
[0117] The data management server is the data management server provided by the embodiments of the present application.
[0118] The recommended data query service is configured to determine user group data corresponding to the user data according to the user data transmitted by the service group, and recommend the recommended data corresponding to the determined user group data to the user.
[0119] The application further provides a storage medium storing one or more computer executable instructions, which, when executed, implement the data caching method provided in the embodiments of the application.
[0120] The application further provides a computer program, which, when executed, implements the data caching method provided in the embodiments of the application.
[0121] The above describes a plurality of embodiment schemes provided by the embodiments of the application, and each optional mode introduced by each embodiment scheme can be combined, cross-referenced in the case of no conflict, thereby extending a plurality of possible embodiment schemes, which can be considered as the embodiment schemes disclosed and published by the embodiments of the application.
[0122] Although the embodiments of the application are disclosed as above, the application is not limited thereto. Any person skilled in the art, without departing from the spirit and scope of the application, can make various changes and modifications, and therefore the protection scope of the application should be subject to the range defined by the claims.
Claims
1. A data caching method, wherein, The method comprises: determining hit information of user data caches of a plurality of service groups in a set time period; wherein one service group is used to query user data for a corresponding user group, different service groups correspond to different user groups, and the user data cache of one service group is used to cache user data of part of users in the corresponding user group, and the user data caches of different service groups cache different user data; a service group judges whether the user data cache caches user data corresponding to a user identifier carried by user traffic; if yes, it is determined that the user data cache hits; if not, it is determined that the user data cache misses; determining active users of the user data caches of the plurality of service groups in the set time period according to the hit information of the user data caches of the plurality of service groups in the set time period; controlling each service group to cache user data of corresponding active users in the user data cache according to the correspondence between the service groups and the user groups.
2. The method of claim 1, wherein, The user data cache caches user identifiers and user data corresponding to the user identifiers, wherein the user identifiers are used to uniquely identify users; the hit information of the user data caches of the plurality of service groups in the set time period comprises: user identifiers hit by the user data caches of the plurality of service groups in the set time period and hit times of the user identifiers. The method of determining the active users of the user data caches of the plurality of service groups in the set time period according to the hit information of the user data caches of the plurality of service groups in the set time period comprises: sorting the user identifiers hit by the user data caches of the plurality of service groups in the set time period according to the hit times of the user identifiers; taking user identifiers in a set sorting range as user identifiers of active users.
3. The method of claim 1, wherein, The method of controlling each service group to cache user data of corresponding active users in the user data cache according to the correspondence between the service groups and the user groups comprises: for any active user, determining a target service group corresponding to a target user group in which the active user is located based on the correspondence between the service groups and the user groups, and controlling the target service group to cache user data of the active user in the user data cache.
4. The method of claim 2, wherein, The method of determining the hit information of the user data caches of the plurality of service groups in the set time period comprises: collecting logs of each service group, wherein the logs of one service group record hit records of the user data cache of the service group, and one hit record records one user identifier hit by the user data cache of the service group; selecting hit records of the user data caches of each service group in the set time period from the logs of each service group; determining user identifiers hit by the user data caches of the plurality of service groups in the set time period and hit times of the user identifiers according to the hit records of the user data caches of each service group in the set time period, so as to obtain the hit information of the user data caches of the plurality of service groups in the set time period.
5. The method according to any one of claims 1 to 4, wherein, The active users include first-type active users and second-type active users; the set time period includes a first set time period for determining the first-type active users and a second set time period for determining the second-type active users, the first set time period being shorter than the second set time period; wherein the sum of the user data amounts of the first-type active users and the second-type active users matches the cache capacity of the user data caches of the plurality of service groups.
6. The method of claim 5, wherein, The first-type active users are determined based on first hit information of the user data caches of the plurality of service groups in the first set time period, wherein the first hit information of the user data caches of the plurality of service groups in the first set time period includes user identifiers that hit the user data caches of the plurality of service groups in the first set time period and hit times of the user identifiers; The second-type active users are determined based on second hit information of the user data caches of the plurality of service groups in the second set time period, wherein the second hit information of the user data caches of the plurality of service groups in the second set time period includes user identifiers that hit the user data caches of the plurality of service groups in the second set time period and hit times of the user identifiers.
7. The method of claim 6, wherein, The user identifiers of the first-type active users are the user identifiers that are in a first set sorting range after sorting the first hit information of the user data caches of the plurality of service groups in the first set time period according to the hit times of the user identifiers; The user identifiers of the second-type active users are the user identifiers that are in a second set sorting range after sorting the second hit information of the user data caches of the plurality of service groups in the second set time period according to the hit times of the user identifiers; The total number of the user identifiers in the first set sorting range and the user identifiers in the second set sorting range corresponds to a set total active user number; the user data amount of the set total active user number matches the cache capacity of the user data caches of the plurality of service groups; For the first-type active users, the user data of the first-type active users is cached in the user data caches of the service groups corresponding to the user groups; for the second-type active users, the user data of the second-type active users is cached in the user data caches of the service groups corresponding to the user groups.
8. A data management server, wherein, The data cache method includes at least one memory and at least one processor, the memory stores one or more computer executable instructions, and the processor invokes the one or more computer executable instructions to execute the data cache method according to any one of claims 1-7.
9. A recommendation system, wherein, The data cache method includes: a traffic distributor, a service cluster, a data management server, and a recommended data query service; The data management server is the data management server according to claim 8; The traffic distributor is configured to distribute user traffic to corresponding service groups in the service cluster according to the correspondence between the user groups and the service groups. The service cluster comprises a plurality of service groups, one service group queries user data for a corresponding user group, different service groups correspond to different user groups, and user data caches of one service group are used to cache user data of part of users in the corresponding user group, and user data caches of different service groups cache different user data; After receiving user traffic distributed by the traffic distributor, the service group queries user data corresponding to the user, and transmits the queried user data to the recommendation data query service; the user data queried by the service group is cached in the user data cache of the service group or stored in the user database; The recommendation data query service is configured to determine user group data corresponding to the user data according to the user data transmitted by the service group, and recommend the recommendation data corresponding to the determined user group data to the user.
10. A storage medium, wherein, The storage medium stores one or more computer executable instructions, and the one or more computer executable instructions are executed to implement the data caching method according to any one of claims 1-7.
Citation Information
Patent Citations
Data caching method and system
CN106372156A
Distributed system and traffic distribution method and device for distributed system
CN108924244A