Activity Query Method and Device Based on Distributed Cache, Computer Device, Readable Medium and Program Product

By setting up cache nodes in the distributed cache system, querying and filtering activity lists based on user identification codes, the query bottleneck problem in distributed applications is solved, and the query success rate and system performance are improved.

CN115665179BActive Publication Date: 2025-07-29INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211410384.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-11
Publication Date
2025-07-29
Estimated Expiration
2042-11-11

AI Technical Summary

Technical Problem

In distributed application scenarios, there is a single-point performance bottleneck when querying active lists, resulting in query failure and degrading overall performance.

Method used

By setting up a distributed cache node, matching the corresponding cache nodes according to the user identification code, querying the full activity list and filtering out the user activity list based on the user class table to avoid bottlenecks in public resource query.

Benefits of technology

It improves the query success rate, improves the overall performance capacity and query success rate, and realizes flexible expansion of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665179B_ABST
    Figure CN115665179B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention provides a method and apparatus for activity query based on distributed cache, which can be used in the field of artificial intelligence technology. The method includes: obtaining a user access request, where the user access request includes a user identification code; matching a corresponding distributed cache node according to the user identification code; querying a full activity list from the distributed cache node; and screening out a corresponding user activity list from the full activity list according to the user identification code based on a pre-set user class table. By setting up distributed cache nodes and performing separate query processing on access requests, it is possible to avoid the query bottleneck of public resources, improve the query success rate, and improve the overall performance.
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, in particular to the field of artificial intelligence technology, and more particularly to a method and device for querying activities based on distributed caching. Background Art

[0002] In existing distributed application scenarios, requests from different users can be routed to specified sub-layers for processing, thereby achieving flexible expansion of the system's concurrent throughput capacity. For common content such as activity lists, they are shared and used in all sub-layers of the rights and interests service layer. In related technologies, during each query process, it is necessary to call the common service layer to obtain the activity list from the common database. When a large number of accesses flood in, there is a single-point performance bottleneck limitation, resulting in query failures and reducing the overall performance. Summary of the Invention

[0003] An object of the present invention is to provide a method for querying activities based on distributed caching. By setting up distributed cache nodes and performing separate query processing on access requests, it can avoid the query bottleneck of common resources, improve the query success rate, and enhance the overall performance. Another object of the present invention is to provide a device for querying activities based on distributed caching. Another object of the present invention is to provide a computer-readable medium. Still another object of the present invention is to provide a computer device.

[0004] To achieve the above objects, on the one hand, the present invention discloses a method for querying activities based on distributed caching, including:

[0005] Obtain a user access request, where the user access request includes a user identification code;

[0006] Match the corresponding distributed cache node according to the user identification code;

[0007] Query the full activity list from the distributed cache node;

[0008] According to a pre-set user class list, screen out the corresponding user activity list from the full activity list according to the user identification code.

[0009] Preferably, matching the corresponding distributed cache node according to the user identification code includes:

[0010] Perform a hash calculation on the user identification code to obtain a service layer key value;

[0011] Match the corresponding service sub-layer according to the service layer key value;

[0012] Match the corresponding distributed cache node according to the service sub-layer.

[0013] Preferably, querying the full activity list from the distributed cache node includes:

[0014] Send an active acquisition request to the distributed cache node;

[0015] Receive the full active list sent by the distributed cache node within a set time period.

[0016] Preferably, the method further includes:

[0017] If the full active list sent by the distributed cache node is not received within the set time period or an abnormal message is received, determine whether the current number of abnormal times is greater than or equal to the abnormal times threshold;

[0018] If so, call the common service layer to obtain the full active list from the corresponding common database;

[0019] If not, increment the current number of abnormal times by 1 and repeat the step of sending an active acquisition request to the distributed cache node.

[0020] Preferably, the user class table includes a user identification code and the corresponding user class information, and the full active list includes multiple activities and the user condition information corresponding to each activity;

[0021] According to the pre-set user class table, filter out the corresponding user active list from the full active list according to the user identification code, including:

[0022] Through the user class table, match the corresponding user class information according to the user identification code;

[0023] Through the full active list, match the user class information with the user condition information to filter out the corresponding user active list.

[0024] Preferably, the method further includes:

[0025] Call the common service layer to perform periodic update on the distributed cache node according to the corresponding common database.

[0026] Preferably, after filtering out the corresponding user active list from the full active list according to the pre-set user class table according to the user identification code, it further includes:

[0027] Visually display the user active list.

[0028] The present invention also discloses an activity query device based on a distributed cache, including:

[0029] An acquisition unit, configured to acquire a user access request, where the user access request includes a user identification code;

[0030] A matching unit, configured to match the corresponding distributed cache node according to the user identification code;

[0031] A query unit for querying a full activity list from distributed cache nodes;

[0032] A filtering unit for filtering out a corresponding user activity list from the full activity list according to a pre-set user class table and a user identification code.

[0033] The present invention also discloses a computer-readable medium having a computer program stored thereon, and when the program is executed by a processor, the above-described method is implemented.

[0034] The present invention also discloses a computer device including a memory and a processor, where the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and when the processor executes the program, the above-described method is implemented.

[0035] The present invention also discloses a computer program product including computer programs / instructions, and when the computer programs / instructions are executed by a processor, the above-described method is implemented.

[0036] The present invention obtains a user access request, where the user access request includes a user identification code; according to the user identification code, a corresponding distributed cache node is matched; a full activity list is queried from the distributed cache node; according to a pre-set user class table, a corresponding user activity list is filtered out from the full activity list according to the user identification code. By setting up distributed cache nodes and performing separate query processing on access requests, it is possible to avoid the query bottleneck of public resources, improve the query success rate, and improve the overall performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.

[0038] Figure 1 A schematic structural diagram of an activity query system based on distributed cache provided by an embodiment of the present invention;

[0039] Figure 2 A flowchart of an activity query method based on distributed cache provided by an embodiment of the present invention;

[0040] Figure 3 A flowchart of another activity query method based on distributed cache provided by an embodiment of the present invention;

[0041] Figure 4Schematic diagram of a structure of an activity query device based on distributed cache provided by an embodiment of the present invention;

[0042] Figure 5 Schematic diagram of a structure of a computer device provided by an embodiment of the present invention. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0044] It should be noted that a method and device for activity query based on distributed cache disclosed in this application can be used in the field of artificial intelligence technology, and can also be used in any field other than the field of artificial intelligence technology. The application field of the method and device for activity query based on distributed cache disclosed in this application is not limited.

[0045] To facilitate understanding of the technical solutions provided in this application, the relevant content of the technical solutions in this application will be described first. Against the background of the transformation from the traditional operation mode to digital operation, each enterprise is promoting the construction of an enterprise-level Internet intelligent operation platform, and building an operation platform centered on users and covering four operation capabilities: channel operation, product operation, user operation, and content operation. The scenarios applicable to the present invention include that when a user logs in to a relevant channel application (such as mobile banking), the full activity list obtained is matched according to the user's information (such as region, customer group, label, etc.), and the activity list that meets the current user is filtered out and displayed.

[0046] Based on the premise that the distributed cache internally supports performance capacity expansion through multi-node concurrency, the hash structure of the activity list is stored in different nodes of the distributed cache. Then, different distributed cache nodes are respectively allocated to different service sub-layers for access, so as to improve the overall performance capacity to N transaction processing volumes (Transaction Per Second, abbreviated as: tps) of 100 - 150 per second.

[0047] Figure 1 Schematic diagram of a structure of an activity query system based on distributed cache provided by an embodiment of the present invention, as Figure 1As shown in the figure, the system includes a rights and interests service access layer, multiple database sub-layers, a public service layer, a public database, and cache access nodes. The rights and interests service access layer is respectively connected to the public service layer and the cache access nodes, and the public service layer is respectively connected to the public database and the cache access nodes. The rights and interests service access layer includes multiple service sub-layers, and each service sub-layer is connected to the corresponding database sub-layer. The multiple service sub-layers are rights and interests service layer set1, rights and interests service layer set2, ……, rights and interests service layer setN, and the multiple database sub-layers are database set1, database set2, ……, database setN. Rights and interests service layer set1 corresponds to database set1, rights and interests service layer set2 corresponds to database set2, ……, rights and interests service layer setN corresponds to database setN. Rights and interests service layer set1 is connected to database set1, rights and interests service layer set2 is connected to database set2, ……, rights and interests service layer setN is connected to database setN. The cache access nodes include multiple distributed cache nodes, specifically distributed cache node 1, distributed cache node 2, distributed cache node 3, ……, distributed cache node N.

[0048] It should be noted that Figure 1 The activity query system based on distributed cache shown in the figure is also applicable to Figure 2 or Figure 3 The activity query method based on distributed cache, which will not be elaborated here.

[0049] Taking the activity query device based on distributed cache as the execution subject as an example below, the implementation process of the activity query method based on distributed cache provided by the embodiments of the present invention will be described. It can be understood that the execution subject of the activity query method based on distributed cache provided by the embodiments of the present invention includes but is not limited to the activity query device based on distributed cache.

[0050] Figure 2 It is a flowchart of an activity query method based on distributed cache provided by an embodiment of the present invention. As Figure 2 shown in the figure, the method includes:

[0051] Step 101: Obtain a user access request, and the user access request includes a user identification code.

[0052] Step 102: Match the corresponding distributed cache node according to the user identification code.

[0053] Step 103: Query the full activity list from the distributed cache node.

[0054] Step 104: According to the pre-set user class table, screen out the corresponding user activity list from the full activity list according to the user identification code.

[0055] In the technical solution provided by the embodiment of the present invention, a user access request is obtained, and the user access request includes a user identification code; according to the user identification code, a corresponding distributed cache node is matched; a full activity list is queried from the distributed cache node; according to a pre-set user class list, a corresponding user activity list is filtered from the full activity list according to the user identification code. By setting up distributed cache nodes and performing separate query processing on access requests, it is possible to avoid the query bottleneck of public resources, improve the query success rate, and improve the overall performance.

[0056] Figure 3 It is a flowchart of another activity query method based on distributed cache provided by the embodiment of the present invention. As shown in Figure 3 shown, the method includes:

[0057] Step 201: Obtain a user access request, and the user access request includes a user identification code.

[0058] In the embodiment of the present invention, each step is executed by an activity query device based on distributed cache.

[0059] In the embodiment of the present invention, the user identification code (Userid) can uniquely identify a user. After the user logs in to the relevant channel application, a user access request is generated to obtain an activity list for display to the user.

[0060] Step 202: Perform a hash calculation on the user identification code to obtain a service layer key value.

[0061] In the embodiment of the present invention, a hash calculation is performed on the user identification code (Userid) to obtain a service layer key value (Key). As an alternative solution, through Hash(Userid) % N, a hash calculation is performed on the user identification code (Userid) to obtain a service layer key value (Key), where N is the number of service sub-layers.

[0062] In the embodiment of the present invention, the service layer key value (Key) can uniquely identify a service sub-layer.

[0063] Step 203: Match a corresponding service sub-layer according to the service layer key value.

[0064] In the embodiment of the present invention, each service sub-layer has a service layer key value (Key), and the identification number of each service sub-layer is pre-allocated. Specifically, through the hash algorithm and the number of service sub-layers N, the service layer key value (Key) is allocated to achieve a discrete effect. For example: each Key value is allocated to a service sub-layer.

[0065] Specifically, the service layer key value (Key) is matched with the Key value of each service sub-layer to obtain a corresponding service sub-layer.

[0066] Step 204: Match the corresponding distributed cache node according to the service sub-layer.

[0067] Specifically, each service sub-layer corresponds to a distributed cache node; match the corresponding distributed cache node according to the service sub-layer.

[0068] Step 205: Query the full activity list from the distributed cache node.

[0069] Specifically, according to the Key value, send an activity acquisition request to the corresponding distributed cache node; receive the full activity list sent by the distributed cache node within the set time period. Here, the time period is set in advance according to actual needs, and the embodiments of the present invention do not limit this.

[0070] In the embodiments of the present invention, the full activity list is stored in each distributed cache node.

[0071] Further, if the full activity list sent by the distributed cache node is not received within the set time period or an abnormal message is received, determine whether the current number of exceptions is greater than or equal to the exception count threshold; if so, call the common service layer to obtain the full activity list from the corresponding common database; if not, increment the current number of exceptions by 1, and repeat the step of sending an activity acquisition request to the distributed cache node until the full activity list is obtained or the current number of exceptions is greater than or equal to the exception count threshold. As an optional solution, the initial value of the current number of exceptions is 0, and the exception count threshold is 2.

[0072] Step 206: According to the pre-set user class table, screen out the corresponding user activity list from the full activity list according to the user identification code.

[0073] In the embodiments of the present invention, the user class table can be set according to actual needs. As an optional solution, the user class table includes the user identification code and the corresponding user class information, and the full activity list includes various activities and the user condition information corresponding to each activity. The user class information includes, but is not limited to, region, customer group, and label; the user condition information includes, but is not limited to, region, customer group, and label.

[0074] In the embodiments of the present invention, step 206 specifically includes:

[0075] Step 2061: Through the user class table, match the corresponding user class information according to the user identification code.

[0076] In the embodiments of the present invention, match the user identification code in the user access request with the user identification code in the user class table to obtain the corresponding user class information.

[0077] Step 2062: Match the user class information with the user condition information through the full activity list, and filter out the corresponding user activity list.

[0078] In the embodiment of the present invention, the user class information is matched with the user condition information, and the matching activities are filtered out; according to the filtered activities, a user activity list is generated. The activities in the user activity list are activities that the user can participate in and match the user.

[0079] Further, call the public service layer to periodically update the distributed cache nodes according to the corresponding public database. The public service layer is connected to the public database, and the public database stores the full activity list and periodically updates the distributed cache nodes and the rights and interests service access sub-layer.

[0080] Step 207: Visualize the user activity list.

[0081] In the embodiment of the present invention, the user activity list is visualized so that the user can view the activities that can be participated in.

[0082] In the embodiment of the present invention, by introducing distributed cache nodes, the bottleneck of public resource query is avoided, and the query performance capacity is improved. Through the design of distributed cache nodes, the full-node update of public resources is realized, and at the same time, discrete access allocation is performed according to the public resource user ID, thereby improving the overall performance capacity; in the distributed application architecture, the nodes of the rights and interests service layer can be horizontally scaled, and the distributed cache nodes can also be horizontally scaled. The corresponding relationship between the two can be one-to-one, or automatic discrete matching can be performed through the cache access node. The two are horizontally scaled respectively, and theoretically, infinite scaling can be performed, further improving the performance capacity of the entire system.

[0083] In the technical solution of the activity query method based on distributed cache provided by the embodiment of the present invention, a user access request is obtained, and the user access request includes a user identification code; according to the user identification code, the corresponding distributed cache node is matched; the full activity list is queried from the distributed cache node; according to the pre-set user class table, the corresponding user activity list is filtered out from the full activity list according to the user identification code. By setting distributed cache nodes, the access requests are separately queried and processed, which can avoid the bottleneck of public resource query, improve the query success rate, and improve the overall performance.

[0084] Figure 4 It is a structural schematic diagram of an activity query device based on distributed cache provided by an embodiment of the present invention. This device is used to execute the above-mentioned activity query method based on distributed cache, as Figure 4 shown. This device includes: an acquisition unit 11, a matching unit 12, a query unit 13, and a filtered activity 14.

[0085] The obtaining unit 11 is configured to obtain a user access request, and the user access request includes a user identification code.

[0086] The matching unit 12 is configured to match a corresponding distributed cache node according to the user identification code.

[0087] The querying unit 13 is configured to query a full activity list from the distributed cache node.

[0088] The filtering unit 14 is configured to filter a corresponding user activity list from the full activity list according to a preset user class table and the user identification code.

[0089] In an embodiment of the present invention, the matching unit 12 is specifically configured to perform a hash calculation on the user identification code to obtain a service layer key value; match a corresponding service sublayer according to the service layer key value; and match a corresponding distributed cache node according to the service sublayer.

[0090] In an embodiment of the present invention, the querying unit 13 is specifically configured to send an activity obtaining request to the distributed cache node; and receive the full activity list sent by the distributed cache node within a set time period.

[0091] In an embodiment of the present invention, the apparatus further includes: a judging unit 15.

[0092] The judging unit 15 is configured to, if the full activity list sent by the distributed cache node is not received within a set time period or an abnormal message is received, judge whether the current number of abnormal times is greater than or equal to an abnormal times threshold; if so, call the common service layer to obtain the full activity list from a corresponding common database; if not, increment the current number of abnormal times by 1, and repeat the step of sending the activity obtaining request to the distributed cache node.

[0093] In an embodiment of the present invention, the user class table includes a user identification code and corresponding user class information, and the full activity list includes multiple activities and user condition information corresponding to each activity; the filtering unit 14 is specifically configured to match the corresponding user class information according to the user identification code through the user class table; and match the user class information with the user condition information through the full activity list to filter out the corresponding user activity list.

[0094] In an embodiment of the present invention, the apparatus further includes: a calling unit 16.

[0095] The calling unit 16 is configured to call the common service layer to periodically update the distributed cache node according to a corresponding common database.

[0096] In an embodiment of the present invention, the apparatus further includes: a visualization unit 17.

[0097] The visualization unit 17 is used to visually display the user activity list.

[0098] In the solution of the embodiment of the present invention, a user access request is obtained, and the user access request includes a user identification code; according to the user identification code, a corresponding distributed cache node is matched; a full activity list is queried from the distributed cache node; according to a preset user class list, a corresponding user activity list is filtered out from the full activity list according to the user identification code. By setting up the distributed cache node and performing separate query processing on the access request, the query bottleneck of public resources can be avoided, the query success rate can be improved, and the overall performance can be improved.

[0099] The systems, devices, modules or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer device, specifically, the computer device can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0100] The embodiment of the present invention provides a computer device, including a memory and a processor. The memory is used to store information including program instructions, and the processor is used to control the execution of the program instructions. When the program instructions are loaded and executed by the processor, each step of the embodiment of the above activity query method based on distributed cache is implemented. For specific descriptions, reference can be made to the embodiment of the above activity query method based on distributed cache.

[0101] Next, refer to Figure 5 , which shows a schematic structural diagram of a computer device 600 suitable for implementing the embodiments of the present application.

[0102] As Figure 5 shown, the computer device 600 includes a central processing unit (CPU) 601, which can perform various appropriate operations and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage section 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the computer device 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0103] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including, for example, a cathode ray tube (CRT), a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read from it can be installed in the storage section 608 as needed.

[0104] Specifically, according to an embodiment of the present invention, the processes described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program tangibly embodied on a machine-readable medium, the computer program including program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611.

[0105] Computer-readable media includes both permanent and non-permanent, removable and non-removable media implemented by any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technologies, compact disc read only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0106] For convenience of description, the above-described apparatus is described by functionally dividing it into various units. Of course, when implementing the present application, the functions of the various units can be implemented in one or more software and / or hardware.

[0107] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0108] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0109] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.

[0110] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or elements inherent to such process, method, commodity or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, commodity or device including the said element.

[0111] In the technical solution of this application, the acquisition, storage, use, processing, etc. of data all comply with the relevant regulations of national laws and regulations.

[0112] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0113] The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0114] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. The key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference can be made to the corresponding part of the method embodiment for the relevant content.

[0115] The above description is only for the embodiments of the present application and is not intended to limit the present application. For those skilled in the art, various changes and modifications can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. An activity query method based on distributed caching, characterized in that, The method includes: Obtaining a user access request, where the user access request includes a user identification code; Matching a corresponding distributed cache node according to the user identification code; Querying a full activity list from the distributed cache node; According to a pre-set user class table, screening out a corresponding user activity list from the full activity list according to the user identification code; Wherein, the matching of a corresponding distributed cache node according to the user identification code includes: Performing a hash calculation on the user identification code to obtain a service layer key value; Matching a corresponding service sub-layer according to the service layer key value; Matching a corresponding distributed cache node according to the service sub-layer; Wherein, the querying of a full activity list from the distributed cache node includes: Sending an activity acquisition request to the distributed cache node; Receiving the full activity list sent by the distributed cache node within a set time period; Wherein, the user class table includes a user identification code and corresponding user class information, and the full activity list includes multiple activities and user condition information corresponding to each activity; The screening of a corresponding user activity list from the full activity list according to the pre-set user class table according to the user identification code includes: Matching corresponding user class information according to the user identification code through the user class table; Matching the user class information with the user condition information through the full activity list to screen out a corresponding user activity list.

2. The method for querying activities based on distributed caching according to claim 1, wherein The method further includes: If the full activity list sent by the distributed cache node is not received within a set time period or an abnormal message is received, determining whether the current number of abnormal times is greater than or equal to an abnormal times threshold; If so, calling the public service layer to obtain the full activity list from a corresponding public database; If not, incrementing the current number of abnormal times by 1 and repeating the step of sending an activity acquisition request to the distributed cache node.

3. The method for querying activities based on distributed caching according to claim 1, wherein The method further includes: Calling the public service layer to periodically update the distributed cache node according to a corresponding public database.

4. The method for querying activities based on distributed caching according to claim 1, wherein After screening out a corresponding user activity list from the full activity list according to the pre-set user class table according to the user identification code, it further includes: Visualizing the user activity list.

5. An activity query device based on distributed caching, characterized in that, The device includes: An obtaining unit, configured to obtain a user access request, where the user access request includes a user identification code; A matching unit, configured to match a corresponding distributed cache node according to the user identification code; A querying unit, configured to query a full activity list from the distributed cache node; A screening unit, configured to screen out a corresponding user activity list from the full activity list according to the pre-set user class table according to the user identification code; Wherein, the matching unit is specifically configured to perform a hash calculation on the user identification code to obtain a service layer key value; match a corresponding service sub-layer according to the service layer key value; match a corresponding distributed cache node according to the service sub-layer; Wherein, the query unit is specifically configured to send an activity acquisition request to the distributed cache node; and receive the full amount of activity lists sent by the distributed cache node within a set time period. Wherein, the user class table includes user identification codes and corresponding user class information, and the full amount of activity lists includes various activities and user condition information corresponding to each activity; the screening unit is specifically configured to, through the user class table, match the corresponding user class information according to the user identification code; and through the full amount of activity lists, match the user class information with the user condition information to screen out the corresponding user activity list.

6. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the activity query method based on distributed cache according to any one of claims 1 to 4.

7. A computer device, comprising a memory and a processor, the memory being used for storing information including program instructions, and the processor being used for controlling the execution of the program instructions, characterized in that, When the program instructions are loaded and executed by the processor, they implement the activity query method based on distributed cache according to any one of claims 1 to 4.

8. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the activity query method based on distributed cache according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Data access method and device

    CN110968603A

  • Data processing method, system and equipment and storage medium

    CN113377817A