WO2023273576A1 - 异常请求处理方法、装置、电子设备和存储介质 - Google Patents

异常请求处理方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2023273576A1
WO2023273576A1 PCT/CN2022/089484 CN2022089484W WO2023273576A1 WO 2023273576 A1 WO2023273576 A1 WO 2023273576A1 CN 2022089484 W CN2022089484 W CN 2022089484W WO 2023273576 A1 WO2023273576 A1 WO 2023273576A1
Authority
WO
WIPO (PCT)
Prior art keywords
request
queue
network resource
resource identifier
target
Prior art date
Application number
PCT/CN2022/089484
Other languages
English (en)
French (fr)
Inventor
王凯
张潇
Original Assignee
北京字节跳动网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字节跳动网络技术有限公司 filed Critical 北京字节跳动网络技术有限公司
Priority to US18/256,591 priority Critical patent/US20240069991A1/en
Publication of WO2023273576A1 publication Critical patent/WO2023273576A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3006Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/547Messaging middleware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Definitions

  • the present disclosure relates to the field of information technology, for example, to an exception request processing method, device, electronic equipment and storage medium.
  • terminals have become an indispensable device in people's daily life.
  • a user may install multiple application programs (Application, APP) of different types and purposes on the terminal.
  • Application Application
  • APP application programs
  • the terminal may consume network traffic during the process of running the application.
  • there may even be abnormal traffic consumption for example, a large amount of traffic is consumed.
  • the present disclosure provides an abnormal request processing method, device, electronic equipment and storage medium.
  • the present disclosure provides a method for processing an abnormal request, including:
  • the target request includes a network resource identifier
  • the first queue does not include the first request matching the network resource identifier
  • the second queue includes a second request matching the network resource identifier
  • the request data of the target request At the end of the preset time period, according to the first queue or the second queue, determine the request data of the target request, and if the request data of the target request meets the first preset condition, It is determined that the target request is an abnormal request.
  • the present disclosure also provides an abnormal request processing device, including:
  • An acquisition module configured to acquire a target request within a preset time period, wherein the target request includes a network resource identifier
  • the query module is configured to query the first queue according to the network resource identifier, wherein the first queue is used to store the relevant information of the first request within the preset time period;
  • the query module is further configured to query a second queue according to the network resource identifier when the first queue does not include the first request matching the network resource identifier, wherein the second queue For storing the relevant information of the second request within the preset time period, the request frequency represented by the request data of the first request is greater than the request frequency represented by the request data of the second request;
  • An updating module configured to update the request data of the second request matching the network resource identifier when the second queue includes a second request matching the network resource identifier
  • the determination module is configured to determine the request data of the target request according to the first queue or the second queue when the preset time period ends, and the request data of the target request conforms to the first preset In the case of the condition, it is determined that the target request is an abnormal request.
  • the present disclosure also provides an electronic device, comprising:
  • processors one or more processors
  • a storage device configured to store one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the exception request processing method as described above.
  • the present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above exception request processing method is realized.
  • the present disclosure also provides a computer program product, where the computer program product includes a computer program or an instruction, and when the computer program or instruction is executed by a processor, the above exception request processing method is realized.
  • FIG. 1 is a flow chart of an abnormal request processing method provided by an embodiment of the present disclosure
  • FIG. 2 is a flow chart of another abnormal request processing method provided by an embodiment of the present disclosure.
  • FIG. 3 is a schematic diagram of the principle of a method for implementing S130 provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of the principle of a method for implementing S150 provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of the principle of a method for implementing S160 provided by an embodiment of the present disclosure
  • FIG. 6 is a flowchart of another abnormal request processing method provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of an abnormal request processing device provided by an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the term “comprise” and its variations are open-ended, ie “including but not limited to”.
  • the term “based on” is “based at least in part on”.
  • the term “one embodiment” means “at least one embodiment”; the term “another embodiment” means “at least one further embodiment”; the term “some embodiments” means “at least some embodiments.” Relevant definitions of other terms will be given in the description below.
  • Fig. 1 is a flow chart of a method for processing an abnormal request provided by an embodiment of the present disclosure.
  • This embodiment is applicable to the situation of determining and processing an abnormal request of a networked application in a client, and the method can be executed by an abnormal request processing device , the device can be implemented in the form of software and/or hardware, and the device can be configured in an electronic device, such as a terminal, including but not limited to a smart phone, a handheld computer, a tablet computer, a wearable device with a display screen, a desktop computer, Laptops, all-in-one PCs, smart home devices, etc.
  • a terminal including but not limited to a smart phone, a handheld computer, a tablet computer, a wearable device with a display screen, a desktop computer, Laptops, all-in-one PCs, smart home devices, etc.
  • this embodiment can be applied to the situation where the abnormal request of the networked application is determined and processed in the server, and the method can be executed by an abnormal request processing device, which can be implemented in software and/or hardware, and the device can Configured in electronic equipment, such as servers.
  • the method will be described below with the terminal as the execution subject. As shown in Figure 1, the method may include:
  • the target request may be a webpage request or a non-webpage request.
  • the webpage request may be a Hypertext Transfer Protocol (HyperText Transfer Protocol, HTTP) request.
  • the non-webpage request may be an on-demand request or a live broadcast request.
  • the network resource identifier may be a Uniform Resource Locator (Uniform Resource Locator, URL).
  • a URL includes a domain name part and a path part.
  • the path part of the uniform resource locator is not considered. That is, in the following, the two requested network resource identifiers are different, which means that the domain names in the two requested network resource identifiers are different; the two requested network resource identifiers are the same, which means that the domain name parts in the two requested network resource identifiers are the same .
  • the target request is generated based on the user's operation on the virtual keys in the user interface, or it may be automatically generated by the terminal based on the application service, which is not limited in this application.
  • the terminal sends a request to the server, and the request is a target request.
  • the number of target requests generated by the terminal may be one or more.
  • the preset time period can be set as required, which is not limited in this application. Exemplarily, the preset time period may be 5 minutes or 10 minutes.
  • the relevant information of the first request includes but not limited to the network resource identifier of the first request and the request data of the first request.
  • the relevant information of the first request may also include the time when the first request occurred last time.
  • the request data represents the request frequency.
  • the request frequency is the number of requests from the beginning of the preset time period to the current moment.
  • the network resource identifiers of any two first requests are different.
  • the second queue is used to store information about the second request within a preset time period.
  • the first The request frequency characterized by the request data of the request is greater than the request frequency characterized by the request data of the second request.
  • the relevant information of the second request includes but not limited to the network resource identifier of the second request and the request data of the second request.
  • the relevant information of the second request may also include the time when the second request occurred last time.
  • the request data represents the request frequency.
  • the request frequency refers to the number of requests (that is, initiated) from the beginning of the preset time period to the current moment.
  • any two second requests have different network resource identifiers. And, the network resource identifier of any second request in the second queue is different from the network resource identifier of any first request in the first queue.
  • the second queue includes a second request matching the network resource identifier, update the request data of the second request matching the network resource identifier.
  • the second request is considered to be the same as the target request; and the request data of the second request is updated.
  • the second request's The updating of the requesting data further includes: modifying the latest occurrence time of the second request to the occurrence time of the target request.
  • the request data of the request corresponding to the network resource identifier of the target request in the first queue or the second queue is directly used as the request data of the target request; or, based on a preset formula, for the first queue or the second queue
  • the request data of the request corresponding to the network resource identifier of the target request is calculated to obtain the request data of the target request; or, the request data of the request corresponding to the network resource identifier of the target request in the first queue or the second queue is analyzed, Process and count, and obtain the request data requested by the target.
  • a first threshold for judging whether a request is an abnormal request may be set.
  • the first preset condition is that the request data of the target request is greater than or equal to the first threshold.
  • abnormal traffic consumption An important reason for abnormal traffic consumption is that there are defects in the application itself, which causes the same request to be initiated multiple times (that is, high-frequency requests occur). For example, after the terminal sends a request to the server, but the server does not respond, the terminal will poll and periodically send requests until the server responds. Or, after the terminal sends a request to the server, the server's response cannot meet the terminal's needs, and the terminal will poll and periodically send requests until the server's response meets the terminal's needs. Therefore, abnormal requests are often high-frequency requests, and the occurrence of abnormal requests often means that the application itself has defects.
  • the above technical solution can be used to screen out high-frequency requests, and then determine which high-frequency requests are abnormal requests, and help R&D personnel locate the cause based on abnormal requests, thereby achieving the purpose of eliminating faults and reducing terminal traffic consumption.
  • FIG. 2 is a flow chart of another method for processing an abnormal request provided by an embodiment of the present disclosure.
  • the example shown in FIG. 2 is an illustration of the example shown in FIG. 1 .
  • the method includes:
  • the target request may be a webpage request or a non-webpage request.
  • the web page request may be an HTTP request.
  • the non-webpage request may be an on-demand request or a live broadcast request.
  • the network resource identifier may be a URL.
  • a URL includes a domain name part and a path part.
  • the path part of the uniform resource locator is not considered. That is, in the following, the two requested network resource identifiers are different, which means that the domain names in the two requested network resource identifiers are different; the two requested network resource identifiers are the same, which means that the domain name parts in the two requested network resource identifiers are the same .
  • the target request is generated based on the user's operation on the virtual keys in the user interface, or it may be automatically generated by the terminal based on the application service, which is not limited in this application.
  • the terminal sends a request to the server, and the request is a target request.
  • the number of target requests generated by the terminal may be one or more.
  • the preset time period can be set as required, which is not limited in this application. Exemplarily, the preset time period may be 5 minutes or 10 minutes.
  • the relevant information of the first request includes but not limited to the network resource identifier of the first request and the request data of the first request.
  • the relevant information of the first request may also include the time when the first request occurred last time.
  • the request data represents the request frequency.
  • the request frequency is the number of requests from the beginning of the preset time period to the current moment.
  • the network resource identifiers of any two first requests are different.
  • the first queue includes a first request matching the network resource identifier of the target request, update request data of the first request matching the network resource identifier of the target request, where the request data represents a request frequency.
  • the network resource identifier of the target request comparing the network resource identifier of the target request with the network resource identifiers of multiple first requests in the first queue in sequence until it can be determined whether the first queue includes a first request matching the network resource identifier of the target request; if there is If the network resource identifier of the first request is the same as (that is, matches) the network resource identifier of the target request, then the first request is considered to be the same as the target request; and the request data of the first request is updated.
  • FIG. 3 is a schematic diagram of a principle of a method for implementing S130 provided by an embodiment of the present disclosure.
  • the first queue includes 5 related information of the first request, they are: related information of request 1, related information of request 2, related information of request 3, related information of request 6 and Information about Request 7.
  • the network resource identifier of request 2 is found to be the same as that of the target request through comparison, it is considered that request 2 is the same as the target request, and the request data of request 2 (ie, the request frequency of request 2) is updated.
  • the update method may be to add 1 to the request data of request 2.
  • the request data of request 2 before updating is n
  • the request data of request 2 after updating is n+1.
  • the relevant information of the first request also includes the time when the first request occurred last time, and there is a network resource identifier of the first request that is the same as (that is, matches) the network resource identifier of the target request, the first request’s
  • the updating of the requesting data further includes: modifying the last occurrence time of the first request to the occurrence time of the target request.
  • the essence of this step is to merge the target request with the first request in the first queue that matches the network resource identifier of the target request.
  • the method further includes: moving the relevant information of the first request matching the network resource identifier of the target request to the head of the first queue.
  • the first request matching the network resource identifier of the target request is Request 2 .
  • the information about request 2 was in the second position of the first queue.
  • the relevant information of request 2 is located at the head of the first queue (that is, the first position).
  • a request is initiated twice in a row, it is the sth time and the s+1th time.
  • this step is initiated for the sth time, it is determined that the request initiated for the sth time corresponds to the first request A in the first queue, and the relevant information of the first request A is moved to the head of the first queue.
  • the request is initiated for the s+1th time.
  • the network resource identifier of the request initiated for the s+1th time needs to be sequentially combined with the network resource identifiers of multiple first requests in the first queue Compare.
  • the request initiated for the s+1th time also corresponds to the first request A.
  • the first request A is already at the head of the first queue, so that the setting can obtain "the first queue includes the first request matching the network resource identifier of the target request" by only one match.
  • Such setting can reduce the time spent on comparing the network resource identifiers of the subsequent same target request with the network resource identifiers of multiple first requests in the first queue, and improve the calculation rate.
  • the request frequency represented by the request data of the first request is greater than the request frequency represented by the request data of the second request.
  • the relevant information of the second request includes but not limited to the network resource identifier of the second request and the request data of the second request.
  • the relevant information of the second request may also include the time when the second request occurred last time.
  • the request data represents the request frequency.
  • the request frequency refers to the number of requests (that is, initiated) from the beginning of the preset time period to the current moment.
  • any two second requests have different network resource identifiers. Moreover, the network resource identifier of any second request in the second queue is different from the network resource identifier of any first request in the first queue.
  • the second queue includes a second request matching the network resource identifier of the target request, update the request data of the second request matching the network resource identifier of the target request.
  • the second request is considered to be the same as the target request; and the request data of the second request is updated.
  • FIG. 4 is a schematic diagram of a principle of a method for implementing S150 provided by an embodiment of the present disclosure.
  • the second queue includes 5 related information of the second request, they are: related information of request 4, related information of request 5, related information of request 8, related information of request 9 and Information about request 10.
  • the request 8 is considered to be the same as the target request, and the request data of the request 8 (ie, the request frequency of the request 8) is updated.
  • the update method can be to add 1 to the request data of request 8. For example, the request data of request 8 before update is m, and the request data of request 8 after update is m+1.
  • the second request's The updating of the requesting data further includes: modifying the latest occurrence time of the second request to the occurrence time of the target request.
  • the essence of this step is to merge the target request with the second request in the second queue that matches the network resource identifier of the target request.
  • the second queue does not include a second request that matches the network resource identifier of the target request, then store relevant information of the target request in the second queue.
  • "store the relevant information of the target request in the second queue” should be understood as generating a new piece of relevant information of the second request based on the relevant information of the target request, and storing the newly generated relevant information of the second request in the first queue. In the second queue.
  • the fifth preset condition is that the length of the second queue is greater than or equal to the fifth threshold
  • the function of the fifth threshold is to limit the length of the second queue so that the second queue can store The number of requests is limited.
  • the first queue is used to store the relevant information of the first request within a preset time period
  • the second queue is used to store the preset Information about the second request in the time period.
  • the first queue is essentially a queue for storing information about high-frequency requests
  • the second queue is a queue for storing information about sub-frequent requests.
  • the second preset condition refers to a condition that can be used to determine whether a request belongs to a high-frequency request or a second-frequency request.
  • a second domain value may be set to distinguish whether the request belongs to a high-frequency request or a second-frequency request. If the request data of a request is greater than the second threshold, the request is determined as a high-frequency request, and relevant data of the request needs to be stored in the first queue. If the request data of a request is less than or equal to the second domain value, the request is determined as a second-frequency request, and the relevant data of the request needs to be stored in the second queue.
  • the second preset condition is: the updated request data of the second request that matches the network resource identifier of the target request is greater than the second threshold.
  • this step can be replaced by: if the updated request data of the second request that matches the network resource identifier of the target request is greater than the second threshold, then transfer the relevant information of the second request that matches the network resource identifier from the second The queue moves to the first queue.
  • FIG. 5 is a schematic diagram of a principle of a method for implementing S160 provided by an embodiment of the present disclosure. For example, referring to FIG. 4 and FIG. 5 , assuming that the second threshold is K/2, after the target request is merged with the request 8 in the second queue, the request data of the request 8 is updated to m+1. Judge the size relationship between m+1 and K/2. If m+1>K/2, move the relevant data of request 8 from the second queue to the first queue.
  • the target request After merging the target request with the second request matching the network resource identifier of the target request in the second queue, it is judged whether the combined second request will be promoted from a second-high frequency request to a high-frequency request; if the combined first The second request is promoted from a second-high frequency request to a high-frequency request, and the relevant information of the second request is moved from the second queue to the first queue.
  • moving the relevant information of the second request matching the network resource identifier of the target request from the second queue to the first queue can be replaced by moving the relevant information of the second request matching the network resource identifier from the first queue
  • the second queue moves to the head of the first queue, and deletes the relevant information of the second request matching the network resource identifier from the second queue.
  • the two queues will not include the same request, which is beneficial to ensure that the two queues are always clearly defined (in the first queue, any The request data of the first request is greater than the second threshold; in the second queue, the request data of any second request is less than or equal to the second threshold), so as to avoid subsequent operation confusion and undesirable phenomena such as program defects.
  • the method further includes: if the length of the first queue satisfies a third preset condition, deleting the information in the first queue Relevant information of the first request that satisfies the fourth preset condition.
  • a third threshold is set, and the third preset condition is that the length of the first queue should be greater than or equal to the third threshold.
  • the function of the third threshold is to limit the length of the first queue, so that the number of requests that can be stored in the first queue is limited.
  • the third threshold used to limit the length of the first queue may be the same as or different from the aforementioned fifth threshold used to limit the length of the second queue. limit.
  • the function of the fourth preset condition is to filter the first requests that need to be eliminated in the first queue.
  • the preset time point should be any time point between the start time of the preset time period and the current time. Its value is not limited in this application.
  • the preset time point may be set as an intermediate time point between the current time and the start time of the preset time period. Exemplarily, if the start time of the preset time period is T, the current time is t, and the preset time point is T+(t-T)/2.
  • the function of the fourth threshold is to filter out the first data with smaller request data in the first queue.
  • the network resource identifier of the target request After updating the request data of the second request matching the network resource identifier of the target request, if the request data of the second request matching the network resource identifier of the target request does not meet the second preset condition, the network resource identifier of the target request will be The relevant information identifying the matching second request is moved to the head of the second queue.
  • determine the request data of the target request includes: at the end of the preset time period, if the network resource identifier of the target request is in the first queue, then According to the request data of the first request corresponding to the network resource identifier of the target request in the first queue, the request data of the target request is determined. At the end of the preset time period, if the network resource identifier requested by the target is in the second queue, the request data of the target request is determined according to the request data of the second request corresponding to the network resource identifier of the target request in the second queue.
  • the network resource identifier of the target request is in the first queue corresponds to two situations: Case 1, according to S130, if the first queue includes the first request matching the network resource identifier of the target request, the target request will be matched with the first request The first request in a queue that matches the network resource identifier of the target request is merged. At this time, the relevant information of the target request is stored in the first queue. Case 2, according to S140-S160, if the second queue includes a second request that matches the network resource identifier of the target request, the target request will be merged with the second request in the second queue that matches the network resource identifier of the target request . Then the relevant information of the second request is moved from the second queue to the first queue, and at this time, the relevant information of the target request is stored in the first queue.
  • the network resource identifier of the target request is in the second queue corresponds to a situation: according to S140-S160, if the second queue includes a second request that matches the network resource identifier of the target request, the target request will be matched with the second request. The second request in the queue that matches the network resource identifier of the target request is merged. Thereafter, the relevant information of the second request is not moved from the second queue to the first queue. At this time, the relevant information of the target request is stored in the second queue.
  • Determining the request data of the target request according to the request data of the first request corresponding to the network resource identifier of the target request in the first queue includes directly The request data is used as the request data of the target request; or, based on a preset formula, the request data of the first request corresponding to the network resource identifier of the target request in the first queue is calculated to obtain the request data of the target request; or, the request data of the second request is obtained.
  • the request data of the first request corresponding to the network resource identifier of the target request in a queue is analyzed, processed, and counted to obtain the request data of the target request.
  • determine the request data of the target request includes: directly assigning the first request data corresponding to the network resource identifier of the target request in the second queue
  • the request data of the second request is used as the request data of the target request; or, based on a preset formula, the request data of the second request corresponding to the network resource identifier of the target request in the first queue is calculated to obtain the request data of the target request; or , analyzing, processing, and counting the request data of the second request corresponding to the network resource identifier of the target request in the second queue to obtain the request data of the target request.
  • a first threshold for judging whether a request is an abnormal request may be set.
  • the first preset condition is that the request data of the target request is greater than or equal to the first threshold.
  • abnormal traffic consumption An important reason for abnormal traffic consumption is that there are defects in the application itself, which causes the same request to be initiated multiple times (that is, high-frequency requests occur). For example, after the terminal sends a request to the server, but the server does not respond, the terminal will poll and periodically send requests until the server responds. Or, after the terminal sends a request to the server, the server's response cannot meet the terminal's needs, and the terminal will poll and periodically send requests until the server's response meets the terminal's needs. Therefore, abnormal requests are often high-frequency requests, and the occurrence of abnormal requests often means that the application itself has defects.
  • the above technical solution can be used to screen out high-frequency requests, and then determine which high-frequency requests are abnormal requests, and help R&D personnel locate the cause based on abnormal requests, thereby achieving the purpose of eliminating faults and reducing terminal traffic consumption.
  • the target request is an abnormal request, which can be replaced by: if the preset time period ends, the target request The network resource identifier of is in the first queue, and the request data of the target request meets the first preset condition, then it is determined that the target request is an abnormal request.
  • the reason for this setting is that the first queue is essentially a queue for storing related information of high-frequency requests, and the second queue is a queue for storing related information of sub-high-frequency requests. Since abnormal requests are often high-frequency requests, when determining abnormal requests, the first queue should be prioritized to determine abnormal requests. This can fully reduce the time it takes to screen out abnormal requests and improve user experience.
  • the target request is set to include a service identifier; after S170, the method further includes: determining the cause of the abnormal traffic consumption according to the service identifier included in the abnormal request. If the target request does not include a service identifier, when determining the cause of abnormal traffic consumption, it is necessary to map the target request to the business to clarify which business the target request is used for. The entire mapping process is complicated and has high requirements for the terminal system . By setting the target request to include a service identifier, it is not necessary to map the target request to a service, and it is possible to clarify which services the target request is used to complete, which has lower requirements on the terminal system.
  • Determine the cause of abnormal traffic consumption based on the service identifier included in the abnormal request can be performed manually or by a computer. For example, if it is performed manually, the terminal sends the abnormal request including the business identifier to the remote server, and the developer obtains the abnormal request including the business identifier through the remote server, and checks the code of the corresponding business according to the business identifier, so as to analyze the abnormal traffic. reason for consumption. If executed by a computer, optionally, according to the service identifier included in the abnormal request, the computer determines the code of the service corresponding to the service identifier, and automatically checks the code to determine the cause of the abnormal traffic consumption.
  • Determine the cause of the abnormal traffic consumption according to the business identifier included in the abnormal request including: if the total traffic consumption of the terminal within the preset time period meets the sixth preset condition, then determine the cause of the abnormal traffic consumption according to the business identifier included in the abnormal request .
  • a sixth threshold for judging whether there is a problem of abnormal traffic consumption in the terminal application is set.
  • the sixth preset condition is that the total traffic consumption of the terminal within the preset time period is greater than or equal to the sixth threshold.
  • the overall traffic consumption is relatively low within a preset period of time. In this case, it can be considered that there is no problem of abnormal traffic consumption in the terminal application.
  • Such a setting is essentially that during the running of the terminal application, although the screening of abnormal requests is always performed, it is not necessarily reported. Only in the case of abnormal traffic consumption, the screened abnormal requests are reported to locate the cause of abnormal traffic consumption.
  • the total traffic consumption of the terminal within the preset time period meets the sixth preset condition, before determining the cause of the abnormal traffic consumption according to the service identifier included in the abnormal request, it also includes: determining the total traffic consumption of the terminal within the preset time period.
  • determining the total traffic consumption of the terminal within a preset time period there are many ways to implement "determining the total traffic consumption of the terminal within a preset time period", which is not limited in this application.
  • the total flow consumption of the terminal within a preset time period can be counted directly by using the flow monitoring application.
  • the terminal For any target request, the terminal will consume a certain amount of traffic when sending the target request.
  • the server responds to the target request and sends the response information to the terminal.
  • the terminal receives the response information corresponding to the target request, the terminal consumes a certain amount of traffic. Therefore, the traffic consumed by any target request includes the traffic consumed when sending the target request and the traffic consumed when receiving the response information.
  • FIG. 6 is a flowchart of another abnormal request processing method provided by an embodiment of the present disclosure.
  • the example shown in FIG. 6 is an illustration of the example shown in FIG. 1 .
  • the first threshold is K
  • the request data of the target request is greater than or equal to K
  • the second threshold is K/2, that is, the relevant data of the request whose request data is greater than K/2 should be stored in the first queue, and the relevant data of the request whose request data is less than or equal to K/2 should be stored in the second queue .
  • Both the third threshold and the fifth threshold are M, that is, the maximum number of requests allowed to be stored in the first queue and the second queue are both M.
  • the start time of the preset time period is T
  • the duration of the preset time period is 10 minutes
  • the current time is t
  • the fourth threshold is N
  • the fourth preset condition is: the first requested The latest request time is earlier than (T+(t-T)/2), and the requested data of the first request is less than N.
  • the method includes:
  • the step of obtaining the target request is continuously performed within a preset time period. For any target request, the following processing steps are executed until the preset time period ends.
  • the processing steps to be performed include:
  • first extract the network resource identifier (ie URL) in the target request When a target request is obtained, first extract the network resource identifier (ie URL) in the target request, and then query in the first queue to determine whether there is a first request corresponding to the target request in the first queue.
  • the correspondence between the first request and the target request means that the network resource identifier of the first request is the same as the network resource identifier of the target request. If there is a first request corresponding to the target request in the first queue, add 1 to the request frequency of the first request corresponding to the target request, and move the relevant information of the first request to the head of the first queue.
  • the second request corresponding to the target request in the second queue If there is no first request corresponding to the target request in the first queue, it is determined whether there is a second request corresponding to the target request in the second queue.
  • the correspondence between the second request and the target request means that the network resource identifier of the second request is the same as the network resource identifier of the target request. If there is a second request corresponding to the target request in the second queue, add 1 to the request frequency of the second request corresponding to the target request. It is judged whether the request frequency of the second request corresponding to the target request is greater than K/2 after adding 1 to the request frequency of the second request corresponding to the target request.
  • the request frequency of the second request corresponding to the target request is increased by 1, and the request frequency of the second request corresponding to the target request is greater than K/2, move the relevant information of the second request to the head of the first queue, and from The related information of the second request is removed from the second queue. If the request frequency of the second request corresponding to the target request is increased by 1, and the request frequency of the second request corresponding to the target request is less than or equal to K/2, move the relevant information of the second request to the head of the second queue.
  • relevant information of a new second request is generated based on the target request, and stored at the head of the second queue.
  • the request frequency of the newly generated second request is 1. If storing the newly generated second request behind the second queue causes the length of the second queue to be greater than M, delete the relevant information of the second request at the tail of the second queue.
  • the first queue is traversed to determine whether there is a first request with a request frequency greater than or equal to K, and if there is, the first request is output, and the output first request is an abnormal request.
  • the above technical solution can be used to screen out high-frequency requests, and then determine which high-frequency requests are abnormal requests, and help R&D personnel locate the cause based on abnormal requests, thereby achieving the purpose of eliminating faults and reducing terminal traffic consumption.
  • Another important reason for abnormal traffic consumption is excessive traffic consumption for a single request. For example, a user clicks to play a large video stream, which consumes a lot of traffic. For this situation, it is necessary to track the traffic consumed by multiple target requests.
  • the abnormal request processing method In the process of executing the abnormal request processing method provided by the present disclosure, monitor the traffic consumed by all the target requests obtained respectively; judge whether there is a traffic consumed by a target request greater than the seventh threshold. If the traffic consumed by a target request is greater than the seventh threshold, it is determined that the target request is an abnormal request.
  • the target request includes a service identifier; after determining that the target request is an abnormal request, the method further includes: determining the cause of abnormal traffic consumption according to the service identifier included in the abnormal request.
  • the method in the process of executing the abnormal request processing method provided by the present disclosure, monitor the traffic consumed by all the target requests acquired within the preset time period; when the preset time period ends, it is judged to be in the second queue, or from Among all the first requests deleted from the first queue and satisfying the fourth preset condition, whether there is one or several requests whose traffic consumption is greater than the seventh threshold. If the traffic consumed by any request is greater than the seventh threshold, it is determined that the request is an abnormal request.
  • This setting can narrow the scope of filtering and quickly filter out single requests that consume too much traffic.
  • the second request includes a service identifier; after determining that the second request is an abnormal request, the method further includes: determining a cause of abnormal traffic consumption according to the service identifier included in the second request.
  • the seventh threshold is used to judge whether there is a situation that the traffic consumption of a single request is too large.
  • the seventh threshold may be the same as or different from the foregoing sixth threshold, which is not limited in the present application.
  • the actual business scenario is that the user is downloading the Android Application Package (Android APK), which conforms to the logic of the business scenario and does not need to modify the code.
  • Android APK Android Application Package
  • a picture requested to be downloaded reaches 10M.
  • the size of the traffic consumed by the request can be reduced to tens of KB, thereby reducing the user's traffic loss.
  • Fig. 7 is a schematic structural diagram of an exception request processing device provided by an embodiment of the present disclosure.
  • the abnormal request processing device provided by the embodiment of the present disclosure can be configured in the client, or can be configured in the server, and the abnormal request processing device includes: an acquisition module 310, a query module 320, an update module 330, and a determination module 340; , the obtaining module 310 is configured to obtain a target request within a preset time period, the target request includes a network resource identifier; the query module 320 is configured to query the first queue according to the network resource identifier, and the first queue uses storing the relevant information of the first request within the preset time period; the query module 320 is further configured to: when the first queue does not include the first request matching the network resource identifier, according to the Network resource identification, query the second queue, the second queue is used to store the relevant information of the second request within the preset time period, and the request frequency represented by the request data of the first request is greater than that of the second request The request frequency represented
  • the update module 330 is further configured to update the request data of the first request matching the network resource identifier when the first queue includes the first request matching the network resource identifier, the request data representing the request frequency; the abnormal request processing device also includes a mobile module 350 configured to, when the updated request data of the second request matching the network resource identifier satisfies a second preset condition, combine the The related information of the second request matched by the resource identifier is moved from the second queue to the first queue.
  • Determination module 340 is set to:
  • the network resource identifier At the end of the preset time period, if the network resource identifier is in the first queue, according to the request data of the first request corresponding to the network resource identifier in the first queue, determine the The request data requested by the target; at the end of the preset time period, if the network resource identifier is in the second queue, according to the second request corresponding to the network resource identifier in the second queue request data, which determines the request data requested by the target.
  • the moving module 350 is configured to, after updating the request data of the first request matching the network resource identifier, move the related information of the first request matching the network resource identifier to the first queue team leader.
  • the moving module 350 is configured to move the relevant information of the second request that matches the network resource identifier from the second queue to the head of the first queue; the device also includes a deletion module configured to move from the The related information of the second request matching the network resource identifier is deleted from the second queue.
  • Mobile module 350 set to:
  • Mobile module 350 set to:
  • the updating module 330 is configured to store the relevant information of the target request in the second queue if the second queue does not include a second request matching the network resource identifier; the deleting module is configured to if If the length of the second queue satisfies the fifth preset condition, the related information of the second request at the end of the second queue is deleted.
  • Determination module 340 is set to:
  • the network resource identifier is in the first queue when the preset time period ends, and the request data of the target request meets a first preset condition, then it is determined that the target request is an abnormal request.
  • the target request includes a service identifier
  • Determination module 340 is set to:
  • Determination module 340 is set to:
  • the cause of the abnormal traffic consumption is determined according to the service identifier included in the abnormal request.
  • the abnormal request processing device provided by the embodiment of the present disclosure can execute the steps performed by the client or the server in the method for processing the abnormal request provided by the method embodiment of the present disclosure, and the execution steps and effects will not be repeated here.
  • FIG. 8 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the electronic device 1000 in the embodiment of the present disclosure may include but not limited to mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (PAD), portable multimedia players (Portable Media Player, PMP), vehicle-mounted terminals (eg, vehicle-mounted navigation terminals), mobile terminals such as wearable electronic devices, and fixed terminals such as digital televisions (Television, TV), desktop computers, smart home devices, etc.
  • PDA Personal Digital Assistant
  • PMP portable multimedia players
  • vehicle-mounted terminals eg, vehicle-mounted navigation terminals
  • mobile terminals such as wearable electronic devices
  • fixed terminals such as digital televisions (Television, TV), desktop computers, smart home devices, etc.
  • the electronic device 1000 shown in FIG. 8 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
  • an electronic device 1000 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 1001, which may be stored in a read-only memory (Read-Only Memory, ROM) 1002 according to a program 1008 is loaded into the program in the random access memory (Random Access Memory, RAM) 1003 to perform various appropriate actions and processing to realize the method for locating performance problems according to the embodiment of the present disclosure.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • various programs and information necessary for the operation of the electronic device 1000 are also stored.
  • the processing device 1001, ROM 1002, and RAM 1003 are connected to each other through a bus 1004.
  • An input/output (Input/Output, I/O) interface 1005 is also connected to the bus 1004 .
  • an input device 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; including, for example, a liquid crystal display (Liquid Crystal Display, LCD) , an output device 1007 such as a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009.
  • the communication means 1009 may allow the electronic device 1000 to perform wireless or wired communication with other devices to exchange information.
  • FIG. 8 shows electronic device 1000 having various means, it is not required to implement or possess all of the means shown. More or fewer means may alternatively be implemented or provided.
  • the processes described above with reference to the flowcharts may be implemented as computer software programs.
  • the embodiments of the present disclosure include a computer program product, which includes a computer program carried on a non-transitory computer readable medium, and the computer program includes program code for executing the method shown in the flow chart, thereby realizing the above The exception request processing method described above.
  • the computer program may be downloaded and installed from a network via the communication means 1009, or from the storage means 1008, or from the ROM 1002.
  • the processing device 1001 the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.
  • the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.
  • Examples of computer readable storage media may include, but are not limited to: electrical connections with one or more wires, portable computer disks, hard disks, RAM, ROM, Erasable Programmable Read-Only Memory (EPROM) or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include an information signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated information signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • the program code contained on the computer readable medium can be transmitted by any appropriate medium, including but not limited to: electric wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • clients and servers can communicate using any known or future-developed network protocol, such as HTTP, and can be interconnected with any form or medium of digital information communication (eg, a communication network).
  • a communication network examples include local area network (Local Area Network, LAN), wide area network (Wide Area Network, WAN), Internet (for example, Internet) and peer-to-peer network (for example, ad hoc peer-to-peer network), and any known or networks developed in the future.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a target request within a preset time period, and the target request includes a network resource identifier ; According to the network resource identifier, query the first queue, and the first queue is used to store the relevant information of the first request within the preset time period; if the first queue does not include the information related to the network resource identifier For the matched first request, query the second queue according to the network resource identifier, the second queue is used to store the relevant information of the second request within the preset time period, and the request data of the first request The request frequency represented is greater than the request frequency represented by the request data of the second request; if the second queue includes a second request matching the network resource identifier, update the first request matching the network resource identifier Two requested request data; at the end of the preset time period, according to the first queue or the second queue, determine the request data of the target
  • the electronic device may also perform other steps described in the above embodiments.
  • Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, or combinations thereof, including but not limited to object-oriented programming languages—such as Java, Smalltalk, C++, and Includes conventional procedural programming languages - such as the "C" language or similar programming languages.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user computer through any kind of network, including a LAN or WAN, or it can be connected to an external computer (eg via the Internet using an Internet Service Provider).
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself in one case.
  • exemplary types of hardware logic components include: Field Programmable Gate Arrays (Field Programmable Gate Arrays, FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (Application Specific Standard Parts, ASSP), System on Chip (System on Chip, SOC), Complex Programmable Logic Device (Complex Programmable Logic Device, CPLD) and so on.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard drives, RAM, ROM, EPROM or flash memory, optical fibers, CD-ROMs, optical storage devices, magnetic storage devices, or Any suitable combination of the above.
  • the present disclosure provides an electronic device, including:
  • One or more processors comprising: memory, configured to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors realize the Any of the exception request handling methods provided.
  • the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the exception request as described in any one of the present disclosure is implemented. Approach.
  • An embodiment of the present disclosure further provides a computer program product, where the computer program product includes a computer program or an instruction, and when the computer program or instruction is executed by a processor, the above exception request processing method is implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本文公开了一种异常请求处理方法、装置、电子设备和存储介质。异常请求处理方法包括:在预设时间段内获取目标请求,目标请求包括网络资源标识;查询第一队列;若第一队列不包括与网络资源标识匹配的第一请求,则查询第二队列,第一请求的请求数据表征的请求频率大于第二请求的请求数据表征的请求频率;若第二队列包括与网络资源标识匹配的第二请求,则更新与网络资源标识匹配的第二请求的请求数据;在预设时间段结束时,根据第一队列或第二队列,确定目标请求的请求数据,若目标请求的请求数据符合第一预设条件,则确定目标请求为异常请求。

Description

异常请求处理方法、装置、电子设备和存储介质
本申请要求在2021年06月30日提交中国专利局、申请号为202110738186.0的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及信息技术领域,例如涉及一种异常请求处理方法、装置、电子设备和存储介质。
背景技术
随着信息技术的发展,终端已经成为人们日常生活中不可或缺的设备。例如,用户可以在终端上安装多种不同类型、不同用途的应用程序(Application,APP)。
通常情况下,终端在运行应用程序的过程中,可能会造成网络流量的消耗。在应用程序的开发测试场景下,甚至会出现异常流量消耗,例如,消耗较多的流量。
发明内容
本公开提供了一种异常请求处理方法、装置、电子设备和存储介质。
本公开提供了一种异常请求处理方法,包括:
在预设时间段内获取目标请求,其中,所述目标请求包括网络资源标识;
根据所述网络资源标识,查询第一队列,其中,所述第一队列用于存储所述预设时间段内的第一请求的相关信息;
在所述第一队列不包括与所述网络资源标识匹配的第一请求的情况下,根据所述网络资源标识,查询第二队列,其中,所述第二队列用于存储所述预设时间段内的第二请求的相关信息,所述第一请求的请求数据表征的请求频率大于所述第二请求的请求数据表征的请求频率;
在所述第二队列包括与所述网络资源标识匹配的第二请求的情况下,更新所述与所述网络资源标识匹配的第二请求的请求数据;
在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,在所述目标请求的请求数据符合第一预设条件的情况下,确定所述目标请求为异常请求。
本公开还提供了一种异常请求处理装置,包括:
获取模块,设置为在预设时间段内获取目标请求,其中,所述目标请求包括网络资源标识;
查询模块,设置为根据所述网络资源标识,查询第一队列,其中,所述第一队列用于存储所述预设时间段内的第一请求的相关信息;
所述查询模块,还设置为在所述第一队列不包括与所述网络资源标识匹配的第一请求的情况下,根据所述网络资源标识,查询第二队列,其中,所述第二队列用于存储所述预设时间段内的第二请求的相关信息,所述第一请求的请求数据表征的请求频率大于所述第二请求的请求数据表征的请求频率;
更新模块,设置为在所述第二队列包括与所述网络资源标识匹配的第二请求的情况下,更新所述与所述网络资源标识匹配的第二请求的请求数据;
确定模块,设置为在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,在所述目标请求的请求数据符合第一预设条件的情况下,确定所述目标请求为异常请求。
本公开还提供了一种电子设备,包括:
一个或多个处理器;
存储装置,设置为存储一个或多个程序;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上所述的异常请求处理方法。
本公开还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上所述的异常请求处理方法。
本公开还提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上所述的异常请求处理方法。
附图说明
图1为本公开实施例提供的一种异常请求处理方法的流程图;
图2为本公开实施例提供的另一种异常请求处理方法的流程图;
图3为本公开实施例提供的一种用于实现S130的方法的原理的示意图;
图4为本公开实施例提供的一种用于实现S150的方法的原理的示意图;
图5为本公开实施例提供的一种用于实现S160的方法的原理的示意图;
图6为本公开实施例提供的另一异常请求处理方法的流程图;
图7为本公开实施例提供的一种异常请求处理装置的结构示意图;
图8为本公开实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将参照附图描述本公开的实施例。虽然附图中显示了本公开的一些实施例,本公开可以通过多种形式来实现,提供这些实施例是为了理解本公开。本公开的附图及实施例仅用于示例性作用。
本公开的方法实施方式中记载的多个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本文使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
图1为本公开实施例提供的一种异常请求处理方法的流程图,本实施例可适用于客户端中对联网应用的异常请求进行确定、处理的情况,该方法可以由异常请求处理装置执行,该装置可以采用软件和/或硬件的方式实现,该装置可配置于电子设备中,例如终端,包括但不限于智能手机、掌上电脑、平板电脑、带显示屏的可穿戴设备、台式机、笔记本电脑、一体机、智能家居设备等。或者,本实施例可适用于服务端中对联网应用的异常请求进行确定、处理的情况,该方法可以由异常请求处理装置执行,该装置可以采用软件和/或硬件的方式实现,该装置可配置于电子设备中,例如服务器。
下面以终端为执行主体对该方法进行说明。如图1所示,该方法可以包括:
S10、在预设时间段内获取目标请求,目标请求包括网络资源标识。
目标请求可以为网页请求,也可以为非网页请求。网页请求可以为超文本传输协议(HyperText Transfer Protocol,HTTP)请求。非网页请求可以为点播请求或直播请求等。
网络资源标识可以为统一资源定位符(Uniform Resource Locator,URL)。URL包括域名部分和路径部分。可选地,在本申请中,仅考虑统一资源定位符的域名部分,不考虑统一资源定位符的路径部分。即,在下文中,两个请求的网络资源标识不同,是指两个请求的网络资源标识中域名部分不同;两个请求的网络资源标识相同,是指两个请求的网络资源标识中域名部分相同。
目标请求基于用户对用户界面中的虚拟按键进行操作生成,也可以为终端基于应用业务自动生成,本申请对此不作限制。示例性地,用户点击用户界面中的一个虚拟按键后,终端向服务器发送请求,该请求即为目标请求。在实际中,当用户对用户界面中的虚拟按键进行操作后,终端生成的目标请求的个数可能为一个或多个。
预设时间段可以根据需要设置,本申请对此不做限制。示例性地,预设时间段可以为5分钟或10分钟。
S20、根据网络资源标识,查询第一队列,第一队列用于存储预设时间段内的第一请求的相关信息。
第一请求的相关信息包括但不限于第一请求的网络资源标识、第一请求的请求数据。可选地,第一请求的相关信息还可以包括第一请求最近一次发生的时间。其中,请求数据表征请求频率。请求频率即从预设时间段开始时刻截止到当前时刻被请求的次数。
第一队列中,任意两个第一请求的网络资源标识均不同。
S30、若第一队列不包括与网络资源标识匹配的第一请求,则根据网络资源标识,查询第二队列,第二队列用于存储预设时间段内的第二请求的相关信息,第一请求的请求数据表征的请求频率大于第二请求的请求数据表征的请求频率。
“第一队列不包括与网络资源标识匹配的第一请求”是指,通过将目标请求的网络资源标识顺次与第一队列中多个第一请求的网络资源标识进行比对后发现,第一队列中所有第一请求的网络资源标识均与目标请求的网络资源标识均不同。
第二请求的相关信息包括但不限于第二请求的网络资源标识、第二请求的请求数据。可选地,第二请求的相关信息还可以包括第二请求最近一次发生的时间。其中,请求数据表征请求频率。请求频率即从预设时间段开始时刻截止到当前时刻被请求(即被发起)的次数。
第二队列中,任意两个第二请求的网络资源标识均不同。并且,第二队列 中任意一个第二请求的网络资源标识与第一队列中任意一个第一请求的网络资源标识均不同。
S40、若第二队列包括与网络资源标识匹配的第二请求,则更新与网络资源标识匹配的第二请求的请求数据。
将目标请求的网络资源标识顺次与第二队列中多个第二请求的网络资源标识进行比对,直至能够确定第二队列是否包括与目标请求的网络资源标识匹配的第二请求;若存在一个第二请求的网络资源标识与目标请求的网络资源标识相同(即匹配),则认为该第二请求与目标请求相同;对该第二请求的请求数据进行更新。
可选地,若第二请求的相关信息还包括第二请求最近一次发生的时间,存在一个第二请求的网络资源标识与目标请求的网络资源标识相同(即匹配),对该第二请求的请求数据进行更新,还包括:将该第二请求最近一次发生的时间修改为目标请求的发生时间。
S50、在预设时间段结束时,根据第一队列或第二队列,确定目标请求的请求数据,若目标请求的请求数据符合第一预设条件,则确定目标请求为异常请求。
可选地,直接将第一队列或第二队列中与目标请求的网络资源标识对应的请求的请求数据作为目标请求的请求数据;或者,基于预设公式,对第一队列或第二队列中与目标请求的网络资源标识对应的请求的请求数据进行计算,得到目标请求的请求数据;或者,对第一队列或第二队列中与目标请求的网络资源标识对应的请求的请求数据进行分析、处理、统计,得到目标请求的请求数据。
可选地,可以设置用于判断一个请求是否为异常请求的第一阈值,此时,第一预设条件为目标请求的请求数据大于或等于第一阈值。
导致异常流量消耗的一个重要原因是应用程序本身存在缺陷,导致相同请求被多次发起(即高频请求出现)。例如,终端向服务器发送请求后,服务器没有响应,终端会轮询、周期性发送请求,直到服务器有响应。或者,终端向服务器发送请求后,服务器的响应不能满足终端的需求,终端会轮询、周期性发送请求,直到服务器的响应满足终端的需求。因此,异常请求往往为高频请求,异常请求的出现往往意味着应用程序本身存在缺陷。
上述技术方案可用于筛选出高频请求,进而判断哪些高频请求为异常请求,帮助研发人员基于异常请求进行原因定位,进而达到故障消除,降低终端流量消耗的目的。
图2为本公开实施例提供的另一种异常请求处理方法的流程图。图2所示示例是对图1所示示例的说明。参见图2,该方法包括:
S110、在预设时间段内获取目标请求,目标请求包括网络资源标识。
目标请求可以为网页请求,也可以为非网页请求。网页请求可以为HTTP请求。非网页请求可以为点播请求或直播请求等。
网络资源标识可以为URL。URL包括域名部分和路径部分。可选地,在本申请中,仅考虑统一资源定位符的域名部分,不考虑统一资源定位符的路径部分。即,在下文中,两个请求的网络资源标识不同,是指两个请求的网络资源标识中域名部分不同;两个请求的网络资源标识相同,是指两个请求的网络资源标识中域名部分相同。
目标请求基于用户对用户界面中的虚拟按键进行操作生成,也可以为终端基于应用业务自动生成,本申请对此不作限制。示例性地,用户点击用户界面中的一个虚拟按键后,终端向服务器发送请求,该请求即为目标请求。在实际中,当用户对用户界面中的虚拟按键进行操作后,终端生成的目标请求的个数可能为一个或多个。
预设时间段可以根据需要设置,本申请对此不做限制。示例性地,预设时间段可以为5分钟或10分钟。
S120、根据目标请求的网络资源标识,查询第一队列,第一队列用于存储预设时间段内的第一请求的相关信息。
第一请求的相关信息包括但不限于第一请求的网络资源标识、第一请求的请求数据。可选地,第一请求的相关信息还可以包括第一请求最近一次发生的时间。其中,请求数据表征请求频率。请求频率即从预设时间段开始时刻截止到当前时刻被请求的次数。
第一队列中,任意两个第一请求的网络资源标识均不同。
S130、若第一队列包括与目标请求的网络资源标识匹配的第一请求,则更新与目标请求的网络资源标识匹配的第一请求的请求数据,请求数据表征请求频率。
将目标请求的网络资源标识顺次与第一队列中多个第一请求的网络资源标识进行比对,直至能够确定第一队列是否包括与目标请求的网络资源标识匹配的第一请求;若存在一个第一请求的网络资源标识与目标请求的网络资源标识相同(即匹配),则认为该第一请求与目标请求相同;对该第一请求的请求数据进行更新。
图3为本公开实施例提供的一种用于实现S130的方法的原理的示意图。示例性地,参见图3,若第一队列中包括5个第一请求的相关信息,分别为:请求1的相关信息、请求2的相关信息、请求3的相关信息、请求6的相关信息和请求7的相关信息。若通过比对发现请求2的网络资源标识与目标请求的网络资源标识相同,则认为请求2与目标请求相同,对请求2的请求数据(即请求2的请求频率)进行更新。更新方法可以为,令请求2的请求数据加1。例如未更新前请求2的请求数据为n,更新后请求2的请求数据为n+1。
可选地,若第一请求的相关信息还包括第一请求最近一次发生的时间,存在一个第一请求的网络资源标识与目标请求的网络资源标识相同(即匹配),对该第一请求的请求数据进行更新,还包括:将该第一请求最近一次发生的时间修改为目标请求的发生时间。
本步骤的实质是,将目标请求与第一队列中和目标请求的网络资源标识匹配的第一请求进行合并。
可选地,在执行本步骤之后,还包括:将与目标请求的网络资源标识匹配的第一请求的相关信息移动到第一队列的队首。示例性地,继续参见图3,与目标请求的网络资源标识匹配的第一请求为请求2。在移动之前,请求2的相关信息位于第一队列的第二位。通过移动,使得请求2的相关信息位于第一队列的队首(即第一位)。
在实际中经常出现在较短时间内,相同请求被连续多次发起的情况。针对于这种情况,若一个请求连续被发起两次,分别为第s次被发起和第s+1次被发起。第s次被发起时,在执行本步骤时,确定第s次发起的请求对应第一队列中的第一请求A,将第一请求A的相关信息移动到第一队列的队首。紧接着,该请求第s+1次被发起,在执行本步骤时,需要将第s+1次被发起的请求的网络资源标识顺次与第一队列中多个第一请求的网络资源标识进行比对。由于第s+1次被发起的请求和第s次被发起的请求是相同的请求,第s+1次被发起的请求同样对应第一请求A。而此时第一请求A已经处于第一队列的队首,这样设置只通过一次匹配就可以得到“第一队列包括与目标请求的网络资源标识匹配的第一请求”。这样设置可以实现缩小后续相同目标请求的网络资源标识与第一队列中多个第一请求的网络资源标识进行比对所花费的时间,提高计算速率。
S140、若第一队列不包括与目标请求的网络资源标识匹配的第一请求,则根据网络资源标识,查询第二队列,第二队列用于存储预设时间段内的第二请求的相关信息,第一请求的请求数据表征的请求频率大于第二请求的请求数据表征的请求频率。
“第一队列不包括与目标请求的网络资源标识匹配的第一请求”是指,通过将 目标请求的网络资源标识顺次与第一队列中多个第一请求的网络资源标识进行比对后发现,第一队列中所有第一请求的网络资源标识均与目标请求的网络资源标识不同。
第二请求的相关信息包括但不限于第二请求的网络资源标识、第二请求的请求数据。可选地,第二请求的相关信息还可以包括第二请求最近一次发生的时间。其中,请求数据表征请求频率。请求频率即从预设时间段开始时刻截止到当前时刻被请求(即被发起)的次数。
第二队列中,任意两个第二请求的网络资源标识均不同。并且,第二队列中任意一个第二请求的网络资源标识与第一队列中任意一个第一请求的网络资源标识均不同。
S150、若第二队列包括与目标请求的网络资源标识匹配的第二请求,则更新与目标请求的网络资源标识匹配的第二请求的请求数据。
将目标请求的网络资源标识顺次与第二队列中多个第二请求的网络资源标识进行比对,直至能够确定第二队列是否包括与目标请求的网络资源标识匹配的第二请求;若存在一个第二请求的网络资源标识与目标请求的网络资源标识相同(即匹配),则认为该第二请求与目标请求相同;对该第二请求的请求数据进行更新。
图4为本公开实施例提供的一种用于实现S150的方法的原理的示意图。示例性地,参见图4,若第二队列中包括5个第二请求的相关信息,分别为:请求4的相关信息、请求5的相关信息、请求8的相关信息、请求9的相关信息和请求10的相关信息。若通过比对发现请求8的网络资源标识与目标请求的网络资源标识相同,则认为请求8与目标请求相同,对请求8的请求数据(即请求8的请求频率)进行更新。更新方法可以为令请求8的请求数据加1。例如未更新前请求8的请求数据为m,更新后请求8的请求数据为m+1。
可选地,若第二请求的相关信息还包括第二请求最近一次发生的时间,存在一个第二请求的网络资源标识与目标请求的网络资源标识相同(即匹配),对该第二请求的请求数据进行更新,还包括:将该第二请求最近一次发生的时间修改为目标请求的发生时间。
本步骤的实质是,将目标请求与第二队列中和目标请求的网络资源标识匹配的第二请求进行合并。
若第二队列不包括与目标请求的网络资源标识匹配的第二请求,则将目标请求的相关信息存储在第二队列中。此时,“将目标请求的相关信息存储在第二队列中”应当理解为,基于目标请求的相关信息生成一条新的第二请求的相关信 息,新生成的第二请求的相关信息存储在第二队列中。
若第二队列的长度满足第五预设条件,则删除第二队列中位于队尾的第二请求的相关信息。示例性地,设置第五阈值,第五预设条件为第二队列的长度大于或等于第五阈值,第五阈值的作用是对第二队列的长度进行限制,以使第二队列可存储的请求的数量是有限的。通过设置“若第二队列的长度满足第三预设条件,则删除第二队列中位于队尾的第二请求的相关信息”,实质是通过对第二队列中位于队尾的第二请求进行淘汰,使得第二队列中请求数量始终处于合理的范围内。这样设置可以降低终端中系统的负荷,保持系统高效运行。
S160、若更新后的与目标请求的网络资源标识匹配的第二请求的请求数据满足第二预设条件,则将与目标请求的网络资源标识匹配的第二请求的相关信息从第二队列移动到第一队列。
由于第一请求的请求数据表征的请求频率大于第二请求的请求数据表征的请求频率,第一队列用于存储预设时间段内的第一请求的相关信息,第二队列用于存储预设时间段内的第二请求的相关信息。第一队列本质上是一个用于存储高频请求的相关信息的队列,第二队列是一个用于存储次高频请求的相关信息的队列。
第二预设条件是指可用于确定一请求属于高频请求还是次高频请求的条件。可选地,在实际中,可以设置第二域值,用于区分请求属于高频请求还是次高频请求。若一请求的请求数据大于第二阈值,则将该请求判定为高频请求,该请求的相关数据需要存储于第一队列中。若一请求的请求数据小于或等于第二域值,则将该请求判定为次高频请求,该请求的相关数据需要存储于第二队列中。此时,第二预设条件为:更新后的与目标请求的网络资源标识匹配的第二请求的请求数据大于第二阈值。
据此,本步骤可替换为:若更新后的与目标请求的网络资源标识匹配的第二请求的请求数据大于第二阈值,则将与网络资源标识匹配的第二请求的相关信息从第二队列移动到第一队列。
图5为本公开实施例提供的一种用于实现S160的方法的原理的示意图。示例性地,参见图4和图5,假设第二阈值为K/2,将目标请求与第二队列中的请求8合并以后,请求8的请求数据被更新为m+1。判断m+1与K/2的大小关系。若m+1>K/2,将请求8的相关数据从第二队列移动到第一队列。
在将目标请求与第二队列中和目标请求的网络资源标识匹配的第二请求进行合并以后,判断合并后的第二请求是否会由次高频请求晋升为高频请求;若合并后的第二请求由次高频请求晋升为高频请求,将该第二请求的相关信息从 第二队列移动到第一队列。
本步骤中“将与目标请求的网络资源标识匹配的第二请求的相关信息从第二队列移动到第一队列”还可替换为,将与网络资源标识匹配的第二请求的相关信息从第二队列移动到第一队列的队首,并从第二队列中删除与网络资源标识匹配的第二请求的相关信息。
类似地,通过设置“将与目标请求的网络资源标识匹配的第二请求的相关信息从第二队列移动到第一队列的队首”,可以实现缩小后续相同目标请求的网络资源标识与第一队列中多个第一请求的网络资源标识进行比对所花费的时间,提高计算速率。
通过设置“从第二队列中删除与网络资源标识匹配的第二请求的相关信息”,可以使得两个队列不包括相同的请求,有利于确保两个队列始终界限分明(第一队列中,任一第一请求的请求数据大于第二阈值;第二队列中,任一第二请求的请求数据小于或等于第二阈值),避免后续运算混乱,出现程序缺陷的不良现象出现。
将与目标请求的网络资源标识匹配的第二请求的相关信息从第二队列移动到第一队列之后,方法还包括:若第一队列的长度满足第三预设条件,则删除第一队列中满足第四预设条件的第一请求的相关信息。示例性地,设置第三阈值,第三预设条件为第一队列的长度应当大于或等于第三阈值。
第三阈值的作用是对第一队列的长度进行限制,以使第一队列可存储的请求的数量是有限的。可选地,在实际中,用于限制第一队列的长度的第三阈值,与前文提及的用于限制第二队列的长度的第五阈值可以相同,也可以不同,本申请对此不作限制。
第四预设条件的作用是对第一队列中需要进行淘汰的第一请求进行筛选。第四预设条件的设置方法有多种,示例性地,可以为满足第四预设条件的第一请求的最近请求时间早于预设时间点,且满足第四预设条件的第一请求的请求数据小于第四阈值。
预设时间点应当为预设时间段开始时刻到当前时间之间的任一时间点。其取值本申请对此不作限制。可选地,可以设置预设时间点为当前时间与预设时间段的开始时间之间的中间时间点。示例性地,若预设时间段的开始时间为T,当前时间为t,预设时间点为T+(t-T)/2。第四阈值的作用是筛选出第一队列中请求数据较小的第一数据。
通过设置“若第一队列的长度满足第三预设条件,则删除第一队列中满足第四预设条件的第一请求的相关信息”,实质是通过对第一队列中请求数据较小, 且请求发生时刻较早的第一请求进行淘汰,使得第一队列中的请求数量始终处于合理的范围内。这样设置可以降低终端中系统的负荷,保持系统高效运行。
更新与目标请求的网络资源标识匹配的第二请求的请求数据之后,若与目标请求的网络资源标识匹配的第二请求的请求数据不满足第二预设条件,则将与目标请求的网络资源标识匹配的第二请求的相关信息移动到第二队列的队首。
在将目标请求与第二队列中和目标请求的网络资源标识匹配的第二请求进行合并以后,经判断合并后的第二请求仍属于次高频请求,该第二请求的相关信息仍需存储于第二队列中。
类似地,“将与目标请求的网络资源标识匹配的第二请求的相关信息移动到第二队列的队首”可以实现缩小后续相同目标请求的网络资源标识与第二队列中多个第二请求的网络资源标识进行比对所花费的时间,提高计算速率。
S170、在预设时间段结束时,根据第一队列或第二队列,确定目标请求的请求数据,若目标请求的请求数据符合第一预设条件,则确定目标请求为异常请求。
“在预设时间段结束时,根据第一队列或第二队列,确定目标请求的请求数据”,包括:在预设时间段结束时,若目标请求的网络资源标识在第一队列中,则根据第一队列中与目标请求的网络资源标识对应的第一请求的请求数据,确定目标请求的请求数据。在预设时间段结束时,若目标请求的网络资源标识在第二队列中,则根据第二队列中与目标请求的网络资源标识对应的第二请求的请求数据,确定目标请求的请求数据。
“目标请求的网络资源标识在第一队列中”,对应两种情况:情况一,根据S130,若第一队列包括与目标请求的网络资源标识匹配的第一请求,会将该目标请求与第一队列中和目标请求的网络资源标识匹配的第一请求进行合并。此时,目标请求的相关信息被存储于第一队列中。情况二,根据S140-S160,若第二队列包括与目标请求的网络资源标识匹配的第二请求,会将该目标请求与第二队列中和目标请求的网络资源标识匹配的第二请求进行合并。然后将该第二请求的相关信息从第二队列移动到第一队列,此时,目标请求的相关信息被存储于第一队列中。
“目标请求的网络资源标识在第二队列中”,对应一种情况:根据S140-S160,若第二队列包括与目标请求的网络资源标识匹配的第二请求,会将该目标请求与第二队列中和目标请求的网络资源标识匹配的第二请求进行合并。此后并不将该第二请求的相关信息从第二队列移动到第一队列。此时,目标请求的相关信息被存储于第二队列中。
“根据第一队列中与目标请求的网络资源标识对应的第一请求的请求数据,确定目标请求的请求数据”包括,直接将第一队列中与目标请求的网络资源标识对应的第一请求的请求数据作为目标请求的请求数据;或者,基于预设公式,对第一队列中与目标请求的网络资源标识对应的第一请求的请求数据进行计算,得到目标请求的请求数据;或者,对第一队列中与目标请求的网络资源标识对应的第一请求的请求数据进行分析、处理、统计,得到目标请求的请求数据。
类似地,“根据第二队列中与目标请求的网络资源标识对应的第二请求的请求数据,确定目标请求的请求数据”包括:直接将第二队列中与目标请求的网络资源标识对应的第二请求的请求数据作为目标请求的请求数据;或者,基于预设公式,对第一队列中与目标请求的网络资源标识对应的第二请求的请求数据进行计算,得到目标请求的请求数据;或者,对第二队列中与目标请求的网络资源标识对应的第二请求的请求数据进行分析、处理、统计,得到目标请求的请求数据。
可选地,可以设置用于判断一个请求是否为异常请求的第一阈值,此时,第一预设条件为目标请求的请求数据大于或等于第一阈值。
导致异常流量消耗的一个重要原因是应用程序本身存在缺陷,导致相同请求被多次发起(即高频请求出现)。例如,终端向服务器发送请求后,服务器没有响应,终端会轮询、周期性发送请求,直到服务器有响应。或者,终端向服务器发送请求后,服务器的响应不能满足终端的需求,终端会轮询、周期性发送请求,直到服务器的响应满足终端的需求。因此,异常请求往往为高频请求,异常请求的出现往往意味着应用程序本身存在缺陷。
上述技术方案可用于筛选出高频请求,进而判断哪些高频请求为异常请求,帮助研发人员基于异常请求进行原因定位,进而达到故障消除,降低终端流量消耗的目的。
在上述技术方案的基础上,可选地,S170中,若目标请求的请求数据符合第一预设条件,则确定目标请求为异常请求,可替换为:若预设时间段结束时,目标请求的网络资源标识在第一队列中,且目标请求的请求数据符合第一预设条件,则确定目标请求为异常请求。这样设置是因为,第一队列本质上是一个用于存储高频请求的相关信息的队列,第二队列是一个用于存储次高频请求的相关信息的队列。由于异常请求往往为高频请求,在确定异常请求时,应当优先从第一队列入手,进行异常请求的确定,这样可以充分缩小筛选出异常请求需要花费的时间,提高用户体验。
在上述技术方案的基础上,设置目标请求包括业务标识;S170之后,该方法还包括:根据异常请求包括的业务标识,确定异常流量消耗的原因。如果目 标请求不包括业务标识,在后续进行异常流量消耗原因的确定时,需要将目标请求映射到业务中,以明确目标请求用于完成哪些业务,其整个映射过程复杂,对终端系统要求较高。通过设置目标请求包括业务标识,不需要将目标请求映射到业务中,就可明确目标请求用于完成哪些业务,其对终端体系要求较低。
“根据异常请求包括的业务标识,确定异常流量消耗的原因”可以由人工执行,也可以由计算机执行。示例性地,若由人工执行,终端将包括业务标识的异常请求发送给远程服务器,开发人员通过远程服务器获取包括业务标识的异常请求,根据业务标识查看相应业务的代码,从而分析出导致异常流量消耗的原因。若由计算机执行,可选地,根据异常请求包括的业务标识,计算机确定与业务标识对应的业务的代码,通过对代码进行自动化检查,确定异常流量消耗的原因。
示例性地,通过上述方法对异常请求进行筛查,发现一个请求在每分钟发起几十次请求,分析其对应的业务代码,发现该代码存在缓存逻辑错误。本应该是终端从服务器中获取到需要的数据后,终端不再向服务器发送该请求,但是该业务代码中缺少能够实现“终端从服务器中获取到需要的数据后,终端不再向服务器发送该请求”的代码。如此,即实现了异常流量消耗的原因的确定。后续可以对该业务代码进行修改,以降低每分钟该请求的发起次数,进而达到减少了用户流量损失的目的。
根据异常请求包括的业务标识,确定异常流量消耗的原因,包括:若预设时间段内终端总的流量消耗符合第六预设条件,则根据异常请求包括的业务标识,确定异常流量消耗的原因。示例性地,设置用于判断终端应用程序是否存在异常流量消耗的问题的第六阈值。此时,第六预设条件为预设时间段内终端总的流量消耗大于或等于第六阈值。
由于在实际中可能出现虽然存在高频请求,但是在预设时间段内流量消耗整体较低,此种情况可认为终端应用程序不存在异常流量消耗的问题。这样设置实质上是在终端应用程序运行的过程中,虽然始终执行异常请求的筛选,但是并不一定进行上报。只有在存在异常流量消耗的情况下,才将所筛选的异常请求进行上报,以进行异常流量消耗的原因定位。
若预设时间段内终端总的流量消耗符合第六预设条件,则根据异常请求包括的业务标识,确定异常流量消耗的原因之前,还包括:确定预设时间段内终端总的流量消耗。
“确定预设时间段内终端总的流量消耗”的实现方法有多种,本申请对此不作限制。示例性地,可以直接利用流量监测应用统计预设时间段内终端总的流量消耗。或者,在执行本公开提供的异常请求处理方法的过程中,监测预设时间 段内所获取的多个目标请求消耗的流量;通过对预设时间段内所获取的多个目标请求消耗的流量进行求和,得到预设时间段内终端总的流量消耗。
针对任一目标请求,终端发送该目标请求时有一定的流量消耗。服务器对该目标请求进行响应,并将响应信息发送给终端,终端接收该目标请求对应的响应信息时,终端又有一定的流量消耗。因此,任一目标请求消耗的流量包括发送目标请求时消耗的流量和接收响应信息时消耗的流量。
图6为本公开实施例提供的另一异常请求处理方法的流程图。图6所示示例是对图1所示示例的说明。假设第一阈值为K,即目标请求的请求数据大于或等于K,则确定目标请求为异常请求。第二阈值为K/2,即请求数据大于K/2的请求的相关数据应当被存储于第一队列中,请求数据小于或等于K/2的请求的相关数据应当被存储于第二队列中。第三阈值和第五阈值均为M,即第一队列和第二队列允许存储的请求的数量最大值均为M。预设时间段的开始时间为T,预设时间段的时长为10分钟,当前时刻为t,第四阈值为N,K<N<K/2,第四预设条件为:第一请求的最近请求时间早于(T+(t-T)/2),且第一请求的请求数据小于N。参见图6,该方法包括:
在预设时间段内持续执行获取目标请求的步骤。针对任一目标请求,均执行下述处理步骤,直至预设时间段结束。
针对任一目标请求,需执行的处理步骤包括:
当获取到一个目标请求时,先提取该目标请求中的网络资源标识(即URL),然后在第一队列中进行查询,判断第一队列中是否存在与目标请求对应的第一请求。第一请求与目标请求对应是指,第一请求的网络资源标识与目标请求的网络资源标识相同。如果第一队列中存在与目标请求对应的第一请求,将与目标请求对应的第一请求的请求频率加1,并把该第一请求的相关信息移动到第一队列的队首。
如果第一队列中不存在与目标请求对应的第一请求,判断第二队列中是否存在与目标请求对应的第二请求。第二请求与目标请求对应是指,第二请求的网络资源标识与目标请求的网络资源标识相同。如果第二队列中存在与目标请求对应的第二请求,将与目标请求对应的第二请求的请求频率加1。判断将与目标请求对应的第二请求的请求频率加1之后,与目标请求对应的第二请求的请求频率是否大于K/2。
若与目标请求对应的第二请求的请求频率加1之后,与目标请求对应的第二请求的请求频率大于K/2,把该第二请求的相关信息移动到第一队列队首,并从第二队列中移除该第二请求的相关信息。若与目标请求对应的第二请求的请 求频率加1之后,与目标请求对应的第二请求的请求频率小于或等于K/2,把该第二请求的相关信息移动到第二队列队首。
若执行“把该第二请求的相关信息移动到第一队列队首,并从第二队列中移除该第二请求的相关信息”之后,如果第一队列的长度大于M,则删除掉第一队列中满足第四预设条件(即第一请求的最近请求时间早于(T+(t-T)/2),且第一请求的请求数据小于N)的第一请求。
如果第二队列中不存在与目标请求对应的第二请求,基于目标请求生成新的第二请求的相关信息,并存储到第二队列的队首。新生成的第二请求的请求频率为1。如果将新生成的第二请求存储到第二队列之后,导致第二队列的长度大于M,删除第二队列中处于队尾的第二请求的相关信息。
预设时间段结束之后,遍历第一队列,判断是否存在请求频率大于或等于K的第一请求,若存在,输出该第一请求,所输出的第一请求为异常请求。
上述技术方案可用于筛选出高频请求,进而判断哪些高频请求为异常请求,帮助研发人员基于异常请求进行原因定位,进而达到故障消除,降低终端流量消耗的目的。
导致异常流量消耗的另一个重要原因是单次请求流量消耗过大。例如,用户点击播放了一个很大的视频流,消耗掉了很多的流量。针对于此种情况,需要对多个目标请求的所消耗的流量进行跟踪。
在执行本公开提供的异常请求处理方法的过程中,监测所获取的所有目标请求分别消耗的流量;判断是否存在一个目标请求消耗的流量大于第七阈值。若存在一个目标请求消耗的流量大于第七阈值,确定该目标请求为异常请求。目标请求包括业务标识;确定该目标请求为异常请求之后,方法还包括:根据异常请求包括的业务标识,确定异常流量消耗的原因。
或者,在执行本公开提供的异常请求处理方法的过程中,监测预设时间段内所获取的所有目标请求分别消耗的流量;在预设时间段结束时,判断在第二队列中,或从第一队列中删除的满足第四预设条件的所有第一请求中,是否存在一个或几个请求消耗的流量大于第七阈值。若存在请求消耗的流量大于第七阈值,确定该请求为异常请求。这样设置可以缩小筛选范围,快速筛选出流量消耗过大的单次请求。第二请求包括业务标识;确定该第二请求为异常请求之后,方法还包括:根据第二请求包括的业务标识,确定异常流量消耗的原因。
第七阈值用于判断是否存在单次请求流量消耗过大的情况。可选地,第七阈值和前文中的第六阈值可以相同,也可以不同,本申请对此不作限制。
示例性地,若一个请求流量消耗高达500M,实际业务场景是用户在下载 Android应用程序包(Android Application Package,Android APK),符合业务场景逻辑,不需要修改代码。又例如,一个请求下载的图片达到了10M。而在实际的业务场景中,只需下载缩略图,排查后发现应用程序端代码错误,未携带正确的图片大小参数。经过对代码修改,可以使得该请求消耗的流量大小减小到几十KB,从而降低了用户的流量损失。
图7为本公开实施例提供的一种异常请求处理装置的结构示意图。本公开实施例所提供的异常请求处理装置可以配置于客户端中,或者可以配置于服务端中,该异常请求处理装置包括:获取模块310、查询模块320、更新模块330和确定模块340;其中,获取模块310,设置为在预设时间段内获取目标请求,所述目标请求包括网络资源标识;查询模块320,设置为根据所述网络资源标识,查询第一队列,所述第一队列用于存储所述预设时间段内的第一请求的相关信息;所述查询模块320,还设置为当所述第一队列不包括与所述网络资源标识匹配的第一请求时,根据所述网络资源标识,查询第二队列,所述第二队列用于存储所述预设时间段内的第二请求的相关信息,所述第一请求的请求数据表征的请求频率大于所述第二请求的请求数据表征的请求频率;更新模块330,设置为当所述第二队列包括与所述网络资源标识匹配的第二请求时,更新所述与所述网络资源标识匹配的第二请求的请求数据;确定模块340,设置为在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,若所述目标请求的请求数据符合第一预设条件,则确定所述目标请求为异常请求。
更新模块330还设置为当所述第一队列包括与所述网络资源标识匹配的第一请求时,更新所述与所述网络资源标识匹配的第一请求的请求数据,所述请求数据表征请求频率;该异常请求处理装置还包括移动模块350,设置为当更新后的所述与所述网络资源标识匹配的第二请求的请求数据满足第二预设条件时,将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列。
确定模块340,设置为:
在所述预设时间段结束时,若所述网络资源标识在所述第一队列中,则根据所述第一队列中与所述网络资源标识对应的第一请求的请求数据,确定所述目标请求的请求数据;在所述预设时间段结束时,若所述网络资源标识在所述第二队列中,则根据所述第二队列中与所述网络资源标识对应的第二请求的请求数据,确定所述目标请求的请求数据。
移动模块350,设置为更新所述与所述网络资源标识匹配的第一请求的请求数据之后,将所述与所述网络资源标识匹配的第一请求的相关信息移动到所述 第一队列的队首。
移动模块350,设置为将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列的队首;该装置还包括删除模块,设置为从所述第二队列中删除所述与所述网络资源标识匹配的第二请求的相关信息。
移动模块350,设置为:
将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列之后,若所述第一队列的长度满足第三预设条件,则删除所述第一队列中满足第四预设条件的第一请求的相关信息。
移动模块350,设置为:
更新所述与所述网络资源标识匹配的第二请求的请求数据之后,若所述与所述网络资源标识匹配的第二请求的请求数据不满足第二预设条件,则将所述与所述网络资源标识匹配的第二请求的相关信息移动到所述第二队列的队首。
更新模块330,设置为若所述第二队列不包括与所述网络资源标识匹配的第二请求,则将所述目标请求的相关信息存储在所述第二队列中;删除模块,设置为若所述第二队列的长度满足第五预设条件,则删除所述第二队列中位于队尾的第二请求的相关信息。
确定模块340,设置为:
若所述预设时间段结束时,所述网络资源标识在所述第一队列中,且所述目标请求的请求数据符合第一预设条件,则确定所述目标请求为异常请求。
所述目标请求包括业务标识;
确定模块340,设置为:
根据所述异常请求包括的业务标识,确定异常流量消耗的原因。
确定模块340,设置为:
若所述预设时间段内终端总的流量消耗符合第六预设条件,则根据所述异常请求包括的业务标识,确定异常流量消耗的原因。
本公开实施例提供的异常请求处理装置,可执行本公开方法实施例所提供的异常请求处理方法中客户端或服务端所执行的步骤,具备执行步骤和效果此处不再赘述。
图8为本公开实施例提供的一种电子设备的结构示意图。下面参考图8,其示出了适于用来实现本公开实施例中的电子设备1000的结构示意图。本公开实施例中的电子设备1000可以包括但不限于诸如移动电话、笔记本电脑、数字广 播接收器、个人数字助理(Personal Digital Assistant,PDA)、平板电脑(PAD)、便携式多媒体播放器(Portable Media Player,PMP)、车载终端(例如车载导航终端)、可穿戴电子设备等等的移动终端以及诸如数字电视(Television,TV)、台式计算机、智能家居设备等等的固定终端。图8示出的电子设备1000仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,电子设备1000可以包括处理装置(例如中央处理器、图形处理器等)1001,其可以根据存储在只读存储器(Read-Only Memory,ROM)1002中的程序或者从存储装置1008加载到随机访问存储器(Random Access Memory,RAM)1003中的程序而执行多种适当的动作和处理以实现如本公开所述的实施例的性能问题定位方法。在RAM 1003中,还存储有电子设备1000操作所需的多种程序和信息。处理装置1001、ROM 1002以及RAM 1003通过总线1004彼此相连。输入/输出(Input/Output,I/O)接口1005也连接至总线1004。
通常,以下装置可以连接至I/O接口1005:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1006;包括例如液晶显示器(Liquid Crystal Display,LCD)、扬声器、振动器等的输出装置1007;包括例如磁带、硬盘等的存储装置1008;以及通信装置1009。通信装置1009可以允许电子设备1000与其他设备进行无线或有线通信以交换信息。虽然图8示出了具有多种装置的电子设备1000,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码,从而实现如上所述的异常请求处理方法。在这样的实施例中,该计算机程序可以通过通信装置1009从网络上被下载和安装,或者从存储装置1008被安装,或者从ROM 1002被安装。在该计算机程序被处理装置1001执行时,执行本公开实施例的方法中限定的上述功能。
本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、RAM、ROM、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机 可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的信息信号,其中承载了计算机可读的程序代码。这种传播的信息信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP之类的任何已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字信息通信(例如,通信网络)互连。通信网络的示例包括局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:在预设时间段内获取目标请求,所述目标请求包括网络资源标识;根据所述网络资源标识,查询第一队列,所述第一队列用于存储所述预设时间段内的第一请求的相关信息;若所述第一队列不包括与所述网络资源标识匹配的第一请求,则根据所述网络资源标识,查询第二队列,所述第二队列用于存储所述预设时间段内的第二请求的相关信息,所述第一请求的请求数据表征的请求频率大于所述第二请求的请求数据表征的请求频率;若所述第二队列包括与所述网络资源标识匹配的第二请求,则更新所述与所述网络资源标识匹配的第二请求的请求数据;在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,若所述目标请求的请求数据符合第一预设条件,则确定所述目标请求为异常请求。
可选的,当上述一个或者多个程序被该电子设备执行时,该电子设备还可以执行上述实施例所述的其他步骤。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在 用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括LAN或WAN—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开多种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在一种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,FPGA)、专用集成电路(Application Specific Integrated Circuit,ASIC)、专用标准产品(Application Specific Standard Parts,ASSP)、片上系统(System on Chip,SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、EPROM或快闪存储器、光纤、CD-ROM、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,本公开提供了一种电子设备,包括:
一个或多个处理器;存储器,设置为存储一个或多个程序;当所述一个或 多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本公开提供的任一所述的异常请求处理方法。
根据本公开的一个或多个实施例,本公开提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开提供的任一所述的异常请求处理方法。
本公开实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上所述的异常请求处理方法。
在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (14)

  1. 一种异常请求处理方法,包括:
    在预设时间段内获取目标请求,其中,所述目标请求包括网络资源标识;
    根据所述网络资源标识,查询第一队列,其中,所述第一队列用于存储所述预设时间段内的第一请求的相关信息;
    在所述第一队列不包括与所述网络资源标识匹配的第一请求的情况下,根据所述网络资源标识,查询第二队列,其中,所述第二队列用于存储所述预设时间段内的第二请求的相关信息,所述第一请求的请求数据表征的请求频率大于所述第二请求的请求数据表征的请求频率;
    在所述第二队列包括与所述网络资源标识匹配的第二请求的情况下,更新所述与所述网络资源标识匹配的第二请求的请求数据;
    在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,在所述目标请求的请求数据符合第一预设条件的情况下,确定所述目标请求为异常请求。
  2. 根据权利要求1所述的方法,在所述根据所述网络资源标识,查询第一队列之后,所述方法还包括:
    在所述第一队列包括与所述网络资源标识匹配的第一请求的情况下,更新所述与所述网络资源标识匹配的第一请求的请求数据,其中,所述请求数据表征请求频率;
    在所述更新所述与所述网络资源标识匹配的第二请求的请求数据之后,所述方法还包括:
    在更新后的所述与所述网络资源标识匹配的第二请求的请求数据满足第二预设条件的情况下,将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列。
  3. 根据权利要求1所述的方法,其中,所述在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,包括:
    在所述预设时间段结束时,在所述网络资源标识在所述第一队列中的情况下,根据所述第一队列中与所述网络资源标识对应的第一请求的请求数据,确定所述目标请求的请求数据;
    在所述预设时间段结束时,在所述网络资源标识在所述第二队列中的情况下,根据所述第二队列中与所述网络资源标识对应的第二请求的请求数据,确定所述目标请求的请求数据。
  4. 根据权利要求2所述的方法,在所述更新所述与所述网络资源标识匹配的第一请求的请求数据之后,所述方法还包括:
    将所述与所述网络资源标识匹配的第一请求的相关信息移动到所述第一队列的队首。
  5. 根据权利要求2所述的方法,其中,所述将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列,包括:
    将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列的队首,并从所述第二队列中删除所述与所述网络资源标识匹配的第二请求的相关信息。
  6. 根据权利要求2所述的方法,在所述将所述与所述网络资源标识匹配的第二请求的相关信息从所述第二队列移动到所述第一队列之后,所述方法还包括:
    在所述第一队列的长度满足第三预设条件的情况下,删除所述第一队列中满足第四预设条件的第一请求的相关信息。
  7. 根据权利要求1所述的方法,在所述更新所述与所述网络资源标识匹配的第二请求的请求数据之后,所述方法还包括:
    在所述与所述网络资源标识匹配的第二请求的请求数据不满足第二预设条件的情况下,将所述与所述网络资源标识匹配的第二请求的相关信息移动到所述第二队列的队首。
  8. 根据权利要求1所述的方法,还包括:
    在所述第二队列不包括与所述网络资源标识匹配的第二请求的情况下,将所述目标请求的相关信息存储在所述第二队列中;
    在所述第二队列的长度满足第五预设条件的情况下,删除所述第二队列中位于队尾的第二请求的相关信息。
  9. 根据权利要求1所述的方法,其中,所述在所述目标请求的请求数据符合第一预设条件的情况下,确定所述目标请求为异常请求,包括:
    在所述预设时间段结束时,所述网络资源标识在所述第一队列中,且所述目标请求的请求数据符合所述第一预设条件的情况下,确定所述目标请求为异常请求。
  10. 根据权利要求1所述的方法,其中,所述目标请求包括业务标识;
    在所述确定所述目标请求为异常请求之后,所述方法还包括:
    根据所述异常请求包括的业务标识,确定异常流量消耗的原因。
  11. 根据权利要求10所述的方法,其中,所述根据所述异常请求包括的业务标识,确定异常流量消耗的原因,包括:
    在所述预设时间段内终端总的流量消耗符合第六预设条件的情况下,根据所述异常请求包括的业务标识,确定所述异常流量消耗的原因。
  12. 一种异常请求处理装置,包括:
    获取模块,设置为在预设时间段内获取目标请求,其中,所述目标请求包括网络资源标识;
    查询模块,设置为根据所述网络资源标识,查询第一队列,其中,所述第一队列用于存储所述预设时间段内的第一请求的相关信息;
    所述查询模块,还设置为在所述第一队列不包括与所述网络资源标识匹配的第一请求的情况下,根据所述网络资源标识,查询第二队列,其中,所述第二队列用于存储所述预设时间段内的第二请求的相关信息,所述第一请求的请求数据表征的请求频率大于所述第二请求的请求数据表征的请求频率;
    更新模块,设置为在所述第二队列包括与所述网络资源标识匹配的第二请求的情况下,更新所述与所述网络资源标识匹配的第二请求的请求数据;
    确定模块,设置为在所述预设时间段结束时,根据所述第一队列或所述第二队列,确定所述目标请求的请求数据,在所述目标请求的请求数据符合第一预设条件的情况下,确定所述目标请求为异常请求。
  13. 一种电子设备,包括:
    至少一个处理器;
    存储装置,设置为存储至少一个程序;
    当所述至少一个程序被所述至少一个处理器执行,使得所述至少一个处理器实现如权利要求1-11中任一项所述的异常请求处理方法。
  14. 一种计算机可读存储介质,存储有计算机程序,其中,所述程序被处理器执行时实现如权利要求1-11中任一项所述的异常请求处理方法。
PCT/CN2022/089484 2021-06-30 2022-04-27 异常请求处理方法、装置、电子设备和存储介质 WO2023273576A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/256,591 US20240069991A1 (en) 2021-06-30 2022-04-27 Abnormal request processing method and apparatus, electronic device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110738186.0A CN113360348B (zh) 2021-06-30 2021-06-30 异常请求处理方法、装置、电子设备和存储介质
CN202110738186.0 2021-06-30

Publications (1)

Publication Number Publication Date
WO2023273576A1 true WO2023273576A1 (zh) 2023-01-05

Family

ID=77537505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/089484 WO2023273576A1 (zh) 2021-06-30 2022-04-27 异常请求处理方法、装置、电子设备和存储介质

Country Status (3)

Country Link
US (1) US20240069991A1 (zh)
CN (1) CN113360348B (zh)
WO (1) WO2023273576A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113360348B (zh) * 2021-06-30 2022-09-09 北京字节跳动网络技术有限公司 异常请求处理方法、装置、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10122740B1 (en) * 2015-05-05 2018-11-06 F5 Networks, Inc. Methods for establishing anomaly detection configurations and identifying anomalous network traffic and devices thereof
CN110138669A (zh) * 2019-04-15 2019-08-16 中国平安人寿保险股份有限公司 接口访问处理方法、装置、计算机设备及存储介质
CN111176866A (zh) * 2020-01-03 2020-05-19 精硕科技(北京)股份有限公司 数据交互方法和电子设备
CN111343152A (zh) * 2020-02-07 2020-06-26 北京达佳互联信息技术有限公司 数据处理方法、装置及电子设备、存储介质
CN113360348A (zh) * 2021-06-30 2021-09-07 北京字节跳动网络技术有限公司 异常请求处理方法、装置、电子设备和存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4983604B2 (ja) * 2005-10-31 2012-07-25 富士通株式会社 性能異常分析装置、方法及びプログラム、並びに性能異常分析装置の分析結果表示方法
EP2124174A1 (en) * 2008-05-19 2009-11-25 Accenture Global Services GmbH Service exception resolution framework
CN106982196B (zh) * 2016-01-19 2020-07-31 阿里巴巴集团控股有限公司 一种异常访问检测方法及设备
CN108737333B (zh) * 2017-04-17 2021-08-24 腾讯科技(深圳)有限公司 一种数据检测方法以及装置
CN109451051B (zh) * 2018-12-18 2021-11-02 百度在线网络技术(北京)有限公司 服务请求处理方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10122740B1 (en) * 2015-05-05 2018-11-06 F5 Networks, Inc. Methods for establishing anomaly detection configurations and identifying anomalous network traffic and devices thereof
CN110138669A (zh) * 2019-04-15 2019-08-16 中国平安人寿保险股份有限公司 接口访问处理方法、装置、计算机设备及存储介质
CN111176866A (zh) * 2020-01-03 2020-05-19 精硕科技(北京)股份有限公司 数据交互方法和电子设备
CN111343152A (zh) * 2020-02-07 2020-06-26 北京达佳互联信息技术有限公司 数据处理方法、装置及电子设备、存储介质
CN113360348A (zh) * 2021-06-30 2021-09-07 北京字节跳动网络技术有限公司 异常请求处理方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
US20240069991A1 (en) 2024-02-29
CN113360348A (zh) 2021-09-07
CN113360348B (zh) 2022-09-09

Similar Documents

Publication Publication Date Title
WO2022105591A1 (zh) 缓存服务器性能测试方法、装置、设备和介质
WO2021139383A1 (zh) 直播间礼物资源更新方法、装置、介质及电子设备
WO2023202276A1 (zh) 域名解析请求的处理方法、装置、设备、介质和程序产品
CN111309747A (zh) 数据同步方法、系统和装置
CN113760536A (zh) 数据缓存方法、装置、电子设备和计算机可读介质
CN111163336B (zh) 视频资源推送方法、装置、电子设备及计算机可读介质
CN111694757A (zh) 应用程序的测试方法、装置、电子设备及计算机可读存储介质
WO2023273576A1 (zh) 异常请求处理方法、装置、电子设备和存储介质
CN111858381B (zh) 应用程序容错能力测试方法、电子设备及介质
CN111309366B (zh) 一种管理注册核心的方法、装置、介质和电子设备
CN113553206B (zh) 数据事件执行方法、装置、电子设备和计算机可读介质
CN112015746B (zh) 数据实时处理方法、装置、介质和电子设备
WO2022048490A1 (zh) 数据处理方法、装置和电子设备
WO2021082599A1 (zh) 网页图像的监控方法、装置、电子设备及计算机可读存储介质
CN110941683B (zh) 获取空间中对象属性信息的方法、装置、介质和电子设备
CN109614137B (zh) 软件版本控制方法、装置、设备和介质
CN111367592B (zh) 信息处理方法和装置
CN113722113A (zh) 一种流量统计的方法和装置
CN111787043A (zh) 数据请求方法和装置
CN112311842A (zh) 用于信息交互的方法和装置
CN112732457A (zh) 图像传输方法、装置、电子设备和计算机可读介质
CN112311840A (zh) 一种多终端数据同步方法、装置、设备及介质
WO2022237428A1 (zh) 网络请求信息的处理方法、装置、设备及存储介质
CN110855767B (zh) 一种操作请求的响应方法、装置、设备和存储介质
WO2022206474A1 (zh) 数据获取方法, 装置, 电子设备及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22831404

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18256591

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE