Business request processing method and apparatus, computer device, and storage medium
By implementing a dual processing flow and circuit breaker mechanism for business requests, the security risks of traditional business request processing methods are resolved, enabling the identification of potential attacks and device protection, thereby improving the security and robustness of business processing.
Patent Information
- Application Number
- CN202011353080.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-26
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2040-11-26
AI Technical Summary
Traditional business request processing methods pose security risks when facing attacks, making it difficult to effectively identify and respond to attacks, resulting in a high risk of device attacks.
By acquiring business requests within the current period, performing two processing flows (online service cluster and bypass service cluster), comparing the processing results, and triggering service circuit breaking when the results do not match, the system restricts subsequent requests. This is combined with machine learning model updates to improve robustness.
It improves the security of business processes, can identify and respond to potential attack risks, reduce the impact of abnormal situations, and protect equipment security through a circuit breaker mechanism.
Smart Images

Figure CN114548982B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a service circuit breaker method, apparatus, computer equipment, and storage medium based on artificial intelligence. Background Technology
[0002] With the development of computer technology, artificial intelligence has permeated all aspects of various industries. In real life, many applications incorporate AI services, such as the currently popular facial recognition payment and facial search applications. Traditionally, during business request processing, risk detection methods are used to protect user operations. These methods include determining the location of the last payment transaction, the frequency of payment times, and whether the payment account is a high-risk account, thus assessing the security of the payment environment. However, traditional methods primarily protect user operations. When one or more types of attacks cannot be identified, the devices used for business processing are vulnerable to attack, posing a significant security risk. Summary of the Invention
[0003] Therefore, it is necessary to provide a business request processing method, apparatus, computer equipment, and storage medium that can greatly improve the security of business processing in response to the above-mentioned technical problems.
[0004] A business request processing method, the method comprising:
[0005] Obtain business requests that arrive within the current period, wherein the business requests carry data to be processed;
[0006] Perform business processing on each of the data to be processed to obtain the corresponding first processing result;
[0007] The data to be processed is transformed to obtain the corresponding transformed data, and the business processing is performed on the transformed data to obtain the corresponding second processing result.
[0008] When the circuit breaker condition is met based on the first and second processing results corresponding to the service requests in the current period, the service circuit breaker process is triggered to restrict the processing of service requests arriving in subsequent periods.
[0009] A business request processing apparatus, characterized in that the apparatus comprises:
[0010] The business request acquisition module is used to acquire business requests that arrive within the current period, and the business requests carry data to be processed.
[0011] The first processing module is used to perform business processing on each of the data to be processed to obtain the corresponding first processing result;
[0012] The second processing module is used to perform transformation processing on each of the data to be processed to obtain corresponding transformed data, and to perform the business processing on each of the transformed data to obtain the corresponding second processing result;
[0013] The service circuit breaker module is used to trigger service circuit breaker processing when the circuit breaker conditions are met based on the first processing result and the second processing result corresponding to the service requests in the current period, so as to restrict the processing of service requests arriving in subsequent periods.
[0014] In one embodiment, the first processing module is used to perform business processing on each of the data to be processed through an online service cluster to obtain a corresponding first processing result; the second processing module is used to perform the business processing on each of the transformed data through a bypass service cluster to obtain a corresponding second processing result; the service circuit breaker module is used to trigger the service circuit breaker processing of the online service cluster when it is determined that the circuit breaker condition is met based on the first processing result and the second processing result corresponding to each of the business requests in the current period, so that the online service cluster can restrict the processing of business requests arriving in subsequent periods.
[0015] In one embodiment, the data to be processed includes an image to be processed; the second processing module is used to perform at least one of image scaling, image padding, and image noise reduction on the image to be processed to obtain transformation data corresponding to the image to be processed.
[0016] In one embodiment, the service circuit breaker module is used to determine the first processing result corresponding to the corresponding business request as a pending processing result when the first processing result and the second processing result corresponding to the same business request meet the difference condition; determine the first number of business requests corresponding to pending processing results among the business requests arriving in the current period; and trigger service circuit breaker processing when it is determined that the circuit breaker condition is met based on the first number.
[0017] In one embodiment, the business request processing device further includes a reporting module, which is used to report the pending data carried by the business request corresponding to the pending processing result to the server. The reported pending data is used to instruct the server to update the machine learning model used to perform the business processing based on the received pending data.
[0018] In one embodiment, the service circuit breaker module is configured to trigger an observation state in the next cycle after the current cycle when it is determined that the first circuit breaker condition is met based on the first quantity.
[0019] Determine the second number of business requests corresponding to pending processing results within the period of the observation state;
[0020] When the second circuit breaker condition is met based on the second quantity, the circuit breaker state is triggered in the period following the period in the observation state, and service requests arriving during the period in the circuit breaker state are restricted.
[0021] In one embodiment, the service circuit breaker module is configured to, when determining that the second circuit breaker condition is met based on the second quantity, trigger the corresponding level of circuit breaker state in each period after the period in the observation state according to the proportion of service requests with pending processing results in each period after the period in the observation state, and perform corresponding restriction processing on the service requests arriving in the period in the corresponding level of circuit breaker state.
[0022] In one embodiment, the service circuit breaker module is used to determine, based on the second quantity, a first proportion of service requests corresponding to pending results that arrive during the period in the observation state;
[0023] When the first ratio exceeds the first abnormal ratio, it is determined that the first-level circuit breaker state will be entered in the next cycle after the cycle in the observation state.
[0024] Based on the first sampling information, a portion of the service requests arriving within the period when the circuit breaker is in the first level state are selected for service processing.
[0025] When the second proportion of business requests with pending processing results included in the selected portion of business requests is less than or equal to the second abnormal proportion, the circuit breaker enters the second level state.
[0026] Based on the second sampling information, a portion of the service requests that arrive during the period when the circuit breaker is in the second level are selected for service processing.
[0027] When the third proportion of the business requests with pending processing results included in the selected business requests is less than or equal to the third abnormal proportion, the circuit breaker enters the third level state.
[0028] According to the third sampling information, a portion of the service requests that arrive within the period of the third-level circuit breaker state are selected for service processing.
[0029] When the fourth proportion of the business requests with pending processing results included in the selected business requests is less than or equal to the fourth abnormal proportion, the circuit breaker enters the fourth level state.
[0030] According to the fourth sampling information, a portion of the service requests arriving within the period of the fourth level of circuit breaker are selected for service processing.
[0031] When the fifth proportion of the selected partial service requests containing the corresponding pending processing results is less than or equal to the fifth abnormal proportion, the system is triggered to enter the normal state, so as to realize full service processing of service requests arriving in the period after the period in the fourth level circuit breaker state.
[0032] In one embodiment, the service circuit breaker module is further configured to maintain the first-level circuit breaker state when the second ratio exceeds the second abnormal ratio, and / or,
[0033] When the third ratio exceeds the third abnormal ratio, maintain the second-level fuse state, and / or,
[0034] When the fourth ratio exceeds the fourth abnormal ratio, the third-level fuse state is maintained, and / or,
[0035] When the fifth ratio exceeds the fifth abnormal ratio, the fourth level of circuit breaker status is maintained.
[0036] In one embodiment, the first processing module is used to extract features from each data to be processed through a machine learning model to obtain a corresponding first feature vector, and perform feature retrieval based on the first feature vector to obtain a first processing result corresponding to each image to be processed.
[0037] The second processing module is used to extract features from each transformed data using the machine learning model to obtain a corresponding second feature vector, and to perform feature retrieval based on the second feature vector to obtain a second processing result corresponding to each transformed data.
[0038] In one embodiment, the service request includes a resource transfer request, the data to be processed includes a face image, the service processing includes face verification service processing, the first processing result includes a first face verification result, and the second processing result includes a second face verification result.
[0039] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the business request processing methods of various embodiments.
[0040] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the business request processing method in various embodiments.
[0041] The aforementioned business request processing method, apparatus, computer equipment, and storage medium acquire business requests arriving within the current period, each carrying data to be processed, and perform business processing on the data to be processed to obtain a first processing result; after transforming the data to be processed, the business processing is performed again to obtain a second processing result; when it is determined that the first and second processing results within the current period meet the circuit breaker conditions, it indicates that the robustness of the business processing algorithm is poor or that it has been subjected to a business attack, requiring the triggering of service circuit breaker processing to restrict the processing of business requests arriving in subsequent periods, greatly improving the security of business processing, and enabling the determination of whether the equipment processing the business is currently facing or about to face risks, reducing the impact of abnormal situations. Attached Figure Description
[0042] Figure 1 This is an application environment diagram of a business request processing method in one embodiment;
[0043] Figure 2 This is a flowchart illustrating a business request processing method in one embodiment;
[0044] Figure 3 This is a schematic diagram of the transformation process in one embodiment;
[0045] Figure 4 This is a schematic diagram of the process in one embodiment where, when the second circuit breaker condition is met, corresponding restrictions are applied to service requests arriving within the period of the corresponding level of circuit breaker status.
[0046] Figure 5 This is a schematic diagram of service circuit breaker processing in one embodiment;
[0047] Figure 6 This is a schematic diagram of the architecture of a business request processing method in one embodiment;
[0048] Figure 7 This is a structural block diagram of a service request processing device in one embodiment;
[0049] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0050] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0051] The business request processing method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal device 102 communicates with computer device 104 via a network. Terminal device 102 can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. Computer device 104 can be implemented using a standalone server or a server cluster composed of multiple servers. Specifically, computer device 104 can be a server, which can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminal device 102 and computer device 104 can be connected directly or indirectly via wired or wireless communication, which is not limited herein.
[0052] Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to achieve data computing, storage, processing, and sharing.
[0053] Cloud technology is a collective term for network technologies, information technologies, integration technologies, management platform technologies, and application technologies applied to the cloud computing business model. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, which can only be achieved through cloud computing.
[0054] Computer device 104 can also be a device corresponding to artificial intelligence cloud services. Artificial intelligence cloud services are generally also called AIaaS (AI as a Service). This is currently a mainstream service model for artificial intelligence platforms. Specifically, AIaaS platforms break down several common AI services and provide them as independent or packaged services in the cloud. This service model is similar to opening an AI-themed marketplace: all developers can access and use one or more artificial intelligence services provided by the platform through API interfaces. Some experienced developers can also use the AI framework and AI infrastructure provided by the platform to deploy and maintain their own dedicated cloud artificial intelligence services.
[0055] In one embodiment, such as Figure 2 As shown, a business request processing method is provided. This method can be executed by a computer device, or by a combination of a terminal device and a computer device. This method is applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:
[0056] Step S202: Obtain the business requests that arrive within the current period, each carrying data to be processed.
[0057] The current period refers to a current time period. For example, a period can be 1 minute, 1 hour, or 1 day, and is not limited to these. A business request can specifically be a business request within a certain scenario. The business request carries data to be processed, and the business request is used to enable the processing of this data. The presentation format of the data to be processed is not limited; for example, it can be an image, video, audio, or text, and this embodiment does not impose any limitations on this. It is understood that the number of business requests arriving within the current period is unlimited. A business request can carry one type of data to be processed or multiple types of data to be processed; this is not limited here.
[0058] Specifically, users can initiate service requests through applications running on their terminal devices, and the computer device can then receive these requests. For example, the computer device might receive a resource transfer request arriving within one minute from a payment application, and this request might include a facial image. In different application scenarios, the data to be processed can have different application purposes. For instance, in a payment application, the data to be processed could be a facial image. In an object recognition application, the data to be processed could be an object image. In a translation application, the data to be processed could be an image or text to be translated. In a video processing application, the data to be processed could be a video to be processed.
[0059] In one embodiment, before performing business processing on each piece of data to be processed, the business request processing method further includes: performing pre-detection processing on each piece of data to be processed according to preset verification conditions to obtain pre-detection processing results; when the pre-detection processing results meet the processing conditions, executing the business processing steps on each piece of data to be processed; when the pre-detection processing results do not meet the processing conditions, intercepting the business request. The preset verification conditions refer to the conditions for verifying the data size, data type, and data format of the data to be processed. For example, the image size cannot exceed a preset image size, the data type is an image type, or the data type is an image containing a face, or the data format is JPEG (Joint Photographic Experts Group) format, etc. When the pre-detection processing results meet the processing conditions, it indicates that the data to be processed meets the requirements and should be processed; when the pre-detection processing results do not meet the processing conditions, it indicates that the business request corresponding to the data to be processed may be an abnormal request, therefore rejecting the request can reduce the resource consumption of the device used for business processing.
[0060] Step S204: Perform business processing on each piece of data to be processed to obtain the corresponding first processing result.
[0061] The first processing result refers to the result of directly performing business processing on the data to be processed. That is, the processing result obtained without transforming the data to be processed. The first processing result can be the final processing result of the business process or an intermediate processing result of the business process. For example, taking face verification processing as an example, the first processing result can be the first feature vector, or the first processing result can be the face of user Z.
[0062] Specifically, the computer equipment performs business processing on each piece of data to be processed, obtaining the corresponding first processing result. For example, if two requests arrive in the current period, namely the first request and the second request, where the first request contains the first piece of data to be processed and the second request contains the second piece of data to be processed, then the computer equipment performs business processing on the first piece of data to be processed, obtaining the first processing result corresponding to the first request. The computer equipment also performs business processing on the second piece of data to be processed, obtaining the first processing result corresponding to the second request.
[0063] Step S206: Perform transformation processing on each piece of data to be processed to obtain the corresponding transformed data, and perform business processing on each piece of transformed data to obtain the corresponding second processing result.
[0064] Transformation processing refers to processing that does not change the essential content of the data to be processed. For example, if the data to be processed is an image, and the image contains a face A, then face A is the essential content of the data to be processed. Therefore, transformation processing cannot replace face A with face B, nor can it delete face A from the image. However, transformation processing can be image noise addition processing on face A, such as adding noise to face A, without changing the essential content of the data to be processed.
[0065] When the data to be processed is text, the transformation processing includes, but is not limited to, text blurring and text misalignment correction. When the data to be processed is an image, the transformation processing includes, but is not limited to, image scaling, image padding, and image noise addition. When the data to be processed is audio, the transformation processing includes, but is not limited to, audio noise addition, voice changing, and audio speed adjustment. When the data to be processed is video, the transformation processing includes, but is not limited to, video noise addition, video speed adjustment, and video compression.
[0066] The business processing flow for transforming data is the same as that for processing the data to be processed. For example, if face verification is performed on the data to be processed, then the same face verification process will be performed on the transformed data.
[0067] The second processing result refers to the result of business processing on the transformed data. The second processing result can be the final result of the business processing or an intermediate result. For example, taking face verification as an example, the second processing result could be the second feature vector, or it could be the face of user Z.
[0068] Specifically, the computer equipment transforms each piece of data to be processed to obtain corresponding transformed data, and then performs business processing on each transformed data to obtain a second processing result corresponding to each business request. The first and second processing results are of the same type. For example, if the first processing result is a first feature vector, the second processing result should also be a second feature vector. However, the first and second processing results may be the same or different.
[0069] It should be noted that the first and second processing results can specifically be the results of processing in a particular scenario. For example, in a payment application, the data to be processed can be a facial image, the business processing can be facial verification, and both the first and second processing results can be facial feature vectors, or both can be user identifiers. In an object recognition application, the data to be processed can be an object image, the business processing can be object recognition processing, and both the first and second processing results can be object feature vectors, or both can be object identifiers. In a translation application, the data to be processed can be an image or text to be translated, the business processing can be translation processing, and therefore both the second and second processing results can be translation results.
[0070] Step S208: When it is determined that the first processing result and the second processing result in the current period meet the circuit breaker conditions, the service circuit breaker process is triggered to restrict the processing of service requests arriving in subsequent periods.
[0071] The circuit breaker condition refers to a mismatch between the first and second processing results for at least a portion of the business requests within the current cycle. For example, if 100 requests arrive in the current cycle, and 50% of the requests have mismatched first and second processing results, the service circuit breaker will be triggered. The circuit breaker condition is determined within a cycle. If the circuit breaker condition is not met within a cycle, the next cycle will restart the determination process, and the data from the previous cycle will be reset to zero.
[0072] Service circuit breaking is used to restrict the processing of service requests arriving in subsequent cycles. Restriction processing involves selecting a subset of service requests arriving in subsequent cycles for processing. Subsequent cycles refer to cycles following the current cycle. Specifically, this can be the next cycle immediately adjacent to the current cycle, or a non-adjacent cycle following the current cycle.
[0073] Specifically, when the first and second processing results within the current cycle are determined to meet the circuit breaker conditions, the computer device triggers circuit breaker processing to restrict service requests arriving in subsequent cycles. Furthermore, the determination of the circuit breaker conditions is based on the service requests arriving within the cycle.
[0074] In one embodiment, when it is determined that the first processing result and the second processing result within the current period meet the circuit breaker conditions, service circuit breaker processing is triggered. This includes: when the first processing result and the second processing result corresponding to at least a portion of the business requests within the current period do not match, service circuit breaker processing is triggered to select a portion of the business requests arriving in subsequent periods for processing. For example, without service circuit breaker processing, assuming 100 business requests are received within a period, all 100 business requests will be processed; however, after entering service circuit breaker processing, assuming the computer device receives 200 business requests within a period, the computer device can process a portion of these 200 business requests (such as 150 or 100 business requests), while the remaining business requests will not be responded to.
[0075] The above-described business request processing method obtains business requests arriving within the current period, each carrying data to be processed, and performs business processing on the data to obtain a first processing result; after transforming the data to be processed, the business processing is performed again to obtain a second processing result; when it is determined that the first and second processing results within the current period meet the circuit breaker conditions, it indicates that the robustness of the business processing algorithm is poor or that it has been subjected to a business attack, requiring the triggering of service circuit breaker processing to restrict the processing of business requests arriving in subsequent periods, greatly improving the security of the business processing equipment, thereby enhancing the security of business processing, and enabling the determination of whether the business processing equipment is currently facing or about to face risks, and reducing the impact of abnormal situations.
[0076] In one embodiment, business processing is performed on each piece of data to be processed to obtain a corresponding first processing result, including: performing business processing on each piece of data to be processed through an online service cluster to obtain a corresponding first processing result. Business processing is performed on each piece of transformed data to obtain a corresponding second processing result, including: performing business processing on each piece of transformed data through a bypass service cluster to obtain a corresponding second processing result. When it is determined that the first processing result and the second processing result in the current period meet the circuit breaker conditions, service circuit breaker processing is triggered, including: when it is determined that the first processing result and the second processing result in the current period meet the circuit breaker conditions, service circuit breaker processing of the online service cluster is triggered so that the online service cluster restricts the processing of business requests arriving in subsequent periods.
[0077] Specifically, the computer equipment can be a server cluster, which may include an online service cluster and a bypass service cluster. The business processing flow executed by the online service cluster and the bypass service cluster is the same. The online service cluster is used to directly interface with the client. The bypass service cluster is used to assist in processing the data to be processed. For example, the bypass service cluster is used to perform business processing on transformed data to obtain the corresponding second processing result.
[0078] Specifically, the online service cluster processes each piece of data separately to obtain a first processing result. The bypass service cluster processes each transformed piece of data separately to obtain a second processing result. When a mismatch is detected between the first and second processing results for at least a portion of the business requests within the current period, the online service cluster's service circuit breaker is triggered, allowing the online service cluster to restrict processing of business requests arriving in subsequent periods. For example, if a mismatch is detected between the first and second processing results for 50% of the requests within period N, the online service cluster's service circuit breaker is triggered.
[0079] In one embodiment, the data to be processed can be transformed through an online service cluster, a bypass service cluster, or other service clusters to obtain the corresponding transformed data. The circuit breaker condition can be determined based on whether the first and second processing results corresponding to the business requests within the current period meet the requirements of the online service cluster, bypass service cluster, or other service clusters.
[0080] In one embodiment, the first processing result is returned to the user terminal corresponding to the service request. Alternatively, when the first processing result is a pending processing result, an alarm signal indicating that the service processing failed is returned to the user terminal corresponding to the service request. Alternatively, when the first processing result is a pending processing result, no response is given to the request.
[0081] In the above embodiments, the online service cluster performs business processing on the data to be processed, and the bypass service cluster performs business processing on each transformed data to obtain a second processing result. This distinguishes between the online service and the auxiliary service for circuit breaker detection, reduces the resource consumption of the online service cluster, and improves the efficiency of business request processing.
[0082] In one embodiment, the data to be processed includes an image to be processed. Transformation processing is performed on each piece of data to be processed to obtain corresponding transformation data, including at least one of image scaling, image padding, and image noise addition processing on the image to be processed, to obtain transformation data corresponding to the image to be processed.
[0083] Specifically, the computer device performs at least one of the following processes on the image to be processed: image scaling, image padding, and image noise addition, to obtain transformed data corresponding to the image to be processed. Image scaling is used to change the size of the image. For example, an image with a size of 60*40 can be scaled to 30*20. Image padding refers to the process of filling in missing parts of an image based on its own information or information from an image library. For example, if the background of an image is a texture, and a part of the image is missing this texture, image padding will fill in the missing texture. Image noise addition refers to adding interference signals to the image, such as adding Gaussian noise.
[0084] In one embodiment, such as Figure 3 The diagram shown illustrates the transformation process in one embodiment. Convolutional Neural Networks (CNNs) are a type of feedforward neural network that includes convolutional computations and has a deep structure; they are one of the representative algorithms of deep learning. Figure 3 The data includes data to be processed 302, images 304 and 306 obtained after image downscaling, image 308 obtained after image padding of image 304, image 310 obtained after image padding of image 306, and one image selected from images 304, 306, 308, and 310 as transformation data 312. The transformation data 312 is then input into a CNN, where a machine learning model extracts features from the transformation data 312 to obtain a corresponding second feature vector. Based on this second feature vector, feature retrieval is performed to obtain a second processing result corresponding to the transformation data.
[0085] In the above embodiments, at least one of the following processes is performed on the image to be processed: resizing, image padding, and noise addition. That is, some transformation processing that does not affect the actual content of the image is performed on the image to be processed to obtain transformed data. Based on the second processing result obtained by processing the transformed data, the robustness of the business processing algorithm or whether it has been subjected to business attacks can be judged based on the first processing result and the second processing result, and circuit breaker processing can be triggered, thereby reducing the risk to the business processing equipment and greatly improving the security of the business processing equipment.
[0086] In one embodiment, when it is determined that the first processing result and the second processing result in the current period meet the circuit breaker conditions, the service circuit breaker process is triggered, including: when the first processing result and the second processing result corresponding to the same business request meet the difference conditions, determining that the first processing result corresponding to the corresponding business request is a pending processing result; determining the first number of business requests corresponding to pending processing results among the business requests arriving in the current period; and triggering the service circuit breaker process when it is determined that the circuit breaker conditions are met based on the first number.
[0087] The difference condition refers to whether the difference between the first processing result and the second processing result is greater than a preset range. For example, in a payment application scenario, the data to be processed is a face image, and both the first and second processing results are face verification results. The first processing result might be that the face in the image belongs to user A, and the second processing result might be that the face in the image belongs to user B. However, user A and user B are different users. Therefore, when the first and second processing results are different, they satisfy the difference condition. When both the first and second processing results are feature vectors, the difference condition can be the similarity between them, satisfying the difference condition if the similarity is less than a preset similarity threshold. The pending processing result is the processing result suspected of being abnormal. Inconsistency between the first and second processing results can be considered a suspected abnormality.
[0088] Specifically, when the difference between the first and second processing results corresponding to the same business request meets a difference condition, the computer device determines that the first processing result corresponding to the business request is a pending processing result. The computer device determines a first number of business requests with pending processing results arriving within the current period. When the circuit breaker condition is met based on the first number, the computer device triggers the service circuit breaker process. For example, assuming the proportion of pending processing results is 50%, if the computer device determines that 100 business requests are received in the current period, and 50 of them have pending processing results, then these 50 requests meet the 50% circuit breaker condition, thus triggering the service circuit breaker process.
[0089] In one embodiment, determining whether the circuit breaker condition is met based on a first quantity and triggering service circuit breaker processing includes: obtaining the total number of service requests arriving in the current period; determining a first proportion of service requests with pending processing results in the current period based on the first quantity and the total quantity; and triggering service circuit breaker processing when it is determined that the circuit breaker condition is met based on the first proportion.
[0090] Service circuit breaking refers to not processing all incoming service requests, but rather randomly selecting or processing a subset of service requests according to preset selection rules, while leaving the rest unprocessed. The preset selection rules can be specific, such as selecting one service request at a preset interval, or selecting one service request at a preset time interval, etc., without limitation.
[0091] In one embodiment, when the circuit breaker condition is met according to a first ratio, the computer device can trigger the online service cluster to restrict the processing of subsequent service requests. Specifically, the online service cluster may select a portion of the incoming service requests for processing and response, while refusing to respond to the other service requests.
[0092] In the above embodiments, when there is a certain difference between the first processing result and the second processing result of the same business request, it indicates that the first processing result corresponding to the corresponding request is a suspected abnormal processing result. Then, a first number of business requests with pending processing results is determined. When the first number is determined to meet the circuit breaker condition, it indicates that the business processing algorithm or the business processing device has weak business processing capability. Here, business processing capability can refer to robustness such as fault tolerance and stability, etc., which requires triggering service circuit breaker processing to reduce the impact caused by pending processing results and improve the security of the business processing device.
[0093] In one embodiment, the business request processing method further includes: reporting the pending data carried by the business request corresponding to the pending processing result to the server, wherein the reported pending data is used to instruct the server to update the machine learning model used to perform business processing based on the received pending data.
[0094] The server can be a computer device as described in this application embodiment, such as an online service cluster or a bypass service cluster, or any server. Machine Learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, and many other disciplines. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to give computers intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning. Machine learning models can be used for processing various business processes.
[0095] Specifically, the computer device reports the pending data carried in the business request corresponding to the pending processing result to the server. The reported pending data instructs the server to update the machine learning model used to perform business processing based on the received pending data. The server trains the machine learning model used to perform business processing based on the received pending data, obtaining an updated machine learning model. The updated machine learning model is then used to perform business processing on the pending data carried in the business request.
[0096] In the above embodiments, the processing result corresponding to the business request is a pending processing result, indicating that the business request may also be abnormal. The pending data carried by the business request with the pending processing result is reported to the server, that is, the pending data carried by the suspected abnormal processing result is reported to the server. The server can update the machine learning model used to perform business processing based on the received pending data. This enables the updated machine learning model to deal with some abnormalities on its own, and the processing result when performing business processing is more accurate. This provides data support for the device to actively perform circuit breaking in subsequent business processing, and actively collects data for the optimization direction in the R&D stage.
[0097] In one embodiment, when it is determined that the circuit breaker condition is met based on a first quantity, service circuit breaker processing is triggered, including:
[0098] When the first circuit breaker condition is met based on the first quantity, the system will enter the observation state in the next cycle following the current cycle.
[0099] Determine the second number of business requests with pending processing results within the observation period;
[0100] When the second circuit breaker condition is met based on the second quantity, the circuit breaker state is triggered in the period following the observation period, and service requests arriving during the period in the circuit breaker state are restricted.
[0101] The circuit breaker conditions include a first circuit breaker condition and a second circuit breaker condition. Service circuit breaker processing includes an observation state and a circuit breaker state. The first circuit breaker condition determines whether to enter the observation state. The second circuit breaker condition determines whether to enter the circuit breaker state. The first circuit breaker condition can specifically be, for example, a proportion of pending processing results exceeding a preset proportion, or a number of pending processing results exceeding a preset number, etc., but is not limited to these. The number of periods corresponding to the observation state and the circuit breaker state is unlimited; it can be one period or multiple periods. The first quantity refers to the number of business requests corresponding to pending processing results that trigger the entry into the observation state. The second quantity refers to the number of business requests corresponding to pending processing results that trigger the entry into the circuit breaker state. The first quantity and the second quantity can be the same or different. The first quantity is negatively correlated with business processing capacity; the higher the first quantity, the weaker the business processing capacity; the lower the first quantity, the stronger the business processing capacity.
[0102] Specifically, when the first circuit breaker condition is met based on the first quantity, the computer device triggers the next cycle following the current cycle to enter an observation state. The computer device determines a second quantity of service requests with pending processing results within the cycle corresponding to this observation state. When the second circuit breaker condition is met based on the second quantity, the next cycle following the observation state is triggered to enter a circuit breaker state, and service requests arriving within the circuit breaker state cycle are restricted. For example, if the total number of service requests arriving in the current cycle is 100, and the total number of service requests arriving in the next cycle is 150, with a first quantity of 51 and a second quantity of 80, and both the first and second circuit breaker conditions (the percentage of pending processing results being greater than 50%) and the first quantity of 51 being greater than 50% and the second circuit breaker condition (the percentage of pending processing results being greater than 50%), then the ratio of the first quantity (51) to the total quantity (100) is greater than 50%, triggering the next cycle following the current cycle to enter an observation state. If the ratio between the second quantity 80 and the total quantity 150 is also greater than 50%, then the period following the period of triggering the observation state will enter the circuit breaker state, and the service requests arriving during the period of the circuit breaker state will be restricted.
[0103] In the above embodiments, when the circuit breaker condition is met based on the first quantity, the system enters the observation state in the next cycle. That is, the circuit breaker will not be triggered immediately, and the system will continue to observe until the second quantity in the cycle under the observation state meets the second circuit breaker condition. This indicates that the robustness and other performance of the business processing algorithm are weak. Therefore, the cycle after the observation state enters the circuit breaker state, and the business requests arriving in the cycle under the circuit breaker state are restricted. By setting the observation state and the circuit breaker state, false circuit breakers are avoided, and the impact is further reduced.
[0104] In one embodiment, when it is determined that the second circuit breaker condition is met based on the second quantity, the circuit breaker state is triggered in the period following the period in the observation state, and the service requests arriving in the period in the circuit breaker state are restricted. This includes: when it is determined that the second circuit breaker condition is met based on the second quantity, the circuit breaker state of the corresponding level is triggered in each period following the period in the observation state according to the proportion of service requests with pending processing results in each period following the period in the observation state, and the service requests arriving in the period in the corresponding level of the circuit breaker state are restricted accordingly.
[0105] The circuit breaker status can include at least one level, such as Level 1, Level 2, etc. Each level has corresponding proportional conditions and corresponding service request restriction results. The proportional conditions and service request restriction results can differ for each level. For example, the condition for entering Level 1 circuit breaker status is that the proportion of service requests with pending processing results is greater than 50%, and the corresponding service request restriction result is 1%. The condition for entering Level 2 circuit breaker status is that the proportion of service requests with pending processing results is less than or equal to 50%, and the corresponding service request restriction result is 10%, and so on, but not limited to these.
[0106] Specifically, when the ratio of the second quantity to the total number of service requests arriving in the current period is greater than or equal to the second preset ratio, that is, when the second circuit breaker condition is met based on the second quantity, the computer device triggers the corresponding level of circuit breaker state in each period following the period in the observation state, based on the proportion of service requests with pending processing results in each period after the period in the observation state, and performs corresponding restriction processing on the service requests arriving in the period in the corresponding level of circuit breaker state. For example, when the second circuit breaker condition is met based on the second quantity, the computer device triggers the period N+M to enter the corresponding level of circuit breaker state based on the proportion of pending processing results in each period N+M following the period in the observation state, and performs corresponding restriction processing on the service requests arriving in the period in the corresponding level of circuit breaker state. Here, N and M are both natural numbers, and M≥1. For example, when the proportion of service requests with pending processing results in period N+M is 60%, the first circuit breaker state is entered; when the proportion of service requests with pending processing results in period N+M is 39%, the second circuit breaker state is entered.
[0107] In one embodiment, when the second circuit breaker condition is met based on the second quantity, the computer device can proceed to the next level of observation state. That is, when the computer device enters the observation state, it can continue to observe level by level until the conditions for entering the circuit breaker state are met. It is understood that the conditions for entering each level of observation state can be the same or different, and the proportion of business requests with corresponding pending results reaching the next level within that cycle will increase.
[0108] In one embodiment, the computer device can enter the corresponding observation state step by step according to the level order, or it can directly skip levels and enter the corresponding observation state when the entry conditions for the corresponding level are met. This application does not limit this. For example, when the first circuit breaker condition is met based on the first quantity, the computer device triggers entry into the first level observation state when the proportion X of the business requests with pending processing results in the period N after the current period corresponds to the proportion Y of the business requests with pending processing results in the period N after the current period corresponds to the proportion Y of the business requests with pending processing results in the period N after the current period.
[0109] In the above embodiments, when the second circuit breaker condition is met according to the second quantity, the circuit breaker state is triggered in each period after the observation period based on the proportion of service requests with pending processing results in each period after the observation period. The service requests arriving in the period of the corresponding circuit breaker state are then subject to corresponding restriction processing. That is, since the proportion of service requests with pending processing results is different, it indicates that the degree of attack is different. Therefore, by setting different levels of circuit breaker states and different restriction processing, the accuracy of circuit breaker processing for service processing devices is improved.
[0110] In one embodiment, such as Figure 4 The diagram illustrates a process in one embodiment where, when a second circuit breaker condition is met, service requests arriving within a period of the corresponding circuit breaker level are subject to corresponding restriction processing. When the second circuit breaker condition is determined to be met based on a second quantity, the proportion of service requests with pending processing results in each period following the observation period triggers the corresponding level of circuit breaker state in each period after the observation period. The process then applies corresponding restriction processing to service requests arriving within the corresponding level of circuit breaker state, including:
[0111] Step S402: Based on the second quantity, determine the first proportion of business requests corresponding to pending results that arrive during the period in the observation state.
[0112] Specifically, based on the second number of business requests corresponding to pending processing results within the observation period, and the total number of business requests arriving within the observation period, a first proportion of business requests corresponding to pending processing results arriving within the observation period is determined. For example, in a payment scenario, the business requests received by the computer device are resource transfer requests. If the computer device receives 100 resource transfer requests within the observation period, and 60 of these 100 resource transfer requests correspond to pending processing results, then the first proportion is 60%.
[0113] Step S404: When the first ratio exceeds the first abnormal ratio, determine that the first level of circuit breaker state will be entered in the next cycle after the cycle in the observation state.
[0114] The first abnormal ratio is used to trigger the first-level circuit breaker state in the next cycle after the cycle in the observation state.
[0115] Specifically, when the first proportion exceeds the first abnormal proportion, the computer device determines that the first-level circuit breaker state will be entered in the next cycle after the observation period. For example, if the first proportion is 60% and the first abnormal proportion is 50%, then 60% exceeds 50%, and the computer device determines that the first-level circuit breaker state will be entered in the next cycle N+1 after the observation period N.
[0116] Step S406: According to the first sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the first level state for service processing.
[0117] The first sampling information can refer to the first sampling ratio or the first sampling quantity, etc. The first sampling information is used to select the business request corresponding to the first sampling information from the business requests for business processing.
[0118] Specifically, the computer device selects a portion of the service requests arriving during the period when the circuit breaker is in its first-level state for service processing, based on a first sampling information. For example, if the first sampling information is 1%, then the computer device selects 1% of the service requests arriving during the period when the circuit breaker is in its first-level state for service processing.
[0119] Step S408: When the second proportion of business requests with corresponding pending processing results included in the selected partial business requests is less than or equal to the second abnormal proportion, the circuit breaker state is entered at the second level.
[0120] The second abnormal ratio is used to trigger the transition to the second-level circuit breaker state in subsequent cycles after the first-level circuit breaker state.
[0121] Specifically, when the second proportion of business requests with pending processing results included in the business requests selected according to the first sampling information is less than or equal to the second abnormal proportion, the computer device enters the second-level circuit breaker state. Taking a selected portion of business requests as 1% and the second abnormal proportion as 50% as an example, then when the second proportion of business requests with pending processing results in this 1% of requests, which is 45%, is less than the second abnormal proportion of 50%, the second-level circuit breaker state is entered.
[0122] Step S410: According to the second sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the second level state for service processing.
[0123] The second sampling information can refer to a second sampling ratio or a second sampling quantity, etc. The second sampling information is used to select the business request corresponding to the second sampling information from the business requests for business processing.
[0124] Specifically, the computer device selects service requests corresponding to the second sampling information from the service requests arriving during the period when the circuit breaker is in the second-level state for service processing. Taking a second sampling information of 10% as an example, the computer device selects 10% of the service requests arriving during the period when the circuit breaker is in the second-level state for service processing.
[0125] Step S412: When the third proportion of the business requests with corresponding pending processing results included in the selected partial business requests is less than or equal to the third abnormal proportion, the circuit breaker enters the third level state.
[0126] The third abnormality ratio is used to trigger the transition to the third-level circuit breaker state in subsequent cycles of the second-level circuit breaker state.
[0127] Specifically, when the third proportion of business requests with pending processing results included in the business requests selected according to the second sampling information is less than or equal to the third anomaly proportion, the computer device enters the third-level circuit breaker state. Taking a second sampling information of 10% and a third anomaly proportion of 40% as an example, when the third proportion of business requests with pending processing results in these 10% of requests (35%) is less than the third anomaly proportion (40%), the third-level circuit breaker state is entered.
[0128] Step S414: Based on the third sampling information, select a portion of the service requests arriving within the period of the third-level circuit breaker state for service processing.
[0129] The third sampling information can refer to the third sampling ratio or the third sampling quantity, etc. The third sampling information is used to select the business request corresponding to the third sampling information from the business requests for business processing.
[0130] Specifically, the computer equipment selects service requests corresponding to the third sampling information from the service requests arriving during the period when the circuit breaker is in the third-level state for service processing. Taking a third sampling information of 30% as an example, the computer equipment selects 30% of the service requests arriving during the period when the circuit breaker is in the third-level state for service processing.
[0131] Step S416: When the fourth proportion of the business requests with corresponding pending processing results included in the selected partial business requests is less than or equal to the fourth abnormal proportion, the circuit breaker enters the fourth level state.
[0132] The fourth abnormal ratio is used to trigger the transition to the fourth level of circuit breaker in subsequent cycles of the third level circuit breaker state.
[0133] Specifically, when the fourth proportion of business requests with pending processing results included in the business requests selected according to the third sampling information is less than or equal to the fourth anomaly proportion, the computer device enters the fourth-level circuit breaker state. Taking a third sampling information of 30% and a fourth anomaly proportion of 30% as an example, when the fourth proportion of business requests with pending processing results in these 30% of requests is less than the fourth anomaly proportion of 30%, the system enters the fourth-level circuit breaker state.
[0134] Step S418: According to the fourth sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the fourth level state for service processing.
[0135] The fourth sampling information can refer to the fourth sampling ratio or the fourth sampling quantity, etc. This fourth sampling information is used to select the business request corresponding to the fourth sampling information from the business requests for business processing.
[0136] Specifically, the computer equipment selects the service requests corresponding to the fourth sampling information from the service requests arriving during the period when the circuit breaker is in the fourth level state for service processing. Taking a fourth sampling information of 70% as an example, the computer equipment selects 70% of the service requests arriving during the period when the circuit breaker is in the fourth level state for service processing.
[0137] Step S420: When the fifth proportion of the business requests with pending processing results included in the selected business requests is less than or equal to the fifth abnormal proportion, the normal state is triggered so as to realize full business processing of the business requests that arrive in the period after the period in the fourth circuit breaker state.
[0138] The fifth abnormality ratio is used to trigger the transition to normal status in subsequent cycles after the fourth-level circuit breaker state. The normal status is the state in which all service requests arriving within the cycle are processed.
[0139] The proportions of the first, second, third, fourth, and fifth anomalies are all preset values and can be adjusted as needed. The proportions of the first, second, third, fourth, and fifth anomalies are not the same. Specifically, it can be: First anomaly proportion ≥ Second anomaly proportion > Third anomaly proportion > Fourth anomaly proportion > Fifth anomaly proportion. First sampling information < Second sampling information < Third sampling information < Fourth sampling information. This means that the circuit breaker conditions gradually become stricter, while the restrictions gradually become more relaxed, allowing the equipment used for business processing to gradually return to normal and reducing the impact of anomalies on the equipment used for business processing.
[0140] Specifically, when the fifth proportion of business requests with pending processing results included in the business requests selected according to the fourth sampling information is less than or equal to the fifth anomaly proportion, the computer device enters the fifth-level circuit breaker state. Taking a fourth sampling information of 70% and a fifth anomaly proportion of 20% as an example, when the fifth proportion of business requests with pending processing results in these 70% of requests is less than the fifth anomaly proportion of 20%, the fifth-level circuit breaker state is entered.
[0141] In the above embodiments, by setting a series of circuit breaker states, from the first level to the second level, then to the third level and the fourth level, and by setting different sampling information selection periods for service requests arriving within those periods, the restrictions on the service processing equipment can be gradually changed, thereby controlling the impact of abnormal situations on the service processing equipment and greatly improving the security of the service processing equipment.
[0142] In one embodiment, such as Figure 5The diagram illustrates a service circuit breaker process in one embodiment. It includes a normal state 502, a first observation state 504, a second observation state 506, a first-level circuit breaker state 508, a second-level circuit breaker state 510, a third-level circuit breaker state 512, and a fourth-level circuit breaker state 514. The explanation uses a one-minute cycle as an example. In normal state 502, the computer device processes all incoming service requests. When the first processing result and the second processing result corresponding to the same service request within the cycle of normal state 502 meet a difference condition, the first processing result corresponding to the corresponding service request is determined as a pending processing result. A first number of service requests with pending processing results is determined among the service requests arriving in the current cycle. When the first circuit breaker condition is met based on the number, i.e., when the number of pending results per minute is greater than X based on the first number, the next cycle after the current cycle enters the first observation state 504. When the number of pending results per minute is ≤50%, the system returns to normal state 502. When the current percentage of pending results per minute exceeds 50%, the system enters a second observation state 506. A second number of service requests corresponding to pending processing results is determined within the period of the second observation state 506. Based on this second number, a first percentage of service requests corresponding to pending processing results arriving within the observation state period is determined.
[0143] When the first proportion exceeds the first abnormal proportion (i.e., the first proportion > 50%), the system enters the first-level circuit breaker state 508. During the period of the first-level circuit breaker state 508, 1% of the service requests are randomly selected for processing, while the remaining 99% of service requests directly return a circuit breaker error and are not processed. This 1% represents the first sampled information. If the proportion of service requests with pending processing results among this 1% of service requests exceeds the second abnormal proportion (i.e., 50%), the system remains in the first-level circuit breaker state 508.
[0144] When the proportion of requests with pending processing results among the 1% of service requests is less than or equal to the second anomaly proportion (50%), the system enters the second-level circuit breaker state 510. During the period of the second-level circuit breaker state 510, 10% of service requests are randomly selected for processing, while the remaining 90% are not processed; the remaining 90% are the second sampled information. If the proportion of requests with pending processing results among these 10% of service requests is greater than the third anomaly proportion (40%), the system remains in the second-level circuit breaker state 510.
[0145] When the proportion of requests with pending processing results among these 10% of business requests is less than or equal to the third exception proportion (40%), the system enters the third circuit breaker state 512. During the period of the third circuit breaker state 512, 30% of business requests are randomly selected for processing, while the remaining 70% of business requests directly return a circuit breaker error and are not processed. The remaining 30% are the third sampled information. If the proportion of requests with pending processing results among these 30% of business requests is greater than the fourth exception proportion (30%), the system remains in the third circuit breaker state 512.
[0146] When the proportion of requests with pending processing results among these 30% of service requests is less than or equal to the fourth anomaly ratio (30%), the system enters the fourth circuit breaker state 514. During the period in the fourth circuit breaker state 514, 70% of service requests are randomly selected for processing, while the remaining 30% are directly returned as circuit breaker errors and not processed. The 70% represents the fourth sampling information. If the proportion of requests with pending processing results among these 70% of service requests is greater than the fifth anomaly ratio (20%), the system remains in the fourth circuit breaker state 514. When the proportion of requests with pending processing results among these 70% of service requests is less than or equal to the fifth anomaly ratio (20%), the system returns to normal operation to process all service requests arriving in each period.
[0147] In the above embodiments, by setting up a series of observation states, erroneous circuit breakers can be reduced, thus mitigating the impact. By setting up a series of circuit breaker states, from the first to the second, then to the third and fourth levels, the abnormality rate increases progressively while the sampling information decreases progressively. This allows for a gradual relaxation of restrictions on the equipment used for business processing, thereby gradually reducing the impact of abnormal situations on the equipment and improving the security of the equipment used for business processing.
[0148] In one embodiment, the business request processing method further includes: maintaining a first-level circuit breaker state when the second ratio exceeds the second abnormal ratio, and / or maintaining a second-level circuit breaker state when the third ratio exceeds the third abnormal ratio, and / or maintaining a third-level circuit breaker state when the fourth ratio exceeds the fourth abnormal ratio, and / or maintaining a fourth-level circuit breaker state when the fifth ratio exceeds the fifth abnormal ratio.
[0149] In the above embodiments, when the second ratio exceeds the second abnormal ratio, it indicates that the number of pending service requests represented by the second ratio is large. Therefore, it is necessary to maintain the first-level circuit breaker state and select some service requests for service processing according to the first sampling information. Similarly, when the third ratio exceeds the third abnormal ratio, it indicates that the number of pending service requests represented by the third ratio is large. Therefore, it is necessary to maintain the third-level circuit breaker state and select some service requests for service processing according to the third sampling information. This can maintain the circuit breaker state and reduce the impact even if an attack is suspected.
[0150] In one embodiment, business processing is performed on each piece of data to be processed to obtain a corresponding first processing result, including: extracting features from each piece of data to be processed using a machine learning model to obtain a corresponding first feature vector, and performing feature retrieval based on the first feature vector to obtain a first processing result corresponding to each piece of data to be processed. Business processing is performed on each piece of transformed data to obtain a corresponding second processing result, including: extracting features from each piece of transformed data using a machine learning model to obtain a corresponding second feature vector, and performing feature retrieval based on the second feature vector to obtain a second processing result corresponding to each piece of transformed data.
[0151] In artificial intelligence, features are typically high-dimensional vectors used to structure and represent information such as images and videos. Feature retrieval, also in AI, calculates the similarity between images or videos corresponding to a feature by measuring the distance between features (e.g., the dot product or Euclidean distance between two feature vectors). The first feature vector refers to the feature vector obtained by extracting features from the data to be processed. The second feature vector refers to the feature vector obtained by extracting features from the transformed data.
[0152] Specifically, the computer device uses a machine learning model to extract features from each piece of data to be processed, obtaining a first feature vector corresponding to the data. Based on the first feature vector, feature retrieval is performed to obtain a first processing result corresponding to each image to be processed. The computer device also uses the same machine learning model to extract features from each piece of transformed data, obtaining a corresponding second feature vector. Based on the second feature vector, feature retrieval is performed to obtain a second processing result corresponding to each piece of transformed data.
[0153] For example, taking a face image as the data to be processed, a transformed face image as the transformed data, a face feature vector as the feature vector, and a processing result of the face image being a user's face image as an example, the computer device performs feature retrieval on the face image using a face retrieval model, obtaining a first face feature vector corresponding to the face image. Based on the first face feature vector, feature retrieval is performed to obtain the processing result that the face image corresponding to the face image is user Z. The computer device performs feature retrieval on the transformed face image using the face retrieval model, obtaining a second face feature vector corresponding to the face image. Based on the second face feature vector, feature retrieval is performed to obtain the processing result that the face image corresponding to the face image is user Y. Therefore, the result corresponding to this face image is a pending processing result, i.e., a processing result suspected of being abnormal.
[0154] In the above embodiments, a machine learning model is used to extract features from the data to be processed to obtain a corresponding first feature vector, and a first processing result is obtained. The same machine learning model is used to extract features from the transformed data to obtain a corresponding second feature vector, and a second processing result is obtained. If the device processing the business is not subjected to feature attacks or the feature retrieval algorithm is robust, the first processing result and the second processing result should not meet the difference condition. However, if the first processing result and the second processing result meet the difference condition, it indicates that the device may be subjected to feature attacks or the feature retrieval algorithm is not robust. Therefore, service circuit breaking can reduce the impact of feature attacks and improve the security of business processing.
[0155] In one embodiment, the business request includes a resource transfer request, the data to be processed includes a face image, the business processing includes face verification business processing, the first processing result includes a first face verification result, and the second processing result includes a second face verification result.
[0156] The resource transfer request is used to transfer resources from one account to another. For example, a resource transfer request could transfer a resource amount from account A to account B. "Resource" specifically refers to virtual resources. "Face image" refers to an image containing a face. The face verification process verifies whether the face image carried in the request matches the face image corresponding to the resource transfer account. Both the first and second face verification results refer to the identity of the face in the face image, that is, which user's face the face in the image belongs to. The first and second face verification results may be the same or different.
[0157] Specifically, the computer device acquires resource transfer requests arriving within the current period, each request carrying a facial image. It then extracts features from each facial image using a machine learning model to obtain a corresponding first feature vector. Based on this first feature vector, it performs feature retrieval to obtain a first facial verification result corresponding to each facial image. Next, it transforms each facial image to obtain corresponding transformed data. Finally, it extracts features from each transformed data using the same machine learning model to obtain a corresponding second feature vector. Based on this second feature vector, it performs feature retrieval to obtain a second facial verification result corresponding to each transformed data. When the first and second facial verification results corresponding to each resource transfer request within the current period determine that the circuit breaker condition is met, the service circuit breaker is triggered to restrict business requests arriving in subsequent periods.
[0158] In the above embodiments, a first processing result is obtained by performing feature retrieval on the face image in the resource transfer request, and a second processing result is obtained by performing feature retrieval on the transformed data obtained after transforming the face image. When the first and second processing results corresponding to the resource transfer requests within the current period determine that the circuit breaker condition is met, it indicates that a feature attack has occurred, thus requiring the triggering of service circuit breaker processing. This can reduce the impact of feature attacks on resource transfer request processing and improve business processing security. In one embodiment, a business request processing method includes:
[0159] Step a1: Obtain the business requests that arrive within the current period. Each business request carries data to be processed.
[0160] Step a2: Through the online service cluster, the machine learning model is used to extract features from each data to be processed to obtain the corresponding first feature vector. Based on the first feature vector, feature retrieval is performed to obtain the first processing result corresponding to each image to be processed.
[0161] Step a3 involves performing at least one of the following processing methods on the image to be processed: image scaling, image padding, and image noise reduction, to obtain transformation data corresponding to the image to be processed.
[0162] Step a4: Extract features from each transformed data using a bypass service cluster and a machine learning model to obtain the corresponding second feature vector. Perform feature retrieval based on the second feature vector to obtain the second processing result corresponding to each transformed data.
[0163] Step a5: When the first processing result and the second processing result corresponding to the same business request meet the difference condition, the first processing result corresponding to the business request is determined as the pending processing result.
[0164] Step a6: Determine the first number of business requests with pending processing results among the business requests arriving in the current period.
[0165] Step a7: When the first circuit breaker condition is met based on the first quantity, the online service cluster is triggered to enter the observation state in the next cycle after the current cycle.
[0166] Step a8: Determine the second number of business requests with pending processing results within the observation period.
[0167] Step a9: Based on the second quantity, determine the first proportion of business requests corresponding to pending results that arrive during the period under observation.
[0168] Step a10: When the first ratio exceeds the first abnormal ratio, determine that the first-level circuit breaker state will be entered in the next cycle after the cycle in the observation state.
[0169] Step a11: Based on the first sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the first level state for service processing.
[0170] Step a12: When the second proportion of business requests with pending processing results included in the selected portion of business requests is less than or equal to the second abnormal proportion, the online service cluster enters the second-level circuit breaker state.
[0171] Step a13: Based on the second sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the second level state for service processing.
[0172] Step a14: When the third proportion of business requests with pending processing results included in the selected business requests is less than or equal to the third abnormal proportion, the online service cluster enters the third-level circuit breaker state.
[0173] Step a15: Based on the third sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the third level state for service processing.
[0174] Step a16: When the fourth proportion of business requests with pending processing results included in the selected business requests is less than or equal to the fourth abnormal proportion, the online service cluster enters the fourth level of circuit breaker state.
[0175] Step a17: Based on the fourth sampling information, select a portion of the service requests that arrive within the period when the circuit breaker is in the fourth level state for service processing.
[0176] Step a18: When the fifth proportion of business requests with pending processing results included in the selected business requests is less than or equal to the fifth abnormal proportion, the online service cluster is triggered to enter the normal state, so as to realize full business processing of business requests arriving in the period after the period in the fourth circuit breaker state.
[0177] Step a19: When the second ratio exceeds the second abnormal ratio, maintain the first-level circuit breaker state.
[0178] Step a20: When the third ratio exceeds the third abnormal ratio, maintain the second-level circuit breaker status.
[0179] Step a21: When the fourth ratio exceeds the fourth abnormal ratio, maintain the third-level circuit breaker status.
[0180] Step a22: When the fifth ratio exceeds the fifth abnormal ratio, maintain the fourth level of circuit breaker status.
[0181] Step a23: The pending data carried by the business request corresponding to the pending processing result is reported to the server. The reported pending data is used to instruct the server to update the machine learning model used to perform business processing based on the received pending data.
[0182] It should be understood that although the above steps are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the above steps may include multiple steps or multiple stages, which are not necessarily completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0183] In the above embodiments, when the online machine learning service is attacked, the system will automatically detect and activate the self-protection program. The embodiments of this application have made relatively novel designs in terms of the detection of characteristic attack behaviors and the circuit breaking of characteristic attack behaviors, which can establish a basic service architecture for attack and defense against black market activities, which is of great significance.
[0184] In one embodiment, such as Figure 6The diagram shown illustrates the architecture of a business request processing method in one embodiment. It includes a service access module, a service detection module, a service circuit breaker module, an online cluster for service A, a bypass cluster for service A, an online cluster for service B, and a bypass cluster for service B. The service access module, service detection module, and service circuit breaker module can all be located on any server, such as within the online cluster for service A, the bypass cluster for service A, the online cluster for service B, the bypass cluster for service B, or other servers.
[0185] Taking the online cluster and bypass cluster of service A as examples, the service access module obtains business requests arriving within the current period. These requests carry data to be processed and are transmitted to the service detection module. The service detection module checks whether the online cluster of service A is currently in a circuit breaker state. If so, it either rejects or processes the business request; otherwise, it verifies the request through the bypass cluster. The service detection module then transmits the business request to the online cluster of service A. The service detection module transforms the data to be processed, such as by adding noise or deformation, and transmits the transformed data to the bypass cluster of service A. The online cluster of service A processes the data to be processed, obtaining a first processing result. The bypass cluster of service A processes the transformed data, obtaining a second processing result. Both the online cluster of service A and the bypass cluster of service A report their respective processing results to the service circuit breaker module. The service circuit breaker module determines whether the online cluster of service A meets the circuit breaker conditions based on the first and second processing results corresponding to the business requests within the current period. When the online cluster of service A meets the circuit breaker conditions, the service circuit breaker process is triggered to restrict the processing of business requests arriving in subsequent periods. The specific judgment method for the service circuit breaker module can be as follows: if the first and second processing results for the same business request are consistent, it indicates that the current online cluster's algorithm is robust enough, and the service circuit breaker should not be triggered in the next cycle of the current cycle. If the first and second processing results for the same business request are inconsistent, it indicates that the current online cluster's algorithm is relatively fragile, and the service circuit breaker should be triggered in subsequent cycles of the current cycle.
[0186] This application also provides an application scenario in which the above-described business request processing method is applied. This business request processing method can be applied to object recognition applications. Specifically, taking the example where the business request is an object recognition request, the data to be processed is an object image, the business processing is object recognition, the first processing result is a first object recognition result, the second processing result is a second object recognition result, the transformed data is a transformed object image, and the circuit breaker condition is that the first and second object recognition results of at least some identical requests are inconsistent, the application of the business request processing method in this scenario is as follows: Obtaining object recognition requests arriving within the current period, each object recognition request carrying an object image; performing object recognition on each object image to obtain the corresponding first object recognition result; performing transformation processing on each object image to obtain a transformed object image, and performing object recognition on each transformed object image to obtain the corresponding second object recognition result; triggering service circuit breaker processing when the first and second object recognition results of at least some object recognition requests within the current period are inconsistent. Through the above embodiments, the security of the equipment used for business processing in the object recognition scenario can be determined, thereby improving the security of object recognition processing. It can also be determined whether the equipment used for business processing is currently facing or about to face risks, and reduce the impact on the equipment used for business processing in the event of an anomaly.
[0187] This application also provides an application scenario in which the above-described business request processing method is applied. This business request processing method can be applied to translation applications. Specifically, taking the business request as a translation processing request, the data to be processed as the text to be translated, the business processing as translation processing, the first processing result as the first translation processing result, the second processing result as the second translation processing result, the transformed data as the transformed text, and the circuit breaker condition as the inconsistency between the first and second translation processing results of at least some identical requests as an example, the application of the business request processing method in this scenario is as follows: The translation processing requests arriving within the current period are obtained, each carrying the text to be translated; each text to be translated is translated to obtain the corresponding first translation processing result; each text to be translated is transformed to obtain the transformed text, and each transformed text is translated to obtain the corresponding second translation processing result; when it is determined that the first and second translation processing results corresponding to at least some translation processing requests within the current period are inconsistent, service circuit breaker processing is triggered. Through the above embodiments, the security of the equipment used for business processing in the translation scenario can be determined, thereby improving the security of translation. It can also be determined whether the equipment used for business processing is currently facing or about to face risks, and reduce the impact on the equipment used for business processing in the event of an anomaly.
[0188] It should be understood that, although Figure 1 and 4The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 and 4 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.
[0189] In one embodiment, such as Figure 7 As shown, a business request processing device is provided. This device can be a software module, a hardware module, or a combination of both integrated into a computer device. Specifically, the device includes: a business request acquisition module 702, a first processing module 704, a second processing module 706, and a service circuit breaker module 708, wherein:
[0190] The business request acquisition module 702 is used to acquire business requests that arrive within the current period, and the business requests carry data to be processed.
[0191] The first processing module 704 is used to perform business processing on each piece of data to be processed and obtain the corresponding first processing result.
[0192] The second processing module 706 is used to transform each piece of data to be processed to obtain the corresponding transformed data, and to perform business processing on each piece of transformed data to obtain the corresponding second processing result.
[0193] The service circuit breaker module 708 is used to trigger service circuit breaker processing when it is determined that the first processing result and the second processing result in the current period meet the circuit breaker conditions, so as to restrict the processing of service requests arriving in subsequent periods.
[0194] The aforementioned business request processing device acquires business requests arriving within the current period, each carrying data to be processed. It then performs business processing on the data to obtain a first processing result. After transforming the data, it performs the same business processing again to obtain a second processing result. When the first and second processing results within the current period are determined to meet the circuit breaker conditions, it indicates that the robustness of the business processing algorithm is poor or that it has been subjected to a business attack. Therefore, it is necessary to trigger service circuit breaker processing to restrict business requests arriving in subsequent periods. This significantly improves the security of the business processing equipment, thereby enhancing the overall security of the business processing. Furthermore, it can determine whether the business processing equipment is currently facing or about to face a risk, and reduce the impact of abnormal situations.
[0195] In one embodiment, the first processing module 704 is used to perform business processing on each piece of data to be processed through the online service cluster to obtain a corresponding first processing result. The second processing module 706 is used to perform business processing on each piece of transformed data through the bypass service cluster to obtain a corresponding second processing result. The service circuit breaker module 708 is used to trigger the service circuit breaker processing of the online service cluster when it is determined that the first processing result and the second processing result in the current period meet the circuit breaker conditions, so that the online service cluster can restrict the processing of business requests arriving in subsequent periods.
[0196] In the above embodiments, the online service cluster performs business processing on the data to be processed, and the bypass service cluster performs business processing on each transformed data to obtain a second processing result. This distinguishes between the online service and the auxiliary service for circuit breaker detection, reduces the resource consumption of the online service cluster, and improves the efficiency of business request processing.
[0197] In one embodiment, the data to be processed includes an image to be processed, and the second processing module 706 is used to perform at least one of image scaling, image padding, and image noise reduction on the image to be processed to obtain transformation data corresponding to the image to be processed.
[0198] In the above embodiments, at least one of the following processes is performed on the image to be processed: resizing, image padding, and noise addition. That is, some transformation processing that does not affect the actual content of the image is performed on the image to be processed to obtain transformed data. Based on the second processing result obtained by processing the transformed data, the robustness of the business processing algorithm or whether it has been subjected to business attacks can be judged based on the first processing result and the second processing result, and circuit breaker processing can be triggered, thereby reducing the risk to the business processing equipment and greatly improving the security of the business processing equipment.
[0199] In one embodiment, the service circuit breaker module 708 is used to determine the first processing result corresponding to the corresponding business request as a pending processing result when the first processing result and the second processing result corresponding to the same business request meet the difference condition; determine the first number of business requests corresponding to pending processing results among the business requests arriving in the current period; and trigger service circuit breaker processing when it is determined that the circuit breaker condition is met based on the first number.
[0200] In the above embodiments, when there is a certain difference between the first processing result and the second processing result of the same business request, it indicates that the first processing result corresponding to the corresponding request is a suspected abnormal processing result. Then, a first number of business requests with pending processing results is determined. When the first number is determined to meet the circuit breaker condition, it indicates that the business processing algorithm or the business processing device has weak business processing capability. Here, business processing capability can refer to robustness such as fault tolerance and stability, etc., which requires triggering service circuit breaker processing to reduce the impact caused by pending processing results and improve the security of the business processing device.
[0201] In one embodiment, the business request processing device further includes a reporting module, which is used to report the pending data carried by the business request corresponding to the pending processing result to the server. The reported pending data is used to instruct the server to update the machine learning model used to perform business processing based on the received pending data.
[0202] In the above embodiments, the processing result corresponding to the business request is a pending processing result, indicating that the business request may also be abnormal. The pending data carried by the business request with the pending processing result is reported to the server, that is, the pending data carried by the suspected abnormal processing result is reported to the server. The server can update the machine learning model used to perform business processing based on the received pending data. This enables the updated machine learning model to deal with some abnormalities on its own, and the processing result when performing business processing is more accurate. This provides data support for the device to actively perform circuit breaking in subsequent business processing, and actively collects data for the optimization direction in the R&D stage.
[0203] In one embodiment, the service circuit breaker module 708 is configured to trigger the next period after the current period to enter an observation state when it is determined that the first circuit breaker condition is met based on a first quantity; determine a second quantity of service requests with pending processing results within the period in the observation state; and trigger the period after the observation state to enter a circuit breaker state when it is determined that the second circuit breaker condition is met based on the second quantity, and restrict the service requests arriving within the period in the circuit breaker state.
[0204] In the above embodiments, when the circuit breaker condition is met based on the first quantity, the system enters the observation state in the next cycle. That is, the circuit breaker will not be triggered immediately, and the system will continue to observe until the second quantity in the cycle under the observation state meets the second circuit breaker condition. This indicates that the robustness and other performance of the business processing algorithm are weak. Therefore, the cycle after the observation state enters the circuit breaker state, and the business requests arriving in the cycle under the circuit breaker state are restricted. By setting the observation state and the circuit breaker state, false circuit breakers are avoided, and the impact is further reduced.
[0205] In one embodiment, the service circuit breaker module 708 is configured to, when it is determined that the second circuit breaker condition is met according to the second quantity, trigger the corresponding level of circuit breaker state in each period after the period in the observation state based on the proportion of service requests with pending processing results in each period after the period in the observation state, and perform corresponding restriction processing on the service requests arriving in the period in the corresponding level of circuit breaker state.
[0206] In the above embodiments, when the second circuit breaker condition is met according to the second quantity, the circuit breaker state is triggered in each period after the observation period based on the proportion of service requests with pending processing results in each period after the observation period. The service requests arriving in the period of the corresponding circuit breaker state are then subject to corresponding restriction processing. That is, since the proportion of service requests with pending processing results is different, it indicates that the degree of attack is different. Therefore, by setting different levels of circuit breaker states and different restriction processing, the accuracy of circuit breaker processing for service processing devices is improved.
[0207] In one embodiment, the service circuit breaker module 708 is configured to: determine, based on a second quantity, a first proportion of service requests corresponding to pending results arriving within a period under observation; when the first proportion exceeds a first abnormal proportion, determine that the next period following the period under observation will enter a first-level circuit breaker state; select a portion of service requests from those arriving within the period under the first-level circuit breaker state for service processing according to first sampling information; when the second proportion of service requests corresponding to pending results included in the selected portion of service requests is less than or equal to a second abnormal proportion, enter a second-level circuit breaker state; and select a portion of service requests from those arriving within the period under the second-level circuit breaker state for service processing according to second ... includes a second abnormal proportion of those arriving within the period under the second-level circuit breaker state for service processing, enter a second-level circuit breaker state. When the third proportion of business requests is less than or equal to the third abnormal proportion, the system enters the third-level circuit breaker state. Based on the third sampling information, a portion of business requests arriving within the period of the third-level circuit breaker state are selected for processing. When the fourth proportion of business requests with pending processing results included in the selected portion of business requests is less than or equal to the fourth abnormal proportion, the system enters the fourth-level circuit breaker state. Based on the fourth sampling information, a portion of business requests arriving within the period of the fourth-level circuit breaker state are selected for processing. When the fifth proportion of business requests with pending processing results included in the selected portion of business requests is less than or equal to the fifth abnormal proportion, the system is triggered to enter the normal state, thereby enabling full processing of business requests arriving in the period following the period of the fourth-level circuit breaker state.
[0208] In the above embodiments, by setting a series of circuit breaker states, from the first level to the second level, then to the third level and the fourth level, and by setting different sampling information selection periods for service requests arriving within those periods, the restrictions on the equipment for service processing can be gradually changed, thereby controlling the impact of abnormal situations on the server and greatly improving the security of the equipment for service processing.
[0209] In one embodiment, the service circuit breaker module 708 is further configured to maintain a first-level circuit breaker state when the second ratio exceeds the second abnormal ratio, and / or maintain a second-level circuit breaker state when the third ratio exceeds the third abnormal ratio, and / or maintain a third-level circuit breaker state when the fourth ratio exceeds the fourth abnormal ratio, and / or maintain a fourth-level circuit breaker state when the fifth ratio exceeds the fifth abnormal ratio.
[0210] In the above embodiments, when the second ratio exceeds the second abnormal ratio, it indicates that the number of pending service requests represented by the second ratio is large. Therefore, it is necessary to maintain the first-level circuit breaker state and select some service requests for service processing according to the first sampling information. Similarly, when the third ratio exceeds the third abnormal ratio, it indicates that the number of pending service requests represented by the third ratio is large. Therefore, it is necessary to maintain the third-level circuit breaker state and select some service requests for service processing according to the third sampling information. This can maintain the circuit breaker state and reduce the impact even if an attack is suspected.
[0211] In one embodiment, the first processing module 704 is used to extract features from each data to be processed using a machine learning model to obtain a corresponding first feature vector, and to perform feature retrieval based on the first feature vector to obtain a first processing result corresponding to each image to be processed; the second processing module 706 is used to extract features from each transformed data using a machine learning model to obtain a corresponding second feature vector, and to perform feature retrieval based on the second feature vector to obtain a second processing result corresponding to each transformed data.
[0212] In the above embodiments, a machine learning model is used to extract features from the data to be processed to obtain a corresponding first feature vector, and a first processing result is obtained. The machine learning model is also used to extract features from the transformed data to obtain a corresponding second feature vector, and a second processing result is obtained. If the server is not subjected to a feature attack or the feature retrieval algorithm is robust, the first processing result and the second processing result should not meet the difference condition. However, if the first processing result and the second processing result meet the difference condition, it indicates that the server may be subjected to a feature attack or the feature retrieval algorithm is not robust. Therefore, a service circuit breaker can be implemented to reduce the impact of the feature attack.
[0213] In one embodiment, the business request includes a resource transfer request, the data to be processed includes a face image, the business processing includes face verification business processing, the first processing result includes a first face verification result, and the second processing result includes a second face verification result.
[0214] In the above embodiments, a first processing result is obtained by performing feature retrieval on the face image in the resource transfer request, and a second processing result is obtained by performing feature retrieval on the transformed data obtained after transforming the face image. When the first and second processing results corresponding to the resource transfer requests in the current period are determined to meet the circuit breaker conditions, it indicates that a feature attack has occurred, and therefore the service circuit breaker processing needs to be triggered, which can reduce the impact of feature attacks on the processing of resource transfer requests.
[0215] For specific limitations regarding the business request processing device, please refer to the limitations on the business request processing method above, which will not be repeated here. Each module in the aforementioned business request processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0216] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores data related to business requests. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements a business request processing method.
[0217] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0218] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0219] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0220] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, causing the computer device to perform the steps in the above method embodiments.
[0221] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0222] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0223] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A business request processing method, characterized in that, The method includes: Obtain business requests that arrive within the current period, wherein the business requests carry data to be processed; The data to be processed is pre-detected according to preset verification conditions to obtain pre-detection results, and the business request is intercepted when the pre-detection results do not meet the processing conditions. The online service cluster processes the data to be processed that meet the processing conditions according to the pre-detection processing results to obtain the corresponding first processing result; the online service cluster is used to interface with the client to provide online services. The bypass service cluster transforms each of the data to be processed that meets the processing conditions in the pre-detection processing results to obtain corresponding transformed data, and then performs the business processing on each of the transformed data to obtain the corresponding second processing result; the business processing flow executed by the online service cluster is the same as that executed by the bypass service cluster; the business processing is executed through a machine learning model; the bypass service cluster is used to provide auxiliary services for circuit breaker detection; the transformation processing refers to processing that does not change the substantive content of the data to be processed. When it is determined that the first processing result and the second processing result corresponding to at least a portion of the business requests in the current period do not match, and the results corresponding to at least a portion of the business requests processed by the online service cluster and the bypass service cluster in the observation state after the current period do not match, the period after the observation state triggers the period after the period in the observation state to enter the circuit breaker state, so that the online service cluster restricts the processing of business requests arriving in the period in the circuit breaker state.
2. The method according to claim 1, characterized in that, The data to be processed includes images to be processed; the transformation processing of each piece of data to be processed whose pre-detection processing result meets the processing conditions to obtain corresponding transformed data includes: The image to be processed that meets the processing conditions after pre-detection processing is subjected to at least one of image scaling, image padding, and image noise addition to obtain transformation data corresponding to the image to be processed.
3. The method according to claim 1, characterized in that, When it is determined that the first processing result and the second processing result corresponding to at least a portion of the service requests in the current period do not match, and the results corresponding to at least a portion of the service requests processed by the online service cluster and the bypass service cluster in the observation state after the current period do not match, triggering the circuit breaker state in the period after the period in the observation state includes: When the first processing result and the second processing result corresponding to the same business request meet the difference condition, the first processing result corresponding to the business request is determined as the pending processing result. Determine the first number of business requests with pending processing results among the business requests arriving in the current period; When the circuit breaker condition is met based on the first quantity, and the results processed by the online service cluster and the bypass service cluster in the observation state after the current period do not match, the period after the observation state period triggers the circuit breaker state in the period after the observation state period, so that the online service cluster restricts the processing of service requests arriving in the period in the circuit breaker state period.
4. The method according to claim 3, characterized in that, The method further includes: The pending data carried by the business request corresponding to the pending processing result is reported to the server. The reported pending data is used to instruct the server to update the machine learning model used to execute the business processing based on the received pending data.
5. The method according to claim 3, characterized in that, When, based on the first quantity, it is determined that the circuit breaker condition is met, and the results processed by the online service cluster and the bypass service cluster in the observation state after the current period do not match, the period after the observation state period triggers the circuit breaker state in the period following the period in the observation state, so that the online service cluster restricts the service requests arriving within the period in the circuit breaker state, including: When it is determined that the first circuit breaker condition is met based on the first quantity, the system will enter the observation state in the next cycle after the current cycle. Determine the second number of business requests corresponding to pending processing results within the period of the observation state; When the second circuit breaker condition is met based on the second quantity, the circuit breaker state is triggered in the period following the period in the observation state, so that the online service cluster restricts the processing of service requests that arrive during the period in the circuit breaker state.
6. The method according to claim 5, characterized in that, When the second circuit breaker condition is met based on the second quantity, the system triggers a circuit breaker state in the period following the period in the observation state, causing the online service cluster to restrict service requests arriving during the period in the circuit breaker state, including: When the second circuit breaker condition is met based on the second quantity, the circuit breaker state is triggered in each period after the observation period based on the proportion of service requests with pending processing results in each period after the observation period, and the service requests arriving in the period of the corresponding circuit breaker state are subject to corresponding restriction processing.
7. The method according to claim 6, characterized in that, When the second circuit breaker condition is determined to be met based on the second quantity, the system triggers a circuit breaker at the corresponding level in each period following the observation period, based on the proportion of service requests with pending processing results in each period after the observation period. The system then applies corresponding restrictions to service requests arriving within the corresponding circuit breaker period, including: Based on the second quantity, a first proportion of business requests with corresponding pending processing results that arrive within the period of the observation state is determined; When the first ratio exceeds the first abnormal ratio, it is determined that the first level of circuit breaker state will be entered in the next cycle after the cycle in the observation state. Based on the first sampling information, a portion of the service requests that arrive within the period when the circuit breaker is in the first level state are selected for service processing. When the second proportion of business requests with pending processing results included in the selected portion of business requests is less than or equal to the second abnormal proportion, the circuit breaker enters the second level state. Based on the second sampling information, a portion of the service requests that arrive during the period when the circuit breaker is in the second level are selected for service processing. When the third proportion of the business requests with pending processing results included in the selected business requests is less than or equal to the third abnormal proportion, the circuit breaker enters the third level state. According to the third sampling information, a portion of the service requests arriving within the period of the third-level circuit breaker state are selected for service processing. When the fourth proportion of the business requests with pending processing results included in the selected business requests is less than or equal to the fourth abnormal proportion, the circuit breaker enters the fourth level state. According to the fourth sampling information, a portion of the service requests arriving within the period of the fourth level of circuit breaker are selected for service processing. When the fifth proportion of the selected partial service requests containing the corresponding pending processing results is less than or equal to the fifth abnormal proportion, the system is triggered to enter the normal state, so as to realize full service processing of service requests arriving in the period after the period in the fourth level circuit breaker state.
8. The method according to claim 7, characterized in that, The method further includes: When the second ratio exceeds the second abnormal ratio, maintain the first level of circuit breaker status, and / or, When the third ratio exceeds the third abnormal ratio, maintain the second-level fuse state, and / or, When the fourth ratio exceeds the fourth abnormal ratio, the third-level circuit breaker state is maintained, and / or, When the fifth ratio exceeds the fifth abnormal ratio, the fourth level of circuit breaker status is maintained.
9. The method according to any one of claims 1 to 8, characterized in that, The process of performing business processing on each of the data to be processed that meets the processing conditions in the pre-detection processing results to obtain the corresponding first processing result includes: The machine learning model extracts features from each data to be processed that meets the processing conditions in the pre-detection processing results, and obtains the corresponding first feature vector. Based on the first feature vector, feature retrieval is performed to obtain the first processing result corresponding to each image to be processed. The process of performing the business processing on each of the transformed data to obtain the corresponding second processing result includes: The machine learning model extracts features from each transformed data to obtain a corresponding second feature vector. Based on the second feature vector, feature retrieval is performed to obtain a second processing result corresponding to each transformed data.
10. The method according to claim 9, characterized in that, The service request includes a resource transfer request, the data to be processed includes a face image, the service processing includes face verification service processing, the first processing result includes a first face verification result, and the second processing result includes a second face verification result.
11. A service request processing apparatus, characterized in that, The device includes: The business request acquisition module is used to acquire business requests that arrive within the current period, and the business requests carry data to be processed. This module is used to perform pre-detection processing on the data to be processed according to preset verification conditions, obtain the pre-detection processing result, and intercept the business request when the pre-detection processing result does not meet the processing conditions. The first processing module is used to perform business processing on each of the data to be processed that meets the processing conditions according to the pre-detection processing results through an online service cluster, and obtain the corresponding first processing result; the online service cluster is used to interface with the client to provide online services. The second processing module is used to transform the data to be processed that meet the processing conditions according to the pre-detection processing results through a bypass service cluster, to obtain corresponding transformed data, and to perform the business processing on each of the transformed data to obtain the corresponding second processing result; the business processing flow executed by the online service cluster is the same as that executed by the bypass service cluster; the business processing is executed through a machine learning model; the bypass service cluster is used to provide auxiliary services for circuit breaker detection; the transformation processing refers to processing that does not change the substantive content of the data to be processed. The service circuit breaker module is used to trigger the service circuit breaker processing of the online service cluster in the period after the observation state when it is determined that the first processing result and the second processing result corresponding to at least a portion of the service requests in the current period do not match, and the results corresponding to at least a portion of the service requests processed by the online service cluster and the bypass service cluster in the observation state after the current period do not match, so that the online service cluster restricts the processing of service requests arriving in the period in the circuit breaker state.
12. The apparatus according to claim 11, characterized in that, The data to be processed includes the image to be processed; the second processing module is further used to perform at least one of the following processing on the image to be processed if the pre-detection processing result meets the processing conditions: image scaling, image completion, and image noise addition, to obtain transformation data corresponding to the image to be processed.
13. The apparatus according to claim 11, characterized in that, The service circuit breaker module is also used to determine the first processing result corresponding to the corresponding business request as a pending processing result when the first processing result and the second processing result corresponding to the same business request meet the difference condition. Determine the first number of business requests with pending processing results among the business requests arriving in the current period; When the circuit breaker condition is met based on the first quantity, and the results processed by the online service cluster and the bypass service cluster in the observation state after the current period do not match, the period after the observation state period triggers the circuit breaker state in the period after the observation state period, so that the online service cluster restricts the processing of service requests arriving in the period in the circuit breaker state period.
14. The apparatus according to claim 13, characterized in that, The device further includes: The reporting module is used to report the pending data carried by the business request corresponding to the pending processing result to the server. The reported pending data is used to instruct the server to update the machine learning model used to execute the business processing based on the received pending data.
15. The apparatus according to claim 13, characterized in that, The service circuit breaker module is further configured to: when the first circuit breaker condition is met based on the first quantity, trigger the next period after the current period to enter the observation state; determine the second quantity of business requests with pending processing results within the period of the observation state; and when the second circuit breaker condition is met based on the second quantity, trigger the period after the period in the observation state to enter the circuit breaker state, so that the online service cluster restricts the processing of business requests arriving within the period in the circuit breaker state.
16. The apparatus according to claim 15, characterized in that, The service circuit breaker module is further configured to, when determining that the second circuit breaker condition is met based on the second quantity, trigger the corresponding level of circuit breaker state in each period after the period in the observation state according to the proportion of service requests with pending processing results in each period after the period in the observation state, and perform corresponding restriction processing on the service requests arriving in the period in the corresponding level of circuit breaker state.
17. The apparatus according to claim 16, characterized in that, The service circuit breaker module is further configured to determine, based on the second quantity, a first proportion of service requests with corresponding pending processing results arriving within the period of the observation state; when the first proportion exceeds the first abnormal proportion, determine that the next period after the period of the observation state will enter the first-level circuit breaker state. According to the first sampling information, a portion of the service requests that arrive within the period of the first-level circuit breaker state are selected for service processing; when the second proportion of the service requests with pending processing results included in the selected portion of service requests is less than or equal to the second abnormal proportion, the second-level circuit breaker state is entered. According to the second sampling information, a portion of the service requests that arrive within the period when the circuit breaker is in the second level state are selected for service processing; when the third proportion of the service requests with pending processing results included in the selected portion of service requests is less than or equal to the third abnormal proportion, the circuit breaker is entered into the third level state. According to the third sampling information, a portion of the service requests arriving within the period of the third-level circuit breaker state are selected for service processing. When the fourth proportion of the business requests with pending processing results included in the selected business requests is less than or equal to the fourth abnormal proportion, the circuit breaker enters the fourth level state. According to the fourth sampling information, a portion of the service requests arriving within the period of the fourth-level circuit breaker state are selected for service processing; when the fifth proportion of the service requests with pending processing results included in the selected portion of service requests is less than or equal to the fifth abnormal proportion, the normal state is triggered so as to realize full service processing of the service requests arriving in the period after the period of the fourth-level circuit breaker state.
18. The apparatus according to claim 17, characterized in that, The service circuit breaker module is further configured to maintain the first-level circuit breaker state when the second ratio exceeds the second abnormal ratio, and / or maintain the second-level circuit breaker state when the third ratio exceeds the third abnormal ratio, and / or maintain the third-level circuit breaker state when the fourth ratio exceeds the fourth abnormal ratio, and / or maintain the fourth-level circuit breaker state when the fifth ratio exceeds the fifth abnormal ratio.
19. The apparatus according to any one of claims 11 to 18, characterized in that, The first processing module is further configured to extract features from each data to be processed that meets the processing conditions in the pre-detection processing results using a machine learning model, obtain a corresponding first feature vector, perform feature retrieval based on the first feature vector, and obtain a first processing result corresponding to each image to be processed. The second processing module is further configured to extract features from each transformed data using the machine learning model to obtain a corresponding second feature vector, and perform feature retrieval based on the second feature vector to obtain a second processing result corresponding to each transformed data.
20. The apparatus according to claim 19, characterized in that, The service request includes a resource transfer request, the data to be processed includes a face image, the service processing includes face verification service processing, the first processing result includes a first face verification result, and the second processing result includes a second face verification result.
21. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 10.
22. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the method of any one of claims 1 to 10.
23. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 10.
Citation Information
Patent Citations
Fusion processing method, device and system for server cluster
CN110460639A
Living body detection method and device and computer device
CN110569808A
Service interface monitoring method and device, electronic equipment and storage medium
CN111324520A