Instantaneous flow intelligent peak elimination method, apparatus, equipment and its storage medium
By introducing a forward notification mechanism through Spring AOP annotations, the instantaneous traffic during flash sales can be identified and segmented, solving the problem of server downtime caused by traffic peaks during flash sales and achieving scientific traffic management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA PING AN PROPERTY INSURANCE CO LTD
- Filing Date
- 2023-04-13
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies cannot effectively eliminate instantaneous traffic spikes during flash sales, leading to excessive server load and frequent crashes. Furthermore, existing algorithms cannot perform scientific traffic processing before such incidents occur.
A Spring AOP annotation-based pre-notification mechanism is introduced. By recognizing the click commands and interfaces of users participating in the flash sale, the mechanism parses and filters the data, identifies and predicts traffic, and splits the traffic if it exceeds the peak value; otherwise, it sends the data directly to the result processing component.
Before processing flash sale tasks, instantaneous traffic statistics and control are performed to avoid traffic peaks exceeding limits, prevent server crashes, and extend processor lifespan.
Smart Images

Figure CN116471243B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of process optimization technology, and in particular to a method, apparatus, device and storage medium for intelligent elimination of instantaneous flow peaks. Background Technology
[0002] In typical traffic monitoring graphs for flash sale systems, the image appears as a straight line, extremely straight, right at the start of the sale. This is because flash sale requests are highly concentrated at a specific point in time. This results in an exceptionally high traffic spike, consuming resources instantaneously. In a flash sale scenario, the number of people who can ultimately purchase the item is fixed. That is, whether 100 people or 10,000 people submit requests, the result is the same: only 100 people will ultimately buy the item. This means that the higher the concurrency, the more invalid requests will ultimately occur. However, from a business perspective, a flash sale is a promotional activity, and the goal is to attract as many participants as possible. More invalid requests indicate a more successful promotion. However, at the start of the flash sale, these massive numbers of requests place a heavy burden on the servers running the flash sale, potentially causing processor crashes.
[0003] Currently, there are three main types of peak suppression algorithms on the market: First, they buffer requests using queues, controlling the issuance of requests. Second, they extend the request issuance time by using a quiz system, controlling the acceptance of requests after they are issued, and finally filtering out requests that do not meet the criteria. Third, they perform layered filtering of requests, filtering out invalid requests layer by layer to reduce the number of valid requests arriving at the end. However, these solutions are all post-event processing and cannot handle requests at the point of the event (e.g., during a flash sale). Therefore, existing technologies still have shortcomings in scientific rigor when performing instantaneous traffic peak suppression. Summary of the Invention
[0004] The purpose of this application is to propose a method, apparatus, device and storage medium for intelligent elimination of instantaneous flow peaks, so as to solve the problem that the existing technology is not scientific enough when performing instantaneous flow peak elimination processing.
[0005] To address the aforementioned technical problems, this application provides a method for intelligently eliminating instantaneous traffic peaks, employing the following technical solution:
[0006] A method for intelligently eliminating instantaneous flow peaks includes the following steps:
[0007] Based on the preset target annotations, the flash sale interface for the preceding target flash sale activity;
[0008] Based on the click command of the flash sale user and the flash sale interface of the target flash sale activity, the analysis is performed to obtain the analysis result. The click command of the flash sale user includes the identification identifier of the corresponding flash sale user and the flash sale click time.
[0009] Based on the analysis results, identify the corresponding flash sale interface for all flash sale users;
[0010] By counting the number of users participating in each flash sale, the predicted traffic for each flash sale interface can be obtained.
[0011] Based on the pre-set peak traffic for each of the flash sale interfaces and the predicted traffic for each flash sale interface, identify whether the predicted traffic of the target flash sale interface is greater than the peak traffic of the corresponding flash sale interface.
[0012] If it exists, the predicted traffic of the target flash sale interface is segmented, and the predicted traffic is controlled to be processed according to the segmentation result and the preset processing rules.
[0013] If it does not exist, the predicted traffic of the target flash sale interface will be sent to the flash sale result processing component for normal processing.
[0014] Furthermore, before executing the step of setting up the flash sale interface for the pre-defined target annotation, the method further includes:
[0015] Obtain pre-built declarative transaction management annotations as target annotations. These annotations are used to introduce AOP programming concepts based on the proxy pattern to supplement the application scenarios of OOP programming concepts and to implement forward advice under Spring AOP.
[0016] Obtain the API address for the target flash sale event;
[0017] The steps of defining the flash sale interface for the pre-defined target annotation and the flash sale activity specifically include:
[0018] Rewrite the corresponding API call method based on the flash sale API address of the target flash sale activity to obtain the rewritten API call method;
[0019] Configure the target annotation for the rewritten interface call method.
[0020] Furthermore, the step of parsing the click command of the user and the flash sale interface of the target flash sale activity to obtain the parsing result specifically includes:
[0021] Based on the preset flash sale interface execution log, obtain the distinctive identifiers of the flash sale users when all flash sale interfaces of the target flash sale activity are called in the current flash sale activity;
[0022] Based on the unique identifiers of all users participating in the flash sale and the addresses of all flash sale interfaces for the target flash sale activity, determine the flash sale interface corresponding to each user.
[0023] Furthermore, after performing the step of identifying the flash sale interface corresponding to all flash sale users based on the parsing results, the method further includes:
[0024] Based on the execution log of the flash sale interface, obtain the flash sale click time of all flash sale users when all flash sale interfaces of the target flash sale activity were called in the current flash sale activity;
[0025] Based on the click time of all users participating in the flash sale and the preset valid time period for the flash sale, users who do not meet the valid time period for the flash sale are filtered out, and valid users are retained.
[0026] Furthermore, before performing the step of obtaining the predicted traffic for each flash sale interface by counting the number of users corresponding to each flash sale interface, the method further includes:
[0027] Based on preset pre-filtering conditions, all users who do not meet the pre-filtering conditions are removed from the flash sale users, and valid flash sale users are retained. The pre-filtering conditions include whether they are eligible for the flash sale, whether the flash sale object is in normal status, whether the flash sale equivalent is sufficient, and whether the flash sale user's click command is an illegal request.
[0028] Furthermore, the step of obtaining the predicted traffic for each flash sale interface by counting the number of users participating in the flash sale for each interface specifically includes:
[0029] Get the unique identifiers of all valid flash sale users corresponding to each flash sale interface;
[0030] According to the preset statistical algorithm, the number of distinctive identifiers of the valid flash sale users corresponding to each flash sale interface is counted.
[0031] Obtain the number of distinctive identifiers of the valid flash sale users corresponding to each flash sale interface, and set the number of distinctive identifiers of the valid flash sale users as the predicted traffic of each flash sale interface.
[0032] Furthermore, the step of segmenting the predicted traffic of the target flash sale interface specifically includes:
[0033] Based on the preset time interval threshold and the effective time period of the flash sale, the effective time period of the flash sale is segmented and processed to obtain several different slices of the effective time period of the flash sale;
[0034] Get the click time of all valid users who participated in the flash sale for each flash sale interface;
[0035] Based on the preset statistical algorithm and the flash sale click time, the number of valid flash sale users corresponding to each flash sale interface under the several different valid flash sale time period slices is counted.
[0036] Furthermore, in the step of counting the number of valid flash sale users corresponding to each flash sale interface under several different valid flash sale time period slices according to the preset statistical algorithm and the flash sale click time, the method further includes:
[0037] By adjusting the time interval threshold, the number of valid flash sale users corresponding to each flash sale interface under the several different valid flash sale time period slices can be dynamically adjusted;
[0038] The dynamic adjustment will stop when the number of valid users corresponding to each flash sale interface under the several different valid flash sale time period slices is less than the traffic peak.
[0039] Furthermore, the step of controlling the processing of the predicted traffic based on the segmentation results and preset processing rules specifically includes:
[0040] Get the predicted traffic for any valid time period slice of the flash sale after dynamic adjustment, and send it to the flash sale result processing component for normal processing;
[0041] Get the predicted traffic for other valid time slots of the flash sale that have been dynamically adjusted, and send it to the preset cache container to wait for the flash sale result processing component to process it.
[0042] To address the aforementioned technical problems, this application also provides an instantaneous flow intelligent peak elimination device, which employs the following technical solution:
[0043] A device for intelligent elimination of instantaneous flow peaks, comprising:
[0044] The flash sale interface front-end module is used to prepare the flash sale interface for the target flash sale activity based on the preset target annotation.
[0045] The click instruction parsing module is used to parse the click instruction of the flash sale user and the flash sale interface of the target flash sale activity to obtain the parsing result. The click instruction of the flash sale user includes the distinguishing identifier of the corresponding flash sale user and the flash sale click time.
[0046] The flash sale interface identification module is used to identify the flash sale interface corresponding to all flash sale users based on the parsing results.
[0047] The traffic prediction module is used to obtain the predicted traffic for each flash sale interface by counting the number of users participating in the flash sale.
[0048] The comparison and identification module is used to identify whether the predicted traffic of the target flash sale interface is greater than the traffic peak of the corresponding flash sale interface, based on the traffic peak value set for each of the flash sale interfaces in advance and the predicted traffic of each flash sale interface.
[0049] The first processing module is used to, if present, segment the predicted traffic of the target flash sale interface, and control the processing of the predicted traffic according to the segmentation result and preset processing rules.
[0050] The second processing module is used to send the predicted traffic of the target flash sale interface to the flash sale result processing component for normal processing if the interface does not exist.
[0051] To address the aforementioned technical problems, this application also provides a computer device that employs the following technical solution:
[0052] A computer device includes a memory and a processor, wherein the memory stores computer-readable instructions, and the processor executes the computer-readable instructions to implement the steps of the instantaneous traffic intelligent peak elimination method described above.
[0053] To address the aforementioned technical problems, this application also provides a computer-readable storage medium, employing the technical solution described below:
[0054] A computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the instantaneous flow intelligent peak elimination method described above.
[0055] Compared with the prior art, the embodiments of this application have the following main advantages:
[0056] The instantaneous traffic intelligent peak elimination method described in this application embodiment, based on preset target annotations, pre-sets the flash sale interface of the target flash sale activity. The pre-set flash sale interface refers to transmitting instantaneous messages generated during the flash sale to a preset cache container via pre-notification, instead of directly transmitting them to a preset flash sale result processing component. Based on the click command of the flash sale user and the flash sale interface of the target flash sale activity, the method performs parsing to obtain the parsing result. The click command of the flash sale user includes a unique identifier for the corresponding flash sale user and the flash sale click time. Through the parsing result, the method identifies... The system identifies all flash sale users and their corresponding flash sale interfaces. By counting the number of users corresponding to each flash sale interface, it obtains the predicted traffic for each interface. Based on the pre-set peak traffic for all flash sale interfaces and the predicted traffic for each interface, it identifies whether the predicted traffic for a target flash sale interface exceeds the peak traffic for that interface. If so, the predicted traffic for the target interface is segmented, and the processing is controlled according to the segmentation result and preset processing rules. If not, the predicted traffic for the target interface is sent to the flash sale result processing component for normal processing. By introducing pre-notifications using Spring AOP annotations, instantaneous traffic is handled. Since pre-notification tasks are processed earlier than normal flash sale tasks, instantaneous traffic statistics can be completed before the flash sale task processing, preventing instantaneous traffic from exceeding the peak traffic during flash sale processing. This is more scientific and avoids processor crashes due to excessive instantaneous traffic, thus preventing processor lifespan delays. Attached Figure Description
[0057] To more clearly illustrate the solutions in this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 This is an exemplary system architecture diagram to which this application can be applied;
[0059] Figure 2 A flowchart of an embodiment of the instantaneous flow intelligent peak elimination method according to this application;
[0060] Figure 3 A schematic diagram of the structure of an embodiment of the instantaneous flow intelligent peak elimination device according to this application;
[0061] Figure 4 A schematic diagram of the structure of an embodiment of the computer device according to this application. Detailed Implementation
[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having," and any variations thereof, in the specification, claims, and foregoing drawings of this application, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification, claims, or foregoing drawings of this application are used to distinguish different objects, not to describe a particular order.
[0063] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0064] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0065] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0066] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social media platform software, etc.
[0067] Terminal devices 101, 102, and 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc.
[0068] Server 105 can be a server that provides various services, such as a backend server that supports the pages displayed on terminal devices 101, 102, and 103.
[0069] It should be noted that the instantaneous traffic intelligent peak elimination method provided in this application embodiment is generally executed by a server / terminal device, and correspondingly, the instantaneous traffic intelligent peak elimination device is generally installed in the server / terminal device.
[0070] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0071] To facilitate understanding, let's first introduce AOP (Aspect-Oriented Programming), which can be considered a supplement and improvement to OOP (Object-Oriented Programming). OOP introduces concepts such as encapsulation, inheritance, and polymorphism to establish an object hierarchy to simulate a set of common behaviors. However, OOP falls short when we need to introduce common behaviors for disparate objects. For example, a flash sale involves providing common behaviors for multiple disparate objects. Spring AOP often provides programming support in the form of annotations. This application aims to optimize the process of eliminating instantaneous traffic spikes by introducing Spring AOP annotations and AOP programming concepts. By introducing before-notification through Spring AOP annotations, instantaneous traffic is handled. Since the before-notification task is processed earlier than the normal flash sale task, instantaneous traffic statistics can be completed before the flash sale task is processed. Specifically, the flash sale click time is earlier than the before-notification time, and the before-notification time is earlier than the normal flash sale processing time.
[0072] Continue to refer to Figure 2 A flowchart of an embodiment of the instantaneous traffic intelligent peak elimination method according to this application is shown. The instantaneous traffic intelligent peak elimination method includes the following steps:
[0073] Step 201: Based on the preset target annotation, the flash sale interface for the preceding target flash sale activity.
[0074] In this embodiment, the flash sale interface of the pre-target flash sale activity refers to transmitting the instantaneous messages generated at the moment of the flash sale to a preset cache container through a pre-notification method, instead of directly transmitting them to the preset flash sale result processing component.
[0075] By using pre-defined target annotations to optimize the flash sale interface for the target flash sale activity, when instantaneous traffic is received, it can selectively transmit the traffic to a cache container instead of directly to the flash sale result processing component. This avoids the instantaneous traffic exceeding the peak traffic, thus preventing the processor from crashing due to excessive instantaneous traffic and extending its lifespan. By using Spring AOP pre-notification at the moment the flash sale action is initiated, instantaneous traffic prediction and processing are performed before the actual flash sale processing begins, preventing the instantaneous traffic from exceeding the peak traffic during flash sale processing, making it more scientific.
[0076] In this embodiment, before executing the step of setting up the flash sale interface of the target flash sale activity according to the preset target annotation, the method further includes: obtaining a pre-built declarative transaction management annotation as the target annotation, wherein the declarative transaction management annotation is used to introduce the AOP programming concept based on the proxy pattern to supplement the application scenario of the OOP programming concept and implement the pre-notification under Spring AOP; and obtaining the flash sale interface address of the target flash sale activity.
[0077] By introducing Spring AOP annotations, the AOP programming paradigm is introduced to supplement the OOP programming paradigm in the flash sale application scenario, providing flash sale business support for multiple dispersed flash sale users.
[0078] In this embodiment, the step of setting up the flash sale interface of the target flash sale activity according to the preset target annotation specifically includes: rewriting the corresponding interface call method according to the flash sale interface address of the target flash sale activity to obtain the rewritten interface call method; and configuring the target annotation for the rewritten interface call method.
[0079] By rewriting the calling method corresponding to the flash sale interface of the target flash sale activity and assigning target annotations to it, Spring AOP annotations are introduced. This introduces the AOP programming concept to supplement the OOP programming concept in the flash sale application scenario, providing flash sale business support for multiple dispersed flash sale users.
[0080] Step 202: Based on the click command of the user and the flash sale interface of the target flash sale activity, perform parsing and obtain the parsing result.
[0081] In this embodiment, the click instruction of the user who participated in the flash sale includes a distinguishing identifier for the user and the click time.
[0082] In this embodiment, the step of parsing the click command of the flash sale user and the flash sale interface of the target flash sale activity to obtain the parsing result specifically includes: obtaining the distinguishing identifiers of the flash sale users corresponding to all the flash sale interfaces of the target flash sale activity when they are called in the current flash sale activity according to the preset flash sale interface execution log; and determining the flash sale interface corresponding to all flash sale users according to the distinguishing identifiers of all flash sale users and the addresses of all flash sale interfaces of the target flash sale activity.
[0083] By identifying the unique identifiers of users participating in the flash sale, the corresponding flash sale interfaces for each user can be determined, making it easier for the program to later analyze the instantaneous traffic corresponding to each flash sale interface.
[0084] Step 203: Based on the parsing results, identify the flash sale interface corresponding to all flash sale users.
[0085] In this embodiment, after performing the step of identifying the flash sale interface corresponding to all flash sale users through the parsing result, the method further includes: obtaining the flash sale click time of all flash sale users when all flash sale interfaces of the target flash sale activity are called in the current flash sale activity according to the flash sale interface execution log; filtering out flash sale users who do not meet the flash sale valid time period according to the flash sale click time of all flash sale users and the preset flash sale valid time period, and retaining valid flash sale users.
[0086] By filtering out all users who were unable to participate in the flash sale due to the limited time frame, the instantaneous traffic was further reduced.
[0087] Step 204: Obtain the predicted traffic for each flash sale interface by counting the number of users participating in the flash sale for each interface.
[0088] In this embodiment, before performing the step of obtaining the predicted traffic of each flash sale interface by counting the number of flash sale users corresponding to each flash sale interface, the method further includes: filtering out flash sale users who do not meet the pre-filtering conditions from all flash sale users according to preset pre-filtering conditions, and retaining valid flash sale users.
[0089] By using the aforementioned pre-filtering conditions, all users who were invalidated due to the pre-filtering conditions are filtered out, further reducing instantaneous traffic.
[0090] In this embodiment, the pre-filtering conditions include whether the user is eligible for the flash sale, whether the flash sale object is in a normal state, whether the flash sale equivalent is sufficient, and whether the user's click command is an illegal request.
[0091] In this embodiment, the step of obtaining the predicted traffic of each flash sale interface by counting the number of flash sale users corresponding to each flash sale interface specifically includes: obtaining the distinguishing identifiers of all valid flash sale users corresponding to each flash sale interface; counting the number of distinguishing identifiers of the valid flash sale users corresponding to each flash sale interface according to a preset statistical algorithm; obtaining the number of distinguishing identifiers of the valid flash sale users corresponding to each flash sale interface, and setting the number of distinguishing identifiers of the valid flash sale users as the predicted traffic of each flash sale interface.
[0092] By statistically analyzing the number of valid users participating in each flash sale interface after secondary filtering, the instantaneous traffic for each flash sale interface is determined as the predicted traffic.
[0093] Step 205: Based on the traffic peak values pre-set for all flash sale interfaces and the predicted traffic for each flash sale interface, identify whether the predicted traffic of a target flash sale interface is greater than the traffic peak value of the corresponding flash sale interface.
[0094] By determining whether the predicted traffic exceeds a preset peak traffic value, the predicted traffic is classified and processed to avoid instantaneous traffic exceeding the peak traffic value, thereby preventing the processor from crashing due to excessive instantaneous traffic and extending the processor's lifespan.
[0095] Step 206: If it exists, the predicted traffic of the target flash sale interface is segmented, and the predicted traffic is processed according to the segmentation result and the preset processing rules.
[0096] In this embodiment, the step of segmenting the predicted traffic of the target flash sale interface specifically includes: segmenting the effective flash sale time period according to a preset time interval threshold and the effective flash sale time period to obtain several different effective flash sale time period slices; obtaining the flash sale click time of all effective flash sale users corresponding to each flash sale interface; and counting the number of effective flash sale users corresponding to each flash sale interface under the several different effective flash sale time period slices according to a preset statistical algorithm and the flash sale click time.
[0097] By dividing the time according to a preset time interval threshold and the effective time period of the flash sale, several different effective time period slices of the flash sale are obtained. The effective users under each effective time period slice of the flash sale are counted, and the predicted traffic corresponding to each flash sale interface under each effective time period slice of the flash sale is determined.
[0098] In this embodiment, during the step of counting the number of valid flash sale users corresponding to each flash sale interface under several different valid flash sale time period slices according to the preset statistical algorithm and the flash sale click time, the method further includes: dynamically adjusting the number of valid flash sale users corresponding to each flash sale interface under several different valid flash sale time period slices by adjusting the time interval threshold; and stopping the dynamic adjustment until the number of valid flash sale users corresponding to each flash sale interface under several different valid flash sale time period slices is less than the traffic peak.
[0099] By dynamically adjusting the traffic flow, it is ensured that the predicted traffic for each flash sale interface under each valid time period slice is less than the peak traffic. This makes it easier to send the corresponding predicted traffic to the flash sale result processing component for normal processing based on each valid time period slice. It also avoids the problem of peak traffic and ensures that the processor will not crash due to peak traffic.
[0100] In this embodiment, the step of controlling the processing of the predicted traffic according to the segmentation processing result and the preset processing rules specifically includes: obtaining the predicted traffic under any dynamically adjusted valid time period slice of the flash sale, and sending it to the flash sale result processing component for normal processing; obtaining the predicted traffic under other dynamically adjusted valid time period slices of the flash sale, and sending it to the preset cache container to wait for the flash sale result processing component to process it.
[0101] By controlling the predicted traffic during the effective time period of the flash sale and transmitting it to the flash sale result processing component, it is ensured that the processor will not crash due to traffic peaks.
[0102] Step 207: If it does not exist, the predicted traffic of the target flash sale interface is sent to the flash sale result processing component for normal processing.
[0103] This application, based on preset target annotations, establishes a pre-set target flash sale interface. This pre-set interface refers to transmitting instantaneous messages generated during the flash sale to a preset cache container via pre-notification, rather than directly to the preset flash sale result processing component. Based on the user's click command and the target flash sale interface, the application parses the data to obtain the parsing result. The user's click command includes a unique identifier for the user and the click time. Using the parsing result, the application identifies the target user for each flash sale. The system provides corresponding flash sale interfaces. It calculates the predicted traffic for each interface by counting the number of users participating in the flash sale. Based on the pre-set peak traffic for all flash sale interfaces and the predicted traffic for each interface, it identifies whether the predicted traffic for a target flash sale interface exceeds the peak traffic for the corresponding interface. If so, the predicted traffic for the target flash sale interface is segmented, and the processing is controlled according to the segmentation result and preset processing rules. If not, the predicted traffic for the target flash sale interface is sent to the flash sale result processing component for normal processing. By introducing pre-notifications using Spring AOP annotations, instantaneous traffic is handled. Since pre-notification tasks are processed earlier than normal flash sale tasks, instantaneous traffic statistics can be completed before the flash sale task processing, preventing instantaneous traffic from exceeding the peak traffic during flash sale processing. This is more scientific and avoids processor crashes due to excessive instantaneous traffic, thus preventing processor lifespan delays.
[0104] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0105] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0106] In this embodiment, the instantaneous traffic is handled by introducing a before-notification method using Spring AOP annotations. Since the before-notification task is processed earlier than the normal flash sale task, the instantaneous traffic can be counted before the flash sale task is processed, which avoids the instantaneous traffic exceeding the traffic peak during flash sale processing. This is more scientific and avoids the processor from crashing due to excessive instantaneous traffic, thus delaying the processor's lifespan.
[0107] Further reference Figure 3 As a response to the above Figure 2 The implementation of the method shown in this application provides an embodiment of an instantaneous flow intelligent peak elimination device, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0108] like Figure 3 As shown, the instantaneous traffic intelligent peak elimination device 300 described in this embodiment includes: a flash sale interface pre-module 301, a click instruction parsing module 302, a flash sale interface identification module 303, a traffic prediction module 304, a comparison identification module 305, a first processing module 306, and a second processing module 307. Wherein:
[0109] The flash sale interface front-end module 301 is used to pre-set the flash sale interface of the target flash sale activity according to the preset target annotation. The pre-set flash sale interface of the target flash sale activity refers to transmitting the instantaneous messages generated at the moment of the flash sale to the preset cache container through the pre-set notification method, instead of directly transmitting them to the preset flash sale result processing component.
[0110] The click instruction parsing module 302 is used to parse the click instruction of the flash sale user and the flash sale interface of the target flash sale activity to obtain the parsing result. The click instruction of the flash sale user includes the distinguishing identifier of the corresponding flash sale user and the flash sale click time.
[0111] The flash sale interface identification module 303 is used to identify the flash sale interface corresponding to all flash sale users based on the parsing results.
[0112] The traffic prediction module 304 is used to obtain the predicted traffic for each flash sale interface by counting the number of users corresponding to each flash sale interface.
[0113] The comparison and identification module 305 is used to identify whether the predicted traffic of the target flash sale interface is greater than the traffic peak of the corresponding flash sale interface, based on the traffic peak value set for each of the flash sale interfaces in advance and the predicted traffic of each flash sale interface.
[0114] The first processing module 306 is used to, if present, segment the predicted traffic of the target flash sale interface, and control the processing of the predicted traffic according to the segmentation result and preset processing rules.
[0115] The second processing module 307 is used to send the predicted traffic of the target flash sale interface to the flash sale result processing component for normal processing if the interface does not exist.
[0116] In some specific embodiments of this application, the instantaneous traffic intelligent peak elimination device 300 further includes a first filtering module. The first filtering module is used to obtain, according to the execution log of the flash sale interface, the flash sale click time of all flash sale users when all flash sale interfaces of the target flash sale activity are called in the current flash sale activity; and based on the flash sale click time of all flash sale users and a preset flash sale valid time period, filter out flash sale users who do not meet the flash sale valid time period and retain valid flash sale users.
[0117] In some specific embodiments of this application, the instantaneous traffic intelligent peak elimination device 300 further includes a second filtering module. The second filtering module is used to filter out all flash sale users who do not meet the pre-filtering conditions according to preset pre-filtering conditions, and retain valid flash sale users. The pre-filtering conditions include whether the user is qualified for flash sale, whether the flash sale object is in normal status, whether the flash sale equivalent is sufficient, and whether the click instruction of the flash sale user is an illegal request.
[0118] In some specific embodiments of this application, the instantaneous traffic intelligent peak elimination device 300 further includes a dynamic adjustment module. The dynamic adjustment module is used to dynamically adjust the number of valid flash sale users corresponding to each flash sale interface under the several different valid flash sale time period slices by adjusting the time interval threshold; and is also used to stop the dynamic adjustment until the number of valid flash sale users corresponding to each flash sale interface under the several different valid flash sale time period slices is less than the traffic peak.
[0119] This application, based on preset target annotations, establishes a pre-set target flash sale interface. This pre-set interface refers to transmitting instantaneous messages generated during the flash sale to a preset cache container via pre-notification, rather than directly to the preset flash sale result processing component. Based on the user's click command and the target flash sale interface, the application parses the data to obtain the parsing result. The user's click command includes a unique identifier for the user and the click time. Using the parsing result, the application identifies the target user for each flash sale. The system provides corresponding flash sale interfaces. It calculates the predicted traffic for each interface by counting the number of users participating in the flash sale. Based on the pre-set peak traffic for all flash sale interfaces and the predicted traffic for each interface, it identifies whether the predicted traffic for a target flash sale interface exceeds the peak traffic for the corresponding interface. If so, the predicted traffic for the target flash sale interface is segmented, and the processing is controlled according to the segmentation result and preset processing rules. If not, the predicted traffic for the target flash sale interface is sent to the flash sale result processing component for normal processing. By introducing pre-notifications using Spring AOP annotations, instantaneous traffic is handled. Since pre-notification tasks are processed earlier than normal flash sale tasks, instantaneous traffic statistics can be completed before the flash sale task processing, preventing instantaneous traffic from exceeding the peak traffic during flash sale processing. This is more scientific and avoids processor crashes due to excessive instantaneous traffic, thus preventing processor lifespan delays.
[0120] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware through computer-readable instructions. These computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the methods described above. The aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, optical disk, or read-only memory (ROM), or random access memory (RAM).
[0121] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0122] To address the aforementioned technical problems, embodiments of this application also provide a computer device. Please refer to [link / reference needed]. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0123] The computer device 4 includes a memory 4a, a processor 4b, and a network interface 4c that are interconnected via a system bus. It should be noted that only the computer device 4 with components 4a-4c is shown in the figure; however, it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively. Those skilled in the art will understand that the computer device described here is a device capable of automatically performing numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0124] The computer device can be a desktop computer, laptop, handheld computer, or cloud server, etc. The computer device can interact with the user via a keyboard, mouse, remote control, touchpad, or voice control.
[0125] The memory 4a includes at least one type of readable storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 4a may be an internal storage unit of the computer device 4, such as the hard disk or memory of the computer device 4. In other embodiments, the memory 4a may also be an external storage device of the computer device 4, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the computer device 4. Of course, the memory 4a may also include both the internal storage unit and its external storage device of the computer device 4. In this embodiment, the memory 4a is typically used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions for a method to intelligently eliminate peak traffic flow. In addition, the memory 4a can also be used to temporarily store various types of data that have been output or will be output.
[0126] In some embodiments, the processor 4b may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip. The processor 4b is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 4b is used to execute computer-readable instructions stored in the memory 4a or to process data, for example, to execute computer-readable instructions for the instantaneous traffic intelligent peak elimination method.
[0127] The network interface 4c may include a wireless network interface or a wired network interface, which is typically used to establish communication connections between the computer device 4 and other electronic devices.
[0128] The computer device proposed in this embodiment belongs to the field of instantaneous peak elimination process optimization technology. This application, based on a preset target annotation, establishes a pre-target flash sale interface. This pre-target flash sale interface refers to transmitting instantaneous messages generated during the flash sale to a preset cache container via a pre-notification method, rather than directly to a preset flash sale result processing component. Based on the user's click command and the target flash sale interface, the system parses the data to obtain the parsing result. The user's click command includes a unique identifier for the corresponding user and the click time. Using the parsing result, the system identifies the target user for each flash sale. The system provides corresponding flash sale interfaces. It calculates the predicted traffic for each interface by counting the number of users participating in the flash sale. Based on the pre-set peak traffic for all flash sale interfaces and the predicted traffic for each interface, it identifies whether the predicted traffic for a target flash sale interface exceeds the peak traffic for the corresponding interface. If so, the predicted traffic for the target flash sale interface is segmented, and the processing is controlled according to the segmentation result and preset processing rules. If not, the predicted traffic for the target flash sale interface is sent to the flash sale result processing component for normal processing. By introducing pre-notifications using Spring AOP annotations, instantaneous traffic is handled. Since pre-notification tasks are processed earlier than normal flash sale tasks, instantaneous traffic statistics can be completed before the flash sale task processing, preventing instantaneous traffic from exceeding the peak traffic during flash sale processing. This is more scientific and avoids processor crashes due to excessive instantaneous traffic, thus preventing processor lifespan delays.
[0129] This application also provides another embodiment, namely, providing a computer-readable storage medium storing computer-readable instructions that can be executed by a processor to cause the processor to perform the steps of the instantaneous flow intelligent peak elimination method described above.
[0130] The computer-readable storage medium proposed in this embodiment belongs to the field of instantaneous peak elimination and optimization technology. This application, based on a preset target annotation, establishes a pre-target flash sale interface. This pre-target flash sale interface refers to transmitting instantaneous messages generated during the flash sale to a preset cache container via a pre-notification method, rather than directly to a preset flash sale result processing component. Based on the user's click command and the target flash sale interface, the system parses the data to obtain the parsing result. The user's click command includes a unique identifier for the corresponding user and the click time. Using the parsing result, the system identifies all users' clicks. The system provides corresponding flash sale interfaces. It calculates the predicted traffic for each interface by counting the number of users participating in the flash sale. Based on the pre-set peak traffic for all flash sale interfaces and the predicted traffic for each interface, it identifies whether the predicted traffic for a target flash sale interface exceeds the peak traffic for the corresponding interface. If so, the predicted traffic for the target flash sale interface is segmented, and the processing is controlled according to the segmentation result and preset processing rules. If not, the predicted traffic for the target flash sale interface is sent to the flash sale result processing component for normal processing. By introducing pre-notifications using Spring AOP annotations, instantaneous traffic is handled. Since pre-notification tasks are processed earlier than normal flash sale tasks, instantaneous traffic statistics can be completed before the flash sale task processing, preventing instantaneous traffic from exceeding the peak traffic during flash sale processing. This is more scientific and avoids processor crashes due to excessive instantaneous traffic, thus preventing processor lifespan delays.
[0131] 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 device (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.
[0132] Obviously, the embodiments described above are only some embodiments of this application, not all embodiments. The accompanying drawings show preferred embodiments of this application, but do not limit the patent scope of this application. This application can be implemented in many different forms; rather, the purpose of providing these embodiments is to provide a more thorough and comprehensive understanding of the disclosure of this application. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing specific embodiments, or make equivalent substitutions for some of the technical features. Any equivalent structures made using the content of this application's specification and drawings, directly or indirectly applied to other related technical fields, are similarly within the scope of patent protection of this application.
Claims
1. A method for intelligently eliminating peak values in instantaneous flow, characterized in that, Includes the following steps: Based on the preset target annotations, the flash sale interface for the preceding target flash sale activity; Based on the click command of the flash sale user and the flash sale interface of the target flash sale activity, the analysis is performed to obtain the analysis result. The click command of the flash sale user includes the identification identifier of the corresponding flash sale user and the flash sale click time. Based on the analysis results, identify the corresponding flash sale interface for all flash sale users; By counting the number of users participating in each flash sale, the predicted traffic for each flash sale interface can be obtained. Based on the pre-set peak traffic for each of the flash sale interfaces and the predicted traffic for each flash sale interface, identify whether the predicted traffic of the target flash sale interface is greater than the peak traffic of the corresponding flash sale interface. If it exists, the predicted traffic of the target flash sale interface is segmented. Based on the segmentation result and the preset processing rules, the predicted traffic is processed. Specifically, the preset processing rules are as follows: from the predicted traffic corresponding to all flash sale valid time period slices included in the segmentation result, the predicted traffic under any flash sale valid time period slice is selected and sent to the flash sale result processing component for normal processing. The predicted traffic under other flash sale valid time period slices that are not selected is sent to a preset cache container to wait for the flash sale result processing component to process. If it does not exist, the predicted traffic of the target flash sale interface will be sent to the flash sale result processing component for normal processing.
2. The method for intelligently eliminating peak values in instantaneous flow according to claim 1, characterized in that, Before executing the step of setting up the flash sale interface for the pre-target flash sale activity based on the preset target annotation, the method further includes: Obtain pre-built declarative transaction management annotations as target annotations. These annotations are used to introduce AOP programming concepts based on the proxy pattern to supplement the application scenarios of OOP programming concepts and to implement forward advice under Spring AOP. Obtain the API address for the target flash sale event; The steps of defining the flash sale interface for the pre-defined target annotation and the flash sale activity specifically include: Rewrite the corresponding API call method based on the flash sale API address of the target flash sale activity to obtain the rewritten API call method; Configure the target annotation for the rewritten interface call method.
3. The method for intelligently eliminating peak values in instantaneous flow according to claim 1, characterized in that, The step of parsing the click command from the user and the flash sale interface of the target flash sale activity to obtain the parsing result specifically includes: Based on the preset flash sale interface execution log, obtain the distinctive identifiers of the flash sale users when all flash sale interfaces of the target flash sale activity are called in the current flash sale activity; Based on the unique identifiers of all users participating in the flash sale and the addresses of all flash sale interfaces for the target flash sale activity, determine the flash sale interface corresponding to each user.
4. The method for intelligently eliminating peak values in instantaneous flow according to claim 3, characterized in that, After performing the step of identifying the flash sale interface corresponding to all flash sale users based on the parsing results, the method further includes: Based on the execution log of the flash sale interface, obtain the flash sale click time of all flash sale users when all flash sale interfaces of the target flash sale activity were called in the current flash sale activity; Based on the click time of all users participating in the flash sale and the preset valid time period for the flash sale, users who do not meet the valid time period for the flash sale are filtered out, and valid users are retained.
5. The method for intelligently eliminating peak values in instantaneous flow according to claim 1, characterized in that, Before performing the step of obtaining the predicted traffic for each flash sale interface by counting the number of users corresponding to each flash sale interface, the method further includes: Based on preset pre-filtering conditions, all users who do not meet the pre-filtering conditions are removed from the flash sale users, and valid flash sale users are retained. The pre-filtering conditions include whether they are eligible for the flash sale, whether the flash sale object is in normal status, whether the flash sale equivalent is sufficient, and whether the flash sale user's click command is an illegal request.
6. The method for intelligently eliminating peak values in instantaneous flow according to claim 1, characterized in that, The step of obtaining the predicted traffic for each flash sale interface by counting the number of users participating in the flash sale for each interface specifically includes: Get the unique identifiers of all valid flash sale users corresponding to each flash sale interface; According to the preset statistical algorithm, the number of distinctive identifiers of the valid flash sale users corresponding to each flash sale interface is counted. Obtain the number of distinctive identifiers of the valid flash sale users corresponding to each flash sale interface, and set the number of distinctive identifiers of the valid flash sale users as the predicted traffic of each flash sale interface.
7. The method for intelligently eliminating peak values in instantaneous flow according to claim 4, characterized in that, The step of segmenting the predicted traffic of the target flash sale interface specifically includes: Based on the preset time interval threshold and the effective time period of the flash sale, the effective time period of the flash sale is segmented and processed to obtain several different slices of the effective time period of the flash sale; Get the click time of all valid users who participated in the flash sale for each flash sale interface; Based on the preset statistical algorithm and the flash sale click time, the number of valid flash sale users corresponding to each flash sale interface under the several different valid flash sale time period slices is counted.
8. The method for intelligently eliminating peak values in instantaneous flow according to claim 7, characterized in that, In the process of executing the step of counting the number of valid flash sale users corresponding to each flash sale interface under several different valid flash sale time period slices according to the preset statistical algorithm and the flash sale click time, the method further includes: By adjusting the time interval threshold, the number of valid flash sale users corresponding to each flash sale interface under the several different valid flash sale time period slices can be dynamically adjusted; The dynamic adjustment will stop when the number of valid users corresponding to each flash sale interface under the several different valid flash sale time period slices is less than the traffic peak.
9. The method for intelligently eliminating peak values in instantaneous flow according to claim 8, characterized in that, The step of controlling the processing of the predicted traffic based on the segmentation results and preset processing rules specifically includes: Get the predicted traffic for any valid time period slice of the flash sale after dynamic adjustment, and send it to the flash sale result processing component for normal processing; Get the predicted traffic for other valid time slots of the flash sale that have been dynamically adjusted, and send it to the preset cache container to wait for the flash sale result processing component to process it.
10. A device for intelligently eliminating peak values in instantaneous flow, characterized in that, include: The flash sale interface front-end module is used to prepare the flash sale interface for the target flash sale activity based on the preset target annotation. The click instruction parsing module is used to parse the click instruction of the flash sale user and the flash sale interface of the target flash sale activity to obtain the parsing result. The click instruction of the flash sale user includes the distinguishing identifier of the corresponding flash sale user and the flash sale click time. The flash sale interface identification module is used to identify the flash sale interface corresponding to all flash sale users based on the parsing results. The traffic prediction module is used to obtain the predicted traffic for each flash sale interface by counting the number of users participating in the flash sale. The comparison and identification module is used to identify whether the predicted traffic of the target flash sale interface is greater than the traffic peak of the corresponding flash sale interface, based on the traffic peak value set for each of the flash sale interfaces in advance and the predicted traffic of each flash sale interface. The first processing module is used to segment the predicted traffic of the target flash sale interface if it exists, and control the processing of the predicted traffic according to the segmentation processing result and the preset processing rules. Specifically, the preset processing rules are as follows: select the predicted traffic under any flash sale effective time period slice from the predicted traffic corresponding to all flash sale effective time period slices included in the segmentation processing result and send it to the flash sale result processing component for normal processing; send the predicted traffic under other flash sale effective time period slices that are not selected to a preset cache container to wait for the flash sale result processing component to process. The second processing module is used to send the predicted traffic of the target flash sale interface to the flash sale result processing component for normal processing if the interface does not exist.
11. A computer device comprising a memory and a processor, the memory storing computer-readable instructions, wherein the processor, when executing the computer-readable instructions, implements the steps of the instantaneous traffic intelligent peak elimination method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the instantaneous traffic intelligent peak elimination method as described in any one of claims 1 to 9.