Anomaly detection method and related device

By obtaining a set of key parameters of API messages for comprehensive detection, the problem of insufficient anomaly detection of API messages in the existing technology is solved, and network security is improved.

WO2024199174A1PCT designated stage expired Publication Date: 2024-10-03HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/083522
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-03-25
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

Existing technologies are difficult to effectively detect anomalies in API messages, resulting in insufficient network security. Especially when multi-parameter business logic is complex, single-dimensional parameter detection cannot comprehensively and accurately identify attack behaviors.

Method used

By obtaining the key parameter set of the API message, comprehensive detection is performed based on the values ​​of these parameters, and the abnormal detection results are determined using parameter configuration templates or trained detection models to ensure the accuracy and comprehensiveness of the detection results.

Benefits of technology

It achieves comprehensive and accurate anomaly detection of API messages, improves network security, avoids the limitations of single-dimensional parameter detection, and can detect attack behaviors without understanding the business logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083522_03102024_PF_FP_ABST
    Figure CN2024083522_03102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of network security, and discloses an anomaly detection method and a related device. A computer device obtains a first key parameter set on the basis of a first API mode of a first API packet, obtains first detection information of the first API packet on the basis of the first key parameter set, and determines an anomaly detection result of the first API packet on the basis of the first API mode and the first detection information. The first key parameter set comprises a plurality of key parameters, and the first detection information comprises a value of each key parameter in the first key parameter set in the first API packet. In this way, a first key parameter set in a first API mode corresponding to a first API packet to be detected is first determined, so that accurate and comprehensive anomaly detection of the API packet is implemented by determining whether a value of each key parameter in the first key parameter set in the first API packet conforms to an expected service logic of the first API packet.
Need to check novelty before this filing date? Find Prior Art

Description

Anomaly detection method and related equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 29, 2023, with application number 202310335740.X and invention name “A Method for Anomaly Detection and Related Equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of network security technology, and in particular to an anomaly detection method and related equipment. Background Art

[0003] With the continuous development of the Internet, more and more companies are providing services to the outside world through open Application Programming Interfaces (APIs). In order to ensure the normal provision of services, it is necessary to perform security testing on the service APIs.

[0004] Summary of the Invention

[0005] Based on this, the present application provides an anomaly detection method and related equipment, which can detect anomalies in API messages, thereby improving network security.

[0006] In the first aspect, the present application provides an anomaly detection method. The method can be performed by a computer device. The computer device, such as a gateway (such as an API gateway), a controller, a firewall, a probe, etc., can collect and parse API messages. The computer device obtains a first key parameter set based on a first API mode of a first API message, obtains first detection information of the first API message based on the first key parameter set, and determines the anomaly detection result of the first API message based on the first API mode and the first detection information. The first key parameter set includes multiple key parameters, and the first detection information includes the value of each key parameter in the first key parameter set in the first API message.

[0007] This solution obtains a set of key parameters based on the API message's API mode and detects API messages based on the value of each key parameter in the key parameter set. This allows for anomaly detection in API messages, improving network security. Furthermore, anomaly detection based on multiple key parameters avoids the problem of single-dimensional parameters failing to reflect business logic, resulting in more comprehensive and accurate anomaly detection results.

[0008] In one possible implementation, a computer device obtains the first key parameter set based on the first API mode and an API key parameter library, where the API key parameter library includes at least one API mode and a key parameter set corresponding to each API mode in the at least one API mode. Thus, maintaining the key parameter set corresponding to each API mode through the API key parameter library facilitates the anomaly detection method provided in this application.

[0009] As an example, the key parameter sets corresponding to each API mode maintained on the computer device can be obtained based on configuration by a staff member, such as an operations and maintenance personnel familiar with API services. For any of the at least one API mode, the method can further include: obtaining the key parameter set corresponding to the any API mode. This eliminates the need for the computer device to calculate and determine the key parameter set for each API mode, reducing the storage, processing, and other resources required for anomaly detection.

[0010] As another example, the key parameter set corresponding to each API mode maintained on the computer device can be determined based on the candidate key parameter set calculated by the analysis platform or computer device. For any API mode in the at least one API mode, the method may also include: obtaining multiple second API messages corresponding to the any API mode; determining the candidate key parameter set corresponding to the any API mode based on the values ​​of multiple parameters of each second API message in the multiple second API messages, the uncertainty of the candidate key parameters in the candidate key parameter set meets the first preset condition; and determining the key parameter set corresponding to the any API mode based on the candidate key parameter set. In this way, by analyzing the API messages of each API mode by the analysis platform or computer device, the key parameter set corresponding to the API mode is determined, and the determined key parameter set is more reasonable, making accurate anomaly detection of API messages possible.

[0011] In one possible implementation, the candidate key parameter set corresponding to any one of the API modes is determined based on the values ​​of multiple parameters of each second API message in the multiple second API messages. For example, this may include: obtaining the values ​​of multiple parameters of each second API message; for any one of the multiple parameters, based on the value of any one of the parameters in the multiple second API messages, determining the first value of any one of the parameters, the first value being used to indicate the uncertainty (also understood as a probability distribution) corresponding to the value of any one of the parameters, and the candidate key parameter set corresponding to any one of the API modes includes the parameters whose first value among the multiple parameters satisfies the first preset condition. The first value may be, for example, information entropy and / or the Gini coefficient. The first preset condition may be, for example, a critical condition for defining the uncertainty of a parameter determined based on experience or preset rules.

[0012] In one possible implementation, for determining the key parameter set corresponding to any API mode based on the candidate key parameter set, in one case, the candidate key parameter set can be directly determined as the corresponding key parameter set; in another case, for greater flexibility, the candidate key parameters in the candidate key parameter set can also be presented to the staff, and the staff obtains the corresponding key parameter set by confirming the candidate key parameters; in yet another case, the key parameter set corresponding to any API mode can also be determined based on the detection model corresponding to any API mode and the values ​​of the key parameters in the candidate key parameter set in each second API message.

[0013] As an example, determining the key parameter set corresponding to any API mode based on the detection model and the values ​​of the key parameters in the candidate key parameter set in each second API message may include, for example: obtaining multiple first training samples, each first training sample in the multiple first training samples includes the values ​​of the key parameters in the candidate key parameter set in any second API message; obtaining the detection difference corresponding to any API mode based on the first training sample corresponding to the any API mode in the multiple first training samples and the detection model corresponding to the any API mode; if the detection difference meets the baseline value of the detection model corresponding to the any API mode, then determining that the candidate key parameter corresponding to the any API mode is the key parameter in the key parameter set corresponding to the any API mode; if the detection difference does not meet the target difference of the detection model, then updating the candidate parameter set corresponding to the any API mode, and returning to execute the steps of obtaining multiple first training samples and subsequent steps.

[0014] In one possible implementation, determining the anomaly detection result of the first API message based on the first API mode and the first detection information may, for example, include: obtaining a parameter configuration template corresponding to the first API mode, the parameter configuration template including a correspondence between any key parameter in the first key parameter set and a baseline value range for the any key parameter; and determining the anomaly detection result of the first API message based on the first detection information and the parameter configuration template. In this way, accurate API message anomaly detection can be achieved through the preset parameter configuration mode.

[0015] As an example, if an anomaly detection result is found to be erroneous, for example, if a staff member checks the anomaly detection result displayed on the interface and finds that the first API message is actually normal but the anomaly detection result indicates that the first API message is abnormal, or if the staff member finds that the first API message is actually abnormal but the anomaly detection result indicates that the first API message is normal, then the method may further include: updating the parameter configuration template corresponding to the first API mode. In this way, by checking whether the anomaly detection result is erroneous and updating the corresponding parameter configuration template when an anomaly detection result is found to be erroneous, the accuracy of anomaly detection is further improved.

[0016] In another possible implementation, determining the anomaly detection result of the first API message based on the first API pattern and the first detection information may include, for example, obtaining a first detection model corresponding to the first API pattern; inputting the first detection information into the first detection model; and determining the anomaly detection result of the first API message based on an output of the first detection model. In this way, accurate API message anomaly detection can be achieved using a trained detection model.

[0017] As an example, if it is found that the anomaly detection result is erroneous, then the method may further include: updating the first detection model corresponding to the first API mode. For example, the updating of the first detection model may include: updating the key parameter set corresponding to the first API mode to a second key parameter set based on the error in the anomaly detection result; obtaining multiple second training samples, the multiple second training samples including the values ​​of the key parameters in the second key parameter set in any third API message, the third API message being the message corresponding to the first API mode in the second training sample; and training the first detection model based on the second training sample corresponding to the first API model in the multiple second training samples. In this way, by checking whether there is an error in the anomaly detection result and updating the corresponding detection model when an error in the anomaly detection result is found, the accuracy of anomaly detection is further improved.

[0018] In the second aspect, the present application also provides an anomaly detection method. The method can be executed by an analysis platform, for example. The analysis platform can be a cloud-based big data platform, a cloud-based artificial intelligence (AI) training platform, an analyzer, or other platform that includes a deep learning training framework. The analysis platform obtains multiple first training samples, and trains a preset detection model based on the multiple first training samples to determine the first detection model corresponding to the first API mode. Each of the multiple first training samples includes the value of a key parameter in a first key parameter set corresponding to the first API mode in a first API message belonging to the first API mode, the first key parameter set includes multiple key parameters, and the first detection model is used to perform anomaly detection on the API message belonging to the first API mode.

[0019] In this solution, by pre-learning the multi-dimensional association of the parameters of the API messages under each API mode, the key parameter set of the API messages under each API mode is determined, and based on multiple training samples of each API mode and the key set of the corresponding API mode, a detection model of the corresponding API mode is trained, making it possible to accurately detect anomalies in the first API message to be detected. When performing anomaly detection on the first API message to be detected, the first key parameter set under the first API mode corresponding to the first API message can be quickly determined, so that the values ​​of each key parameter in the first key parameter set in the first API message are input into the trained first detection model, and the anomaly detection result of the first API message is determined based on the output result of the first detection model, thereby achieving accurate and comprehensive anomaly detection of the API message and improving the security of the network.

[0020] In a possible implementation, the above description is made by taking the training of the detection model of the first API mode as an example, and the training of the detection modes of other API modes is similar. The training process of the detection model of the second API mode may include, for example: obtaining a plurality of second training samples, each of the plurality of second training samples including the values ​​of the key parameters in the second key parameter set corresponding to the second API mode in the API message belonging to the second API mode; training the preset detection model based on the plurality of second training samples, obtaining the second detection model corresponding to the second API mode, and the second detection model is used to perform anomaly detection on the API message belonging to the second API mode. In this way, the method provided in the present application can be used to train the detection model of each API mode, obtain a detection model capable of performing anomaly detection on each API mode, and prepare for the anomaly detection provided in the present application.

[0021] In a possible implementation, the method may further include: obtaining a plurality of first verification samples, each of the plurality of first verification samples including the value of a key parameter in a first key parameter set corresponding to the first API mode in a second API message belonging to the first API mode; determining a first baseline value of the first detection model based on the plurality of first verification samples and the first detection model, wherein the probability that the difference between the output result of each first verification sample in the plurality of first verification samples after the first detection model and the corresponding first verification sample is less than or equal to the first baseline value satisfies a first preset condition, and the first baseline value is used to cooperate with the first detection model to perform anomaly detection on the API message belonging to the first API mode. The first preset condition may be, for example, that the probability is greater than or equal to a preset value (such as 95%). In this way, by training the detection model with the training samples and then determining the baseline value of the detection model based on the verification samples, preparations are made for the subsequent configuration of the detection model to determine the anomaly detection results of the API message.

[0022] In a possible implementation, the method may further include: obtaining a plurality of first test samples, each of the plurality of first test samples including the value of a key parameter in a first key parameter set corresponding to the first API mode in a third API message belonging to the first API mode; testing the first detection model based on the plurality of first test samples to determine a test result of the first detection model, and if the probability that the difference between the output result of each first test sample in the plurality of first test samples after the first detection model and the corresponding first test sample is less than or equal to the first baseline value satisfies the first preset condition, then the test result indicates that the first detection model is qualified. In this way, by testing the detection model trained with the training samples to determine whether the detection model is qualified, a qualified detection model can be recommended to a computer device for anomaly detection, and further training or model optimization can be performed on an unqualified detection model, so that the quality of the inspection model for user anomaly detection on the computer device is guaranteed.

[0023] In one possible implementation, the method may further include: obtaining a fourth API message belonging to the first API mode; determining an abnormality detection result of the fourth API message based on the first detection model, the first baseline value, and the values ​​of the key parameters in the first key parameter set in the fourth API message. As an example, the method may further include: in response to determining that the abnormality detection result of the fourth API message is erroneous, updating the multiple first training samples and / or the first key parameter set, and retraining the first detection model. For relevant instructions on this implementation, please refer to the corresponding description of the first aspect.

[0024] In a possible implementation, the method may further include: obtaining the first key parameter set corresponding to the first API mode.

[0025] In another possible implementation, the method may further include: obtaining multiple fifth API messages corresponding to the first API mode; determining a set of candidate key parameters corresponding to the first API mode based on the values ​​of multiple parameters of each fifth API message in the multiple fifth API messages, the uncertainty of the candidate key parameters in the candidate key parameter set meeting the second preset condition; and determining the first key parameter set corresponding to the first API mode based on the candidate key parameter set.

[0026] As an example, determining the set of candidate key parameters corresponding to the first API mode based on the values ​​of multiple parameters of each fifth API message in the multiple fifth API messages may include: obtaining the values ​​of multiple parameters of each fifth API message; for any parameter among the multiple parameters, determining the first value of any parameter based on the value of any parameter in the multiple fifth API messages, the first value is used to indicate the uncertainty corresponding to the value of any parameter, and the set of candidate key parameters corresponding to any API mode includes the parameters among the multiple parameters whose first values ​​meet the second preset condition.

[0027] As another example, the key parameter set corresponding to any API mode is determined based on the candidate key parameter set. In one case, the candidate key parameter set can be directly determined as the corresponding key parameter set; in another case, in order to be more flexible, the candidate key parameters in the candidate key parameter set can also be presented to the staff, and the staff obtains the corresponding key parameter set by confirming the candidate key parameters; in yet another case, the key parameter set corresponding to any API mode can also be determined based on the detection model corresponding to any API mode and the values ​​of the key parameters in the candidate key parameter set in each second API message. Among them, the determining of the key parameter set corresponding to any API mode based on the detection model and the values ​​of the key parameters in the candidate key parameter set in each fifth API message may include, for example: obtaining multiple first training samples, each first training sample in the multiple first training samples includes the values ​​of the key parameters in the candidate key parameter set in any fifth API message; obtaining the detection difference corresponding to any API mode based on the first training sample corresponding to the any API mode in the multiple first training samples and the detection model corresponding to the any API mode; if the detection difference meets the baseline value of the detection model corresponding to the any API mode, then determining that the candidate key parameter corresponding to the any API mode is the key parameter in the key parameter set corresponding to the any API mode; if the detection difference does not meet the target difference of the detection model, then updating the candidate parameter set corresponding to the any API mode, and returning to execute the steps of obtaining multiple first training samples and subsequent steps.

[0028] In a third aspect, the present application also provides an anomaly detection device, which may include: an acquisition unit and a determination unit. The acquisition unit is used to acquire a first key parameter set based on a first API mode of a first application program interface (API) message, wherein the first key parameter set includes multiple key parameters; the acquisition unit is also used to acquire first detection information of the first API message based on the first key parameter set, wherein the first detection information includes the value of each key parameter in the first key parameter set in the first API message; the determination unit is used to determine an anomaly detection result of the first API message based on the first API mode and the first detection information.

[0029] In one possible implementation, the acquisition unit is specifically used to acquire the first key parameter set based on the first API mode and the API key parameter library, where the API key parameter library includes at least one API mode and a key parameter set corresponding to each API mode in the at least one API mode.

[0030] As an example, the acquisition unit is further configured to acquire, for any API mode among the at least one API mode, a set of key parameters corresponding to the any API mode.

[0031] As another example, for any API mode in the at least one API mode, the acquisition unit is further configured to acquire multiple second API messages corresponding to the any API mode. The determination unit is further configured to determine a set of candidate key parameters corresponding to the any API mode based on the values ​​of multiple parameters of each second API message in the multiple second API messages, wherein the uncertainty of the candidate key parameters in the set of candidate key parameters meets a first preset condition; and determine a set of key parameters corresponding to the any API mode based on the set of candidate key parameters.

[0032] For example, the determination unit is specifically used to: obtain the values ​​of multiple parameters of each second API message; for any parameter among the multiple parameters, based on the value of the any parameter in the multiple second API messages, determine the first value of the any parameter, the first value is used to indicate the uncertainty corresponding to the value of the any parameter, and the candidate key parameter set corresponding to the any API mode includes the parameters whose first value among the multiple parameters meets the first preset condition.

[0033] For example, the determination unit is specifically used to: determine the key parameter set corresponding to any one of the API modes based on the detection model and the values ​​of the key parameters in the candidate key parameter set in each second API message. The determination unit is specifically used to: obtain a plurality of first training samples, each of the plurality of first training samples including the values ​​of the key parameters in the candidate key parameter set in any second API message; obtain the detection difference corresponding to any one of the API modes based on the first training sample corresponding to the any one of the plurality of first training samples and the detection model corresponding to the any one of the API modes; if the detection difference meets the baseline value of the detection model corresponding to the any one of the API modes, then determine that the candidate key parameter corresponding to the any one of the API modes is the key parameter in the key parameter set corresponding to the any one of the API modes.

[0034] In one possible implementation, the determination unit is specifically used to: obtain a parameter configuration template corresponding to the first API mode, the parameter configuration template including a correspondence between any key parameter in the first key parameter set and a benchmark value range of any key parameter; and determine an abnormality detection result of the first API message based on the first detection information and the parameter configuration template.

[0035] As an example, the device further includes an updating unit, and the updating unit is configured to update the parameter configuration template corresponding to the first API mode if an error occurs in the abnormality detection result.

[0036] In one possible implementation, the determination unit is specifically used to: obtain a first detection model corresponding to the first API mode; input the first detection information into the first detection model, and determine the abnormality detection result of the first API message based on the output result of the first detection model.

[0037] As an example, the device further includes an updating unit, and the updating unit is configured to update the first detection model if an error occurs in the abnormality detection result.

[0038] For example, the updating unit is specifically used to: update the key parameter set corresponding to the first API mode to a second key parameter set based on the error of the abnormal detection result; obtain multiple second training samples, the multiple second training samples include the values ​​of the key parameters in the second key parameter set in any third API message, and the third API message is the message in the second training sample corresponding to the first API mode; train the first detection model based on the second training sample corresponding to the first API model in the multiple second training samples.

[0039] The device provided in the third aspect corresponds to the method provided in the first aspect. For the specific implementation method and technical effects achieved, please refer to the relevant description of the first aspect.

[0040] In a fourth aspect, the present application also provides an anomaly detection device, which may include: an acquisition unit and a determination unit. The acquisition unit is used to acquire multiple first training samples, each of the multiple first training samples includes the value of a key parameter in a first key parameter set corresponding to a first API mode in a first API message belonging to the first API mode, and the first key parameter set includes multiple key parameters; the determination unit is used to train a preset detection model based on the multiple first training samples, determine a first detection model corresponding to the first API mode, and the first detection model is used to perform anomaly detection on the API message belonging to the first API mode.

[0041] In one possible implementation, the acquisition unit is further used to acquire multiple first verification samples, each of the first verification samples including the value of the key parameter in the first key parameter set corresponding to the first API mode in the second API message belonging to the first API mode; the determination unit is further used to determine the first baseline value of the first detection model based on the multiple first verification samples and the first detection model, and the probability that the difference between the output result of each first verification sample in the multiple first verification samples after the first detection model and the corresponding first verification sample is less than or equal to the first baseline value satisfies a first preset condition, and the first baseline value is used to cooperate with the first detection model to perform anomaly detection on the API message belonging to the first API mode.

[0042] In one possible implementation, the acquisition unit is further used to acquire multiple first test samples, each of the multiple first test samples including the values ​​of key parameters in the first key parameter set corresponding to the first API mode in the third API message belonging to the first API mode; the determination unit is further used to test the first detection model based on the multiple first test samples to determine the test results of the first detection model. If the probability that the difference between the output result of each first test sample in the multiple first test samples after the first detection model and the corresponding first test sample is less than or equal to the first baseline value meets the first preset condition, then the test result indicates that the first detection model is qualified.

[0043] In one possible implementation, the acquisition unit is also used to acquire a fourth API message belonging to the first API mode; the determination unit is also used to determine the abnormality detection result of the fourth API message based on the first detection model, the first baseline value and the values ​​of the key parameters in the first key parameter set in the fourth API message.

[0044] In one possible implementation, the device may further include an updating unit, which is used to update the multiple first training samples and / or the first key parameter set and retrain the first detection model in response to determining that the abnormality detection result of the fourth API message is erroneous.

[0045] In a possible implementation, the acquisition unit is further configured to acquire the first key parameter set corresponding to the first API mode.

[0046] In one possible implementation, the acquisition unit is further used to acquire multiple fifth API messages corresponding to the first API mode; the determination unit is further used to determine the candidate key parameter set corresponding to the first API mode based on the values ​​of multiple parameters of each fifth API message in the multiple fifth API messages, and the uncertainty of the candidate key parameters in the candidate key parameter set meets the second preset condition; the determination unit is also used to determine the first key parameter set corresponding to the first API mode based on the candidate key parameter set.

[0047] As an example, when the determination unit executes the determination of the candidate key parameter set corresponding to the first API mode based on the values ​​of multiple parameters of each fifth API message in the multiple fifth API messages, the determination unit is specifically used to: obtain the values ​​of multiple parameters of each fifth API message; for any parameter among the multiple parameters, based on the value of any parameter in the multiple fifth API messages, determine the first value of any parameter, the first value is used to indicate the uncertainty of the value corresponding to any parameter, and the candidate key parameter set corresponding to any API mode includes the parameters among the multiple parameters whose first value satisfies the second preset condition.

[0048] The device provided in the fourth aspect corresponds to the method provided in the second aspect. For the specific implementation method and technical effects achieved, please refer to the relevant description of the second aspect.

[0049] In the above solution, the detection model may include, for example, an unsupervised autoencoder or a deep support vector data description (Deep-SVDD) model.

[0050] In a fifth aspect, the present application further provides a computer device. The computer device includes a processor and a memory. The processor is configured to execute instructions stored in the memory to cause the computer device to perform the method provided by the first aspect or any possible implementation of the first aspect, or the method provided by the second aspect or any possible implementation of the second aspect.

[0051] In a sixth aspect, the present application further provides a computer-readable storage medium. The storage medium stores instructions that, when executed on a processor, execute the method provided by the first aspect or any possible implementation of the first aspect, or the method provided by the second aspect or any possible implementation of the second aspect. The storage medium may, for example, be a computer-readable storage medium.

[0052] In a seventh aspect, the present application provides a program product that, when executed on a processor, performs the method provided by the first aspect or any possible implementation of the first aspect, or the method provided by the second aspect or any possible implementation of the second aspect. The program product may be, for example, a computer program product. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] FIG1 is a schematic diagram of an architecture structure of an applicable network scenario provided in an embodiment of the present application;

[0054] FIG2 is a flow chart of an anomaly detection method 100 provided in an embodiment of the present application;

[0055] FIG3 is a flow chart of another anomaly detection method 200 provided in an embodiment of the present application;

[0056] FIG4 is a schematic diagram of an unsupervised autoencoder provided in an embodiment of the present application;

[0057] FIG5 is a schematic diagram of a Deep-SVDD model provided in an embodiment of the present application;

[0058] FIG6 is a schematic structural diagram of an anomaly detection device 600 provided in an embodiment of the present application;

[0059] FIG7 is a schematic structural diagram of a communication device 700 provided in an embodiment of the present application;

[0060] FIG8 is a schematic structural diagram of another communication device 800 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0061] With the continuous development of the internet, users are increasingly providing services through open APIs. While this convenience comes at the expense of API security, it also poses an unavoidable challenge with the development of API technology. An API request or response message is called an API message. API messages typically contain multiple parameters. Attackers can attack API messages by modifying one or more parameters within an API message, threatening API security. To mitigate the risks associated with parameter tampering within API messages, API message parameter detection is necessary. However, due to the complexity and diversity of real-world services, the types of parameters within API messages are diverse and constantly changing. Furthermore, the legal value ranges for these parameters vary flexibly. Only personnel with a deep understanding of business logic can understand the true meaning and legal value range of each parameter, making API message parameter detection challenging. If only a single parameter value within an API message is checked for anomalies, some attacks may be missed, resulting in incomplete and inaccurate API anomaly detection. For example, for a user who has activated membership (also known as VIP) rights for Application A, if the user needs to renew the membership of Application A, then the parameters of the user's API message for requesting renewal of the membership rights for Application A may at least include: whether the user is a member and whether there is a coupon for 10 yuan off. The rules for using the coupon for 10 yuan off are: if the values ​​of the above two parameters are both "yes", that is, the user is both a member and has a coupon for 10 yuan off, then the user can use the coupon for 10 yuan off when renewing the membership of Application A. Otherwise, the coupon for 10 yuan off is not available when the user needs to become a member of Application A. Without knowing the usage rules of the 10 yuan discount coupon, the attacker may maliciously modify the value of the parameter "whether there is a 10 yuan discount coupon" in the API message used to request renewal of the membership rights of Application A to "yes". In this case, the API message is detected using a single-dimensional parameter detection method. The values ​​of the single-dimensional parameters "whether there is a 10 yuan discount coupon" or "whether the user is a member" in the modified API message are both normal, and the attack cannot be detected. The attacker, who is not a member, has successfully used the 10 yuan discount coupon to activate membership of Application A.

[0062] Based on this, an embodiment of the present application provides an anomaly detection method. A device having the anomaly detection function provided by an embodiment of the present application, when obtaining a first API message to be detected, first obtains a first key parameter set based on the first API mode corresponding to the first API message, and the first key parameter set includes multiple key parameters; then, obtains first detection information of the first API message based on the first key parameter set, and the first detection information includes the value of each key parameter in the first key parameter set in the first API message; then, based on the first API mode and the first detection information, determines the anomaly detection result of the first API message. It can be seen that this scheme obtains a key parameter set based on the API mode of the API message, and detects the API message based on the value of each key parameter in the key parameter set in the API message, thereby realizing anomaly detection of the API message and providing network security. Furthermore, performing anomaly detection on the API message based on multiple key parameters can avoid the problem that a single-dimensional parameter cannot reflect the business logic, making the anomaly detection result more comprehensive and accurate.

[0063] Still taking the API message of the user renewing the membership of application A as an example, the key parameter set of the API mode corresponding to the API message in the embodiment of the present application may include two key parameters: "Is it a member" and "Is there a coupon for 10 yuan off", and the normal combinations of the values ​​of the above two key parameters include: combination 1 (yes, yes), combination 2 (no, no) and combination 3 (yes, no). Without knowing the usage rules of the 10 yuan off coupon, the attacker maliciously modifies the value of the parameter "Is there a coupon for 10 yuan off" in the parameters of the API message used to request renewal of the membership rights of application A to "yes". The values ​​of "Is it a member" and "Is there a coupon for 10 yuan off" in the API message are "no" and "yes" respectively. Then, the method provided in the embodiment of the present application is used to perform anomaly detection on the API message, and it is determined that the values ​​of each key parameter in the key parameter set of the API message do not match the normal combination of key parameter values, thereby determining that the API message is abnormal. It can be seen that the anomaly detection method provided in the embodiment of the present application takes into account multiple key parameters in the API message that have a correlation relationship in business logic, and matches the values ​​of multiple key parameters in the API message with the normal combination of the corresponding multiple key parameter values ​​under the expected business logic. It can comprehensively and accurately detect attacks, and cannot implement attacking behaviors when the attacking user does not understand the business logic. For example, only changing the value of "Is there a coupon for 10 yuan off" to "Yes" cannot successfully use the coupon for 10 yuan off to activate membership of application A.

[0064] The following is an illustrative description of a possible architecture of a network scenario to which the method provided in the embodiment of the present application is applicable. Referring to Figure 1, the network scenario may include: a device 100 and an analysis platform 200, wherein the device 100 may be a device capable of collecting and parsing API messages, and the device 100 may be, for example, a gateway (such as an API gateway), a controller, a firewall, a probe, etc.; the analysis platform 200 may be a platform including a deep learning training framework, and the analysis platform 200 may include any one or more of an analysis device, a management device, or a control device, and the analysis platform 200 may be, for example, a cloud-based big data platform, a cloud-based artificial intelligence (AI) training platform, an analyzer, etc.

[0065] With reference to FIG1 , the overall implementation process of the embodiment of the present application is described below: Before the device 100 performs anomaly detection on the API message to be detected, on the one hand, the device 100 can obtain a set of key parameters corresponding to each API mode from the analysis platform 200, and the device 100 can store the obtained set of key parameters corresponding to each API mode in the API key parameter library 110; on the other hand, the device 100 can also obtain a parameter configuration template or detection model corresponding to each API mode from the analysis platform 200, and the device 100 can store the obtained parameter configuration template or detection model corresponding to each API mode in the anomaly detection module 120. In addition, the device 100 can also include a parsing module 130 for parsing the collected original API message or the flow log of the original API message to obtain the "API message" mentioned herein. It should be noted that the API message in the embodiment of the present application can refer to the original API message or the flow log of the original API message received or generated by the device 100, or it can also refer to the information obtained after parsing the "original API message" and other processing, as shown in Table 1 below.

[0066] The anomaly detection process of the device 100 for the API message 1 to be detected may include: S11, determining the key parameter set 1 corresponding to the API mode 1 to which the API message 1 belongs from the API key parameter library 110; S12, obtaining the values ​​of each key parameter in the key parameter set 1 from the API message 1, recorded as the detection information 1 corresponding to the API message 1; S13, determining the parameter configuration template 1 or detection model 1 corresponding to the API mode 1 to which the API message 1 belongs from the anomaly detection module 120. It should be noted that the execution order of S13 and S11-S12 is not limited in this embodiment of the application. If the parameter configuration template 1 is determined in S13, then after the above steps, the following may be included: S14, determining whether the detection information 1 matches the parameter configuration template 1, and determining the anomaly detection result 1 of the API message 1 based on the matching result. If the detection model 1 is determined in S13, then after the above steps, the following may be included: S14, inputting the detection information 1 into the detection model 1, and determining the anomaly detection result 1 of the API message 1 based on the output of the detection model 1. For relevant descriptions of the parameter configuration template and the detection model, please refer to the corresponding description in the following embodiments.

[0067] The analysis platform 200 may include, for example, a key parameter determination module 210 and a training module 220. For a description of the functions and acquisition methods of each component of the analysis platform 200, please refer to the following description.

[0068] As a first example, the key parameter sets corresponding to each API mode sent by the analysis platform 200 to the device 100 can be obtained by the analysis platform 200 from configuration information. The configuration information can be entered by a staff member on the configuration interface 300 connected to the analysis platform 200. The staff member can be, for example, an operation and maintenance personnel familiar with the API business. As a second example, the key parameter sets corresponding to each API mode can also be obtained by the analysis platform 200 from the key parameter determination module 210. In one embodiment of the second example, the key parameter determination module 210 can directly calculate the key parameter sets corresponding to each API mode based on the values ​​of the parameters in the multiple training API messages corresponding to each API mode. In another embodiment of the second example, the key parameter determination module 210 calculates the candidate key parameter sets corresponding to each API mode based on the values ​​of the parameters in the multiple training API messages corresponding to each API mode. Then, the candidate key parameter sets corresponding to each API mode are displayed on the configuration interface 300. The staff member confirms the key parameter sets corresponding to each API mode based on the candidate key parameter sets of each API mode on the configuration interface 300. Thus, the key parameter determination module 210 obtains the key parameter sets corresponding to each API mode that are finally confirmed by the staff member from the configuration interface 300. In another case of the second example, the key parameter determination module 210 calculates the candidate key parameter set corresponding to each API mode based on the parameter values ​​in the multiple training API messages corresponding to each API mode, and then inputs the value of each candidate key parameter in the candidate key parameter set of the training API message corresponding to each API mode into the trained detection model corresponding to the API mode. Thus, the key parameter determination module 210 determines whether the selection of the candidate key parameter set of each API mode is reasonable based on the output result of the detection model corresponding to each API mode. If the selection of the candidate key parameter set of the API mode is determined to be reasonable based on the output result of the detection model corresponding to a certain API mode, then the candidate key parameter set of the API mode is recorded as the key parameter set corresponding to the API mode; if the selection of the candidate key parameter set of the API mode is determined to be unreasonable based on the output result of the detection model corresponding to a certain API mode, then the process is re-executed for the API mode until the key parameter set of the API mode is determined, wherein, when the process is re-executed, the multiple training API messages corresponding to the API mode can be updated, or the calculation method of the candidate key parameter set corresponding to the API mode can also be updated. It should be noted that for the relevant description of the key parameter sets corresponding to each API mode, please refer to the corresponding description in the following embodiments.

[0069] The parameter configuration template or detection model corresponding to each API mode sent by the analysis platform 200 to the device 100, as a first example, can be obtained by the analysis platform 200 from the configuration information, and the configuration information can be entered by the staff on the configuration interface 300 connected to the analysis platform 200. The staff can be, for example, an operation and maintenance personnel familiar with the API business. As a second example, it can be obtained by the training module 220 in the analysis platform 200. In one case of the second example, the training module 220 can determine the parameter configuration template corresponding to each API mode based on the analysis of multiple training API messages for each API mode; in another case of the second example, the training module 220 can use the values ​​of each key parameter in the key parameter set corresponding to the API mode in the multiple training API messages corresponding to each API mode as training samples, train the initial model corresponding to the API mode, and obtain the detection model corresponding to the API mode. It should be noted that for the relevant description of the parameter configuration template or detection model corresponding to each API mode, please refer to the corresponding description in the following embodiments.

[0070] It should be noted that the network scenario shown in FIG1 above only uses the example of the separate deployment of the analysis platform 200 and the device 100 to illustrate the network scenario applicable to the embodiment of the present application. The key parameter determination module 210 and the training model 220, which require powerful processing capabilities, are implemented on the analysis platform 200, which alleviates the processing pressure of the device 100 to a certain extent. In other implementations, the analysis platform 200 can be integrated into the device 100 according to other actual needs, or some functions in the analysis platform 200 can be migrated to the device 100 for implementation, or some functions in the device 100 can be migrated to the analysis platform 200 for implementation. For example, in order to further alleviate the storage pressure of the device 100, the key parameter set corresponding to the API model to which the API message belongs can be loaded from the analysis platform 200 when the API message to be detected is determined, as well as the parameter configuration template or detection model corresponding to the API model to which the API message belongs.

[0071] The method provided in the embodiments of the present application is described below with reference to the accompanying drawings.

[0072] Figure 2 is a flow chart illustrating an anomaly detection method 100 provided in an embodiment of the present application. The execution entity of method 100 is not described below. This execution entity may be any device capable of performing the functions of method 100 provided in an embodiment of the present application, such as device 100 shown in Figure 1 . As shown in Figure 2 , method 100 may include, for example, steps S101 through S103 described below.

[0073] S101 : Acquire a first key parameter set based on a first API mode of a first API message, where the first key parameter set includes multiple key parameters.

[0074] The first API message is an API message to be detected. Based on different protocol types, the protocol type corresponding to the first API message may include: Hypertext Transfer Protocol (HTTP) or File Transfer Protocol (FTP). The following description takes the API message as an HTTP message as an example.

[0075] As an example, before S101, the method 100 may also include: filtering Internet traffic and collecting original API messages by configuring the Internet address (Internet Protocol, IP), port and protocol type of the API server; parsing each original API message and extracting relevant fields including the Uniform Resource Locator (URL) and the request body, and mining all parameters of the original API message and the values ​​of each parameter. Since the anomaly detection in the embodiment of the present application focuses on the parameters related to the business logic in the API message, parsing the original API message, for example, can be parsing the application layer content of the original API message. The application layer content of the original API message may include: URL field and body part. Among them, the URL field may include: protocol (scheme), host (host), path (path) and query (query). The content of scheme indicates the protocol used by the original API message, the contents of host and path indicate the API pattern (API pattern) corresponding to the original API message, and the content of query indicates some parameters of the API message and the values ​​of the parameters. For example, query may include the following parameters: user serial number (userNo), page size (PageSize), count (Count) and username (username); the body part may include the following parameters: user login identifier (id), whether it is an administrator (Is_admin), role (role), user type (User_type) and performed action (ops).

[0076] For example, assuming that the original API message corresponding to the first API message can be expressed as:

[0077] API URL: http: / / www.test.com / login / index.html? userNo=aa&PageSize=10&Count=1000&username=bb

[0078] API body: {"id":"5deb09097","Is_admin":True,"role":"client","User_type":0,"ops":delete}

[0079] For the original API message, the scheme is http, the host corresponds to www.test.com, the path corresponds to login / index.html, and the query is userNo=aa&PageSize=10&Count=1000&username=bb. Based on the parsing and field extraction of the original API message, the schema of the first API message and the parameters and parameter values ​​included in the first API message can be found in Table 1 below:

[0080] Table 1

[0081] It should be noted that since each API message contains different parameter types, it is necessary to extract the API pattern of the API message as the key to index the key parameter set, parameter configuration template, or detection model. Because the business functions of each API interface are different, the parameters contained in each API interface are also different. Using API patterns to represent different types of API interfaces makes it easier to distinguish the parameters contained in each API. For example, the API pattern can be composed of the host and path in the URL field.

[0082] In some implementations, before S101, the execution subject of the method 100 may maintain the key parameter set corresponding to each API mode to provide a data basis for the execution of S101. Among them, the way to maintain the key parameter set corresponding to each API mode may be an API key parameter library, that is, the key parameter set corresponding to each API mode is saved in the API key parameter library, and the key parameter set corresponding to each API mode includes at least two key parameters. Then, S101 may, for example, include: obtaining a first key parameter set that matches the first API mode from the API key parameter library. For example, the API key parameter library includes: API mode 1-key parameter set 1 {key parameter 11 and key parameter 12}, API mode 2-key parameter set 2 {key parameter 21, key parameter 22 and key parameter 23}, ..., API mode n-key parameter set n {key parameter n1, key parameter n2, ..., key parameter nm}, wherein n and m are both integers greater than 1. If the first API mode of the first API message in S101 corresponds to API mode 2, then the first key parameter set is key parameter set 2, and the multiple key parameters included in the first key parameter set are: key parameter 21, key parameter 22, and key parameter 23.

[0083] Methods for obtaining the key parameter set corresponding to each API mode maintained in the API key parameter library include but are not limited to the following possible implementation methods.

[0084] Method 1: Based on the key parameter sets corresponding to each API mode configured by a staff member, an API key parameter library is obtained, which includes the key parameter sets corresponding to each configured API mode. The staff member may be, for example, an operation and maintenance staff familiar with API business.

[0085] Method 2: The first step is to calculate the candidate key parameter sets corresponding to each API mode, and the second step is to determine the key parameter set corresponding to the API mode based on the candidate key parameter sets of each API mode.

[0086] Regarding the implementation of the first step of the second method, taking any API mode in each API mode as an example, it can include: S21, obtaining multiple second API messages corresponding to the any API mode; S22, determining a set of candidate key parameters corresponding to the any API mode based on the values ​​of multiple parameters of each second API message in the multiple second API messages, wherein the uncertainty of the candidate key parameters in the candidate key parameter set meets the first preset condition. Before S21, the collected multiple original API messages can be parsed and field extracted to obtain the second API messages corresponding to each original API message. The second API messages can be maintained in a parameter value sample library, for example, each second API message in the parameter value sample library corresponds to a piece of data in the form of Table 1, or each second API message in the parameter value sample library can also correspond to a piece of data in the form of Table 1 and the corresponding values ​​of the parameters. The parameters reflected in the parameter value sample library can be extracted according to requirements. The parameters of all parameters are more relevant (e.g., more closely related to the business) are extracted. Then, S21 can include: for the multiple second API messages in the parameter value sample library, the multiple second API messages belonging to the same API mode are divided into a group. Taking the arbitrary API mode in S21 as www.test.com / login / index.html as an example, the plurality of second API messages corresponding to the arbitrary API mode may be as shown in Table 2 below:

[0087] Table 2

[0088] S22 may, for example, include: extracting values ​​of multiple parameters from each second API message; and calculating, for any of the multiple parameters, a first value of the parameter based on the values ​​of the parameter in the multiple second API messages, where the first value indicates the uncertainty of the value of the parameter. The set of candidate key parameters corresponding to the API mode includes the parameters whose first values ​​satisfy the first preset condition. The uncertainty of a parameter can be understood as the probability distribution of the parameter's value, or the stability of the parameter's value. The first value may, for example, include at least one of the following: information entropy or a Gini coefficient. It is understood that among the parameters in an API message, some parameters have relatively random values, such as session identifiers and temporary usernames, which may be randomly encoded and populated, and thus have weak statistical significance in analysis. Conversely, some parameters have relatively fixed values, such as the number of returned pages and the amount of page data, which have relatively regular values ​​and thus have strong statistical significance in analysis. The strength of "analytical statistical significance" can be determined according to actual needs. For example, in an embodiment of the present application, it is necessary to select multiple parameters with relatively stable values ​​as a key parameter set. Therefore, the first preset condition can be the first value of the parameter that can identify the parameter value with a strong regularity and has analytical statistical significance. Parameters that meet the first preset condition can be considered to have strong analytical statistical significance or analytical statistical significance, while parameters that do not meet the first preset condition can be considered to have weak analytical statistical significance or no analytical statistical significance.

[0089] Taking the multiple second API messages corresponding to the API mode shown in Table 2 as an example, the implementation of S22 is exemplified. If the first value is information entropy, then the first values ​​of the five parameters userNo, PageSize, Count, username, and Is_admin in Table 2 can be calculated based on the following formula (1):

[0090] In formula (1), n ​​is the number of second API messages belonging to the API mode. For the API mode shown in Table 2, n=3; pi is the value of the parameter in the i-th second API message in the API mode. For example, when calculating the first value of Count based on formula (1), H Count=-(1000log21000+500log2500+1000log21000). It should be noted that the data type of the parameter value may include numeric type and character type. For parameters with character type values, mapping encoding can be used to convert the character type value into a numeric value. For example, the value False of Is_admin is mapped to 0 and True is mapped to 1. Information entropy is usually used to measure the uncertainty of a parameter value. The more random the parameter value, the greater the information entropy of the parameter. The first preset condition may be less than a first threshold. Then, the candidate key parameter set for determining the API mode may be: H calculated based on formula (1) userNo 、H PageSize 、H Count 、H username and H Is_admin Parameters smaller than the first threshold are recorded in the candidate key parameter set corresponding to the API mode. The first threshold can be set by the staff based on experience; alternatively, the first threshold can be determined according to a certain rule based on the information entropy of multiple parameters obtained by calculation. For example, the information entropy of the calculated parameters is arranged from small to large or from large to small, and the median of the rearranged information entropy is taken as the first threshold.

[0091] If the first value is the Gini coefficient, then the first values ​​of the five parameters userNo, PageSize, Count, username, and Is_admin in Table 2 can be calculated based on the following formula (2):

[0092] In formula (2), k is the number of second API messages belonging to the API mode. For the API mode shown in Table 2, k=3; pi is the value of the parameter in the i-th second API message in the API mode. For example, when calculating the first value of Count based on formula (2), G Count =1-(1000 2 +500 2 +1000 2 ). The Gini coefficient is usually used to measure the uncertainty of a parameter value. The more random the parameter value is, the larger the Gini coefficient of the parameter is. Therefore, it is necessary to select a parameter with a smaller Gini coefficient as a candidate key parameter. Then, the first preset condition can be less than the second threshold. Then, the candidate key parameter set for determining the API mode can be: G obtained by calculation based on formula (2) userNo , G PageSize , G Count , G username and G Is_adminParameters smaller than the second threshold are recorded in the candidate key parameter set corresponding to the API mode. The second threshold can be set by the staff based on experience; alternatively, the second threshold can be determined according to a certain rule based on the calculated Gini coefficients of multiple parameters. For example, the calculated Gini coefficients of the parameters are arranged from small to large or from large to small, and the median of the rearranged Gini coefficients is taken as the first threshold.

[0093] If the first value of the parameter includes the Gini coefficient of the parameter and the information entropy of the parameter, then the first preset condition may include: the information entropy in the first value is less than the third threshold and the Gini coefficient in the first value is less than the fourth threshold. When the information entropy of the parameter is less than the third threshold and the Gini coefficient of the parameter is less than the fourth threshold, the first value of the parameter is considered to meet the first preset condition.

[0094] If the first value of the parameter is calculated based on the Gini coefficient of the parameter and the information entropy of the parameter, for example, weights are preset for the information entropy and the Gini coefficient, and the Gini coefficient of the parameter and the information entropy of the parameter are weighted (or weighted averaged) to obtain the first value of the parameter, then the first preset condition may include: the first value is less than the fifth threshold.

[0095] It should be noted that the first threshold, the second threshold, the third threshold, the fourth threshold and the fifth threshold in the above-mentioned first preset condition may be the same or different and may be flexibly set based on the requirements of each solution.

[0096] It should be noted that the data type of the parameter value can include numeric type and character type. For parameters with character value, mapping encoding can be used to convert the character value into a numeric value. For example, the value False of Is_admin is mapped to 0 and True is mapped to 1, and then the first value of the parameter is calculated based on the above method.

[0097] For the implementation of the second step of the second method, after determining the candidate key parameter set corresponding to each API mode, as an example, the candidate key parameter set determined in the first step can be directly recorded as the key parameter set of the corresponding API mode. As another example, the candidate key parameter set determined in the first step can be displayed to the staff through an interface (such as the configuration interface 300 in Figure 1), and the staff can confirm the parameters of the candidate key parameter set according to the actual situation (for example, it can include selecting parameters in the candidate key parameter set, adding parameters to the candidate key parameter set, or deleting parameters from the candidate key parameter set). The staff's confirmation result of the candidate key parameter set is recorded as the key parameter set of the corresponding API mode. As another example, the candidate key parameter set of the API mode can also be verified based on the detection model corresponding to the API mode. If the verification passes, the candidate key parameter set corresponding to the API mode is used as the key parameter set of the API mode. If the verification fails, the first step of the second method and the process of implementing the second step of the second method in this example are re-executed until the verification passes. Alternatively, the candidate key parameter set can be manually adjusted based on the verification result, and the manual adjustment result of the candidate key parameter set is recorded as the key parameter set of the corresponding API mode.

[0098] Among them, verifying the candidate key parameter set of the API mode based on the detection model corresponding to the API mode can include: for any API mode, based on the detection model of any API mode and the values ​​of the key parameters in the candidate key parameter set corresponding to any API mode in each second API message of any API mode, determining the key parameter set corresponding to any API mode. For example, the process of verifying the candidate key parameter set based on the detection model and determining the key parameter set corresponding to the API mode may include: S31, obtaining multiple first training samples, each of the multiple first training samples including the value of the key parameter in the candidate key parameter set in any second API message; S32, obtaining the detection difference corresponding to the any API mode based on the first training sample corresponding to the any API mode in the multiple first training samples and the detection model corresponding to the any API mode; S33, if the detection difference meets the baseline value of the detection model corresponding to the any API mode, then determining that the candidate key parameter corresponding to the any API mode is the key parameter in the key parameter set corresponding to the any API mode; S34, if the detection difference does not meet the baseline value of the detection model corresponding to the any API mode, then updating the candidate key parameter set corresponding to the any API mode and returning to execute S31 to S34 until the key parameter set of each API mode is obtained. Wherein, the detection difference may refer to the difference between the input content and the output result of the detection model. For a detailed description of the detection difference, please refer to the relevant description in the embodiment shown in Figure 3 below.

[0099] It should be noted that after determining the key parameter set of a certain API mode, you can check in the API key parameter library whether a key parameter set corresponding to the API mode already exists. If so, use the latest determined key parameter set to determine the existing key parameter set to ensure that each API mode has only one more reasonable key parameter set corresponding to it.

[0100] It can be seen that through the above method, the key parameter set of each API mode can be obtained, so that preparations are made for the execution of S101 and subsequent steps.

[0101] Assuming that the first API mode is www.test.com / login / index.html, and the API key parameter library includes the records shown in Table 3 below, then the first key parameter set obtained based on S101 can be expressed as: {PageSize, Count, Is_admin}.

[0102] Table 3

[0103] S102: Obtain first detection information of the first API message based on the first key parameter set, where the first detection information includes a value of each key parameter in the first key parameter set in the first API message.

[0104] As an example, S102 may include: extracting the value of each key parameter in the first key parameter set in the first API message to obtain first detection information of the first API message. Taking the first API mode as www.test.com / login / index.html, the first key parameter set as {PageSize, Count, Is_admin}, and the parameters included in the first API message and the corresponding values ​​of the parameters as: userNo=xx, PageSize=10, Count=800, username=yy, and Is_admin=True as an example, the first detection information can be expressed as {PageSize=10, Count=800, Is_admin=True}, or, if the parameters of each input position in the input data of the parameter configuration template or the detection model are known and fixed, then the first detection information can also be expressed as {10, 800, True}.

[0105] S103: Determine an abnormality detection result of the first API message based on the first API mode and the first detection information.

[0106] In a first possible implementation, S103 can be implemented with the aid of a preset parameter configuration template corresponding to the first API mode. In this implementation, before S103, the parameter configuration template corresponding to each API mode can be maintained in advance, and the parameter configuration template corresponding to any API mode can include: a correspondence between any key parameter in the key parameter set corresponding to any API mode and a baseline value range of any key parameter, wherein the baseline value range of any key parameter can be determined based on the value of any key parameter in multiple second API messages under the API mode and / or experience.

[0107] As an example, S103 may include: obtaining a parameter configuration template corresponding to the first API mode, the parameter configuration template including a correspondence between any key parameter in the first key parameter set and a benchmark value range of any key parameter; and determining an abnormality detection result of the first API message based on the first detection information and the parameter configuration template. If the value of any key parameter in the first detection information does not match the corresponding benchmark value range in the parameter configuration template, then the abnormality detection result of the first API message can be determined to be abnormal. Only when the values ​​of all key parameters in the first detection information match the corresponding benchmark value range in the parameter configuration template can the abnormality detection result of the first API message be determined to be normal. When determining that the first API message is abnormal, the abnormality detection result of the first API message may also include the cause of the abnormality. For example, the abnormality detection result of the first API message may include the key parameter that does not match the benchmark value range and the value of the key parameter in the first API message.

[0108] For example, for the API mode shown in Table 3, the parameter configuration template corresponding to the API mode can be expressed as: {PageSize∈(8,15), Count∈(300,1200), Is_admin=True}. If the first detection information is {10,800,True}, since the values ​​of the key parameters of the first API message indicated in the first detection information all match the corresponding benchmark value ranges in the parameter configuration template, the anomaly detection result of the first API message indicates that the first API message is normal. If the first detection information is {9,10000,True}, since the value of Count among the key parameters of the first API message indicated in the first detection information does not match the corresponding benchmark value range in the parameter configuration template, the anomaly detection result of the first API message indicates that the first API message is abnormal. In addition, the anomaly detection result of the first API message may also indicate the cause of the anomaly. For example, the anomaly detection result of the first API message can be expressed as: {abnormal, Count=10000}.

[0109] After S103, the method 100 may also include: abnormality detection result confirmation and abnormality blocking and other operations. The abnormality detection result confirmation can be understood as the confirmation of whether the abnormality detection result output by the parameter configuration template is accurate. For example, the abnormality detection result can be displayed on an interface (the configuration interface 300 shown in Figure 1, or any display interface connected to the device 100 in Figure 1). The staff can view the abnormality detection result on the interface and confirm whether the abnormality detection result is wrong through experience or other means. Abnormality blocking can be understood as when the staff determines on the interface that the abnormality detection result indicates that the first API message is abnormal, the first API message is blocked to protect the network from attack as much as possible and improve network security.

[0110] As an example, if an error is found in the anomaly detection result, for example, when a staff member checks the anomaly detection result displayed on the interface and finds that the first API message is actually normal but the anomaly detection result indicates that the first API message is abnormal, or finds that the first API message is actually abnormal but the anomaly detection result indicates that the first API message is normal, then the method 100 may also include: updating the parameter configuration template corresponding to the first API mode. Wherein, updating the parameter configuration template corresponding to the first API mode, for example, can be performed based on the error analysis result of the anomaly detection result of the first API message. The updating method may include: updating the first key parameter set corresponding to the first API mode, and / or updating the benchmark value range corresponding to all or part of the key parameters in the parameter configuration template corresponding to the first API mode.

[0111] In a second possible implementation, S103 can be implemented with the aid of a trained first detection model corresponding to the first API mode. In this implementation, before S103, a detection model corresponding to each API mode can be obtained in advance. The detection model can include, for example, an unsupervised autoencoder or a deep support vector data description (Deep Support Vector Data Description, Deep-SVDD) model. For the specific implementation of the detection model and the training process of the model under each specific implementation, please refer to the embodiment shown in Figure 3 below.

[0112] As an example, S103 may include: obtaining a first detection model corresponding to the first API mode; inputting the first detection information into the first detection model, and determining the abnormality detection result of the first API message based on the output result of the first detection model. Taking the first detection model including an unsupervised autoencoder as an example, in one case, if the first detection model only includes an unsupervised autoencoder, then, determining the abnormality detection result of the first API message based on the output result of the first detection model in S103 may include: calculating the difference between the output result and the first detection information, comparing whether the difference is less than or equal to the first baseline value of the first detection model, and if so, determining that the abnormality detection result of the first API message is normal; otherwise, determining that the abnormality detection result of the first API message is abnormal. In another case, if the first detection model includes an unsupervised autoencoder and a computing module, then the output result of the first detection model in S103 can be the difference between the first detection information calculated by the computing module and the output result of the unsupervised autoencoder, and determining the abnormal detection result of the first API message based on the output result of the first detection model in S103 can include: comparing whether the difference is less than or equal to the first baseline value of the first detection model; if so, determining that the abnormal detection result of the first API message is normal; otherwise, determining that the abnormal detection result of the first API message is abnormal. In another case, if the first detection model includes an unsupervised autoencoder, a calculation module, and a comparison module, then the output result of the first detection model in S103 can be the comparison result of the difference between the first detection information and the output result of the unsupervised autoencoder calculated by the calculation module, and the comparison module comparing the difference with the first baseline value of the first detection model; determining the abnormality detection result of the first API message based on the output result of the first detection model in S103 may include: if the output result indicates that the difference is less than or equal to the first baseline value of the first detection model, then determining that the abnormality detection result of the first API message is normal; otherwise, determining that the abnormality detection result of the first API message is abnormal. Among them, the first baseline value is a value determined when training the first detection model and is used in conjunction with the first detection model to perform abnormality detection. The specific determination method can refer to the relevant description of the embodiment shown in Figure 3.

[0113] For example, taking the first detection model as an example, which only includes an unsupervised autoencoder, the detection model corresponding to the first API mode is the unsupervised autoencoder 1, and the first baseline value corresponding to the unsupervised autoencoder 1 is 5%. If the first detection information is A, A is input into the unsupervised autoencoder 1, and the output result of the unsupervised autoencoder 1 is B, then the abnormality detection result of the first API message can be determined by judging whether the difference between A and B is less than or equal to 5%. If the judgment result is yes, then the abnormality detection result of the first API message indicates that the first API message is normal. If the judgment result is no, then the abnormality detection result of the first API message indicates that the first API message is abnormal. The difference between A and B can be understood as the proportion of the difference between B and A to the information of A itself after the unsupervised autoencoder 1 compresses A and then restores it to B.

[0114] After S103 , the method 100 may further include operations such as abnormality detection result confirmation and abnormality blocking.

[0115] As an example, if an error is found in the anomaly detection result, for example, the staff checks the anomaly detection result displayed on the interface and finds that the first API message is actually normal but the anomaly detection result indicates that the first API message is abnormal, or finds that the first API message is actually abnormal but the anomaly detection result indicates that the first API message is normal, then the method 100 may also include: updating the first detection model. Wherein, updating the first detection model may include: updating the key parameter set corresponding to the first API mode to the second key parameter set based on the error of the anomaly detection result; obtaining multiple second training samples, the multiple second training samples including the values ​​of the key parameters in the second key parameter set in any third API message, the third API message being the message corresponding to the first API mode in the second training sample; training the first detection model based on the second training sample corresponding to the first API model in the multiple second training samples. In this way, on the one hand, by updating the samples participating in the training, the problem of inaccurate anomaly detection results determined based on the first detection model due to insufficient training samples can be overcome. On the other hand, by updating the key parameters in the key parameter set, the problem of inaccurate anomaly detection results determined based on the first detection model due to unreasonable selection of key parameters can be overcome.

[0116] It should be noted that the method of updating the detection model may also include: updating only the samples involved in training or updating only the key parameter set. The above example introduces the method of updating both the samples involved in training and the key parameter set.

[0117] It can be seen that in the method 100, by pre-learning the multi-dimensional association of the parameters of the API messages under each API mode, the key parameter set of the API messages under each API mode is determined. When the first API message to be detected is subjected to anomaly detection, the first key parameter set under the first API mode corresponding to the first API message can be quickly determined, thereby determining whether the values ​​of the key parameters in the first key parameter set in the first API message conform to the expected business logic of the first API message, for example, determining whether the values ​​of the key parameters in the first key parameter set in the first API message satisfy the normal combination of the values ​​of the key parameters in the first key parameter set, and determining the anomaly detection result of the first API message. In this way, accurate and comprehensive anomaly detection of the API message is achieved, thereby improving the security of the network.

[0118] Figure 3 is a flow chart of an anomaly detection method 200 provided in an embodiment of the present application. Method 200 uses a first detection model of a first API model as an example to illustrate how to train a detection model corresponding to any API mode. Method 200 can, for example, be executed by training module 220 in analysis platform 200 in Figure 1 . As shown in Figure 3 , method 200 can, for example, include the following steps S201 to S202.

[0119] S201, obtain multiple first training samples, each of the multiple first training samples includes the value of a key parameter in a first key parameter set corresponding to a first API mode in a first API message belonging to the first API mode, and the first key parameter set includes multiple key parameters.

[0120] Before S201 , the key parameter sets corresponding to the various API modes that need to be maintained and the method for obtaining the key parameter sets corresponding to the various API modes can refer to the relevant description of S101 .

[0121] Before S201, it is also necessary to collect multiple API messages, parse and extract fields for each of the multiple API messages, obtain a parameter value sample corresponding to the API message, and maintain the parameter value samples corresponding to the multiple API messages in a parameter value sample library. Each parameter value sample in the parameter value sample library can be shown in Table 1 above, for example.

[0122] As an example, S201 may include: S41, obtaining multiple parameter value samples corresponding to the first API mode from a parameter value sample library, each parameter value sample corresponding to a first API message; S42, obtaining a first key parameter set corresponding to the first API mode; S43, for any parameter value sample from the multiple parameter value samples obtained in S41, extracting the value of each key parameter in the first key parameter set in the any parameter value sample as a first training sample in S201. It should be noted that there is no order restriction on the execution of S41 and S42.

[0123] In some implementations, after S201, the obtained plurality of first training samples may be maintained in a training sample library.

[0124] Assuming the first API mode is www.test.com / login / index.html, S41 obtains the three parameter value samples shown in Table 3 (which can also be understood as three first API messages), and S42 obtains the first key parameter set of {PageSize, Count, Is_admin}. Then, after S43, three first training samples are obtained: {10, 1000, True}, {10, 500, False}, and {10, 1000, False}. If these three first training samples are maintained in a training sample set, the training sample set may include, for example, the following portion shown in Table 4:

[0125] Table 4

[0126] S202: Train a preset detection model based on the multiple first training samples to obtain a first detection model corresponding to the first API mode, where the first detection model is used to perform anomaly detection on API messages belonging to the first API mode.

[0127] If the collected training samples meet the training start conditions, the preset detection model can be trained according to the API mode to obtain a detection model corresponding to each API mode that can be used in the anomaly detection method provided in the embodiment of the present application. The embodiment of the present application uses the example of obtaining the first detection model corresponding to the first API mode. The training process of the detection model corresponding to other API modes can be referred to the implementation of S202.

[0128] For example, the training start conditions may include: the collection time of training samples reaches a preset time (such as 1 week), or the number of training samples in the API mode reaches a preset number (such as 1000).

[0129] The preset detection model may be a neural network model.

[0130] In some possible implementations, the preset detection model may include an unsupervised autoencoder, which can be understood as a neural network that uses a backpropagation algorithm to make the output value as close as possible to the input value. As shown in Figure 4, the unsupervised autoencoder may include two parts: an encoder 401 and a decoder 402. The encoder 401 compresses the input X1 into a potential space annotation Z (also known as a latent code). The learning process is the process of the encoder 401 performing dimensionality reduction encoding on X1; the decoder 402 reconstructs Z into an output X2. The reconstruction process is the process of the decoder 402 performing dimensionality increase decoding on Z. X1 can be expressed as [x11, x12, ..., x1n], and X2 can be expressed as [x21, x22, ..., x2n], where n is an integer greater than 1 and the value of n is consistent with the number of key parameters included in the first key parameter set. x1i is the value of the i-th key parameter in the first key parameter set in the first API message, i = 1, 2, ..., n, and x2i is the restoration result of X1i by the unsupervised autoencoder. Taking the first first training sample in Table 4 as an example, X1 can be [x11, x12, x13], and X2 can be [x21, x22, x23], where x11 = 10, x12 = 1000, and x13 = True (or 1).

[0131] It can be understood that the training of the unsupervised autoencoder is to make the input and output closer as possible, so as to learn a mapping relationship. That is to say, through the association learning of the values ​​of multiple key parameters in the first key parameter set of the first API mode, the unsupervised autoencoder learns the mapping relationship between the multiple key parameters in the first key parameter set and the normal value combination of the multiple key parameters. The unsupervised autoencoder can restore the value combination of the multiple key parameters in the input first key parameter set very well. If the input to the unsupervised autoencoder is the value combination of multiple key parameters in the first key parameter set extracted from the normal API message, since the unsupervised autoencoder has learned the mapping relationship between the multiple key parameters in this normal first key parameter set and the normal value combination of the multiple key parameters, the unsupervised autoencoder can restore the value combination of the multiple key parameters in the first key parameter set very well. If the input to the unsupervised autoencoder is a combination of values ​​of multiple key parameters in the first key parameter set extracted from an abnormal API message, after the mapping relationship between the multiple key parameters in the first key parameter set and the normal value combination of the multiple key parameters learned by the unsupervised autoencoder, the unsupervised autoencoder cannot restore the value combination of the multiple key parameters in the first key parameter set, or in other words, the output result of the unsupervised autoencoder deviates greatly from the input. The deviation between the input and output of the unsupervised autoencoder can be represented by the distance between X1 and X2, and the following formula (3) can be used to determine whether the deviation D(X1, X2) between the input and output of the unsupervised autoencoder is normal:

[0132] Among them, f(X1, X2) can also be understood as the judgment condition for the training convergence of the unsupervised autoencoder.

[0133] The training samples corresponding to each API mode can be divided into three parts: training samples for training, training samples for verification, and training samples for testing. Taking the training samples corresponding to the first API mode as an example, they can be divided into: a first training sample, a first verification sample, and a first test sample. The above-mentioned execution of S202 training is to make the output and input of the first detection model as close as possible; the method 200 may also include determining a first baseline value of the first detection model based on the first verification sample. A reasonable first baseline value can enable the first detection model to achieve a preset standard for the accuracy of input restoration (such as an accuracy of 95% for input restoration). In order to determine whether the first detection model can achieve a preset standard for the restoration of the input, the method 200 may also include testing whether the first detection model meets the use standard of the anomaly detection method in the embodiment of the present application based on the first test sample and the first baseline value.

[0134] As an example, after S202, the method 200 may further include: S203, obtaining a plurality of first verification samples, each of the first verification samples including the value of the key parameter in the first key parameter set corresponding to the first API mode in the second API message belonging to the first API mode; S204, based on the plurality of first verification samples and the first detection model, determining the first baseline value of the first detection model, the probability that the difference between the output result of each first verification sample in the plurality of first verification samples after the first detection model and the corresponding first verification sample is less than or equal to the first baseline value satisfies a second preset condition, and the first baseline value is used to cooperate with the first detection model to perform anomaly detection on the API message belonging to the first API mode. Wherein, the second preset condition may be, for example, that the probability is greater than or equal to a preset value (such as 95%).

[0135] For example, the first baseline value can be obtained based on the mean square error (MSE) of each value in X4 restored by the unsupervised autoencoder of the first validation sample X3 and X3, and the fluctuation of the MSE. If X3 is {x31, x32, ..., x3n} and X4 is {x41, x42, ..., x4n}, then the MSE of X3 and X4 can be calculated by the following formula (4):

[0136] Wherein, MSE(X3,X4) is the MSE of X3 and X4, i=1, 2, ..., n. The first baseline value can be calculated based on the following formula (5): θ=AVE(MSE(Xopt))+N*STD(MSE(Xopt))...Formula (5)

[0137] Among them, θ is used to represent the first baseline value, AVE() is the average value function, STD() is the standard deviation function, STD(MSE()) can also be understood as the fluctuation of MSE(), MSE() is the mean square error function, and Xopt is an array consisting of at least one first verification sample and the restoration result of the first verification sample after the unsupervised autoencoder. For example, Xopt can be the above-mentioned MSE(X3, X4).

[0138] As an example, after S204, the method 200 may further include: S205, obtaining a plurality of first test samples, each of the plurality of first test samples including the value of a key parameter in a first key parameter set corresponding to the first API mode in a third API message belonging to the first API mode; S206, testing the first detection model based on the plurality of first test samples to determine a test result of the first detection model, and if the probability that the difference between the output result of each first test sample in the plurality of first test samples after the first detection model and the corresponding first test sample is less than or equal to the first baseline value θ satisfies the second preset condition, then the test result indicates that the first detection model is qualified. The first detection model that has been determined to be qualified in this example can be used to execute S103 in the method 100, for example, it can be sent from the new control platform 200 in FIG1 to the device 100, and the device 100 can complete the anomaly detection of the API message to be detected based on the method 100 and with the help of the first detection model.

[0139] In this implementation, after obtaining the first detection model and the first baseline value according to method 200, anomaly detection can be performed on the API message belonging to the first API mode. For example, method 200 may also include: obtaining a fourth API message belonging to the first API mode; and determining an anomaly detection result for the fourth API message based on the first detection model, the first baseline value, and the values ​​of the key parameters in the first key parameter set in the fourth API message. For anomaly detection of the fourth API message, please refer to the relevant description of method 100 above.

[0140] In some other possible implementations, the preset detection model may also be a Deep-SVDD model. The basic principle of the Deep-SVDD model is shown in FIG5 . The Deep-SVDD model maps multiple first training samples to a hypersphere with c as the center and R as the radius, ensuring that the first training samples corresponding to normal API messages all fall within the sphere shown on the right side of FIG5 , and the first training samples corresponding to abnormal API messages all fall outside the sphere, thereby enabling the Deep-SVDD model to implement anomaly detection in the embodiment of the present application. For the first training sample set D n ={x1,…,x n}, in order to realize the function of mapping all sample points to the hypersphere, the loss function of the Deep-SVDD model can be referred to the following formula (6):

[0141] Among them, φ(x i ,W) is the feature mapping function of Deep-SVDD model, W={W 1 ,…,WL} is the weight of the Deep-SVDD model, represents the distance from the first training sample point to the center of the hypersphere after mapping. Since we hope to create a hypersphere with the smallest possible volume and cluster the sample points as close together as possible in the mapping space, the above formula (6) can be understood as minimizing the distance from each point to the center c, without involving the process of optimizing the radius of the hypersphere.

[0142] When searching for outliers (i.e., during the testing phase), the distance from each point to the center of the sphere can be calculated and sorted by distance, with larger scores assigned to outliers with larger distances. For example, the outlier score can be calculated based on the following formula (7):

[0143] Where s represents the anomaly score, W * Represents the weights in the trained Deep-SVDD model.

[0144] In this implementation, after obtaining the first detection model according to method 200, anomaly detection can be performed on the API message belonging to the first API mode. For example, the method 200 may also include: obtaining a fourth API message belonging to the first API mode; determining the anomaly detection result of the fourth API message based on the first detection model and the values ​​of the key parameters in the first key parameter set in the fourth API message. It should be noted that if the points obtained by mapping the values ​​of the key parameters in the first key parameter set in the fourth message through the first detection model fall inside the hypersphere, then the anomaly detection result indicates that the fourth API message is normal. Conversely, if the points obtained by mapping the values ​​of the key parameters in the first key parameter set in the fourth message through the first detection model fall outside the hypersphere, then the anomaly detection result indicates that the fourth API message is abnormal.

[0145] To improve the performance of the anomaly detection method, staff can also confirm the anomaly detection results of the API messages, introducing a feedback mechanism for erroneous anomaly detection results. That is, method 200 can also include: in response to determining that the anomaly detection result of the fourth API message is erroneous, updating the multiple first training samples and / or the first key parameter set, and retraining the first detection model. In this way, a more reasonable first key parameter set and first detection model are obtained, making anomaly detection of the API in the first API mode more accurate.

[0146] The above method 200 is illustratively described using the first detection model of the first API model as an example. For the training process of the detection models of other API modes, please refer to the relevant description of the method 200.

[0147] It should be noted that the neural network types used by the detection models corresponding to different API modes can be the same or different; alternatively, the API messages of some API modes can use the detection model for anomaly detection, while the API messages of other API modes can use the parameter configuration template for anomaly detection.

[0148] It can be seen that in the method 200, by pre-learning the multi-dimensional association of the parameters of the API messages under each API mode, the key parameter set of the API messages under each API mode is determined, and based on multiple training samples of each API mode and the key set of the corresponding API mode, a detection model of the corresponding API mode is trained, making it possible to accurately detect anomalies in the first API message to be detected. When performing anomaly detection on the first API message to be detected, the first key parameter set under the first API mode corresponding to the first API message can be quickly determined, so that the values ​​of each key parameter in the first key parameter set in the first API message are input into the trained first detection model, and the anomaly detection result of the first API message is determined based on the output result of the first detection model, thereby achieving accurate and comprehensive anomaly detection of the API message and improving the security of the network.

[0149] Accordingly, an embodiment of the present application further provides an anomaly detection device 600 , as shown in FIG6 . The device 600 may include an acquisition unit 601 and a determination unit 602 .

[0150] In some possible implementations, the anomaly detection device 600 may execute the method 100 .

[0151] The acquisition unit 601 is configured to acquire a first key parameter set based on a first API mode of a first API message, wherein the first key parameter set includes a plurality of key parameters. The acquisition unit 601 may execute S101 shown in FIG2 .

[0152] The acquisition unit 601 is further configured to acquire first detection information of the first API message based on the first key parameter set, wherein the first detection information includes a value of each key parameter in the first key parameter set in the first API message. The acquisition unit 601 may execute S102 shown in FIG. 2 .

[0153] The determining unit 602 is configured to determine an abnormality detection result of the first API message based on the first API mode and the first detection information. The determining unit 602 may execute S103 shown in FIG2 .

[0154] In one possible implementation, the acquisition unit 601 is specifically used to acquire the first key parameter set based on the first API mode and the API key parameter library, where the API key parameter library includes at least one API mode and a key parameter set corresponding to each API mode in the at least one API mode.

[0155] As an example, the acquisition unit 601 is further configured to acquire, for any API mode among the at least one API mode, a set of key parameters corresponding to the any API mode.

[0156] As another example, for any API mode in the at least one API mode, the acquisition unit 601 is further configured to acquire multiple second API messages corresponding to the any API mode. The determination unit 602 is further configured to determine a set of candidate key parameters corresponding to the any API mode based on the values ​​of multiple parameters of each second API message in the multiple second API messages, wherein the uncertainty of the candidate key parameters in the set of candidate key parameters meets a first preset condition; and determine a set of key parameters corresponding to the any API mode based on the set of candidate key parameters.

[0157] For example, the determination unit 602 is specifically used to: obtain the values ​​of multiple parameters of each second API message; for any parameter among the multiple parameters, based on the value of the any parameter in the multiple second API messages, determine the first value of the any parameter, the first value is used to indicate the uncertainty corresponding to the value of the any parameter, and the candidate key parameter set corresponding to the any API mode includes the parameters whose first value among the multiple parameters meets the first preset condition.

[0158] For example, the determination unit 602 is specifically used to: determine the key parameter set corresponding to any API mode based on the detection model and the values ​​of the key parameters in the candidate key parameter set in each second API message. The determination unit 602 is specifically used to: obtain multiple first training samples, each first training sample in the multiple first training samples includes the values ​​of the key parameters in the candidate key parameter set in any second API message; based on the first training sample corresponding to the any API mode in the multiple first training samples and the detection model corresponding to the any API mode, obtain the detection difference corresponding to the any API mode; if the detection difference meets the baseline value of the detection model corresponding to the any API mode, then, determine that the candidate key parameter corresponding to the any API mode is the key parameter in the key parameter set corresponding to the any API mode.

[0159] In one possible implementation, the determination unit 602 is specifically used to: obtain a parameter configuration template corresponding to the first API mode, the parameter configuration template including a correspondence between any key parameter in the first key parameter set and a benchmark value range of any key parameter; and determine an abnormality detection result of the first API message based on the first detection information and the parameter configuration template.

[0160] As an example, the apparatus 600 further includes an updating unit, and the updating unit is configured to update the parameter configuration template corresponding to the first API mode if an error occurs in the abnormality detection result.

[0161] In one possible implementation, the determination unit 602 is specifically used to: obtain a first detection model corresponding to the first API mode; input the first detection information into the first detection model, and determine the abnormality detection result of the first API message based on the output result of the first detection model.

[0162] As an example, the apparatus 600 further includes an updating unit, and the updating unit is configured to update the first detection model if an error occurs in the abnormality detection result.

[0163] For example, the updating unit is specifically used to: update the key parameter set corresponding to the first API mode to a second key parameter set based on the error of the abnormal detection result; obtain multiple second training samples, the multiple second training samples include the values ​​of the key parameters in the second key parameter set in any third API message, and the third API message is the message in the second training sample corresponding to the first API mode; train the first detection model based on the second training sample corresponding to the first API model in the multiple second training samples.

[0164] It should be noted that for the specific implementation method and technical effects achieved when the device 600 provided in the embodiment of the present application executes the method 100, please refer to the relevant description of the method 100.

[0165] In some possible implementations, the anomaly detection device 600 may execute the method 200 .

[0166] An acquisition unit 601 is configured to acquire multiple first training samples, each of which includes a value of a key parameter in a first key parameter set corresponding to a first API mode, in a first API message belonging to the first API mode, the first key parameter set including multiple key parameters. Acquisition unit 601 may execute S201 shown in FIG. 3 .

[0167] A determination unit 602 is configured to train a preset detection model based on the plurality of first training samples to determine a first detection model corresponding to the first API mode, wherein the first detection model is configured to perform anomaly detection on API messages belonging to the first API mode. The determination unit 602 may execute S202 shown in FIG. 3 .

[0168] In one possible implementation, the acquisition unit 601 is further used to acquire multiple first verification samples, each of the first verification samples including the value of the key parameter in the first key parameter set corresponding to the first API mode in the second API message belonging to the first API mode. The acquisition unit 601 can execute S203 in method 200. The determination unit 602 is also used to determine the first baseline value of the first detection model based on the multiple first verification samples and the first detection model, the probability that the difference between the output result of each first verification sample in the multiple first verification samples after the first detection model and the corresponding first verification sample is less than or equal to the first baseline value satisfies a first preset condition, and the first baseline value is used to cooperate with the first detection model to perform anomaly detection on the API message belonging to the first API mode. The determination unit 602 can execute S204 in method 200.

[0169] In one possible implementation, the acquisition unit 601 is further used to acquire multiple first test samples, each of the multiple first test samples including the value of the key parameter in the first key parameter set corresponding to the first API mode in the third API message belonging to the first API mode. The acquisition unit 601 can execute S205 in method 200. The determination unit 602 is also used to test the first detection model based on the multiple first test samples to determine the test result of the first detection model. If the probability that the difference between the output result of each first test sample in the multiple first test samples after the first detection model and the corresponding first test sample is less than or equal to the first baseline value meets the first preset condition, then the test result indicates that the first detection model is qualified. The determination unit 602 can execute S206 in method 200.

[0170] In one possible implementation, the acquisition unit 601 is also used to obtain a fourth API message belonging to the first API mode; the determination unit 602 is also used to determine the abnormality detection result of the fourth API message based on the first detection model, the first baseline value and the values ​​of the key parameters in the first key parameter set in the fourth API message.

[0171] In one possible implementation, the device 600 may further include an updating unit, which is used to update the multiple first training samples and / or the first key parameter set and retrain the first detection model in response to determining that the abnormality detection result of the fourth API message is erroneous.

[0172] In a possible implementation, the acquiring unit 601 is further configured to acquire the first key parameter set corresponding to the first API mode.

[0173] In one possible implementation, the acquisition unit 601 is also used to acquire multiple fifth API messages corresponding to the first API mode; the determination unit 602 is also used to determine the candidate key parameter set corresponding to the first API mode based on the values ​​of multiple parameters of each fifth API message in the multiple fifth API messages, and the uncertainty of the candidate key parameters in the candidate key parameter set meets the second preset condition; the determination unit 602 is also used to determine the first key parameter set corresponding to the first API mode based on the candidate key parameter set.

[0174] As an example, when the determination unit 602 executes the determination of the candidate key parameter set corresponding to the first API mode based on the values ​​of multiple parameters of each fifth API message in the multiple fifth API messages, the determination unit 602 is specifically used to: obtain the values ​​of multiple parameters of each fifth API message; for any parameter among the multiple parameters, based on the value of any parameter in the multiple fifth API messages, determine the first value of any parameter, the first value is used to indicate the uncertainty of the value corresponding to any parameter, and the candidate key parameter set corresponding to any API mode includes the parameters among the multiple parameters whose first value satisfies the second preset condition.

[0175] It should be noted that the specific implementation method and technical effects achieved by the device 600 provided in the embodiment of the present application can be found in the relevant description of the method 200.

[0176] Referring to Figure 7 , an embodiment of the present application provides a communication device 700. The communication device 700 may be any communication unit capable of executing the method provided in the embodiment of the present application, such as the device 100 or analysis platform 200 in Figure 1 . The communication device 700 includes at least one processor 701, a bus system 702, a memory 703, and at least one communication interface 704.

[0177] The communication device 700 is a hardware device that can be used to implement the functional modules in the anomaly detection device 600 shown in Figure 6. For example, the at least one processor 701 calls the code in the memory 703 to implement the acquisition unit 601 or the determination unit 602 in the anomaly detection device 600 shown in Figure 6.

[0178] Optionally, the communication device 700 may also be used to implement the functions of the network device in any of the above embodiments.

[0179] Optionally, the processor 701 may be a general-purpose central processing unit (CPU), a network processor (NP), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application.

[0180] The bus system 702 may include pathways for transmitting information between the components.

[0181] The communication interface 704 is used to communicate with other devices or communication networks.

[0182] The above-mentioned memory 703 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this. The memory can exist independently and be connected to the processor through a bus. The memory can also be integrated with the processor.

[0183] The memory 703 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 701. The processor 701 is used to execute the application code stored in the memory 703, thereby realizing the functions of the method of the present application.

[0184] In a specific implementation, as an embodiment, the processor 701 may include one or more CPUs, such as CPU0 and CPU1 in FIG. 7 .

[0185] In a specific implementation, as an embodiment, the communication device 700 may include multiple processors, such as processor 701 and processor 707 in Figure 7. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0186] Figure 8 is a schematic diagram of the structure of another communication device 800 provided in an embodiment of the present application. Communication device 800 can be any communication unit capable of executing the method provided in an embodiment of the present application, for example, it can be device 100 or analysis platform 200 in Figure 1. Communication device 800 can implement the functions of various network devices or servers in the above embodiments.

[0187] The communication device 800 includes a main control board 810 and an interface board 830 .

[0188] Main control board 810, also known as the main processing unit (MPU) or route processor card, controls and manages various components in communication device 800, including routing calculation, device management, device maintenance, and protocol processing. Main control board 810 includes a central processing unit (CPU) 811 and memory 812.

[0189] Interface board 830 is also known as a line processing unit (LPU), line card, or service board. It provides various service interfaces and implements data packet forwarding. Service interfaces include, but are not limited to, Ethernet interfaces and POS (Packet over SONET / SDH) interfaces. Ethernet interfaces, for example, are Flexible Ethernet Clients (FlexE Clients). Interface board 830 includes a central processing unit (CPU) 831, a network processor (NPU) 832, a forwarding table memory 834, and a physical interface card (PIC) 833.

[0190] The central processing unit 831 on the interface board 830 is used to control and manage the interface board 830 and communicate with the central processing unit 811 on the main control board 810 .

[0191] The network processor 832 is used to implement packet forwarding processing. The network processor 832 can be in the form of a forwarding chip. Specifically, the processing of uplink packets includes: processing of the packet input interface and forwarding table lookup; the processing of downlink packets includes: forwarding table lookup, etc.

[0192] The physical interface card 833 is used to implement the physical layer docking function. The original traffic enters the interface board 830 from this, and the processed message is sent from the physical interface card 833. The physical interface card 833 includes at least one physical interface, which is also called a physical port. The physical interface card 833 corresponds to the FlexE physical interface in the system architecture. The physical interface card 833, also known as a daughter card, can be installed on the interface board 830. It is responsible for converting the optical and electrical signals into messages and performing a validity check on the messages before forwarding them to the network processor 832 for processing. In some embodiments, the central processing unit 831 of the interface board 830 can also perform the functions of the network processor 832, such as implementing software forwarding based on a general-purpose CPU, so that the network processor 832 is not required in the physical interface card 833.

[0193] Optionally, the communication device 800 includes multiple interface boards. For example, the communication device 800 further includes an interface board 840 . The interface board 840 includes a central processing unit 841 , a network processor 842 , a forwarding table entry memory 844 , and a physical interface card 843 .

[0194] Optionally, the communication device 800 further includes a switching fabric board 820. The switching fabric board 820 may also be referred to as a switch fabric unit (SFU). If the communication device 800 includes multiple interface boards 830, the switching fabric board 820 is used to exchange data between the interface boards. For example, the interface board 830 and the interface board 840 can communicate via the switching fabric board 820.

[0195] The main control board 810 and the interface board 830 are coupled. For example, the main control board 810, the interface board 830, the interface board 840, and the switching network board 820 are connected to the system backplane via a system bus to achieve intercommunication. In one possible implementation, an inter-process communication (IPC) channel is established between the main control board 810 and the interface board 830, and communication between the main control board 810 and the interface board 830 is performed via the IPC channel.

[0196] Logically, communication device 800 comprises a control plane and a forwarding plane. The control plane includes a main control board 810 and a central processing unit 831, while the forwarding plane comprises various components responsible for forwarding, such as a forwarding table entry memory 834, a physical interface card 833, and a network processor 832. The control plane performs functions such as routing, generating forwarding tables, processing signaling and protocol messages, and configuring and maintaining device status. The control plane sends the generated forwarding tables to the forwarding plane. On the forwarding plane, the network processor 832 forwards messages received by the physical interface card 833 based on the forwarding tables sent by the control plane. The forwarding tables sent by the control plane can be stored in the forwarding table entry memory 834. In some embodiments, the control plane and forwarding plane can be completely separate and not located on the same device.

[0197] If the communication device 800 is configured as a device for executing method 100, the central processor 811 can obtain a first key parameter set based on the first API mode of the first API message, obtain first detection information of the first API message based on the first key parameter set, and determine the abnormality detection result of the first API message based on the first API mode and the first detection information.

[0198] It should be understood that the acquisition unit 601 and the determination unit 602 in the abnormality detection apparatus 600 may be equivalent to the central processing unit 811 or the central processing unit 831 in the communication device 800 .

[0199] It should be understood that the communication device 800 of this embodiment may correspond to the abnormality detection device 600 in each of the above-mentioned embodiments. The main control board 810, interface board 830 and / or interface board 840 in the communication device 800 can implement the functions and / or various steps implemented in the abnormality detection device 600 in each of the above-mentioned embodiments. For the sake of brevity, they will not be repeated here.

[0200] It should be understood that the operations on the interface board 840 in the embodiment of the present application are consistent with those on the interface board 830, and for the sake of brevity, a detailed description thereof will not be repeated. It should be understood that the main control board 810, interface board 830, and / or interface board 840 in the communication device 800 of this embodiment can implement the functions and / or various steps implemented in the communication device 700 in each of the above-mentioned embodiments, and for the sake of brevity, a detailed description thereof will not be repeated here.

[0201] It should be understood that there may be one or more main control boards, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may be one or more interface boards. The stronger the data processing capability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching network board, or there may be one or more switching network boards. When there are multiple switching network boards, they can jointly achieve load sharing and redundant backup. In a centralized forwarding architecture, the network device may not need a switching network board, and the interface board is responsible for processing the business data of the entire system. In a distributed forwarding architecture, the network device can have at least one switching network board, which realizes data exchange between multiple interface boards through the switching network board, providing large-capacity data exchange and processing capabilities. Therefore, the data access and processing capabilities of network devices with a distributed architecture are greater than those of devices with a centralized architecture. Alternatively, a network device can consist of a single card, without a switching fabric board (SFB), integrating the functions of the interface board and the main control board. In this case, the CPUs on the interface board and the main control board can be combined into a single CPU, performing the combined functions of the two. This type of device has lower data exchange and processing capabilities (for example, low-end network devices such as switches or routers). The specific architecture used depends on the specific network deployment scenario.

[0202] In some possible embodiments, each of the above-mentioned network devices or network devices can be implemented as a virtualized device. For example, the virtualized device can be a virtual machine (English: Virtual Machine, VM) running a program for sending message functions, and the virtual machine is deployed on a hardware device (for example, a physical server). A virtual machine refers to a complete computer system with complete hardware system functions simulated by software and running in a completely isolated environment. The virtual machine can be configured as each network device or server in the embodiments of the present application. For example, each network device or network device can be implemented based on a general physical server in combination with Network Function Virtualization (NFV) technology. Each network device or network device is a virtual host, a virtual router or a virtual switch. Those skilled in the art can virtualize each network device or network device with the above-mentioned functions on a general physical server in combination with NFV technology by reading this application, and will not be repeated here.

[0203] It should be understood that the network devices in the various product forms mentioned above respectively have any functions of the network devices or communication devices in the above method embodiments, which will not be described in detail here.

[0204] The present application also provides a chip comprising a processor and an interface circuit, the interface circuit being configured to receive instructions and transmit them to the processor; the processor, which may be, for example, a specific implementation of the message processing device in the present application, being configured to execute the aforementioned routing method. The processor is coupled to a memory configured to store programs or instructions. When the programs or instructions are executed by the processor, the chip system implements the method in any of the aforementioned method embodiments.

[0205] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.

[0206] Optionally, the memory in the chip system may be one or more memories. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in this application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. This application does not specifically limit the type of memory or the configuration of the memory and the processor.

[0207] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.

[0208] In addition, an embodiment of the present application further provides an anomaly detection system, which includes a computer device and an analysis platform. The computer device is used to execute any one of the implementations of method 100, and the analysis platform is used to execute any one of the implementations of method 200.

[0209] In addition, an embodiment of the present application further provides a storage medium, in which program code or instructions are stored. When the storage medium is run on a processor, the method of any one of the implementation modes in the embodiments shown in FIG. 2 or FIG. 3 is executed.

[0210] In addition, an embodiment of the present application also provides a program product, which, when running on a processor, executes any one of the implementation methods of the aforementioned method 100 or method 200.

[0211] It should be understood that "based on determining B according to A" mentioned in the embodiments of the present application does not mean that B is determined only according to A, but B can also be determined according to A and / or other information.

[0212] In the embodiments of the present application, the parameters or fields in the API message refer to the same meaning and can be understood and used interchangeably.

[0213] The "first" in the names of "first API mode" and "first API message" mentioned in this application is only used for name identification and does not mean the first in order. The same rule applies to "second" and so on.

[0214] Through the description of the above embodiments, it can be known that those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by means of software plus a general hardware platform. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a storage medium, such as a read-only memory (ROM) / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network communication device such as a router) to execute the methods described in each embodiment or certain parts of the embodiments of the present application.

[0215] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments and device embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. The device and system embodiments described above are merely schematic. The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without making any creative effort.

[0216] The above description is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application. It should be noted that those skilled in the art may make several improvements and modifications without departing from the scope of protection of the present application, and such improvements and modifications should also be considered as within the scope of protection of the present application.

Claims

1. An anomaly detection method, characterized in that: The method comprises: Acquire a first key parameter set based on a first API mode of a first application programming interface API message, where the first key parameter set includes a plurality of key parameters; Acquire first detection information of the first API message based on the first key parameter set, where the first detection information includes a value of each key parameter in the first key parameter set in the first API message; Based on the first API mode and the first detection information, an abnormality detection result of the first API message is determined.

2. The method according to claim 1, characterized in that The acquiring of a first key parameter set based on a first API mode of a first application program interface API message includes: Based on the first API mode and an API key parameter library, the first key parameter set is acquired, where the API key parameter library includes at least one API mode and a key parameter set corresponding to each API mode in the at least one API mode.

3. The method according to claim 2, characterized in that The method further comprises: For any API mode among the at least one API mode: obtain a key parameter set corresponding to the any API mode.

4. The method according to claim 2, characterized in that: The method further comprises: For any API mode of the at least one API mode: Obtain multiple second API messages corresponding to any one of the API modes; Determine, based on the values ​​of multiple parameters of each second API message in the multiple second API messages, a set of candidate key parameters corresponding to any one of the API modes, wherein the uncertainty of the candidate key parameters in the set of candidate key parameters meets the first preset condition; A key parameter set corresponding to any one of the API modes is determined based on the candidate key parameter set.

5. The method according to claim 4, characterized in that The determining, based on the values ​​of the multiple parameters of each second API message in the multiple second API messages, a candidate key parameter set corresponding to any one of the API modes includes: Obtaining values ​​of multiple parameters of each second API message; For any parameter among the multiple parameters, a first value of the parameter is determined based on the value of the parameter in the multiple second API messages, wherein the first value is used to indicate the uncertainty of the value corresponding to the parameter, and the candidate key parameter set corresponding to the any API mode includes the parameters whose first values ​​among the multiple parameters satisfy the first preset condition.

6. The method according to claim 4 or 5, characterized in that: The determining, according to the candidate key parameter set, a key parameter set corresponding to any one of the API modes includes: Based on the detection model and the values ​​of the key parameters in the candidate key parameter set in each second API message, the key parameter set corresponding to any one of the API modes is determined.

7. The method according to claim 6, characterized in that The determining, based on the detection model and the values ​​of the key parameters in the candidate key parameter set in each second API message, the key parameter set corresponding to any one of the API modes includes: Acquire a plurality of first training samples, each of the plurality of first training samples comprising a value of a key parameter in the candidate key parameter set in any second API message; Based on a first training sample corresponding to the any API mode among the plurality of first training samples and a detection model corresponding to the any API mode, obtaining a detection difference corresponding to the any API mode; If the detection difference meets the baseline value of the detection model corresponding to any API mode, then the candidate key parameter corresponding to any API mode is determined to be a key parameter in the key parameter set corresponding to any API mode.

8. The method according to any one of claims 1 to 7, characterized in that: The determining, based on the first API mode and the first detection information, an abnormality detection result of the first API message includes: Acquire a parameter configuration template corresponding to the first API mode, the parameter configuration template including a correspondence between any key parameter in the first key parameter set and a reference value range of the any key parameter; Based on the first detection information and the parameter configuration template, determine an abnormality detection result of the first API message.

9. The method according to claim 8, characterized in that The method further comprises: If an error occurs in the abnormality detection result, the parameter configuration template corresponding to the first API mode is updated.

10. The method according to any one of claims 1 to 7, characterized in that: The determining, based on the first API mode and the first detection information, an abnormality detection result of the first API message includes: Acquire a first detection model corresponding to the first API mode; The first detection information is input into the first detection model, and an abnormality detection result of the first API message is determined based on an output result of the first detection model.

11. The method according to claim 10, characterized in that The method further comprises: If the abnormality detection result is wrong, then the first detection model is updated.

12. The method according to claim 11, characterized in that The updating of the first detection model comprises: According to the error of the abnormal detection result, updating the key parameter set corresponding to the first API mode to a second key parameter set; Acquire multiple second training samples, where the multiple second training samples include values ​​of key parameters in the second key parameter set in any third API message, where the third API message is a message in the second training sample corresponding to the first API mode; The first detection model is trained based on a second training sample among the multiple second training samples corresponding to the first API model.

13. An anomaly detection method, characterized in that: The method comprises: Acquire a plurality of first training samples, each of the plurality of first training samples comprising a value of a key parameter in a first key parameter set corresponding to a first API mode in a first API message belonging to the first API mode, the first key parameter set comprising a plurality of key parameters; The preset detection model is trained based on the multiple first training samples to determine a first detection model corresponding to the first API mode, where the first detection model is used to perform anomaly detection on API messages belonging to the first API mode.

14. The method according to claim 13, characterized in that The method further comprises: Acquire multiple first verification samples, each of the multiple first verification samples including a value of a key parameter in a first key parameter set corresponding to the first API mode in a second API message belonging to the first API mode; Based on the multiple first verification samples and the first detection model, a first baseline value of the first detection model is determined, and the probability that the difference between the output result of each first verification sample in the multiple first verification samples after the first detection model and the corresponding first verification sample is less than or equal to the first baseline value satisfies a first preset condition, and the first baseline value is used to cooperate with the first detection model to perform anomaly detection on API messages belonging to the first API mode.

15. The method according to claim 14, characterized in that The method further comprises: Acquire a plurality of first test samples, each of the plurality of first test samples comprising a value of a key parameter in a first key parameter set corresponding to the first API mode in a third API message belonging to the first API mode; The first detection model is tested based on the multiple first test samples to determine the test result of the first detection model. If the probability that the difference between the output result of each first test sample in the multiple first test samples after the first detection model and the corresponding first test sample is less than or equal to the first baseline value satisfies the first preset condition, then the test result indicates that the first detection model is qualified.

16. The method according to claim 14 or 15, characterized in that The method further comprises: Obtaining a fourth API message belonging to the first API mode; An abnormality detection result of the fourth API message is determined based on the first detection model, the first baseline value, and the values ​​of the key parameters in the first key parameter set in the fourth API message.

17. The method according to claim 16, characterized in that The method further comprises: In response to determining that the anomaly detection result of the fourth API message is erroneous, the multiple first training samples and / or the first key parameter set are updated, and the first detection model is retrained.

18. The method according to any one of claims 13 to 17, characterized in that: The method further comprises: Get the first key parameter set corresponding to the first API mode.

19. The method according to any one of claims 13 to 17, characterized in that: The method further comprises: Acquire multiple fifth API messages corresponding to the first API mode; Determining a set of candidate key parameters corresponding to the first API mode based on values ​​of multiple parameters of each fifth API message in the multiple fifth API messages, where uncertainties of candidate key parameters in the set of candidate key parameters meet a second preset condition; The first key parameter set corresponding to the first API mode is determined according to the candidate key parameter set.

20. The method according to claim 19, characterized in that The determining, based on the values ​​of the multiple parameters of each fifth API message in the multiple fifth API messages, a candidate key parameter set corresponding to the first API mode includes: Obtaining values ​​of multiple parameters of each fifth API message; For any parameter among the multiple parameters, a first value of the parameter is determined based on the value of the parameter in the multiple fifth API messages, wherein the first value is used to indicate the uncertainty of the value corresponding to the parameter, and the candidate key parameter set corresponding to the any API mode includes the parameters whose first values ​​among the multiple parameters satisfy the second preset condition.

21. An abnormality detection device, characterized in that: The device comprises: An acquisition unit, configured to perform an acquisition operation in the method according to any one of claims 1 to 20; A determination unit, used to perform the determination operation in the method according to any one of claims 1 to 20.

22. A computer device, characterized in that: The computer device includes a processor and a memory; The processor is configured to execute instructions stored in the memory so that the computer device executes the method according to any one of claims 1 to 20.

23. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a processor, the method according to any one of claims 1 to 20 is executed.

24. A program product, characterized in that The program product comprises a program, and when the program is run on a processor, the method according to any one of claims 1 to 20 is executed.

Citation Information

Patent Citations

  • Abnormal traffic data detection method and device, equipment and storage medium

    CN113556358A

  • Abnormal access detection method and device, electronic equipment and storage medium

    CN114826717A

  • API safety monitoring model training method, API safety monitoring method, API safety monitoring device and API safety monitoring equipment

    CN115499187A

  • Automatic parameter value resolution for API evaluation

    US20210216443A1

Cited By

  • API endpoint management method and system based on unsupervised learning

    CN119854051A

  • Verification method, system and device for ECU calibration file parameters and medium

    CN120010451A