Method, device, equipment and storage medium for blocking malicious requests of flash sale system

By obtaining and detecting the URL string in the spike system to obtain the spike address, the fairness and user experience problems caused by malicious requests have been solved, and a more fair and efficient spike experience is achieved.

CN115484066BActive Publication Date: 2025-01-28CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210998362.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-19
Publication Date
2025-01-28
Estimated Expiration
2042-08-19

AI Technical Summary

Technical Problem

In the flash sale system, malicious requests directly obtain the flash sale interface lead to a decrease in fairness and poor user experience.

Method used

By obtaining the URL string of the unified resource positioning character triggered by the user, you can detect whether there is a matching string in the preset cache server. If you exist, obtain the spike address, otherwise it will be judged as a malicious request and a response.

Benefits of technology

Effectively avoid the malicious spike of the spike address in advance, greatly enhance the fairness and user experience of spikes, and curb the re -occurrence of malicious requests from the root cause.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115484066B_ABST
    Figure CN115484066B_ABST
Patent Text Reader

Abstract

The present application relates to the field of computer software technology, and in particular to a method, device, equipment and storage medium for blocking malicious requests of a flash sale system, wherein the method includes: obtaining a flash sale request generated by a user triggering a uniform resource locator URL string; detecting whether there is a string matching the URL string in a preset cache server; when detecting the existence of a string matching the URL string, obtaining the flash sale address of the target product based on the URL string, otherwise determining that the flash sale request is a malicious request and prohibiting the response to the flash sale request. Thus, the problem of directly obtaining the flash sale address through the request interface in the related technology is solved, resulting in the inability to avoid malicious flash sales, reducing the fairness of flash sales, and poor user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software technology, and in particular to a method, device, equipment and storage medium for blocking malicious requests of a flash sale system. Background Art

[0002] During a flash sale, if there is a malicious flash sale, users may not be able to buy the product, which reduces the flash sale experience. This is because the speed of human hands is much slower than the speed of machine requests. For example, malicious buyers can view the web page code based on the browser's developer mode, obtain the flash sale interface request address, and then use the ticket grabbing system to easily grab tickets or discounted products, which is very unfair to other users.

[0003] In the related art, the flash sale system controls the access frequency of each IP through Nginx, determines whether the access frequency of the IP exceeds the access frequency threshold of the IP, and discards the request if it exceeds. Although restrictions are imposed on the access of the same IP, reducing the concurrency, malicious buyers can still obtain the flash sale request interface in advance through the ticket grabbing system, and conduct flash sale activities through different IPs, which still cannot guarantee the fairness of the flash sale for users, and the user experience is poor. Summary of the invention

[0004] The present application provides a method, device, electronic device and storage medium for blocking malicious requests of a flash sale system, so as to solve the problems in the related art of directly obtaining the flash sale address through a request interface, resulting in the inability to avoid malicious flash sales, reducing the fairness of flash sales, and causing poor user experience.

[0005] The first aspect of the present application provides a method for blocking malicious requests of a flash sale system, comprising the following steps: obtaining a flash sale request generated by a user triggering a uniform resource locator URL string; detecting whether there is a string matching the URL string in a preset cache server; and upon detecting the presence of a string matching the URL string, obtaining a flash sale address of a target product based on the URL string, otherwise determining that the flash sale request is a malicious request and prohibiting a response to the flash sale request.

[0006] According to the above technical means, the embodiment of the present application can obtain the flash sale address based on the URL. Since the flash sale address cannot be obtained directly and needs to be obtained through the URL, the request address of the flash sale cannot be obtained in advance, thereby effectively avoiding the situation of malicious flash sale by obtaining the flash sale address in advance, greatly improving the fairness of the flash sale and enhancing the user experience.

[0007] Furthermore, after determining that the flash sale request is a malicious request, the method further includes: obtaining an actual IP address of the flash sale request; and prohibiting all flash sale requests whose response address is the actual IP address.

[0008] According to the above technical means, after determining that a flash sale request is a malicious request, the embodiment of the present application obtains the actual IP address of the flash sale request and prohibits all flash sale requests from this IP address, thereby curbing the recurrence of malicious requests from the root and ensuring the fairness of other users' purchases or ticket grabbing.

[0009] Furthermore, before detecting whether there is a character string matching the URL character string in the preset cache server, it includes: obtaining the flash sale address of the target product; randomly encrypting the flash sale address to generate the URL character string of the target product, and storing the URL character string of the target product and the flash sale address in the preset cache server.

[0010] According to the above technical means, the embodiment of the present application can encrypt and store the flash sale address in advance to avoid the situation where the flash sale address is obtained in advance for malicious flash sales, greatly improve the fairness of the flash sales, and enhance the user experience.

[0011] Furthermore, before obtaining the flash sale request generated by the user triggering the uniform resource locator URL string, it includes: detecting whether the current moment meets the preset push condition; when it is detected that the current moment meets the preset push condition, pushing the URL string of the target product to the subscribed user.

[0012] According to the above-mentioned technical means, the embodiment of the present application detects whether the set push conditions are met at this time, and if so, pushes the URL string of the target product to the subscribed user, thereby subscribing the URL string of the product required by the user to the user in a safe manner, thereby ensuring the uniqueness of the product purchased by each user and the fairness of the purchase or ticket grabbing.

[0013] Furthermore, before pushing the URL string of the target product to the subscribed user, it includes: obtaining the user's identity; establishing a connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity, and subscribing to the push service.

[0014] According to the above technical means, before pushing the URL string of the product required by the user to the user, the embodiment of the present application needs to obtain the user's real identity, establish a connection with the server based on the identity identifier, and subscribe to the push service to prevent others from impersonating the identity and maliciously stealing the URL string of the target product, thereby improving security.

[0015] Furthermore, before establishing the connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server respectively according to the identity identifier, it includes: when detecting that a user logs in to the front-end page layer, identifying whether the user's account is already online; if the account is offline, or the account is online and the account is logged out, logging in to the account at the front-end page layer.

[0016] According to the above technical means, the embodiment of the present application detects the user's login status, determines whether the user is online, and restricts the login, allowing only one client of the user to be online, avoiding multiple logins for one account and initiating malicious applications.

[0017] Furthermore, the identification of whether the user's account is already online includes: when the front-end page layer calls the login interface, detecting whether there is a session message of the account in the business service layer; if there is session information of the account, determining that the account is already online in other clients.

[0018] According to the above-mentioned technical means, the embodiment of the present application detects whether there is a session message in the user's account when calling the login interface through the front-end page layer. If there is a message, the account is online; if there is no message, the account is offline. It detects whether the user is online in other clients and allows the user to choose whether to log in to this device to avoid multiple logins for one account and initiate malicious applications.

[0019] The second aspect of the present application provides a malicious request blocking device for a flash sale system, including: an acquisition module, used to acquire a flash sale request generated by a user triggering a uniform resource locator URL string; a detection module, used to detect whether there is a string matching the URL string in a preset cache server; a processing module, used to acquire the flash sale address of a target product based on the URL string when a string matching the URL string is detected, otherwise the flash sale request is determined to be a malicious request, and the response to the flash sale request is prohibited.

[0020] Furthermore, the processing module is used to: after determining that the flash sale request is a malicious request, obtain the actual IP address of the flash sale request; and prohibit all flash sale requests whose response address is the actual IP address.

[0021] Furthermore, the detection module is used to: obtain the flash sale address of the target product before detecting whether there is a string matching the URL string in the preset cache server; randomly encrypt the flash sale address to generate the URL string of the target product, and store the URL string of the target product and the flash sale address in the preset cache server.

[0022] Furthermore, the acquisition module is used to: before acquiring the flash sale request generated by the user triggering the uniform resource locator URL string, detect whether the current moment meets the preset push condition; when it is detected that the current moment meets the preset push condition, push the URL string of the target product to the subscribed user.

[0023] Furthermore, the acquisition module is further used to: obtain the user's identity before pushing the URL string of the target product to the subscribed user; establish a connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity, and subscribe to the push service.

[0024] Furthermore, the acquisition module is further used for: before establishing the connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity identifier, when it is detected that the user logs into the front-end page layer, identifying whether the user's account is already online; if the account is offline, or the account is online and the account is logged out, logging in to the account at the front-end page layer.

[0025] Furthermore, the acquisition module is further used to: when the front-end page layer calls the login interface, detect whether there is a session message of the account in the business service layer; if there is session information of the account, determine that the account is already online in other clients.

[0026] The third aspect of the present application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the malicious request blocking method of the flash sale system as described in the above embodiment.

[0027] The fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement the malicious request blocking method of the flash sale system as described in the above embodiment.

[0028] Therefore, this application has at least the following beneficial effects:

[0029] (1) The embodiment of the present application can obtain the flash sale address based on the URL. Since the flash sale address cannot be obtained directly but needs to be obtained through the URL, the request address of the flash sale cannot be obtained in advance, thereby effectively avoiding the situation where the flash sale address is obtained in advance for malicious flash sales, greatly improving the fairness of the flash sale and enhancing the user experience.

[0030] (2) After determining that a flash sale request is a malicious request, the embodiment of the present application obtains the actual IP address of the flash sale request and prohibits all flash sale requests from this IP address, thereby preventing the recurrence of malicious requests from the root and ensuring the fairness of other users' purchases or ticket grabbing.

[0031] (3) The embodiment of the present application can encrypt and store the flash sale address in advance to avoid the situation where the flash sale address is obtained in advance for malicious flash sales, greatly improving the fairness of the flash sales and enhancing the user experience.

[0032] (4) The embodiment of the present application detects whether the set push conditions are met at this time. If so, the URL string of the target product is pushed to the subscribed user, thereby subscribing the URL string of the product required by the user to the user in a safe manner, thereby ensuring the uniqueness of the product purchased by each user and the fairness of the purchase or ticket grabbing.

[0033] (5) Before pushing the URL string of the product required by the user to the user, the embodiment of the present application needs to obtain the user's real identity, establish a connection with the server based on the identity identifier, and subscribe to the push service to prevent others from impersonating the identity and maliciously stealing the URL string of the target product, thereby improving security.

[0034] (6) The embodiment of the present application detects the user's login status, determines whether the user is online, and restricts the login, allowing only one client of the user to be online, thereby preventing one account from logging in to multiple locations and initiating malicious applications.

[0035] (7) The embodiment of the present application detects whether there is a session message in the user's account when calling the login interface through the front-end page layer. If there is a message, the account is online; if there is no message, the account is offline. It detects whether the user is online in other clients and allows the user to choose whether to log in to this device to avoid multiple logins for one account and initiate malicious applications.

[0036] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0038] Figure 1 It is a flow chart of a method for preventing malicious requests in a flash sale system according to an embodiment of the present application;

[0039] Figure 2 A communication flow chart of a method for preventing malicious requests in a flash sale system according to an embodiment of the present application;

[0040] Figure 3 This is a flowchart of a method for preventing malicious requests in a flash sale system according to an embodiment of the present application;

[0041] Figure 4 This is an example diagram of a malicious request blocking device of a flash sale system according to an embodiment of the present application;

[0042] Figure 5 Schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0043] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0044] The following describes the malicious request blocking method, device, electronic device and storage medium of the flash sale system of the embodiment of the present application with reference to the accompanying drawings. In view of the problem mentioned in the above background technology that the flash sale address is directly obtained through the request interface, resulting in the inability to avoid malicious flash sales, reducing the fairness of flash sales, and poor user experience, the present application provides a malicious request blocking method for a flash sale system. In this method, the flash sale address is obtained based on the URL. Since the flash sale address cannot be obtained directly and needs to be obtained through the URL, the request address of the flash sale cannot be obtained in advance, thereby effectively avoiding the malicious flash sale by obtaining the flash sale address in advance, greatly improving the fairness of the flash sale, and improving the user experience. As a result, the problem of directly obtaining the flash sale address through the request interface in the related technology, resulting in the inability to avoid malicious flash sales, reducing the fairness of the flash sale, and poor user experience is solved.

[0045] Specifically, Figure 1 A flowchart of a method for preventing malicious requests in a flash sale system provided in an embodiment of the present application.

[0046] like Figure 1 As shown, the malicious request blocking method of the flash sale system includes the following steps:

[0047] In step S101, a flash sale request generated by a user triggering a uniform resource locator URL string is obtained.

[0048] Among them, the Uniform Resource Locator, referred to as URL, is the address used to identify a resource on the Internet, namely the "Web address".

[0049] It is understandable that the embodiments of the present application can process the initiated network request by obtaining the dynamic URL address of the flash sale product triggered by the user.

[0050] In an embodiment of the present application, before obtaining the flash sale request generated by the user triggering the uniform resource locator URL string, it includes: detecting whether the current moment meets the preset push conditions; when it is detected that the current moment meets the preset push conditions, pushing the URL string of the target product to the subscribed user.

[0051] Among them, the preset push condition can be that the server time is about to reach the flash sale time, which can be adjusted according to the actual situation and is not specifically limited here.

[0052] It can be understood that the embodiment of the present application detects whether the set push conditions are met at this time, and if so, pushes the URL string of the target product to the subscribed user, thereby subscribing the URL string of the product required by the user to the user in a safe manner, thereby ensuring the uniqueness of the product purchased by each user and the fairness of the purchase or ticket grabbing.

[0053] Specifically, the business service layer uses the elastic-job distributed timing framework to implement a timing task; when the flash sale time is reached, the business service layer pushes the dynamic URL string generated by the above encryption algorithm to the topic (title) generated by the current user ID through MQTT (Message Queuing Telemetry Transport).

[0054] In an embodiment of the present application, before pushing the URL string of the target product to the subscribed user, it includes: obtaining the user's identity; establishing a connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity, and subscribing to the push service.

[0055] The identity identifier may be a user's ID (IDentity document, account number) and token, which is not specifically limited here.

[0056] Among them, the telemetry transmission MQTT server is used for IoT data exchange.

[0057] It is understandable that before the embodiment of the present application pushes the URL string of the product required by the user to the user, it is necessary to obtain the user's real identity, establish a connection with the server based on the identity identifier, and subscribe to the push service to prevent others from impersonating the identity and maliciously stealing the URL string of the target product, thereby improving security.

[0058] In an embodiment of the present application, before the front-end page layer and the business service layer are connected to the back-end message queue telemetry transmission MQTT server according to the identity identification, it includes: when it is detected that the user logs in to the front-end page layer, identifying whether the user's account is already online; if the account is offline, or the account is online and the account is logged out, logging in to the account at the front-end page layer.

[0059] It can be understood that the embodiment of the present application detects the user's login status, determines whether the user is online, and restricts the login, allowing only one client of the user to be online, thereby avoiding multiple logins for one account and initiating malicious applications.

[0060] Specifically, when the user logs in, the front-end page layer verifies whether the user is online in other clients based on the information returned by the login interface of the business service layer. If the user is online, it will prompt that the user is online and let the user choose whether to force login. If the user chooses forced login, the online user account of other clients will be offline; if the user is not online in other clients, the front-end page layer obtains the connection information of the back-end MQTT (message queue telemetry transmission) server through the interface of the business service layer, establishes a one-way authenticated websocket connection with MQTT for the current user's user ID (account) and token, and subscribes to the topic generated by the user ID. When the business service layer pushes the dynamic URL to the topic through the MQTT service, the front-end obtains the dynamic URL address from the topic and then initiates a network request.

[0061] In an embodiment of the present application, identifying whether a user's account is already online includes: when calling a login interface at the front-end page layer, detecting whether there is a session message of the account at the business service layer; if there is session information of the account, determining that the account is already online at other clients.

[0062] It can be understood that the embodiment of the present application detects whether there is a session message in the user's account when calling the login interface through the front-end page layer. If there is a message, the account is online. If there is no message, the account is offline. It detects whether the user is online in other clients and allows the user to choose whether to log in to this device to avoid multiple logins for one account and initiate malicious applications.

[0063] Specifically, the front-end page layer calls the login interface and first determines whether the user's session information already exists. If so, it returns to the front-end page layer the information that the user has logged in on other clients. Otherwise, it obtains the current user ID and token to establish an MQTT one-way authenticated SSL connection; if the user forces a login, the business service layer will remove the existing session information, and after a successful login, it will establish an MQTT one-way authenticated SSL (Secure Sockets Layer) connection through the current user ID and token.

[0064] In step S102, it is detected whether there is a character string matching the URL character string in the preset cache server.

[0065] The preset cache server may use Redis, and Redis adopts a cluster plus sentinel mode to achieve high availability, which is not specifically limited here.

[0066] It can be understood that the embodiment of the present application determines whether the user's request is malicious based on whether the URL string triggered by the user is detected in the preset server, and prepares for the subsequent execution of related actions.

[0067] In an embodiment of the present application, before detecting whether there is a character string matching the URL character string in the preset cache server, it includes: obtaining the flash sale address of the target product; randomly encrypting the flash sale address to generate the URL character string of the target product, and storing the URL character string and the flash sale address of the target product in the preset cache server.

[0068] The encryption may be an MD5 (Message Digest Algorithm 5) encryption algorithm, which is not specifically limited herein.

[0069] It is understandable that the embodiments of the present application can encrypt and store the flash sale address in advance to avoid the situation where the flash sale address is obtained in advance for malicious flash sales, greatly improve the fairness of the flash sales, and enhance the user experience.

[0070] Specifically, the business service layer uses the MD5 encryption algorithm to encrypt the current user's flash sale request address into a dynamic URL (the current reliable encryption algorithm is MD5 encryption, because MD5 is an irreversible encryption algorithm), and caches the generated dynamic URL string and the real flash sale address to the cache server. The cache server uses the most commonly used Redis, and Redis uses a cluster plus sentinel mode to achieve high availability.

[0071] In step S103, when a character string matching the URL character string is detected, the flash sale address of the target product is obtained based on the URL character string, otherwise the flash sale request is determined to be a malicious request and is prohibited from being responded to.

[0072] It can be understood that in the embodiment of the present application, when a matching string is detected in the preset server after the user triggers the URL string, the user can obtain the flash sale address of the target product; but when the match is unsuccessful, it is judged as a malicious request and the response is prohibited, which greatly avoids malicious flash sale requests, greatly improves the fairness of flash sales, and enhances the user experience.

[0073] In the embodiment of the present application, after determining that the flash sale request is a malicious request, it also includes: obtaining the actual IP address of the flash sale request; and prohibiting all flash sale requests whose response address is the actual IP address.

[0074] The actual IP address may be the actual Internet Protocol address of the computer that the user logs into.

[0075] It can be understood that after determining that the flash sale request is a malicious request, the embodiment of the present application obtains the actual IP address of the flash sale request and prohibits all flash sale requests from this IP address, thereby curbing the recurrence of malicious requests from the root and ensuring the fairness of other users' purchases or ticket grabbing.

[0076] Specifically, after receiving the request from the front end, the business service layer processes the request to obtain the dynamic URL and checks whether the URL exists in the cache server. If so, the real flash sale address is extracted and the request is forwarded to the address to process the product flash sale. If not, it means that the request is a malicious request and subsequent business is not allowed to continue. The business service layer can discard the request or record the requested IP address and blacklist it.

[0077] According to the malicious request blocking method of the flash sale system proposed in the embodiment of the present application, the method can obtain the flash sale address based on the URL. Since the flash sale address cannot be obtained directly and needs to be obtained through the URL, the request address of the flash sale cannot be obtained in advance, thereby effectively avoiding the situation of obtaining the flash sale address in advance for malicious flash sale, greatly improving the fairness of the flash sale and improving the user experience. Therefore, the problem of obtaining the flash sale address directly through the request interface in the related technology, which still cannot avoid the malicious flash sale situation, reduces the fairness of the flash sale, and has a poor user experience is solved.

[0078] The following will be combined Figure 2 and Figure 3 The flowchart shown in the figure explains the method of blocking malicious requests of the flash sale system, as follows:

[0079] The user logs in to the front-end page. At this time, the front-end page layer calls the login interface to determine whether the user's session information already exists. If the user's session information exists, the information that the user has been online on other clients is returned to the front-end page layer. At this time, the user is online on other clients, and the user is prompted to be online. The user chooses whether to force login: If the user chooses forced login, the business service layer will remove the existing session information, and the online user account of other clients will be offline. At the same time, after the login is successful, the current user ID and token will be used to establish an MQTT one-way authenticated SSL connection, and subscribe to the topic, or the front-end page layer obtains the connection information of the back-end MQTT (message queue telemetry transmission) server through the interface of the business service layer, and the current user's user ID (account) and token will be used to establish a one-way authenticated websocket connection with MQTT, and subscribe to the topic generated by the user's ID;

[0080] If the user's session information does not exist, the front-end page layer obtains the connection information of the back-end MQTT (Message Queue Telemetry Transport) server through the interface of the business service layer, establishes a one-way authenticated websocket connection with MQTT using the current user's user ID (account) and token, and subscribes to the topic generated by the user ID.

[0081] After the business service layer pushes the dynamic URL to the topic through the MQTT service, the front end obtains the dynamic URL address from the topic and then initiates a network request. At this time, the business service layer polls whether the flash sale moment has arrived. This is because the business service layer uses the elastic-job distributed timing framework to implement a scheduled task and encrypts the current user's flash sale request address into a dynamic URL through the MD5 encryption algorithm. When the flash sale moment arrives, the business service layer pushes the dynamic URL string generated by the above encryption algorithm to the topic generated by the current user ID through MQTT. If the flash sale moment has not arrived, the query will continue.

[0082] At the same time, after receiving the request from the front end, the business service layer processes the request to obtain the dynamic URL and checks whether the URL exists in the cache server. If so, the real flash sale address is extracted and the request is forwarded to the address to process the product flash sale. If it does not exist, it means that the request is a malicious request and subsequent business is not allowed to continue. The business service layer can discard the request or record the requested IP address and blacklist it.

[0083] Next, a malicious request blocking device for a flash sale system according to an embodiment of the present application will be described with reference to the accompanying drawings.

[0084] Figure 4 It is a block diagram of a malicious request blocking device of a flash sale system according to an embodiment of the present application.

[0085] like Figure 4 As shown, the malicious request blocking device 10 of the flash sale system includes: an acquisition module 100, a detection module 200 and a processing module 300.

[0086] Among them, the acquisition module 100 is used to obtain the flash sale request generated by the user triggering the uniform resource locator URL string; the detection module 200 is used to detect whether there is a character string matching the URL string in the preset cache server; the processing module 300 is used to obtain the flash sale address of the target product based on the URL string when the existence of a character string matching the URL string is detected, otherwise the flash sale request is determined to be a malicious request and the response to the flash sale request is prohibited.

[0087] In an embodiment of the present application, the acquisition module 100 is used to: before acquiring the flash sale request generated by the user triggering the uniform resource locator URL string, detect whether the current moment meets the preset push conditions; when it is detected that the current moment meets the preset push conditions, push the URL string of the target product to the subscribed user.

[0088] In an embodiment of the present application, the acquisition module 100 is further used to: obtain the user's identity before pushing the URL string of the target product to the subscribed user; establish a connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity, and subscribe to the push service.

[0089] In an embodiment of the present application, the acquisition module 100 is further used for: before establishing the connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity identification, when it is detected that the user logs in to the front-end page layer, identifying whether the user's account is already online; if the account is offline, or the account is online and the account is logged out, logging in to the account at the front-end page layer.

[0090] In an embodiment of the present application, the acquisition module 100 is further used to: when the login interface is called at the front-end page layer, detect whether there is a session message of the account at the business service layer; if there is session information of the account, determine that the account is already online at other clients.

[0091] In an embodiment of the present application, the detection module 200 is used to: obtain the flash sale address of the target product before detecting whether there is a string matching the URL string in the preset cache server; randomly encrypt the flash sale address to generate the URL string of the target product, and store the URL string and flash sale address of the target product in the preset cache server.

[0092] In the embodiment of the present application, the processing module 300 is used to: after determining that the flash sale request is a malicious request, obtain the actual IP address of the flash sale request; and prohibit all flash sale requests whose response address is the actual IP address.

[0093] It should be noted that the above explanation of the embodiment of the method for preventing malicious requests of the second-hand selling system is also applicable to the device for preventing malicious requests of the second-hand selling system of this embodiment, and will not be repeated here.

[0094] According to the malicious request blocking device of the flash sale system proposed in the embodiment of the present application, the flash sale address can be obtained based on the URL. Since the flash sale address cannot be obtained directly and needs to be obtained through the URL, the request address of the flash sale cannot be obtained in advance, thereby effectively avoiding the situation of obtaining the flash sale address in advance for malicious flash sale, greatly improving the fairness of the flash sale and improving the user experience. Therefore, the problem of obtaining the flash sale address directly through the request interface in the related art, which still cannot avoid the malicious flash sale situation, reduces the fairness of the flash sale, and has a poor user experience is solved.

[0095] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0096] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0097] When the processor 502 executes the program, the malicious request blocking method of the flash sale system provided in the above embodiment is implemented.

[0098] Furthermore, the electronic device further comprises:

[0099] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0100] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0101] The memory 501 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0102] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (PerIPheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0103] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0104] The processor 502 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0105] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for preventing malicious requests in a flash sale system as described above is implemented.

[0106] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not necessarily directed to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0107] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0108] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0109] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0110] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0111] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A method for preventing malicious requests in a flash sale system, characterized in that: The following steps are involved: Get the flash sale request generated by the uniform resource locator URL string triggered by the user; Detect whether there is a character string matching the URL character string in a preset cache server, wherein the preset cache server adopts Redis, and the Redis adopts a cluster plus sentinel mode; When a character string matching the URL character string is detected, the target product's flash sale address is obtained based on the URL character string; otherwise, the flash sale request is determined to be a malicious request, and the flash sale request is prohibited from being responded to; Before detecting whether there is a character string matching the URL character string in the preset cache server, the method includes: Get the flash sale address of the target product; Randomly encrypt the flash sale address to generate a URL string of the target product, and store the URL string of the target product and the flash sale address in the preset cache server; Before obtaining the flash sale request generated by the user triggering the uniform resource locator URL string, including: Check whether the current moment meets the preset push conditions. The business service layer uses the elastic-job distributed timing framework to implement a timing task. When it is detected that the current moment satisfies the preset push condition, the business service layer pushes the URL string of the target product generated by the encryption algorithm to the subscribed user through MQTT to the topic generated by the current user ID.

2. The method according to claim 1, characterized in that After determining that the flash sale request is a malicious request, the method further includes: Get the actual IP address of the flash sale request; All flash sale requests whose response address is the actual IP address are prohibited.

3. The method according to claim 1, characterized in that Before pushing the URL string of the target product to the subscribed user, include: Get the user's identity; According to the identity identifier, the front-end page layer and the business service layer are connected to the back-end message queue telemetry transmission MQTT server respectively, and subscribe to the push service.

4. The method according to claim 3, characterized in that Before establishing the connection between the front-end page layer and the business service layer and the back-end message queue telemetry transmission MQTT server according to the identity identifier, it includes: When detecting that a user has logged into the front-end page layer, identifying whether the user's account is already online; If the account is offline, or the account is online and the account is logged out, log in to the account at the front-end page layer.

5. The method according to claim 4, characterized in that The identifying whether the user's account is already online includes: When the front-end page layer calls the login interface, detecting whether the business service layer has a session message of the account; If there is session information of the account, it is determined that the account is already online at another client.

6. A malicious request blocking device for a flash sale system, which is used to implement the malicious request blocking method for a flash sale system as claimed in any one of claims 1 to 5, characterized in that: include: An acquisition module is used to acquire a flash sale request generated by a user triggering a uniform resource locator URL string; A detection module, used to detect whether there is a character string matching the URL character string in a preset cache server; The processing module is used to obtain the flash sale address of the target product based on the URL string when a string matching the URL string is detected; otherwise, the flash sale request is determined to be a malicious request and the response to the flash sale request is prohibited.

7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the malicious request blocking method for a second sale system according to any one of claims 1 to 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the malicious request blocking method of the flash sale system as described in any one of claims 1-5.