Flow limiting method, device and equipment for seckilling service, medium and program product

By dynamically updating the current limit value in the cache area on the application server side of the flash sale system, and using the distributed configuration center to push the current limit value, the business continuity problem caused by the modification of the current limit value of the existing flash sale system is solved, and efficient current limit value adjustment and real-time update are achieved.

CN119583460APending Publication Date: 2025-03-07INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411900769.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The existing flash sale system leads to poor business continuity when the current limit value is modified, and requires manual performance monitoring, manual modification of the current limit value and restarting the system, which increases emergency steps and operating time.

Method used

By dynamically updating the current limit value in the cache area on the application server side, pushing the current limit value using the distributed configuration center side, and reloading it into the cache area under the running state of the flash sale service, avoiding business interruptions caused by system restart.

Benefits of technology

It realizes dynamic adjustment and real-time update of the current limit value of the flash sale system, improves the system's business continuity and emergency response capabilities, and reduces manual operation steps and time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119583460A_ABST
    Figure CN119583460A_ABST
Patent Text Reader

Abstract

The invention provides a flow limiting method for a seckilling service, which can be applied to the field of distributed technologies. The method comprises the steps of obtaining a client request; the client request is responded, a cache flow limiting value is obtained from a cache region of the application server side, flow limiting identification processing is conducted on the client request, and the cache flow limiting value in the cache region is dynamically updated in the state that the seckilling service is operated; in response to the client request subjected to the flow limiting identification processing, processing the client request subjected to the flow limiting identification processing; wherein the step of dynamically updating the current limiting value in the cache region comprises the substeps of receiving the current limiting value pushed by a distributed configuration center end electrically connected with the application server end; and the pushed flow limiting value is reloaded to the cache region. The invention further provides a flow limiting method, device and equipment for the seckilling service, a medium and a program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of distributed and financial technology, and more specifically to a flow limiting method, device, equipment, medium and program product for a flash sale service. Background Art

[0002] The description in this section merely provides background information related to the present disclosure and does not constitute prior art.

[0003] With the popularity of e-commerce, shopping on the Internet platform has become a common phenomenon. Flash sales are a limited-time online shopping activity for the purpose of promotion, allowing multiple people to buy goods online in real time. Bank financial products can also be sold in the form of flash sales. The current flash sales system can provide customers with core flash sales services, which generally include: maintaining flash sales product information before the flash sales, deducting inventory after the flash sales start, and querying the current flash sales inventory. For a flash sales system that only provides core flash sales services, the above three services are encapsulated into three http interfaces, so that different channel platforms can implement flash sales services by calling http interfaces.

[0004] However, the current method of configuring the current limit value in the flash sale system is to configure a fixed current limit value in the server configuration file, and then load the current limit value from the configuration file when the server starts, and write it to the server cache. If the current limit value needs to be modified, the server must be restarted for it to take effect. During the server restart process, the system cannot provide services to the outside world, which increases the difficulty of system emergency response and the time required for system recovery. The flash sale system sets different current limit values ​​for different interfaces to ensure the stability of the system during operation. When the system's performance capacity suddenly increases or reaches the upper limit of the performance capacity, the system's current limit value needs to be modified and reloaded in an emergency. The current emergency process requires manual monitoring of the system's performance capacity, manual modification of the current limit value and restart of the system, which increases the manual steps and operation time of the system emergency response.

[0005] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present invention and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because these solutions are described in the background technology section of the present invention. Summary of the invention

[0006] In view of the above problems, the present disclosure provides a flow limiting method, device, equipment, medium and program product for a flash sale service, which solves the problem of poor business continuity of the flash sale system due to the modification of the flow limiting value in the existing flash sale system.

[0007] According to the first aspect of the present disclosure, a flow limiting method for a flash sale service is provided, which is used on an application server side, and the method includes: obtaining a client request; in response to the client request, obtaining a cached flow limiting value from a cache area of ​​the application server side and performing flow limiting identification processing on the client request, wherein, when the flash sale service is running, the cached flow limiting value in the cache area is dynamically updated; in response to the client request after the flow limiting identification processing, processing the client request after the flow limiting identification processing; wherein, dynamically updating the flow limiting value in the cache area includes: receiving a flow limiting value pushed by a distributed configuration center side electrically connected to the application server side; and reloading the pushed flow limiting value into the cache area.

[0008] According to an embodiment of the present disclosure, the distributed configuration center end includes a server end, and multiple clients that are respectively long-connected to the server end, wherein the receiving of the current limiting value pushed by the distributed configuration center end electrically connected to the application server end includes: obtaining a first current limiting value pushed by a first client corresponding to the application server end, wherein the first client is the client corresponding to the application server end, and the first current limiting value is obtained by processing the change information broadcast and pushed by the server end by the first client, and the first current limiting value is the current limiting value under the environment and cluster corresponding to the application server end in the change information.

[0009] According to an embodiment of the present disclosure, the cached current limiting value includes multiple cached interface current limiting values ​​corresponding to different interface dimensions respectively, and the dynamic update of the current limiting value in the cache area includes: obtaining at least one second current limiting value pushed by the distributed configuration center, wherein the second current limiting value is the current limiting value changed and adjusted within the distributed configuration center; reloading the at least one second current limiting value into the cached interface current limiting value in the cache area corresponding to the same interface dimension as each second current limiting value.

[0010] According to an embodiment of the present disclosure, obtaining at least one second current limiting value pushed by the distributed configuration center includes: obtaining at least one second current limiting value pushed by the first client, wherein the second current limiting value is obtained by processing the change information broadcast by the server by the first client, and the second current limiting value is the current limiting value in the change information corresponding to different interface dimensions in the application server.

[0011] According to an embodiment of the present disclosure, when the flash sale service is started, the method for obtaining the current limiting value of the cache area includes: the application server side obtains a third current limiting value through the distributed configuration center side, wherein the third current limiting value is a current limiting value under the environment and cluster corresponding to the application server side in the distributed configuration center side; and the third current limiting value is written into the cache area of ​​the application server side.

[0012] According to an embodiment of the present disclosure, in response to the client request, the current limiting value is obtained from the cache area of ​​the application server and the client request is subjected to current limiting identification processing, including: standardizing the client request; and performing current limiting identification processing in the interface dimension on the client request after standardization.

[0013] According to an embodiment of the present disclosure, the standardized processing of the client request includes: obtaining interface service information of the client request; and performing interface service marking on the client request.

[0014] According to an embodiment of the present disclosure, the interface-dimensional flow limiting identification processing of the standardized customer requests includes: counting the number of customer requests per unit time for the first interface service to which the standardized customer requests belong, and obtaining the number of first customer requests for the first interface service; according to the cache interface flow limiting value of the first interface dimension corresponding to the first interface service in the cache area, presetting the maximum number of transactions processed per unit time for the first interface service as the fourth flow limiting value for the first interface service; if the first customer request number is greater than the corresponding fourth flow limiting value, data flow limiting is performed.

[0015] According to an embodiment of the present disclosure, the first interface service is the interface service tag corresponding to the client request after the standardized processing; the first interface dimension is the interface dimension corresponding to the first interface service.

[0016] According to a second aspect of the present disclosure, a flow limiting device for a flash sale service is provided, which is used on an application server side, and the device includes: a first acquisition module, used to obtain a client request; a first flow limiting module, used to obtain a flow limiting value from a cache area of ​​the application server side in response to the client request and perform flow limiting identification processing on the client request, wherein, when the flash sale service is running, the cached flow limiting value in the cache area is dynamically updated; a data processing module, which processes the client request after the flow limiting identification processing in response to the client request after the flow limiting identification processing; wherein, dynamically updating the flow limiting value in the cache area includes: receiving a flow limiting value pushed by a distributed configuration center end electrically connected to the application server side; and reloading the pushed flow limiting value into the cache area.

[0017] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the current limiting method for the flash sale service.

[0018] The fourth aspect of the present disclosure further provides a computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed by a processor, the steps of the flow limiting method of the above-mentioned flash sale service are implemented.

[0019] The fifth aspect of the present disclosure further provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the steps of the current limiting method for the above-mentioned flash sale service. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0021] Figure 1 A schematic diagram showing an application scenario of a flow limiting method, apparatus, device, medium, and program product for a flash sale service according to an embodiment of the present disclosure;

[0022] Figure 2 A flow chart schematically shows a method for limiting the flow of a flash sale service on an application server according to an embodiment of the present disclosure;

[0023] Figure 3 A first update flow chart of a method for limiting the flow of a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown;

[0024] Figure 4 A second update flow chart of the current limiting method for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown;

[0025] Figure 5 A flowchart schematically shows operation S200 of a method for limiting the flow of a flash sale service on an application server according to an embodiment of the present disclosure;

[0026] Figure 6 A flowchart schematically shows operation S210 of a method for limiting the flow of a flash sale service on an application server according to an embodiment of the present disclosure;

[0027] Figure 7 A flowchart schematically shows operation S220 of a method for limiting the flow of a flash sale service on an application server according to an embodiment of the present disclosure;

[0028] Figure 8 A flowchart of a method for obtaining a cache current limit value for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown;

[0029] Fig. 9 A first structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown;

[0030] Fig.10 A second structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown;

[0031] Fig.11 A third structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown;

[0032] Fig.12 A fourth structural block diagram schematically shows a current limiting device 200 for a flash sale service on an application server according to an embodiment of the present disclosure; and

[0033] Fig.13 A block diagram of an electronic device suitable for implementing a flow limiting method for a flash sale service according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0034] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0035] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0036] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0037] When using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted as the meaning of the expression generally understood by those skilled in the art. For example, "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc. When using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted as the meaning of the expression generally understood by those skilled in the art. For example, "a system having at least one of A, B, or C" should include but not be limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.

[0038] An embodiment of the present disclosure provides a flow limiting method for a flash sale service on an application server side.

[0039] Figure 1 The application scenario diagram of the flow limiting method, device, equipment, medium and program product of the flash sale service according to the embodiment of the present disclosure is schematically shown.

[0040] like Figure 1 As shown, the network 104 is used to provide a medium for communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables.

[0041] The user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as financial service applications, web browser applications, email clients, social platform software, etc.

[0042] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0043] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for information browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0044] It should be noted that, in the first aspect, the flow limiting method of the flash sale service provided in the embodiment of the present disclosure can be executed by the server 105, and in the second aspect, the flow limiting method of the flash sale service provided in the embodiment of the present disclosure can be executed by the first terminal device 101, the second terminal device 102 or the third terminal device 103. Accordingly, in the third aspect, the flow limiting device of the flash sale service provided in the embodiment of the present disclosure can be set in the server 105, and in the fourth aspect, the flow limiting device of the flash sale service provided in the embodiment of the present disclosure can be set in the first terminal device 101, the second terminal device 102 or the third terminal device 103. The flow limiting method of the flash sale service provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105. Accordingly, the flow limiting device of the flash sale service provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the first terminal device 101, the second terminal device 102, the third terminal device 103 and / or the server 105.

[0045] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0046] The following will be based on Figure 1 The scene described by Figure 2~Figure 7 The current limiting method for the flash sale service of the disclosed embodiment is described in detail.

[0047] Figure 2 A flowchart of a method for limiting the flow of a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0048] like Figure 2 As shown, the flow limiting method for the flash sale service of this embodiment includes operations S100 to S300.

[0049] In operation S100, a client request is obtained.

[0050] In the embodiments of this article, the obtained customer request comes from the first terminal device 101, the second terminal device 102 or the third terminal device 103 that interacts with the customer, where the access channels include but are not limited to PC, mini-programs, APP and other access channels of various application platforms.

[0051] In operation S200, in response to a client request, a cache current limit value is obtained from a cache area of ​​an application server and a current limit identification process is performed on the client request, wherein the cache current limit value in the cache area is dynamically updated when the flash sale service is running.

[0052] In one embodiment, the application server includes a transaction processing unit and a flow limiting processing unit. The obtained client request first passes through the flow limiting processing unit, and by calculating the tps value (Transaction per Second) of the access request, it is determined whether it exceeds the cache flow limiting value preset in the cache area. If it exceeds, the flow is limited. If it does not exceed the cache flow limiting value, the client request is forwarded to the transaction processing unit for data processing. In a specific embodiment, the number of client requests per second can be directly counted as the tps value of the client access request. In order to obtain a more reference value for the tps value of the client access request, the tps value of the client access request can also be calculated based on the number of client requests per day. For example, when the number of client requests per day is 1 million, 80% of the client requests per day occur within 8 hours of working time. It can be understood that the number of 800,000 client requests occurring within 8 hours of working time every day is the number of valid reference client requests. The tps value of the client access request can be calculated by the number of valid reference client requests. That is, by calculating the number of 800,000 client requests within 8 hours (i.e., 28,800 seconds), the number of client requests per second is calculated. Through calculation, we can get the TPS value of the client access request to be 27.78.

[0053] In operation S300 , in response to the client request after the flow limiting identification process, the client request after the flow limiting identification process is processed.

[0054] In a specific embodiment, the transaction processing unit of the application server performs business processing on the client request after the flow limiting identification process, returns it to the caller, and saves it in the data storage end, where the data storage end is composed of a database and a distributed cache for storing business data. In this embodiment, a monitoring unit can also be set in another server to monitor the operation of the application server and the data storage end and the performance capacity of the server such as the CPU usage rate and memory usage rate. When the performance of a certain module exceeds the threshold, an alarm is sent to the operation and maintenance personnel in real time. When the operation and maintenance personnel receive the alarm event, they can immediately start the emergency plan, modify the parameters on the distributed configuration center end and publish it.

[0055] Figure 3 A first update flow chart of a method for limiting the flow of a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0056] like Figure 3 As shown, in this embodiment, due to business needs, it is necessary to increase or decrease the cache flow limit value in the cache area. Therefore, when the flash sale service is running, the cache flow limit value in the cache area is dynamically updated. Specifically in this embodiment, dynamically updating the flow limit value in the cache area includes operations S400 to S500:

[0057] In operation S400, a current limiting value pushed by a distributed configuration center end electrically connected to an application server end is received;

[0058] In operation S500 , the pushed current limit value is reloaded into the cache area.

[0059] In this embodiment, the distributed configuration center is a platform for centralized management of configuration parameters of different environments and clusters. After the parameters are modified and published at the distributed configuration center, they can be pushed to the application server in real time. Upon receiving the parameter changes, the application server reloads the cache current limit value in the cache area, and can implement hot update of the cache current limit value without downtime, without affecting business continuity, avoiding the problem of the system being unable to provide services to the outside world during the server restart process, and also avoiding the problem of increasing the difficulty of system emergency response and the waiting time required for system recovery.

[0060] Figure 4 A second updated flow chart of the current limiting method for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0061] like Figure 4 As shown, in a specific embodiment of this invention, the cache current limiting value includes a plurality of cache interface current limiting values ​​corresponding to different interface dimensions respectively, so dynamically updating the current limiting value in the cache area includes: operation S400A to operation S500A.

[0062] In operation 400A, at least one second current limiting value pushed by the distributed configuration center is obtained, wherein the second current limiting value is a current limiting value changed and adjusted in the distributed configuration center. The number of second current limiting values ​​can be multiple, each second current limiting value has a corresponding interface dimension, and when there are multiple second current limiting values, each second current limiting value is used to reload the cache current limiting value of the same dimension corresponding to itself in the cache area.

[0063] In operation 500A, at least one second current limiting value is reloaded into the cached interface current limiting value corresponding to the same interface dimension as each second current limiting value in the cache area. In a specific embodiment, the cached current limiting value includes the cached interface current limiting value limit(a) corresponding to interface a, the cached interface current limiting value limit(b) corresponding to interface b, and the cached interface current limiting value limit(c) corresponding to interface c, respectively. The current limiting value changed and adjusted in the distributed configuration center end is the current limiting value corresponding to interface c and the current limiting value corresponding to interface b, so the two second current limiting values ​​are reloaded into the cache area, so that the second current limiting value corresponding to interface c is reloaded into the cached interface current limiting value limit(c) corresponding to interface c, and the second current limiting value corresponding to interface b is reloaded into the cached interface current limiting value limit(b) corresponding to interface b.

[0064] In a specific embodiment of the present invention, which will be briefly described as the first embodiment below, the distributed configuration center includes a server, and multiple clients that are respectively connected to the server for a long time, wherein the server is a distributed cluster that centrally stores configuration parameters. In one embodiment, the server provides an API interface (application programming interface), so that the client can access the server through the API interface and perform operations such as adding, modifying, deleting, and querying parameters. In one specific embodiment, the client is set in the built-in environment of the application server, and in another embodiment, the client is set outside the application server. In this embodiment, the server and the client establish a long connection, that is, the client and the server establish a subscription relationship. In this embodiment, multiple clients correspond to multiple application servers one by one, that is, each client subscribes to all parameter values ​​under the environment and cluster corresponding to each application server in the server. When the server pushes a change message to the outside, each client receives the change message and processes it and notifies the application server of the parameter value under the corresponding environment and cluster in the change message, so that the application server updates the cache current limit value in the cache area. In a specific embodiment, receiving the current limit value pushed by the distributed configuration center electrically connected to the application server includes: obtaining the current limit value corresponding to the application server. A first current limiting value is pushed by a first client corresponding to the server, wherein the first client is a client corresponding to the application server, and the first current limiting value is obtained by processing the change information broadcast and pushed by the first client to the server, and the first current limiting value is the current limiting value under the environment and cluster corresponding to the application server in the change information; by setting the server and the client, maintenance personnel only need to modify the corresponding parameters on the server, which can be broadcast to multiple clients, thereby achieving the effect of adjusting multiple application servers at a time with a single modification, avoiding the problem of low adjustment efficiency and poor emergency response capability caused by manual adjustment of each application server.

[0065] In another embodiment of the present invention, the second current limiting value is a current limiting value that is changed and adjusted in the distributed configuration center. Obtaining at least one second current limiting value pushed by the distributed configuration center includes: obtaining at least one second current limiting value pushed by the first client, wherein the second current limiting value is obtained by the first client processing the change information broadcast by the server, and the second current limiting value is the current limiting value corresponding to different interface dimensions in the application server in the change information. In a specific embodiment based on the first embodiment, the cache current limiting value includes a cache interface current limiting value limit(a) corresponding to interface a and a cache interface current limiting value limit(b) corresponding to interface b, respectively. The first client processes the change information broadcast by the server to obtain the second current limiting value corresponding to interface a and the second current limiting value corresponding to interface b. The first client notifies the second current limiting value corresponding to interface a and the second current limiting value corresponding to interface b to the application server, so that the second current limiting value corresponding to interface a is reloaded to the cache interface current limiting value limit(a) corresponding to interface a, and the second current limiting value corresponding to interface b is reloaded to the cache interface current limiting value limit(b) corresponding to interface b.

[0066] Figure 5 The flowchart of operation S200 of the current limiting method for the flash sale service on the application server side according to an embodiment of the present disclosure is schematically shown.

[0067] like Figure 5 As shown, in a specific embodiment of this invention, in response to a client request, obtaining a current limiting value from a cache area of ​​an application server and performing current limiting identification processing on the client request include: operations S210 to S220:

[0068] In operation S210, the client request is standardized.

[0069] In a specific embodiment, Figure 6 The flowchart of operation S210 of the method for limiting the flow of the flash sale service on the application server side according to the embodiment of the present disclosure is schematically shown. Figure 6 As shown, operation S210 includes: operation S211 to operation S212.

[0070] In operation S211, the interface service information requested by the customer is obtained. For example, the interface service information includes: maintaining flash sale product interface information, flash sale interface information, and querying flash sale inventory interface information.

[0071] In operation S212, the client request is marked with an interface service tag. The client request is marked with an interface service tag. For example, the interface information tag for maintaining the flash sale product, the interface information tag for the flash sale, and the interface information tag for querying the flash sale inventory, etc. By standardizing the data, it is helpful to classify and identify different interfaces of the standardized data in the future.

[0072] In operation S220, the standardized client request is subjected to flow limiting identification processing in the interface dimension.

[0073] In a specific embodiment, Figure 7 The flowchart of operation S220 of the method for limiting the flow of the flash sale service on the application server side according to the embodiment of the present disclosure is schematically shown. Figure 7 As shown, operation S220 includes: operation S221 to operation S223.

[0074] In operation S221, the number of client requests to the first interface service to which the standardized client requests belong within a unit time is counted to obtain the number of first client requests for the first interface service.

[0075] In this embodiment, the number of transactions of the first interface service to which the customer request belongs within a unit time can be obtained. For example, if the customer request is to query the flash sale inventory, the number of customer requests to the first interface service within a unit time can be counted, that is, the number of customer requests to query the flash sale inventory interface within a unit time. In other embodiments, the first interface service to which the customer request belongs can also be for maintaining flash sale products, etc.

[0076] In operation S222, according to the cache interface current limiting value of the first interface dimension corresponding to the first interface service in the cache area, the maximum number of transactions processed per unit time of the first interface service is preset as the fourth current limiting value of the first interface service.

[0077] In this embodiment, for example, according to the cache interface current limit value of the query flash sale inventory interface service in the cache area, the maximum number of transactions processed per unit time of the query flash sale inventory interface service can be preset as the current limit threshold of the query flash sale inventory interface service. Among them, the first interface service is the interface service tag corresponding to the customer request after standardization processing; the first interface dimension is the interface dimension corresponding to the first interface service.

[0078] In operation S223, if the number of first client requests is greater than the corresponding fourth flow limiting value, data flow limiting is performed.

[0079] In this embodiment, taking the customer request for maintaining the flash sale product interface as an example, if the number of customer requests for maintaining the flash sale product interface is greater than the preset flow limiting threshold for maintaining the flash sale product interface, data flow limiting is performed. Data flow limiting includes: obtaining the acquisition time of the customer request for maintaining the flash sale product interface; sorting the customer request for maintaining the flash sale product interface and the multiple customer requests that have been counted according to the acquisition time. If the number of customer requests for maintaining the flash sale product interface does not exceed the preset flow limiting threshold for maintaining the flash sale product interface, data processing is performed directly.

[0080] By classifying customer requests according to the interface dimension, we can avoid resource competition among different interfaces. Moreover, since the current limiting values ​​of different interfaces do not affect each other, we can avoid the problem of resource waste caused by different popularity of different interfaces and achieve the technical effect of rational resource utilization.

[0081] Figure 8 The following schematically shows a flow chart of a method for obtaining a cache current limit value for a flash sale service on an application server according to an embodiment of the present disclosure.

[0082] like Figure 8 As shown, in a specific embodiment of this invention, when the flash sale service is started, the method for obtaining the cache current limit value of the cache area includes: operation S600 to operation S700.

[0083] In operation S600, the application server side obtains a third current limiting value through the distributed configuration center side, wherein the third current limiting value is a current limiting value under the environment and cluster corresponding to the application server side in the distributed configuration center side; specifically in the present embodiment, the client side corresponding to the application server side can access the server side through the API interface and query the current limiting value under the environment and cluster corresponding to the application server side in the server side. In a specific embodiment, the current limiting value under the environment and cluster corresponding to the application server side in the server side may also include multiple current limiting values ​​corresponding to different interface dimensions.

[0084] In operation S700, the third current limiting value is written into the cache area of ​​the application server. In a specific embodiment, multiple current limiting values ​​of different interface dimensions corresponding to the application server in the server are written into the cache area to enable the current limiting mechanism, so that the application server can obtain the cached current limiting value in the cache area at any time during the operation of the flash sale service.

[0085] Based on the above-mentioned flow limiting method for the flash sale service, the present disclosure also provides a flow limiting device for the flash sale service, which is used on the application server side. Figure 9~Figure 12 The device is described in detail.

[0086] Fig. 9 A first structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0087] like Fig. 9 As shown, the flow limiting device 200 for the flash sale service of this embodiment includes a first acquisition module 210 , a first flow limiting module 220 , and a data processing module 230 .

[0088] The first acquisition module 210 is used to acquire a client request. In one embodiment, the first acquisition module 210 can be used to perform the operation S100 described above, which will not be described in detail here.

[0089] The first current limiting module 220 is used to obtain the current limiting value from the cache area of ​​the application server in response to the client request and perform current limiting identification processing on the client request, wherein the cache current limiting value in the cache area is dynamically updated when the flash sale service is running. In one embodiment, the first current limiting module 220 can be used to perform the operation S200 described above, which will not be repeated here.

[0090] The data processing module 230 is used to respond to the client request after the current limiting identification process and process the client request after the current limiting identification process. In one embodiment, the data processing module 230 can be used to perform the operation S300 described above, which will not be repeated here.

[0091] Fig.10 A second structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0092] like Fig.10 As shown, in a specific embodiment, the current limiting device 200 for the flash sale service further includes: a second acquisition module 240 and a first loading module 250 .

[0093] The second acquisition module 240 is used to receive the current limit value pushed by the distributed configuration center end electrically connected to the application server end; in one embodiment, the second acquisition module 240 can be used to perform the operation S400 described above, which will not be repeated here. In one embodiment, the second acquisition module 240 can also be used to obtain the first current limit value pushed by the first client corresponding to the application server end, wherein the first client is the client corresponding to the application server end, and the first current limit value is obtained by the first client processing the change information broadcast and pushed by the server end, and the first current limit value is the current limit value under the environment and cluster corresponding to the application server end in the change information.

[0094] The first loading module 250 is used to reload the pushed current limiting value into the cache area; in one embodiment, the first loading module 250 can be used to perform the operation S500 described above, which will not be repeated here.

[0095] Fig.11 A third structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0096] like Fig.11 As shown, in another specific embodiment, the cache current limiting value includes multiple cache interface current limiting values ​​corresponding to different interface dimensions respectively. Therefore, the current limiting device 200 for the flash sale service also includes: a third acquisition module 240A and a second loading module 250A.

[0097] The third acquisition module 240A is used to obtain at least one second current limiting value pushed by the distributed configuration center, wherein the second current limiting value is the current limiting value changed and adjusted within the distributed configuration center; in one embodiment, the third acquisition module 240A can be used to perform the operation S400A described above, which will not be repeated here. In one embodiment, the third acquisition module 240A can also be used to obtain at least one second current limiting value pushed by the first client, wherein the first client is a client corresponding to the application server, and the second current limiting value is obtained by the first client processing the change information broadcast by the server, and the second current limiting value is the second current limiting value corresponding to different interface dimensions in the application server in the change information.

[0098] The second loading module 250A is used to reload at least one second current limiting value into the cache interface current limiting value corresponding to the same interface dimension as each second current limiting value in the cache area; in one embodiment, the second loading module 250A can be used to perform the operation S500A described above, which will not be repeated here.

[0099] Fig.12 A fourth structural block diagram of a current limiting device 200 for a flash sale service on an application server side according to an embodiment of the present disclosure is schematically shown.

[0100] like Fig.12 As shown, in another specific embodiment, the current limiting device 200 for the flash sale service further includes: a fourth acquisition module 260 and a third loading module 270 .

[0101] The fourth acquisition module 260 is used for the application server to obtain the third current limiting value through the distributed configuration center, wherein the third current limiting value is the current limiting value under the environment and cluster corresponding to the application server in the distributed configuration center; in one embodiment, the fourth acquisition module 260 can be used to execute the operation S600 described above, which will not be repeated here.

[0102] The third loading module 270 is used to write the third current limiting value into the cache area of ​​the application server. In one embodiment, the third loading module 270 can be used to execute the operation S700 described above, which will not be repeated here.

[0103] In a specific embodiment, the first current limiting module 220 includes a standard module 221 and a current limiting module 222 .

[0104] The standard module 221 is used to perform standardized processing on the client request. In one embodiment, the standard module 221 can be used to execute the operation S210 described above, which will not be described in detail here.

[0105] The current limiting module 222 is used to perform current limiting identification processing in the interface dimension on the client request after standardization processing; in one embodiment, the current limiting module 222 can be used to execute the operation S220 described above, which will not be repeated here.

[0106] In a specific embodiment, the standard module 221 includes a fifth acquisition module 2211 and a marking module 2212 .

[0107] The fifth acquisition module 2211 is used to acquire the interface service information requested by the client. In one embodiment, the fifth acquisition module 2211 can be used to execute the operation S211 described above, which will not be described in detail here.

[0108] The marking module 2212 is used to perform interface service marking on the client request. In one embodiment, the marking module 2212 can be used to perform the operation S212 described above, which will not be repeated here.

[0109] In a specific embodiment, the current limiting module 222 includes a statistical module 2221 , a preset module 2222 and a judgment module 2223 .

[0110] The statistical module 2221 is used to count the number of customer requests to the first interface service to which the customer requests after standardization belong within a unit time, and obtain the number of first customer requests for the first interface service; in one embodiment, the statistical module 2221 can be used to execute the operation S221 described above, which will not be repeated here.

[0111] The preset module 2222 is used to preset the maximum number of transactions processed per unit time of the first interface service according to the cache interface current limiting value of the first interface dimension corresponding to the first interface service in the cache area, as the fourth current limiting value of the first interface service; in one embodiment, the preset module 2222 can be used to execute the operation S222 described above, which will not be repeated here.

[0112] The judgment module 2223 is used to perform data flow limiting if the number of first client requests is greater than the corresponding fourth flow limiting value; in one embodiment, the judgment module 2223 can be used to execute the operation S223 described above, which will not be repeated here.

[0113] According to an embodiment of the present disclosure, any multiple modules among the first acquisition module 210, the first current limiting module 220, the data processing module 230, the second acquisition module 240, the first loading module 250, the third acquisition module 240A, the second loading module 250A, the fourth acquisition module 260, the third loading module 270, the standard module 221, the current limiting module 222, the fifth acquisition module 2211, the marking module 2212, the statistics module 2221, the preset module 2222 and the judgment module 2223 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 210, the first current limiting module 220, the data processing module 230, the second acquisition module 240, the first loading module 250, the third acquisition module 240A, the second loading module 250A, the fourth acquisition module 260, the third loading module 270, the standard module 221, the current limiting module 222, the fifth acquisition module 2211, the marking module 2212, the statistical module 2221, the preset module 2222 and the judgment module 2223 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the first acquisition module 210, the first current limiting module 220, the data processing module 230, the second acquisition module 240, the first loading module 250, the third acquisition module 240A, the second loading module 250A, the fourth acquisition module 260, the third loading module 270, the standard module 221, the current limiting module 222, the fifth acquisition module 2211, the marking module 2212, the statistical module 2221, the preset module 2222 and the judgment module 2223 can be at least partially implemented as a computer program module, and when the computer program module is executed, the corresponding function can be executed.

[0114] Fig.13 A block diagram of an electronic device suitable for implementing a flow limiting method for a flash sale service according to an embodiment of the present disclosure is schematically shown.

[0115] like Fig.13As shown, the electronic device 900 according to an embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 to a random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a dedicated microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0116] In RAM 903, various programs and data required for the operation of electronic device 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other via bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.

[0117] According to an embodiment of the present disclosure, the electronic device 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The electronic device 900 may further include one or more of the following components connected to the input / output (I / O) interface 905: an input portion 906 including a keyboard, a mouse, etc.; an output portion 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 908 including a hard disk, etc.; and a communication portion 909 including a network interface card such as a LAN card, a modem, etc. The communication portion 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the input / output (I / O) interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage portion 908 as needed.

[0118] The present disclosure also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0119] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 902 and / or RAM 903 described above and / or one or more memories other than ROM 902 and RAM 903.

[0120] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the flow limiting method of the flash sale service provided in the embodiment of the present disclosure.

[0121] The above functions defined in the apparatus of the embodiment of the present disclosure are performed when the computer program is executed by the processor 901. According to the embodiment of the present disclosure, the apparatus described above can be implemented by a computer program module.

[0122] In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of a signal on a network medium, and downloaded and installed through the communication part 909, and / or installed from a removable medium 911. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0123] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the above-described means and the like can be implemented by a computer program module.

[0124] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0125] The flow chart and block diagram in the accompanying drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0126] It will be appreciated by those skilled in the art that the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations or combinations are not explicitly described in the present disclosure. In particular, without departing from the spirit and teachings of the present disclosure, the features described in the various embodiments of the present disclosure may be combined and / or combined in a variety of ways. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0127] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A method for limiting the flow of flash sales services, characterized in that: For application server side, the method comprises: Get customer requests; In response to the client request, a cache current limit value is obtained from the cache area of ​​the application server and a current limit identification process is performed on the client request, wherein the cache current limit value in the cache area is dynamically updated when the flash sale service is running; In response to a client request after current limiting identification processing, processing the client request after current limiting identification processing; Among them, dynamically updating the current limiting value in the cache area includes: receiving the current limiting value pushed by the distributed configuration center end electrically connected to the application server end; and reloading the pushed current limiting value into the cache area.

2. The method according to claim 1, characterized in that The distributed configuration center end includes a server end, and a plurality of clients respectively connected to the server end in a long-term connection, wherein the receiving of the current limiting value pushed by the distributed configuration center end electrically connected to the application server end includes: Obtain a first current limiting value pushed by a first client corresponding to the application server, wherein the first client is the client corresponding to the application server, and the first current limiting value is obtained by processing the change information broadcast and pushed by the server by the first client, and the first current limiting value is the current limiting value in the environment and cluster corresponding to the application server in the change information.

3. The method according to claim 2, characterized in that The cache current limiting value includes a plurality of cache interface current limiting values ​​corresponding to different interface dimensions respectively, and the dynamic updating of the current limiting value in the cache area includes: Acquire at least one second current limiting value pushed by the distributed configuration center, wherein the second current limiting value is a current limiting value changed and adjusted in the distributed configuration center; The at least one second current limiting value is reloaded into the cached interface current limiting value in the cache area corresponding to the same interface dimension as each second current limiting value.

4. The method according to claim 3, characterized in that The obtaining of at least one second current limiting value pushed by the distributed configuration center includes: Obtain at least one of the second current limiting values ​​pushed by the first client, wherein the second current limiting value is obtained by processing the change information broadcast by the server by the first client, and the second current limiting value is the current limiting value in the change information corresponding to different interface dimensions in the application server.

5. The method according to claim 2, characterized in that: When the flash sale service is started, the method for obtaining the current limit value of the cache area includes: The application server obtains a third current limiting value through the distributed configuration center, wherein the third current limiting value is a current limiting value in the environment and cluster corresponding to the application server in the distributed configuration center; The third current limiting value is written into the cache area of ​​the application server.

6. The method according to claim 4, characterized in that The step of obtaining the current limiting value from the cache area of ​​the application server in response to the client request and performing current limiting identification processing on the client request includes: Performing standardized processing on the client request; Perform current limiting identification and processing on the interface dimension for standardized customer requests.

7. The method according to claim 6, characterized in that The standardized processing of the client request includes: Obtaining interface service information requested by the client; An interface service mark is performed on the client request.

8. The method according to claim 7, characterized in that The interface-dimensional flow limiting identification processing of the standardized client request includes: Counting the number of client requests to the first interface service to which the standardized client requests belong within a unit time, to obtain the number of first client requests to the first interface service; According to the cache interface current limiting value of the first interface dimension corresponding to the first interface service in the cache area, presetting a maximum number of transactions processed per unit time by the first interface service as a fourth current limiting value of the first interface service; If the number of the first client requests is greater than the corresponding fourth flow limiting value, data flow limiting is performed.

9. The method according to claim 8, characterized in that The first interface service is the interface service tag corresponding to the client request after the standardization process; The first interface dimension is the interface dimension corresponding to the first interface service.

10. A flow limiting device for a flash sale service, characterized in that: Used for an application server, the device comprises: A first acquisition module, used to acquire a client request; A first current limiting module, configured to obtain a current limiting value from a cache area of ​​the application server in response to the client request and perform current limiting identification processing on the client request, wherein the cached current limiting value in the cache area is dynamically updated when the flash sale service is running; A data processing module, in response to a client request after the current limiting identification processing, processes the client request after the current limiting identification processing; Among them, dynamically updating the current limiting value in the cache area includes: receiving the current limiting value pushed by the distributed configuration center end electrically connected to the application server end; and reloading the pushed current limiting value into the cache area.

11. An electronic device, comprising: one or more processors; a memory for storing one or more computer programs, It is characterized in that the one or more processors execute the one or more computer programs to implement the steps of the flow limiting method for the flash sale service according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program or instruction stored thereon, characterized in that: When the computer program or instruction is executed by the processor, the steps of the flow limiting method for the flash sale service according to any one of claims 1 to 9 are implemented.

13. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by the processor, the steps of the flow limiting method for the flash sale service according to any one of claims 1 to 9 are implemented.