Authentication method, electronic device, storage medium and program product
By combining access volume prediction and local caching modules with a Hawkes process-optimized TensorFlow model, the authentication performance bottleneck of Redis cache nodes during hot access was resolved, achieving efficient authentication of hot access content.
Patent Information
- Application Number
- CN202611088330.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-21
- Publication Date
- 2026-11-06
AI Technical Summary
When accessing frequently accessed content, the high concurrency of access requests to Redis cache nodes leads to a decrease in authentication performance, making it impossible to meet authentication requirements in a timely manner.
By predicting the access volume of the accessed content, if the predicted value exceeds the threshold, the authentication information is written to the local cache module and authentication is performed using the local cache module, avoiding direct retrieval from the Redis cache. The Hawkes process is combined with TensorFlow model optimization for hotspot prediction and cache configuration.
It improves authentication processing performance, enabling timely handling of authentication requests for frequently accessed content, reducing Redis cache pressure, and improving system stability and response efficiency.
Smart Images

Figure CN123055346A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing technology, and more particularly to an authentication method, electronic device, storage medium, and program product. Background Technology
[0002] In related technologies, a solution has been proposed to cache the content to be accessed using Redis. This allows access to content such as video programs by reading the Redis cache. However, since the same content is always stored on a single Redis node, the performance of authentication for accessed content depends on the performance of that Redis node. In cases of frequently accessed content, high-concurrency access requests impact the processing performance of the Redis node, thus hindering timely authentication of this content and failing to meet authentication requirements for such content. Summary of the Invention
[0003] This application provides an authentication method, an electronic device, a storage medium, and a program product.
[0004] The technical solution of this application embodiment is implemented as follows: This application provides an authentication method, the method comprising: Predict the number of visits to N content items at future time points, where N is an integer greater than or equal to 1; If the predicted access volume of the target access content among the N accessed content is greater than or equal to the first access volume threshold, the cache record of the target access content is obtained. The cache record of the target access content is used to represent the cache configuration information of the authentication information of the target access content. Based on the cached record of the target accessed content, the authentication information of the target accessed content is written into the local cache module; Upon receiving an authentication request for the target access content, the target access content is authenticated based on the authentication information in the local cache module.
[0005] This application also provides an electronic device, which includes a processor and a memory for storing a computer program that can run on the processor; wherein the processor is used to run the computer program to perform any of the above-described authentication methods.
[0006] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the authentication methods described above.
[0007] This application also provides a computer program product, including a computer program or computer executable instructions, which, when executed by a processor, implements any of the above-described authentication methods.
[0008] It can be seen that when the predicted access volume of the target content is greater than or equal to the first access volume threshold, it indicates that the predicted access volume of the target content is relatively large. It can be considered that the target content will be a hot access content in the future. At this time, the cached record of the target content can be obtained, and the authentication information of the target content can be written to the local cache module. Then, it is not necessary to authenticate the access content through the data in the Redis cache. Instead, the authentication of the access content can be performed through the data in the local cache module. In this way, compared with the related technologies that only use the data in the Redis cache for authentication, the data in the local cache module can be fully utilized to improve the authentication processing performance, which is conducive to timely authentication of hot access content and can meet the authentication requirements of hot access content. Attached Figure Description
[0009] Figure 1 This is a flowchart of the authentication method according to an embodiment of this application; Figure 2 This is a flowchart illustrating the processing of configuration information in this embodiment of the application; Figure 3 This is an interactive flowchart of the authentication method according to an embodiment of this application; Figure 4 This is a schematic diagram of the authentication device according to an embodiment of this application; Figure 5 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0010] With the development of current internet applications, various information technology (IT) systems are proliferating. Regardless of the type of IT system, authentication is the most frequently used and highest-volume function module, handling the largest number of requests, concurrency, and pressure. In practical applications, to cope with various special business scenarios, especially authentication requests during peak business periods with high concurrency, microservice scaling is a common solution. After microservice scaling, database performance can become a bottleneck. In this case, using Redis to cache relevant data becomes a common method to further improve system performance.
[0011] In practical applications, multiple methods can be used simultaneously to improve system performance. For example, in high-concurrency business scenarios, to improve the speed and performance of authentication responses, service scaling combined with Redis caching can be used to improve the overall system performance. This can meet the performance requirements in most scenarios. However, in some special scenarios, Redis caching can also become a bottleneck for system performance. For instance, when user authentication requests are concentrated on one or a few specific programs, content, or products, since the same program, content, or product is fixed on a single Redis node, the performance of system authentication depends on the performance of that Redis node. When hot content is accessed frequently, high-concurrency access requests can impact the performance of the Redis node, thus hindering timely authentication of frequently accessed content and failing to meet the authentication requirements. In other words, a performance bottleneck for system authentication can occur when hot content is accessed frequently.
[0012] In view of the technical problems existing in related technologies, this application proposes technical solutions based on its embodiments.
[0013] The embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the embodiments provided herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application. Furthermore, the embodiments provided below are some embodiments for implementing this application, and not all embodiments for implementing this application. Unless otherwise specified, the technical solutions described in the embodiments of this application can be implemented in any combination.
[0014] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a method or apparatus that includes a list of elements includes not only the elements expressly described, but also other elements not expressly listed, or elements inherent to implementing the method or apparatus. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other related elements (e.g., steps in the method or units in the apparatus, such as portions of circuitry, processors, programs, or software, etc.) in the method or apparatus that includes that element.
[0015] The authentication method provided in this application includes a series of steps, but the authentication method provided in this application is not limited to the steps described. Similarly, the authentication device provided in this application includes a series of modules, but the device provided in this application is not limited to the modules explicitly described, and may also include modules that need to be set up for obtaining relevant information or processing based on information.
[0016] This application provides an authentication method. Figure 1 This is a flowchart of the authentication method according to an embodiment of this application, such as... Figure 1 As shown, the process includes: Step 101: Predict the number of visits to N content items at future times.
[0017] Here, N is an integer greater than or equal to 1, and the accessed content can be online service products such as video programs. By predicting the access volume of N accessed content items at future times, the predicted access volume of the target accessed content can be obtained among the N accessed content items. For example, a pre-trained access volume prediction model can be used to predict the access volume of the N accessed content items at future times.
[0018] In practical applications, the monitoring and prediction module can be used to predict the access volume of N accessed content items at future times.
[0019] Step 102: If the predicted access volume of the target access content is greater than or equal to the first access volume threshold among the N accessed content, obtain the cache record of the target access content. The cache record of the target access content is used to represent the cache configuration information of the authentication information of the target access content.
[0020] The first visit threshold can be set according to actual needs or based on experience.
[0021] Step 103: Based on the cache record of the target accessed content, write the authentication information of the target accessed content into the local cache module.
[0022] Here, the local caching module and the Redis cache are deployed in different locations. The local caching module is deployed on the local device that generates the authentication request for the accessed content. The local caching module is a cache created in the memory of the local device based on the microservice POD itself. The Redis cache can cache all information, including user information, program information, and product information, and can dynamically and periodically refresh the cache according to business needs, improving system performance. When performing authentication based on the Redis cache, the authentication information in the Redis cache can be read and fed back to the authentication module, which then performs subsequent logical processing and judgment. For example, the authentication information in the Redis cache may include one or more of the following: product information subscribed by the user, detailed information about the program requiring authentication, and the detailed information about the program to which the program belongs, etc.
[0023] In some embodiments, after obtaining the predicted access volume of the target access content among N accessed content, the relationship between the predicted access volume of the target access content and the first access volume threshold can be determined. If the predicted access volume of the target access content is greater than or equal to the first access volume threshold, it indicates that the predicted access volume of the target access content is relatively large, and the target access content can be considered to be a hot access content in the future. At this time, the cache record of the target access content can be obtained, and the authentication information of the target access content can be written into the local cache module.
[0024] If the predicted access volume of the target content is less than the first access volume threshold, it means that the predicted access volume of the target content is small, and it can be considered that the target content will not be a hot access content in the future. At this time, the cache record of the target content can be obtained; based on the cache record of the target content, the authentication information of the target content is written into the Redis cache.
[0025] In practical applications, steps 102 to 103 can be executed through the monitoring and prediction module. For example, if the monitoring and prediction module determines that the predicted value of the access volume of the target accessed content is greater than or equal to the first access volume threshold, it can activate the local caching module, and then write the authentication information of the target accessed content into the local caching module based on the cached record of the target accessed content.
[0026] Step 104: Upon receiving an authentication request for the target content, authenticate the target content based on the authentication information in the local cache module.
[0027] In practical applications, this step can be performed using an authentication module. When the authentication module receives an authentication request for the target content, it can authenticate the target content based on the authentication information in the local cache module and generate an authentication result.
[0028] In practical applications, steps 101 to 104 can be implemented based on a processor and a communication interface. The processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor.
[0029] It can be seen that when the predicted access volume of the target content is greater than or equal to the first access volume threshold, it indicates that the predicted access volume of the target content is relatively large. It can be considered that the target content will be a hot access content in the future. At this time, the cached record of the target content can be obtained, and the authentication information of the target content can be written to the local cache module. Then, it is not necessary to authenticate the access content through the data in the Redis cache. Instead, the authentication of the access content can be performed through the data in the local cache module. In this way, compared with the related technologies that only use the data in the Redis cache for authentication, the data in the local cache module can be fully utilized to improve the authentication processing performance, which is conducive to timely authentication of hot access content and can meet the authentication requirements of hot access content.
[0030] For the implementation of writing authentication information of the target accessed content into the local cache module based on the cache record of the target accessed content, in some embodiments, after obtaining the cache record of the target accessed content, the cache record of the target accessed content can be synchronously updated to the cache configuration module; based on the cache record of the target accessed content read from the cache configuration module, the authentication information of the target accessed content can be written into the local cache module. Therefore, the embodiments of this application can synchronously update the cache record of the target accessed content to the cache configuration module, which makes the cache record of the cache configuration module real-time and accurate. Thus, based on the cache record of the target accessed content read from the cache configuration module, the authentication information can be accurately written into the local cache module, which is beneficial for accurate authentication based on the data in the local cache module.
[0031] In practical applications, the local caching module can retrieve authentication information corresponding to cached records from the database. This authentication information can be stored using a key-value pair storage structure. For example, the key in a key-value pair is the identifier of the accessed content, and the value is the authentication information corresponding to the key. For instance, based on business requirements and the needs of the authentication interface, the value in the key-value pair is obtained by concatenating relevant fields. When authentication information is needed, the local caching module can be queried, and the authentication information retrieved from the local caching module can be returned to the authentication module. For example, the local caching module does not cache all information, but rather caches pre-configured authentication information such as program information and product information.
[0032] As can be seen, when authentication information is stored in the local cache module, the authentication information of hot access content can be distributed from Redis cache to each local cache module. Therefore, the problem of excessive read pressure on a single Redis cache node when authentication requests for hot access content occur can be effectively avoided.
[0033] In this embodiment of the application, each cache record stored in the cache configuration module includes an identifier of the accessed content, and the cache record of the target accessed content includes the identifier of the target accessed content; here, the identifier of the accessed content may include one or more of the following: name, key, identity (ID).
[0034] In some embodiments, when the identifier in the first cache record stored in the cache configuration module is the identifier of the target access content, the first cache record stored in the cache configuration module can be updated based on the cache record of the target access content; the first cache record can be any cache record stored in the cache configuration module; when the identifiers in each cache record of the cache configuration module are different from the identifier of the target access content, the cache record of the target access content is written into the cache configuration module.
[0035] For example, refer to Figure 2The configuration information is the cache record of the target accessed content. After obtaining the configuration information, it is determined whether the cache configuration module already has the original cache record of the target accessed content. If so, the original cache record of the target accessed content is modified in the cache configuration module, changing it to the obtained configuration information. After modifying the original cache record of the target accessed content, the configuration information is validated. If the cache configuration module does not have the original cache record of the target accessed content, configuration information can be entered into the cache configuration module, and then the configuration information is validated. As an example, it can be determined whether the identifier in each cache record of the cache configuration module is the same as the identifier of the target accessed content. If the identifier in the first cache record stored in the cache configuration module is the same as the identifier of the target accessed content, it means that the cache configuration module already has the original cache record of the target accessed content; otherwise, it means that the cache configuration module does not have the original cache record of the target accessed content.
[0036] Reference Figure 2 If the configuration information fails verification, the configuration information can be modified until it passes verification. If the configuration information passes verification, it can be saved and submitted for manual review. The manual review then determines whether the configuration passes. If the manual review fails, the configuration information can be modified, and the process returns to the configuration verification step. If the manual review passes, the configuration information can be saved to the database, and the process ends.
[0037] As can be seen, the embodiments of this application can accurately determine whether the cache configuration module has stored a cache record of the target access content by comparing the identifier in each cache record of the cache configuration module with the identifier of the target access content. Then, based on the determination result, the cache configuration module can add a new cache record of the target access content or update the cache record of the target access content in a timely manner. In this way, the cache records of the cache configuration module can be real-time and accurate.
[0038] The embodiments of this application can also refresh the authentication information in the local cache module. In some embodiments, the first cache record stored in the cache configuration module includes the refresh rules for the authentication information corresponding to the first cache record. Accordingly, the authentication information in the local cache module can be refreshed based on the refresh rules for the authentication information corresponding to the first cache record stored in the cache configuration module.
[0039] Here, the refresh rules for the authentication information corresponding to the first cache record include one or more of the following: expiration rules, invalidation rules, removal rules, reload rules, etc. For example, the expiration rule can be a rule that updates the authentication information based on a set expiration time, and the removal rule can be a rule that removes the authentication information based on a set eviction time. For example, the removal rule can be a Least Recently Used (LRU) rule.
[0040] In practical applications, in order to improve the caching efficiency of the local caching module, the local caching module supports automatically removing or reloading authentication information at certain times or under certain conditions, so as to ensure that the data cached in the local caching module is all authentication information with high usage.
[0041] For example, expiration rules, invalidation rules, removal rules, and reload rules can be defined by the cache configuration module. The specific data volume of the local cache module can also be defined by the cache configuration module. In this embodiment, the cache configuration module can define the identifier of cache records and configure and manage the refresh rules for authentication information. The cache configuration module can provide the identifier of cache records and the refresh rules for authentication information to the local cache program, thereby controlling the local cache module. In some embodiments, the functionality of the cache configuration module can also be extended to implement access control, logging, and other functions.
[0042] Referring to Table 1, each cache record in the cache configuration module can include the name of the accessed content, the key of the accessed content, the maximum amount of authentication information in the local cache module, the expiration time, the eviction time, the removal rule, and the operation time. Here, the units for expiration time and eviction time are seconds, and the operation time represents the time it takes for the cache record to be written to the cache configuration module.
[0043] Table 1
[0044] In practical applications, the cache configuration module can be implemented using a management page. Configurers can view all currently configured cache records through this page. These records are displayed in a list format, and selecting a specific record allows viewing its detailed information. On the detailed information page, configurers can modify or delete the cache record's information.
[0045] For example, the cache configuration module can also receive cache records synchronized from the monitoring and prediction module. If the predicted access volume of the target accessed content is greater than or equal to a first access volume threshold, the cache record of the target accessed content is automatically added to the cache configuration module. The cache record of the target accessed content in the cache configuration module can also be manually adjusted. In other words, the cache configuration module can add the cache records of predicted hot accessed content to the cache configuration module, and the cache records of predicted hot accessed content can also be adjusted.
[0046] For example, after the cache configuration module writes or updates the cache record, the local cache module obtains the specific cache record and completes the corresponding authentication information processing based on the name, key, expiration time, data volume limit, expiration time, eviction rules, etc. in the cache record. For example, it can complete the storage, refresh, and expiration of authentication information.
[0047] As can be seen, the embodiments of this application can realize timely refreshing of the authentication information in the local cache module according to the refresh rules of the authentication information corresponding to the first cache record stored in the cache configuration module, so that the authentication information in the local cache module has real-time performance and accuracy.
[0048] To train the traffic prediction model, training data can be acquired. In some embodiments, the training data includes one or more of the following: access request information for multiple accessed content, device performance metrics related to the access process of multiple accessed content, network performance metrics related to the access process of multiple accessed content, and access records for authentication information stored in the cache. After acquiring the training data, the traffic prediction model can be trained based on the training data.
[0049] In practical applications, training data can be obtained through the monitoring and prediction module. This module can collect data from both local and network sources, employing a lightweight machine learning model based on Artificial Intelligence Generated Content (AIGC), combined with real-time access request streams and performance metric analysis, to achieve intelligent performance evaluation, hotspot prediction, and cache preheating. For example, the monitoring and prediction module can also automatically start or stop the local caching module using a shell script based on the predicted access volume of the target content, and can also add or update cache records in the cache configuration module as needed.
[0050] The monitoring and prediction module collects data including access request information for multiple accessed content. For example, the monitoring and prediction module can collect access request information for multiple accessed content from system logs. The access request information for the accessed content includes one or more of the following: Application Programming Interface (API) path, data ID, user token, access frequency, time distribution information of access requests, and Internet Protocol (IP) address of the source of the access request.
[0051] The monitoring and prediction module also collects data related to the access process of multiple accessed content items. For example, the monitoring and prediction module can collect device performance metrics related to the access process of multiple accessed content items through system tools. These device performance metrics include one or more of the following: CPU performance metrics, memory performance metrics, network input / output (I / O) performance metrics, network bandwidth utilization, Redis connection count, and Redis queries per second (QPS). For instance, CPU performance metrics may include CPU utilization.
[0052] The monitoring and prediction module also collects data including access records for authentication information stored in the local cache module and access records for authentication information stored in the Redis cache. In practical applications, custom tracking points can be used to record access records for authentication information stored in the local cache module and the Redis cache within the code. For example, access records for authentication information can include information indicating whether the authentication information was hit (i.e., whether the authentication information corresponding to the access request exists in the local cache module or the Redis cache), access latency, and other data.
[0053] In this embodiment, the access records in the training data can come from various sources. For example, access records for authentication information stored in the cache include: access records for authentication information stored in the local cache module and access records for authentication information stored in the Redis cache. Therefore, this embodiment can obtain access records for authentication information more comprehensively based on access records for authentication information stored in the local cache module and access records for authentication information stored in the Redis cache, thereby improving the training accuracy of the access volume prediction model based on the obtained access records for authentication information.
[0054] After collecting data, the monitoring and prediction module can also extract features from the collected data. For example, one or more of the following features can be extracted from the collected data: time-series features, statistical features, system features, contextual features, and business scenario features. Time-series features may include one or more of the following: short-term trends in access volume (e.g., changes in access volume over the past 5 minutes or 1 hour), the rate of change in access volume, and the periodicity of access volume; for example, the periodicity of access volume may be a fixed period of high access volume each day, week, or month (i.e., peak access periods). Statistical features may include one or more of the following: information on changes in access frequency, results of access volume surge detection, and temporal distribution information of access volume; for example, the Z-Score anomaly detection method can be used to detect access volume surges. System features may include one or more of the following: the relationship between current CPU performance and access volume, the relationship between current memory performance and access volume, and the relationship between current network I / O utilization and access volume; for example, each of the system features can be represented by a correlation coefficient. Contextual features may include user behavior; for example, user behavior may be: a surge in access to authentication information corresponding to a certain key after a specific event, or a surge in access to authentication information corresponding to a certain key at a specific time. Business scenario characteristics can include promotional activity information, popular content release information, etc.
[0055] After extracting features from the collected data, the extracted features can be normalized. For example, Z-Score normalization, Min-Max normalization, and other methods can be used for normalization.
[0056] It's important to note that the monitoring and prediction module can simultaneously monitor the quality of the collected data during data collection, feature extraction, or feature normalization. It ensures data quality and removes outlier data through reasonable rule validation. For example, it can remove outlier data when there's a sudden drop in access to authentication information (e.g., a 90% decrease within 5 minutes may indicate a collection failure); it can also perform range checks on feature values to remove outliers. For instance, feature values should not be negative, so negative feature values can be removed. A key goal of the monitoring and prediction module is to output high-quality feature data, providing reliable input for subsequent machine learning models.
[0057] After obtaining the training data, a traffic prediction model can be selected based on computing resources and real-time requirements. The traffic prediction model can be a TensorFlow model or other time series prediction models. This application does not limit the type of traffic prediction model.
[0058] The training process of a traffic prediction model is illustrated below using an application scenario. In this scenario, the requirements for time series prediction are relatively low. The training objective of the traffic prediction model is to predict the traffic volume of at least one content item within the next 5 minutes. Therefore, data collection and feature processing are performed at 5-minute intervals. The traffic prediction model can be trained offline. The training data can be historical data, such as regularly updated (e.g., daily) data. During training, the model needs to calculate the traffic volume of each content item's key. The traffic prediction model can employ a Recurrent Neural Network (RNN). During training, it's important to adjust the number of units in the output layer to ensure that all features output from the output layer are included in the model's multiple labels, thus achieving the effect of predicting the traffic volume of multiple content items. The model's multiple labels are used to predict the traffic volume of multiple content items.
[0059] It can be seen that the access request information of multiple accessed content, the device performance indicators related to the access process of multiple accessed content, the network performance indicators related to the access process of multiple accessed content, and the access records for authentication information stored in the cache are all closely related to the access volume of the accessed content. Therefore, the training accuracy of the access volume prediction model can be improved by using the access request information of multiple accessed content, the device performance indicators related to the access process of multiple accessed content, the network performance indicators related to the access process of multiple accessed content, or the access records for authentication information stored in the cache.
[0060] In some application scenarios, changes in trending content (such as changes in the popularity of video programs) are often non-linear. Statistically, website traffic is considered to have a self-reinforcing characteristic, meaning that past behavior increases the probability of future events, with the degree of influence exponentially related to time. For example, in daily operations, a sudden surge in attention to a video program can trigger more viewing behavior, which in turn further increases the program's popularity. This characteristic poses a significant challenge for machine learning prediction, and its abnormally rapid increase greatly increases the difficulty of prediction. Therefore, targeted optimization algorithms are needed to address this characteristic. In some embodiments, during the training of the traffic prediction model, maximizing the log-likelihood function of the Hawkes process can be used as the optimization objective; the parameters in the traffic prediction model and the parameters in the intensity function of the Hawkes process can be adjusted based on this optimization objective.
[0061] Hawkes processes are widely used to model time-series data of events, where the occurrence of each event may influence the probability of subsequent events. In machine learning, particularly in model optimization, Hawkes processes can be used to model and understand the dynamic changes in parameters, learning rates, and other aspects of a model. For example, in a traffic prediction model using TensorFlow, applying Hawkes processes to optimize the TensorFlow model allows for dynamic adjustment of the learning rate or other hyperparameters, thereby improving the training performance of the TensorFlow model.
[0062] intensity function of Hawkes process It can be defined according to formula (1).
[0063] (1) in, This indicates the preset baseline intensity. This represents the preset incentive coefficient, which indicates the magnitude of the increase in intensity after an event occurs. This indicates the preset attenuation coefficient, which refers to the coefficient by which the intensity increase decreases over time. This indicates the time when the i-th event occurs.
[0064] The intensity function of a Hawkes process defines a process with a "self-excitation" property, similar to how "one event triggers more future events." Hawkes processes excel at modeling the temporal dependencies of events, while TensorFlow deep learning models are adept at modeling complex feature spaces. Fusing Hawkes processes with TensorFlow models allows for the optimization of sequence modeling, and the resulting model is suitable for behavior prediction (e.g., user clicks). Introducing Hawkes processes into TensorFlow models for optimizing model parameters (end-to-end learning) is a more advanced and flexible fusion approach. The core idea is to model the intensity function of the Hawkes process as a differentiable module, as part of the neural network, and allow its parameters to be... , and We learn and optimize together during the model training process.
[0065] In practical applications, Hawkes processes can be used to model the time dependencies of events. By combining Hawkes processes with recurrent neural networks in TensorFlow models, the model parameters in the intensity functions of both the TensorFlow model and the Hawkes process can be jointly optimized by maximizing the likelihood function of the point process (i.e., the likelihood function of the Hawkes process). Here, the likelihood function of the Hawkes process is used to evaluate how well the model fits the observed data.
[0066] When training a TensorFlow model using the intensity function of a Hawkes process, a time series set H can be defined. , to This represents n discrete time points within the time window [0, T], where n is an integer greater than 1. In this embodiment, the time series set H can represent the access volume of cached authentication information over time.
[0067] The likelihood function of a Hawkes process can be defined according to formula (2).
[0068] (2) When parameterizing the likelihood function of formula (2) using a recurrent neural network of a TensorFlow model, the time series data E can be defined. When i takes values from 1 to n, Let i represent the time when the i-th event occurs. This indicates the type of the i-th event. In the time series data E, the event type is optional.
[0069] Recurrent neural networks in TensorFlow models can be defined as follows: This recurrent neural network satisfies ,in, It can be the data corresponding to time t in the time series data E.
[0070] exist During training, maximizing the likelihood function of the Hawkes process is used as the optimization objective, thereby adjusting... And the parameters in the intensity function of the Hawkes process. For example, in During the training process, the likelihood function of the Hawkes process can be solved approximately or analytically, and related parameters (such as...) can also be... , and (Perform backpropagation training.)
[0071] After obtaining the trained traffic prediction model, inference can be performed based on real-time data, i.e., real-time prediction. The inputs to the trained traffic prediction model are access request information for real-time accessed content, device performance metrics related to the access process, network performance metrics related to the access process, and access records for authentication information of real-time accessed content stored in the cache. The outputs of the trained traffic prediction model are: a list of keys for hot accessed content in the next 5 minutes and the access volume of hot accessed content in the next 5 minutes. Applying the Hawkes process to the training process of the traffic prediction model can improve the accuracy of predicting sudden hotspots with self-excitation characteristics.
[0072] The monitoring and prediction module can determine whether to activate local caching based on the output of the trained access volume prediction model: when the predicted access volume of the target access content is greater than or equal to the first access volume threshold, the local caching module can be activated; if the key of the target access content is not in the cache configuration module, the cache record of the target access content will be automatically added to the cache configuration module.
[0073] It can be seen that, during the training of the traffic prediction model, maximizing the likelihood function of the Hawkes process is used as the optimization objective. Since the Hawkes process can effectively model the time dependence of events, adjusting the parameters in the traffic prediction model and the intensity function of the Hawkes process through the optimization objective can improve the time series prediction capability of the trained traffic prediction model.
[0074] Figure 3 This is an interactive flowchart of the authentication method according to an embodiment of this application, referring to... Figure 3 The client provides an interactive interface for users. The client can send authentication requests to the authentication module. The authentication module can read data from a local cache module or a Redis cache. The local cache module can return authentication information to the authentication module. The Redis cache handles normal system data caching and also caches authentication information, which it can then return to the authentication module. The authentication module can then obtain the authentication result based on the authentication information and return it to the client. In an exemplary application scenario, the authentication module provides a business authentication interface, providing authentication results based on user information, program information, etc. The implementation process is as follows: An interface is written to provide authentication services. The input parameters of this interface include user identity information, program information, authentication object information, timestamp, signature information, etc. The interface determines whether to query relevant data from the Redis cache or the local cache module based on the system configuration. Based on the data retrieved from the cache, it performs matching and judgment to provide the final authentication result.
[0075] Reference Figure 3 The cache configuration module can write configuration information and synchronize it to the local cache module, which then caches authentication information based on the configuration information. The monitoring and prediction module can predict access volume and send the prediction results to the local cache module, which can then refresh the locally cached authentication information based on the prediction results.
[0076] As can be seen, this application's embodiment implements authentication processing based on a two-level caching mechanism. Leveraging the advantages of Redis caching, it improves authentication performance for large-scale data reads. Simultaneously, through a local caching module and AIGC machine learning, it predicts potential hot content and cached information in advance, activating the local caching module for potentially hot content in advance to reduce the pressure on the Redis cache. Ultimately, it allows for different caching strategies to be used in different application scenarios, improving overall authentication performance. Because a Hawkes process is used to train the TensorFlow model's recurrent neural network, the authentication capability is significantly improved under extreme conditions of a sudden surge in popular programs and products.
[0077] In summary, addressing the problems in related technologies, this application proposes an authentication scheme applicable to fields such as information processing and artificial intelligence. In this embodiment, a traffic prediction model is constructed by deeply embedding Hawkes processes into a TensorFlow recurrent neural network. This accurately captures the self-incentivizing characteristics of user access behavior, such as the chain reaction of traffic surges triggered by popular programs. Furthermore, it can automatically start and stop the local caching module and dynamically update fields in the cache configuration module based on real-time prediction results. Combined with a lightweight monitoring framework that integrates multi-source features, a closed-loop control system from hotspot prediction to resource scheduling is formed. This allows for the preloading of hotspot data to the local caching module 5 minutes in advance. While ensuring efficient processing of regular authentication requests by the Redis cache, it proactively mitigates the risk of cache avalanche caused by sudden traffic surges, significantly improving the stability and response efficiency of the authentication system under extreme business scenarios.
[0078] The solution in this application embodiment has at least the following advantages: 1) Design a prediction-driven dynamic scheduling system to automatically preload hot data to the local cache module before the peak of access volume, dynamically allocate cache levels according to the first access volume threshold, and directly convert the access volume prediction results into cache operation instructions. This realizes a complete technical chain of real-time triggering of cache level switching and pre-deployment based on prediction results, and solves the resource mismatch problem of fixed two-level cache strategy.
[0079] 2) Enables bidirectional real-time interaction between the traffic prediction model and the cache configuration module. The cache content is dynamically reconstructed through a structured configuration table (such as eviction rules and field combinations). When the predicted hotspot is not hit, the information in the cache configuration module can be automatically corrected, solving the pain point of the cache strategy lagging behind business changes.
[0080] 3) Hawkes process processing was introduced into the recurrent neural network algorithm of the TensorFlow deep learning framework model. The intensity function of Hawkes process was deeply embedded into the neural network. The learning rate and model parameters were dynamically adjusted through end-to-end joint training. This fusion produced a synergistic effect, solved the modeling problem of hotspot propagation chain (i.e. modeling problem when user behaviors mutually stimulate each other), and could solve the problem of nonlinear mutation of cached hotspots, making the model more suitable for predicting hotspot programs with self-excitation.
[0081] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0082] Based on the authentication method proposed in the foregoing embodiments, this application also proposes an authentication device, such as... Figure 4 As shown, the device includes: The prediction module 401 is used to predict the number of visits to N accessed items at future times, where N is an integer greater than or equal to 1. The processing module 402 is configured to, when the predicted access volume of the target access content among the N accessed content is greater than or equal to a first access volume threshold, obtain the cache record of the target access content, and write the authentication information of the target access content into a local cache module based on the cache record of the target access content; when receiving an authentication request for the target access content, authenticate the target access content based on the authentication information in the local cache module; the cache record of the target access content is used to represent the cache configuration information of the authentication information of the target access content.
[0083] In some embodiments, the processing module 402 is further configured to synchronously update the cache record of the target access content to the cache configuration module after obtaining the cache record of the target access content; The processing module 402 writes the authentication information of the target access content into a local cache module based on the cache record of the target access content, including: writing the authentication information of the target access content into a local cache module based on the cache record of the target access content read from the cache configuration module.
[0084] In some embodiments, each cache record stored in the cache configuration module includes an identifier of the accessed content, and the cache record of the target accessed content includes the identifier of the target accessed content; The processing module 402 synchronously updates the cache record of the target accessed content to the cache configuration module, including: when the identifier in the first cache record stored in the cache configuration module is the identifier of the target accessed content, updating the first cache record stored in the cache configuration module based on the cache record of the target accessed content; the first cache record is any cache record stored in the cache configuration module; when the identifiers in each cache record of the cache configuration module are different from the identifier of the target accessed content, writing the cache record of the target accessed content into the cache configuration module.
[0085] In some embodiments, the first cache record stored in the cache configuration module includes refresh rules for the authentication information corresponding to the first cache record; in some embodiments, the processing module 402 is further configured to refresh the authentication information in the local cache module based on the refresh rules for the authentication information corresponding to the first cache record stored in the cache configuration module.
[0086] In some embodiments, the prediction module 401 predicts the access volume of N accessed content at future times, including: using a pre-trained access volume prediction model to predict the access volume of the N accessed content at future times. The device also includes a training module, which is used to train the visitor prediction model through the following steps: Acquire training data, which includes one or more of the following: access request information for multiple accessed content, device performance indicators related to the access process of the multiple accessed content, network performance indicators related to the access process of the multiple accessed content, and access records for authentication information stored in the cache; the access records for authentication information stored in the cache include: access records for authentication information stored in the local cache module, and access records for authentication information stored in the Redis cache; The visit volume prediction model is trained based on the training data.
[0087] In some embodiments, the training module is further configured to, when the predicted access volume of the target access content among the N accessed content is less than a first access volume threshold, obtain a cache record of the target access content; and write the authentication information of the target access content into a Redis cache based on the cache record of the target access content.
[0088] In some embodiments, the training module trains the traffic prediction model based on the training data, including: during the training of the traffic prediction model, taking maximizing the value of the likelihood function of the Hawkes process as the optimization objective; and adjusting the parameters in the traffic prediction model and the parameters in the intensity function of the Hawkes process through the optimization objective.
[0089] In practical applications, the prediction module 401 and the processing module 402 can be implemented based on a processor and a communication device.
[0090] It should be noted that the description of the above device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0091] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a terminal, server, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0092] Correspondingly, this application embodiment further provides a computer program product, the computer program product including computer executable instructions, which are used to implement any of the authentication methods provided in this application embodiment.
[0093] Accordingly, this application embodiment further provides a computer storage medium storing computer-executable instructions, which are used to implement any of the authentication methods provided in the above embodiments.
[0094] This application also provides an electronic device. Figure 5 This is a schematic diagram of the composition structure of an electronic device provided in an embodiment of this application, as shown below. Figure 5 As shown, the electronic device 50 may include: Memory 501 is used to store executable instructions; The processor 502 is used to implement any of the above authentication methods when executing executable instructions stored in the memory 501.
[0095] The processor 502 mentioned above can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0096] The aforementioned computer-readable storage medium and memory 501 may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; or it may be various terminals that include one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0097] In some embodiments, the functions or modules of the apparatus provided in this application can be used to perform the methods described in the above method embodiments. The specific implementation can be referred to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0098] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0099] The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined to obtain new method embodiments without conflict.
[0100] The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0101] The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0103] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims. All of these forms are within the protection scope of this application.
Claims
1. An authentication method, characterized in that, The method includes: Predict the number of visits to N content items at future time points, where N is an integer greater than or equal to 1; If the predicted access volume of the target access content among the N accessed content is greater than or equal to the first access volume threshold, the cache record of the target access content is obtained. The cache record of the target access content is used to represent the cache configuration information of the authentication information of the target access content. Based on the cached record of the target accessed content, the authentication information of the target accessed content is written into the local cache module; Upon receiving an authentication request for the target access content, the target access content is authenticated based on the authentication information in the local cache module.
2. The method according to claim 1, characterized in that, The method further includes: After obtaining the cache record of the target access content, the cache record of the target access content is synchronously updated to the cache configuration module; The step of writing the authentication information of the target accessed content into the local cache module based on the cache record of the target accessed content includes: Based on the cache record of the target access content read from the cache configuration module, the authentication information of the target access content is written into the local cache module.
3. The method according to claim 2, characterized in that, Each cache record stored in the cache configuration module includes an identifier of the accessed content, and the cache record of the target accessed content includes the identifier of the target accessed content; The step of synchronously updating the cache record of the target accessed content to the cache configuration module includes: If the identifier in the first cache record stored in the cache configuration module is the identifier of the target accessed content, the first cache record stored in the cache configuration module is updated based on the cache record of the target accessed content; the first cache record is any cache record stored in the cache configuration module. If the identifiers in each cache record of the cache configuration module are different from the identifier of the target accessed content, then the cache record of the target accessed content is written into the cache configuration module.
4. The method according to claim 3, characterized in that, The first cache record stored in the cache configuration module includes the refresh rules for the authentication information corresponding to the first cache record; The method further includes: refreshing the authentication information in the local cache module based on the refresh rules of the authentication information corresponding to the first cache record stored in the cache configuration module.
5. The method according to claim 1, characterized in that, The method of predicting the access volume of N accessed content items at future times includes: using a pre-trained access volume prediction model to predict the access volume of the N accessed content items at future times. The training process of the traffic prediction model includes: Acquire training data, which includes one or more of the following: access request information for multiple accessed content, device performance indicators related to the access process of the multiple accessed content, network performance indicators related to the access process of the multiple accessed content, and access records for authentication information stored in the cache; the access records for authentication information stored in the cache include: access records for authentication information stored in the local cache module, and access records for authentication information stored in the Redis cache; The visit volume prediction model is trained based on the training data.
6. The method according to claim 5, characterized in that, The method further includes: If the predicted access volume of the target access content among the N accessed content is less than the first access volume threshold, obtain the cache record of the target access content; based on the cache record of the target access content, write the authentication information of the target access content into the Redis cache.
7. The method according to claim 5, characterized in that, Training the visit volume prediction model based on the training data includes: During the training of the visit volume prediction model, the optimization objective is to maximize the value of the likelihood function of the Hawkes process. The parameters in the traffic prediction model and the parameters in the intensity function of the Hawkes process are adjusted according to the optimization objective.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory for storing computer programs capable of running on the processor; wherein, The processor is used to run the computer program to perform the method according to any one of claims 1 to 7.
9. A computer storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the method described in any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.
