Request message processing method, device, system, equipment and medium
The client obtains the timing duration after receiving the preset status code returned by the server and sends the request message again, combined with the server deciding the current limit processing based on the amount of visits, which solves the problem of poor request message processing in e-commerce systems under high visits. problem and achieve more stable system operation.
Patent Information
- Application Number
- CN202410702832.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-06
AI Technical Summary
It is difficult for the existing technology to effectively balance the current limiting processing and business processing of business request messages, which affects the request message processing effect. Especially when there is a sudden high traffic volume or the request frequency is too high in the e-commerce system, the server is under great pressure and difficult to maintain stability. sex.
A request message processing method is proposed. After receiving the preset status code returned by the server, the client obtains the timing duration, and sends the business request message again after the duration to obtain the business implementation results, thereby taking into account current limiting processing and Business processing. The server decides whether to limit the request based on the traffic data, and generates corresponding return results.
Sending request messages again at regular intervals can effectively improve the request message processing effect, ensure timely acquisition of business implementation results under current limiting conditions, reduce server pressure, and improve system stability.
Smart Images

Figure CN118612299A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of electronic devices, and in particular to a request message processing method, apparatus, system, equipment and medium. Background Art
[0002] As the number of users and transaction volume of e-commerce systems increase, the stability of e-commerce system services is becoming more and more important. When encountering a sudden surge in business requests, malicious user access, or excessive request frequency that puts great pressure on the server, it is often necessary to ensure service stability through various methods such as current limiting and load balancing.
[0003] In the related art, it is not possible to effectively take into account both the flow limiting processing and the business processing of the service request message, thereby affecting the processing effect of the request message. Summary of the invention
[0004] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the purpose of the present disclosure is to propose a request message processing method, device, system, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product, which can effectively take into account the flow limiting processing and business processing of business request messages, thereby effectively improving the request message processing effect.
[0006] To achieve the above-mentioned purpose, the first aspect embodiment of the present disclosure proposes a request message processing method, which is applied to a client, including: sending a service request message to a server; receiving a return result corresponding to the service request message returned by the server; in response to a preset status code included in the return result, obtaining a timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting; and sending the service request message to the server again after an interval of the timing duration to obtain the service implementation result returned by the server.
[0007] To achieve the above-mentioned purpose, the second aspect embodiment of the present disclosure proposes a request message processing method, which is applied to the server, including: receiving a business request message sent by a client; determining the access volume data when the business request message is received; in response to determining that the business request message needs to be flow-limited based on the access volume data, generating a return result corresponding to the business request message according to a preset status code, wherein the preset status code is used to indicate that the business request message has been flow-limited; sending a return result corresponding to the business request message to the client; and receiving the business request message sent again by the client, wherein the business request message sent again is used to obtain the business implementation result.
[0008] To achieve the above-mentioned purpose, the third aspect embodiment of the present disclosure proposes a request message processing device, including: a first sending module, used to send a business request message to a server; a first receiving module, used to receive a return result corresponding to the business request message returned by the server; an acquisition module, used to obtain a timing duration configured for the business request message in response to a preset status code included in the return result; wherein the preset status code is used to indicate that the business request message has been processed by flow limiting; a second sending module, used to send the business request message to the server again after an interval of the timing duration, so as to obtain the business implementation result returned by the server.
[0009] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present disclosure proposes a request message processing device, including: a second receiving module, used to receive a business request message sent by a client; a determination module, used to determine the access data when the business request message is received; a generation module, used to respond to the determination based on the access data that the business request message needs to be flow-limited, and generate a return result corresponding to the business request message according to a preset status code, wherein the preset status code is used to indicate that the business request message has been flow-limited; a third sending module, used to send a return result corresponding to the business request message to the client; a third receiving module, used to receive the business request message sent again by the client, wherein the business request message sent again is used to obtain the business implementation result.
[0010] To achieve the above-mentioned purpose, the fifth aspect embodiment of the present disclosure proposes a request message processing system, including: a client, used to send a business request message to a server, in response to a received return result including a preset status code, obtain a timing duration configured for the business request message, wherein the preset status code is used to indicate that the business request message has been processed by flow limiting, and to send the business request message again after an interval of the timing duration; a server, used to determine the access data when the business request message is received, in response to determining that the business request message needs to be processed by flow limiting based on the access data, generate a return result corresponding to the business request message according to the preset status code, send the return result to the client, and return the business implementation result corresponding to the business request message received again to the client.
[0011] To achieve the above-mentioned purpose, the sixth aspect embodiment of the present disclosure proposes an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method applied to the client as in the first aspect above and / or the method applied to the server as in the second aspect above is implemented.
[0012] To achieve the above-mentioned objectives, the seventh aspect embodiment of the present disclosure proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the method applied to the client as in the first aspect above and / or the method applied to the server as in the second aspect above.
[0013] To achieve the above-mentioned objectives, the eighth aspect of the present disclosure proposes a computer program product. When the instructions in the computer program product are executed by a processor, the method applied to the client as in the first aspect and / or the method applied to the server as in the second aspect are implemented.
[0014] The present disclosure provides a request message processing method, device, system, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product, wherein a client sends a service request message to a server; receives a return result corresponding to the service request message returned by the server; in response to a preset status code included in the return result, obtains a timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting; and sends the service request message to the server again after an interval of the timing duration to obtain the service implementation result returned by the server, thereby effectively taking into account both flow limiting processing and service processing of the service request message, thereby effectively improving the request message processing effect.
[0015] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0017] Figure 1 It is a flowchart of a request message processing method proposed in an embodiment of the present disclosure;
[0018] Figure 2 is a flowchart of a request message processing method proposed in another embodiment of the present disclosure;
[0019] Figure 3 is a flowchart of a request message processing method proposed in another embodiment of the present disclosure;
[0020] Figure 4 is a flowchart of request message processing in an embodiment of the present disclosure;
[0021] Figure 5 It is a schematic diagram of the logic of automatic current limiting processing by the network library in the embodiment of the present disclosure;
[0022] Figure 6is a schematic diagram of the flow limiting service logic in an embodiment of the present disclosure;
[0023] Figure 7 is a schematic diagram of a current limiting framework architecture in an embodiment of the present disclosure;
[0024] Figure 8 is a schematic diagram of a processing flow of multiple requests in an embodiment of the present disclosure;
[0025] Fig. 9 is a structural diagram of a request message processing device proposed in an embodiment of the present disclosure;
[0026] Fig.10 is a structural diagram of a request message processing device proposed in another embodiment of the present disclosure;
[0027] Fig.11 is a structural diagram of a request message processing system proposed in another embodiment of the present disclosure;
[0028] Fig.12 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure 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 disclosure, and should not be construed as limiting the present disclosure.
[0030] Figure 1 It is a flowchart of a request message processing method proposed in an embodiment of the present disclosure.
[0031] This embodiment takes the request message processing method being configured in a request message processing device as an example. In this embodiment, the request message processing method can be configured in the request message processing device, and the request message processing device can be set in a server, or can also be set in an electronic device, without limitation.
[0032] This embodiment takes the request message processing method configured in an electronic device as an example, wherein the electronic device is a hardware device such as a smart phone, a tablet computer, a personal digital assistant, an e-book, etc. having various operating systems.
[0033] It should be noted that the execution subject of the embodiment of the present disclosure may be, for example, a central processing unit (CPU) in a server or electronic device in terms of hardware, or may be, for example, a related background service in a server or electronic device in terms of software, without limitation.
[0034] This embodiment can be applied to a client, which can also be called a front end, such as a front-end part of a website, a web page running on a browser and displayed to a user for browsing, without limitation.
[0035] like Figure 1 As shown, the request message processing method includes:
[0036] S101: Send a service request message to the server.
[0037] In some embodiments, the request message for obtaining the service implementation result may be referred to as a service request message. The client may monitor the user's service operation, generate and send a service request message to the server in response to the service operation, and obtain the service implementation result based on the service request message.
[0038] In some embodiments, the number of service request messages is one or more, thereby being able to effectively take into account both the flow limiting processing and the service processing of one or more service request messages, thereby effectively improving the overall request message processing effect.
[0039] S102: Receive a return result corresponding to the service request message returned by the server.
[0040] The returned result refers to the result generated by the server based on the service request message.
[0041] In some embodiments, if the current service access volume puts a great pressure on the server, the service request message sent by the client may be subject to flow control. The client may perform corresponding operations based on whether the sent service request message is subject to flow control.
[0042] In some embodiments, after receiving the service request message, the server may generate and feed back a return result in response to the service request message, and the client may receive the return result corresponding to the service request message and perform corresponding operations based on the return result.
[0043] S103: In response to the return result including a preset status code, a timing duration configured for the service request message is obtained, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting.
[0044] In some embodiments, after receiving the return result fed back by the server, the client can determine whether the return result contains a preset status code. The preset status code is used to indicate that the business request message has been processed by current limiting. The preset status code can be generated by the server and included in the return result, which is used to prompt the client of the processing status of the business request message. After receiving the return result of the business request message, the client can perform corresponding processing based on whether the return result contains the preset status code.
[0045] The timing duration is used to determine the timing of sending the service request message again. The timing duration can be pre-set for the service request message, or can be adaptively adjusted according to actual service application requirements, and there is no restriction on this.
[0046] In some embodiments, the client may pre-configure a suitable timing duration for the service request message, and process the service request message based on the configured timing duration; or the timing duration may be agreed upon with the server in advance, and the service request message may be processed based on the configured timing duration; or any other possible method may be used to set the defined duration, without limitation.
[0047] In some embodiments, in response to the return result containing a preset status code, it is determined that the server has performed flow limiting on the business request message, that is, the service access volume pressure on the server is relatively large. At this time, the client may not be able to obtain the business implementation result in a timely manner (because the business request message has been flow limited). The client can obtain the timing duration configured for the business request message, and refer to the timing duration to further request the business implementation result, and there is no restriction on this.
[0048] In some embodiments, in response to the return result including a preset status code, a pop-up window interface is displayed on the current interface of the client, wherein the current interface is the interface for triggering the sending of the service request message, and the flow limiting information corresponding to the service request message is displayed in the pop-up window interface, wherein the flow limiting information is used to describe the situation in which the service request message is flow-limited. Thus, the situation in which the service request message is flow-limited can be effectively notified, so that timely countermeasures can be taken, and the practicality of the method is effectively improved.
[0049] S104: Sending a service request message to the server again after a predetermined time interval to obtain a service implementation result returned by the server.
[0050] In some embodiments, the client may time after sending a service request message and obtain a continuous duration. If the client determines that the server has performed flow limiting processing on the service request message, it may send the service request message again when it is determined that the continuous duration after sending the service request message reaches the timing duration, so as to obtain the service implementation result in a timely manner.
[0051] In some embodiments, if the client sends a service request message again, the service implementation result corresponding to the service request message sent again can be obtained. For example, it can be first determined whether the return result corresponding to the service request message sent again contains a preset status code. If it contains a preset status code, steps S103-S104 can be repeatedly performed until the return result of the service request message sent again does not contain the preset status code, and the service implementation result is obtained based on the service request message sent again. For example, the client can trigger a subsequent service implementation result acquisition process based on the service request message sent again to obtain the service implementation result, and there is no limitation on this.
[0052] In this embodiment, the client sends a service request message to the server; receives a return result corresponding to the service request message returned by the server; in response to the return result including a preset status code, obtains a timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting; and sends the service request message to the server again after an interval of the timing duration to obtain the service implementation result returned by the server, thereby effectively taking into account both the flow limiting processing and the service processing of the service request message, thereby effectively improving the request message processing effect.
[0053] In some embodiments of the present disclosure, in response to the return result not including a preset status code, the client may directly obtain the business implementation result returned by the server.
[0054] That is to say, if the return result does not contain the preset status code, it means that the server has not performed flow control on the service request message, that is, the service access pressure on the server is not large, and the front end can obtain the corresponding service implementation result based on the service request message. For example, the front end can directly parse the return result to obtain the service implementation result, or the front end can trigger the subsequent service implementation result acquisition process based on the service request message to obtain the service implementation result, and there is no restriction on this.
[0055] Figure 2 It is a flowchart of a request message processing method proposed in another embodiment of the present disclosure.
[0056] This embodiment can be applied to a client, which can also be called a front end, such as a front-end part of a website, a web page running on a browser and displayed to a user for browsing, without limitation.
[0057] like Figure 2 As shown, the request message processing method includes:
[0058] S201: Sending a service request message to a server, wherein the number of the service request messages is multiple.
[0059] S202: Receive a return result corresponding to the reference service request message returned by the server.
[0060] In some embodiments, if the client sends multiple service request messages, the client may process the corresponding service request message (which may be referred to as a reference service request message) according to the returned result each time after receiving the returned result of a service request message.
[0061] S203: In response to the return result corresponding to the reference service request message not including a preset status code, obtaining a service implementation result corresponding to the reference service request message, wherein the preset status code is used to indicate that the reference service request message has been processed by flow limiting.
[0062] For detailed description of S202 - S203 , please refer to the above embodiment, which will not be repeated here.
[0063] S204: In response to the return result corresponding to the reference service request message including a preset status code, obtain request parameters and request callback records from the reference service request message.
[0064] The parameters included in the reference service request message may be referred to as request parameters, and the records of calling and being called related to the reference service request message may be referred to as request callback records.
[0065] In some embodiments, the determined request parameters and request callback records can be used to assist in sending the reference service request message again to ensure the consistency of the reference service request messages sent multiple times, thereby supporting the acquisition of service implementation results that meet the requirements.
[0066] S205: Determine a flow limiting order corresponding to the reference service request message, wherein the flow limiting order indicates the order in which the reference service request message is flow limited among multiple service request messages.
[0067] The above-mentioned return result corresponding to the reference business request message includes a preset status code, and after obtaining the request parameters and request callback records from the reference business request message, the flow limiting order corresponding to the reference business request message can be further determined, wherein the flow limiting order indicates the order in which the reference business request message is flow-limited among multiple business request messages, and the flow limiting order is used to determine the position order in which the request parameters and request callback records of the reference business request message are stored in the stack to be processed.
[0068] S206: According to the current limiting order, the request parameters and the request callback record of the reference service request message are added to the to-be-processed stack.
[0069] After determining the flow limiting order corresponding to the reference service request message, the request parameters and request callback records of the reference service request message can be added to the corresponding position sequence in the to-be-processed stack based on the flow limiting order, so that the request parameters and request callback records of the reference service request message can be read effectively and conveniently.
[0070] S207: Obtain the timing duration configured for the reference service request message.
[0071] For the description of S207, please refer to the above embodiment, which will not be repeated here.
[0072] S208: In response to a timed interval after sending a reference service request message to the server, obtain a request parameter and a request callback record corresponding to the reference service request message from a to-be-processed stack.
[0073] When the duration after sending the reference business request message reaches the timing duration, the request parameters and request callback records corresponding to the reference business request message can be directly obtained from the pending stack, and since the request parameters and request callback records corresponding to the reference business request message are stored in the pending stack based on the order of current limiting processing, when the request parameters and request callback records corresponding to the reference business request message are read from the pending stack, the request parameters and request callback records corresponding to the reference business request message can be read effectively and quickly to support the effective sending of the reference business request message again.
[0074] S209: according to the request parameters and the request callback record, a reference service request message is sent to the server again to obtain the service implementation result returned by the server.
[0075] In this embodiment, it is possible to effectively take into account both the flow limiting processing and the business processing of the service request message, thereby effectively improving the request message processing effect. After the return result corresponding to the reference service request message includes a preset status code, and the request parameters and request callback records are obtained from the reference service request message, the flow limiting order corresponding to the reference service request message can be further determined, wherein the flow limiting order indicates the order in which the reference service request message is flow-limited in multiple service request messages, and the flow limiting order is used to determine the position order in which the request parameters and request callback records of the reference service request message are stored in the to-be-processed stack. After determining the flow limiting order corresponding to the reference service request message, the request parameters and request callback records of the reference service request message can be added to the corresponding position order in the to-be-processed stack based on the flow limiting order, so that the request parameters and request callback records of the reference service request message can be effectively and conveniently read. When the duration after sending the reference business request message reaches the timing duration, the request parameters and request callback records corresponding to the reference business request message can be directly obtained from the pending stack, and since the request parameters and request callback records corresponding to the reference business request message are stored in the pending stack based on the order of current limiting processing, when the request parameters and request callback records corresponding to the reference business request message are read from the pending stack, the request parameters and request callback records corresponding to the reference business request message can be read effectively and quickly to support the effective sending of the reference business request message again.
[0076] It should be noted that in the following embodiments, the descriptions of the terms and method steps that are the same as or corresponding to those in the above embodiments can be referred to in conjunction with the above embodiments and will not be repeated here.
[0077] Figure 3 It is a flowchart of a request message processing method proposed in another embodiment of the present disclosure.
[0078] This embodiment can be applied to a server, which refers to a computer or computer program that provides services in a network environment. It usually corresponds to a client, and the client can connect to the server through the network to obtain services or resources, and there is no limitation on this.
[0079] like Figure 3 As shown, the request message processing method includes:
[0080] S301: receiving a service request message sent by a client.
[0081] In some embodiments, the client may send a service request message to the server, and the server may receive the service request message sent by the client and perform subsequent processing.
[0082] S302: Determine the access volume data when the service request message is received.
[0083] In some embodiments, after receiving the service request message, the server may determine the access volume data when the service request message is currently received, and the server may determine whether to perform flow limiting processing on the service request message based on the access volume data.
[0084] In some embodiments, the server may compare the access volume data with a data threshold. The data threshold may be a threshold value of the access volume data when determining whether current limiting processing is required. If the access volume data is greater than or equal to the data threshold, it is determined that the current access volume is large and the service request message needs to be current limited. If the access volume data is less than the data threshold, it is determined that the current access volume is not large and the service request message does not need to be current limited. Of course, the access volume data may be referenced based on any other possible method to determine whether current limiting processing is required for the service request message, and there is no restriction on this.
[0085] S303: In response to determining that the service request message needs to be flow-limited based on the access volume data, a return result corresponding to the service request message is generated according to a preset status code, wherein the preset status code is used to indicate that the service request message has been flow-limited.
[0086] In some embodiments, if the server determines that the service request message needs to be throttled based on the access volume data, the server may include a preset status code in the return result corresponding to the service request message and wait to receive the service request message again.
[0087] S304: Send a return result corresponding to the service request message to the client.
[0088] In some embodiments, the server may feed back a return result corresponding to the service request message to the client.
[0089] S305: Receive the service request message sent again by the client, wherein the service request message sent again is used to obtain the service implementation result.
[0090] In this embodiment, the server can receive a business request message sent by the client, and determine the access data when the business request message is received. In response to determining that the business request message needs to be flow-limited based on the access data, a return result corresponding to the business request message is generated according to a preset status code, wherein the preset status code is used to indicate that the business request message has been flow-limited, a return result corresponding to the business request message is sent to the client, and a business request message sent again by the client is received, wherein the business request message sent again is used to obtain the business implementation result, which can effectively take into account both the flow-limiting processing and the business processing of the business request message, thereby effectively improving the request message processing effect.
[0091] In some embodiments, if the server determines that there is no need to perform flow limiting processing on the service request message based on the access volume data, a return result corresponding to the service request message is directly generated, and the return result does not include a preset status code.
[0092] The examples for the above embodiment can be as follows:
[0093] In the embodiments of the present disclosure, the client may also be referred to as a front end.
[0094] The embodiment of the present disclosure mainly provides a request message processing method, which not only satisfies the fast access flow control solution without code intrusion, but also can quickly integrate e-commerce business and meet the positioning of the technical middle platform, thereby reducing code maintenance costs, user interface (UI) design costs, maintenance costs, etc. Figure 4 As shown, Figure 4 It is a flowchart of request message processing in the embodiment of the present disclosure. The front end can initiate a request (an optional example of a business request message), and the server determines whether the traffic is overloaded after receiving the request (an optional example of determining whether current limiting is required). If so, the current limiting is returned, and the current limiting status code is inserted into the current limiting. The front end can trigger the re-initiation of the request at the end of the monitoring countdown. If the server determines that the traffic is not overloaded, it processes the business logic and returns the correct result (which may include the business implementation result), and there is no restriction on this.
[0095] In the embodiments of the present disclosure, a technology including a server and a client can be provided. When accessing the current limiting solution, it is only necessary to introduce an existing network library (the existing network library can be, for example, the Apollo network library, which is not limited to this), and the network library automatically handles the current limiting logic. The network library can contain some basic logic for processing business request messages, which can be directly called and used. Figure 5 As shown, Figure 5 The network library automatically processes the flow limiting logic diagram in the embodiment of the present disclosure. The business side module / component can trigger the sending of a business request message, and the network library side component receives the business request message and calls the logic for processing the business request message in the network library to process the business request message, and there is no restriction on this.
[0096] like Figure 6 As shown, Figure 6 It is a schematic diagram of the flow limiting business logic in the embodiment of the present disclosure. The flow limiting business logic mainly includes return result interception, status code recognition, automatic pop-up of flow limiting pop-up window, flow limiting countdown, multiple interface flow limiting queues, automatic initiation of requests after the countdown ends, and return of the correct result of the flow limiting end business.
[0097] In the embodiment of the present disclosure, a current limiting framework (RequestLimit) can be deployed on the front end to support the implementation of the request message processing method on the front end side in the embodiment of the present disclosure, such as Figure 7 As shown, Figure 7 Schematic diagram of the current limiting framework architecture in the embodiment of the present disclosure. It mainly includes a network request processing module, a countdown module, a current limiting pop-up window module, and a pending stack module. The current limiting framework intercepts the result returned by each request. When it is identified that interception is required, it is added to the pending stack. If current limiting is not required, the correct result is returned. When the countdown of the pending stack ends, the request is re-initiated, and the correct result is returned to the request end after receiving it.
[0098] In the disclosed embodiment, in the front-end page, there may be a situation where there are multiple network requests (an optional example of a business request message) on one page. When multiple interfaces are limited at the same time, the limiting framework recognizes the status code and can record the limited request parameters and request callbacks in the pending stack of the limiting framework in order, trigger a limiting pop-up window, and start a countdown. After the countdown ends, the limiting framework traverses the pending stack and automatically initiates multiple requests, which are re-accepted and processed by the server. Design as Figure 8 shown. Figure 8 1 is a schematic diagram of the processing flow of multiple requests in the embodiment of the present disclosure, wherein the request is an optional example of the service request message in the above embodiment.
[0099] Fig. 9 It is a structural diagram of a request message processing device proposed in an embodiment of the present disclosure.
[0100] like Fig. 9 As shown, the request message processing device 90 includes:
[0101] The first sending module 901 is used to send a service request message to the server.
[0102] The first receiving module 902 is used to receive a return result corresponding to the service request message returned by the server.
[0103] The acquisition module 903 is used to obtain the timing duration configured for the service request message in response to the preset status code included in the returned result; wherein the preset status code is used to indicate that the service request message has been processed by flow limiting.
[0104] The second sending module 904 is used to send a service request message to the server again after a predetermined time interval to obtain a service implementation result returned by the server.
[0105] It should be noted that the aforementioned explanation of the request message processing method is also applicable to the request message processing device of this embodiment, and will not be repeated here.
[0106] In this embodiment, the client sends a service request message to the server; receives a return result corresponding to the service request message returned by the server; in response to the return result including a preset status code, obtains a timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting; and sends the service request message to the server again after an interval of the timing duration to obtain the service implementation result returned by the server, thereby effectively taking into account both the flow limiting processing and the service processing of the service request message, thereby effectively improving the request message processing effect.
[0107] Fig.10 It is a structural diagram of a request message processing device proposed in another embodiment of the present disclosure.
[0108] like Fig.10 The request message processing device 100 comprises:
[0109] The second receiving module 1001 is used to receive a service request message sent by a client.
[0110] The determination module 1002 is used to determine the access volume data when the service request message is received.
[0111] The generation module 1003 is used to generate a return result corresponding to the business request message according to a preset status code in response to determining that the business request message needs to be flow-limited based on the access volume data, wherein the preset status code is used to indicate that the business request message has been flow-limited.
[0112] The third sending module 1004 is used to send a return result corresponding to the service request message to the client.
[0113] The third receiving module 1005 is used to receive the service request message sent again by the client, wherein the service request message sent again is used to obtain the service implementation result.
[0114] It should be noted that the aforementioned explanation of the request message processing method is also applicable to the request message processing device of this embodiment, and will not be repeated here.
[0115] In this embodiment, the server can receive a business request message sent by the client, and determine the access data when the business request message is received. In response to determining that the business request message needs to be flow-limited based on the access data, a return result corresponding to the business request message is generated according to a preset status code, wherein the preset status code is used to indicate that the business request message has been flow-limited, a return result corresponding to the business request message is sent to the client, and a business request message sent again by the client is received, wherein the business request message sent again is used to obtain the business implementation result, which can effectively take into account both the flow-limiting processing and the business processing of the business request message, thereby effectively improving the request message processing effect.
[0116] Fig.11 It is a structural diagram of a request message processing system proposed in another embodiment of the present disclosure.
[0117] like Fig.11 , the request message processing system 110 comprises:
[0118] The client 1101 is used to send a service request message to the server 1102, and in response to the received return result including a preset status code, obtains the timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting, and to send the service request message again after an interval of the timing duration.
[0119] The server 1102 is used to determine the access data when a business request message is received, and in response to determining that the business request message needs to be flow-limited based on the access data, generates a return result corresponding to the business request message according to a preset status code, and sends the return result to the client 1101, and returns the business implementation result corresponding to the business request message received again to the client 1101.
[0120] It should be noted that the aforementioned explanation of the request message processing method is also applicable to the request message processing system of this embodiment and will not be repeated here.
[0121] Fig.12 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Fig.12 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0122] like Fig.12 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a memory 28, and a bus 18 that connects various system components (including the memory 28 and the processing unit 16).
[0123] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. For example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnection (PCI) bus. The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0124] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig.12 Not shown, often called a "hard drive").
[0125] although Fig.12 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (hereinafter referred to as: CD-ROM), a digital versatile disc read only memory (hereinafter referred to as: DVD-ROM) or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0126] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0127] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable the human body to interact with the electronic device 12, and / or communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 through a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0128] The processing unit 16 executes various functional applications and data processing by running the programs stored in the memory 28, such as implementing the request message processing method applied to the client and / or the request message processing method applied to the server mentioned in the above embodiments.
[0129] In order to implement the above embodiments, the present disclosure also proposes a non-temporary computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, it implements the request message processing method applied to the client and / or the request message processing method applied to the server as proposed in the aforementioned embodiments of the present disclosure.
[0130] In order to implement the above embodiments, the present disclosure also proposes a computer program product. When the instructions in the computer program product are executed by a processor, the request message processing method applied to the client and / or the request message processing method applied to the server proposed in the aforementioned embodiments of the present disclosure are executed.
[0131] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this disclosure shall comply with the relevant laws and regulations and shall not violate public order and good morals.
[0132] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0133] The present disclosure anticipates providing implementation schemes for users to selectively block the use or access of personal information data. That is, the present disclosure anticipates providing hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, risks can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0134] In the description of the aforementioned embodiments, 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 disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more 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, unless they are contradictory.
[0135] 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 the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0136] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes 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 disclosure includes additional 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 disclosure belong.
[0137] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0138] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: 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 (PGA), a field programmable gate array (FPGA), etc.
[0139] 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.
[0140] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0141] The storage medium mentioned above may be a read-only memory, a disk or an optical disk, etc. Although the embodiments of the present disclosure have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present disclosure. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present disclosure.
Claims
1. A request message processing method, characterized in that: Applied to the client, including: Send a service request message to the server; Receive a return result corresponding to the service request message returned by the server; In response to the return result including a preset status code, obtaining a timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by current limiting; and After the timed interval, the service request message is sent to the server again to obtain the service implementation result returned by the server.
2. The method according to claim 1, characterized in that The method further comprises: In response to the return result not including a preset status code, directly obtaining the business implementation result returned by the server.
3. The method according to claim 1, characterized in that The sending the service request message to the server again after the timed interval comprises: In response to the service request message being sent to the server and then being sent to the server again after the timer period has elapsed, the service request message is sent to the server again.
4. The method according to claim 1, characterized in that: The method further comprises: In response to the return result including the preset status code, displaying a pop-up window interface on the current interface of the client, wherein the current interface is the interface that triggers the sending of the service request message; The flow limiting information corresponding to the service request message is displayed in the pop-up window interface, wherein the flow limiting information is used to describe the situation in which the service request message is subjected to flow limiting processing.
5. The method according to any one of claims 1 to 4, characterized in that: The number of the service request messages is multiple; the method further includes: In response to the return result corresponding to the reference service request message including the preset status code, obtaining a request parameter and a request callback record from the reference service request message, wherein the reference service request message is the service request message whose return result is currently received; Determine a flow limiting order corresponding to the reference service request message, wherein the flow limiting order indicates the order in which the reference service request message is flow limited among the multiple service request messages; According to the current limiting order, the request parameters and request callback record of the reference service request message are added to the to-be-processed stack.
6. The method according to claim 5, characterized in that The to-be-processed stack includes: request parameters and request callback records of at least one service request message; The sending the service request message to the server again after the timed interval includes: In response to the reference service request message being sent to the server after the timer duration, obtaining the request parameter and request callback record corresponding to the reference service request message from the to-be-processed stack; According to the request parameters and the request callback record, the reference service request message is sent to the server again.
7. A request message processing method, characterized in that: Applied to the server, including: Receive the service request message sent by the client; Determine the access volume data when the service request message is received; In response to determining that the service request message needs to be subjected to flow limiting processing based on the access volume data, generating a return result corresponding to the service request message according to a preset status code, wherein the preset status code is used to indicate that the service request message has been subjected to flow limiting processing; Sending a return result corresponding to the service request message to the client; and The service request message resent by the client is received, wherein the resent service request message is used to obtain a service implementation result.
8. The method according to claim 7, characterized in that The method further comprises: In response to determining that there is no need to perform flow limiting processing on the service request message based on the access volume data, a return result corresponding to the service request message is directly generated.
9. A request message processing device, characterized in that: include: A first sending module, used to send a service request message to the server; A first receiving module, used to receive a return result corresponding to the service request message returned by the server; An acquisition module, configured to acquire a timing duration configured for the service request message in response to a preset status code included in the returned result; wherein the preset status code is used to indicate that the service request message has been subjected to flow limiting processing; The second sending module is used to send the service request message to the server again after an interval of the timing length to obtain the service implementation result returned by the server.
10. A request message processing device, characterized in that: include: A second receiving module is used to receive a service request message sent by a client; A determination module, used to determine the access volume data when the service request message is received; A generating module, configured to generate a return result corresponding to the service request message according to a preset status code in response to determining that the service request message needs to be subjected to flow limiting processing based on the access volume data, wherein the preset status code is used to indicate that the service request message has been subjected to flow limiting processing; A third sending module, used to send a return result corresponding to the service request message to the client; The third receiving module is used to receive the service request message sent again by the client, wherein the service request message sent again is used to obtain the service implementation result.
11. A request message processing system, characterized in that: include: The client is used to send a service request message to the server, and in response to the received return result including a preset status code, obtain a timing duration configured for the service request message, wherein the preset status code is used to indicate that the service request message has been processed by flow limiting, and send the service request message again after an interval of the timing duration; The server is used to determine the access data when the service request message is received, and in response to determining that the service request message needs to be current limited based on the access data, generate a return result corresponding to the service request message according to the preset status code, send the return result to the client, and return the service implementation result corresponding to the service request message received again to the client.
12. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method applied to the client as described in any one of claims 1-6 and / or the method applied to the server as described in any one of claims 7-8.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method applied to the client as described in any one of claims 1-6 and / or the method applied to the server as described in any one of claims 7-8.
14. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the method applied to the client as claimed in any one of claims 1 to 6 and / or the method applied to the server as claimed in any one of claims 7 to 8.
