Method and apparatus for detecting injection attack

By constructing a feature library and utilizing sensor feature data from user devices, injection attacks during the image acquisition process are detected, solving the problem of forged facial or document images in eKYC and achieving efficient injection attack detection.

WO2026118743A1PCT designated stage Publication Date: 2026-06-11ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2025-10-30
Publication Date
2026-06-11

Smart Images

  • Figure CN2025131158_11062026_PF_FP_ABST
    Figure CN2025131158_11062026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present description provide a method and apparatus for detecting an injection attack. The method comprises: acquiring first feature data when a user equipment performs a first image acquisition process, wherein the first feature data at least comprises sensor feature data corresponding to a target sensor in the user equipment, and the target sensor is used for sensing the motion of the user equipment; determining whether second feature data matching the first feature data is present in a first feature library, wherein the second feature data corresponds to a second image acquisition process having an injection behavior; and on the basis of a determination result, determining whether the first image acquisition process has an injection behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Methods and devices for detecting injection attacks

[0001] This application claims priority to Chinese Patent Application No. 202411780508.8, filed on December 4, 2024, entitled “Method and Apparatus for Detecting Injection Attacks”, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The embodiments in this specification belong to the field of computer technology, and in particular relate to methods and apparatus for detecting injection attacks. Background Technology

[0003] In eKYC (Electronic Know Your Customer) verification, users need to provide their devices to capture facial and document videos. With the development of AIGC (Artificial Intelligence Generated Content) technology, it has become easier for criminals to forge facial or document images.

[0004] A reasonable and reliable solution is needed to effectively detect injection attacks in image acquisition activities. Summary of the Invention

[0005] The purpose of this invention is to provide a scheme for detecting injection attacks, which can effectively detect injection attacks in image acquisition behavior.

[0006] The first aspect of this specification provides a method for detecting injection attacks, comprising: acquiring first feature data during a first image acquisition process performed by a user equipment, wherein at least sensor feature data corresponding to a target sensor in the user equipment, the target sensor being used to sense the motion of the user equipment; determining whether there is second feature data in a first feature library that matches the first feature data, the second feature data corresponding to a second image acquisition process in which injection behavior exists; and determining whether injection behavior exists in the first image acquisition process based on the determination result.

[0007] A second aspect of this specification provides an apparatus for detecting injection attacks, comprising: an acquisition unit configured to acquire first feature data during a first image acquisition process performed by a user equipment, wherein the first feature data includes at least sensor feature data corresponding to a target sensor in the user equipment, the target sensor being used to sense motion of the user equipment; a first determination unit configured to determine whether second feature data matching the first feature data exists in a first feature library, the second feature data corresponding to a second image acquisition process in which injection behavior exists; and a second determination unit configured to determine whether injection behavior exists in the first image acquisition process based on the determination result of the first determination unit.

[0008] A third aspect of this specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in the first aspect.

[0009] A fourth aspect of this specification provides a computing device including a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method described in the first aspect.

[0010] This specification provides a computer program product in a fifth aspect, including a computer program / instructions that, when executed by a processor, implement the steps of the method as described in the first aspect.

[0011] The solutions provided in the embodiments described above in this specification support the construction of a first feature library for injection attack detection. This library includes second feature data corresponding to a second image acquisition process where injection behavior exists. The second feature data includes at least sensor feature data corresponding to a target sensor in the user equipment performing the second image acquisition process. The target sensor is used to sense the movement of the user equipment. During the injection attack detection phase, first feature data can be acquired during the first image acquisition process in the user equipment, including at least sensor feature data corresponding to the target sensor in the user equipment. Then, it is determined whether second feature data matching the first feature data exists in the first feature library. Based on the determination result, it is then determined whether injection behavior exists in the first image acquisition process. Since the sensor feature data corresponding to the target sensor is related to user behavior, it is not easily forged, and the cost of forgery is high. Therefore, when malicious actors conduct mass injection attacks, this sensor feature data is generally limited. By using this sensor feature data for injection attack detection, effective injection attack detection of image acquisition behavior can be achieved. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments in this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 is a schematic diagram of the feature library construction process in an embodiment of this specification;

[0014] Figure 2 is another schematic diagram of the feature library construction process in an embodiment of this specification;

[0015] Figure 3 is a flowchart of a method for detecting injection attacks in an embodiment of this specification;

[0016] Figure 4 is another flowchart of the method for detecting injection attacks in the embodiments of this specification;

[0017] Figure 5 is a schematic diagram of the structure of the device for detecting injection attacks in the embodiments of this specification. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0019] As mentioned earlier, during eKYC identity verification, users need to use their devices to capture facial and document videos. With the development of AIGC technology, it has become easier for criminals to forge facial or document images.

[0020] This specification provides a scheme for detecting injection attacks, which can effectively detect injection attacks on image acquisition processes. It should be noted that the applicable scenarios for this scheme include, but are not limited to, electronic authentication scenarios. Furthermore, this scheme can be divided into a feature library construction stage and an injection attack detection stage. In the feature library construction stage, one or more feature libraries can be constructed based on the feature data D1 corresponding to each of the multiple image acquisition processes P1 that exhibit injection behavior. The construction of these one or more feature libraries can be performed by any device, platform, or device cluster with computing and processing capabilities.

[0021] Feature data D1 includes at least sensor feature data corresponding to the target sensor in the user equipment performing the corresponding image acquisition process P1, whereby the target sensor is used to sense the motion of the user equipment. The target sensor may include at least one of a linear accelerometer, an accelerometer, and a gyroscope. The sensor feature data may include at least one of device pose information and device motion data. Device pose information may include the absolute position of the device in the global coordinate system, as well as the device's roll, pitch, and yaw angles. Device motion data may include three-axis acceleration values ​​excluding the influence of gravity, three-axis acceleration values ​​including the influence of gravity, data sampling time intervals, rotational rates along the three axes, and timestamps. Here, the three axes refer to the X-axis, Y-axis, and Z-axis. Further, feature data D1 may be acquired based on multiple preset feature categories, and the sensor feature data in feature data D1 corresponds to a first feature category among these multiple feature categories. The first feature category can be used to characterize sensor features related to the target sensor.

[0022] The image acquisition process P1 corresponding to feature data D1 may, for example, involve image acquisition of a person's face and a target identification document. The acquisition of sensor feature data in feature data D1 can begin when the page for acquiring images of the person's face is launched and end when the image acquisition of the person's face is completed. The acquisition frequency of this sensor feature data can be 25 or 50 times per second, etc. It should be understood that this acquisition frequency can be configured according to actual needs and is not specifically limited here. The target identification document may include, but is not limited to, identification documents used to prove user identity. Feature data D1 may also include at least one of the following: facial feature data corresponding to the person's face, document attribute feature data corresponding to the target identification document, GPS (Global Positioning System) information corresponding to the user device performing the image acquisition process P1, and device model information corresponding to the user device. The document attribute feature data may be structured data.

[0023] The aforementioned feature categories may further include at least one of the following: a second feature category for characterizing facial features, a third feature category for characterizing document attribute features, a fourth feature category for characterizing GPS, and a fifth feature category for characterizing device model. As previously mentioned, facial feature data may correspond to the second feature category, document attribute feature data may correspond to the third feature category, GPS information may correspond to the fourth feature category, and device model information may correspond to the fifth feature category. As one implementation, the fourth and fifth feature categories can be combined into a sixth feature category. This sixth feature category characterizes GPS and device model. When feature data D1 includes GPS information and device model information, this GPS information and device model information are combined in feature data D1 to form structured data corresponding to the sixth feature category. It should be noted that, due to limitations in data collection permissions (such as permissions for collecting GPS and / or device model information), the feature data included in feature data D1 may correspond to some or all of the aforementioned feature categories.

[0024] The document attribute feature data may include at least one of the following: document location, angle features, sharpness value, brightness value, integrity value, and distance from the target document to the user device. The document location may include the locations of four corner points. The angle features may include roll angle, pitch angle, and yaw angle.

[0025] The process of collecting document attribute feature data may include the following steps: During the image acquisition of the target document by the user equipment, in response to acquiring the image frame P1, a document detection model is used to perform document detection on image frame P1, obtaining a detection result DR1. Then, in response to the detection result DR1 indicating the presence of a document in image frame P1, including its initial position, the document region is extracted from image frame P1 based on this initial position, and a document image is generated based on this region. Next, the document attribute detection model is used to perform document attribute detection on the document image, obtaining a detection result DR2, which includes multiple document attribute features. After determining that the document image quality is acceptable based on the detection result DR2, at least a portion of the multiple document attribute features are combined to form document attribute feature data. It should be noted that if the detection result DR1 indicates that no document is present in image frame P1, the user equipment can continue to acquire the next image frame P2, and then perform document detection and other processing on image frame P2.

[0026] The initial position of the document can include the initial four corner positions. Both the document detection model and the document attribute detection model can be implemented based on a CNN (Convolutional Neural Network). The aforementioned multiple document attribute features can include multiple aspects such as document position, angle features, sharpness value, brightness value, integrity value, and the distance from the target document to the user's device. Furthermore, these multiple document attribute features can also include the document category. Additionally, to detect whether the document image quality is acceptable, a pre-defined document image quality review standard can be used. This standard can then be used to determine whether the document image quality is acceptable based on the detection result DR2.

[0027] It should be noted that the process of collecting document attribute feature data can be performed by the user equipment as described above, or by the server communicating with the user equipment; no specific limitation is made here. Other feature data in feature data D1 can be collected by the user equipment. Furthermore, if the document image quality is determined to be acceptable based on the detection result DR2, the user equipment can take a picture of the target document based on this determination. If the document image quality is determined to be unacceptable based on the detection result DR2, a prompt message indicating the unacceptable document image quality can be provided to the user.

[0028] When constructing a feature library, each feature data D1 can be stored in the feature library FL, as shown in Figure 1. Figure 1 is a schematic diagram of the feature library construction process in an embodiment of this specification. Furthermore, to facilitate subsequent matching operations, for each feature data D1, the vector representation of feature data D1 can be stored in the feature library FL, or the vector representations of each feature data item in feature data D1 can be stored in the feature library FL.

[0029] In the case of constructing multiple feature libraries, all of which involve the first feature category as described above, and the feature categories involved in the multiple feature libraries are not completely identical. For each feature data D1, and for each feature library in which the feature categories involved in the multiple feature libraries are subsets of the feature categories corresponding to feature data D1, several feature data items in feature data D1 corresponding to the feature categories involved in the feature library can be stored in the feature library. Furthermore, to facilitate subsequent matching operations, the vector representation of the combination of these several feature data items can be stored in the feature library, or the vector representation of each of the several feature data items can be stored in the feature library.

[0030] Assuming the preset feature categories are the first, third, and sixth feature categories as described above, and the multiple feature libraries to be constructed are feature library FL1, feature library FL2, and feature library FL3, where feature library FL1 involves the multiple feature categories, feature library FL2 involves the first and sixth feature categories, and feature library FL3 involves the first feature category. For any feature data D1, if feature data D1 includes sensor feature data corresponding to the first feature category, document attribute feature data corresponding to the third feature category, and GPS and device model information corresponding to the sixth feature category, then as shown in Figure 2, each feature data in feature data D1 can be stored in feature library FL1. Figure 2 is another schematic diagram of the feature library construction process in an embodiment of this specification. Further, to expand the feature data in feature library FL2 and / or feature library FL3, as shown in Figure 2, the sensor feature data and GPS and device model information in feature data D1 can also be stored in feature library FL2, and / or the sensor feature data in feature data D1 can be stored in feature library FL3.

[0031] In one implementation, for a feature library involving multiple feature categories, where the feature library stores vector representations of several feature data items corresponding to the multiple feature categories in feature data D1, in order to improve the matching accuracy of subsequent matching operations, weight values ​​corresponding to each feature category involved in the feature library can be configured to achieve segmented matching.

[0032] After constructing the feature library based on each feature data D1, the injection attack detection process shown in Figure 3 can be executed during the injection attack detection phase. Figure 3 is a flowchart of a method for detecting injection attacks in an embodiment of this specification. This method can be executed by any device with computing and processing capabilities (such as the user device in step S301 below, or a server communicating with the user device), platform, or device cluster, and includes steps S301-S305 as shown below.

[0033] As shown in Figure 3, in step S301, feature data D2 is acquired during the image acquisition process P2 of the user equipment, which includes at least sensor feature data corresponding to the target sensor in the user equipment. The target sensor is used to sense the motion of the user equipment.

[0034] Feature data D2 can be acquired based on multiple feature categories as described above, and the sensor feature data in feature data D2 corresponds to the first feature category among these multiple feature categories. For an explanation of image acquisition process P2 and feature data D2, please refer to the previous explanations of image acquisition process P1 and feature data D1, which will not be repeated here.

[0035] It should be noted that if only one feature library is built during the feature library construction phase, such as feature library FL as shown in Figure 1, then feature library FL can be used as the first feature library, and step S303 can be executed next. If multiple feature libraries are built during the feature library construction phase, then a feature library in which each feature category involved is a subset of each feature category corresponding to feature data D2 can be used as the first feature library, and step S303 can be executed next. Furthermore, if there is a feature library in the multiple feature libraries where each feature category involved is the same as each feature category corresponding to feature data D2, then that feature library can be used as the first feature library. In addition, to facilitate the differentiation of different feature data, each feature data in the first feature library will be referred to as feature data D3 in the following text.

[0036] In step S303, it is determined whether there is feature data D3 in the first feature library that matches feature data D2. Feature data D3 corresponds to the image acquisition process P1 in which injection behavior occurs.

[0037] Specifically, in one implementation, each feature data D3 in the first feature library can be sequentially matched with feature data D2 until a feature data D3 that matches feature data D2 is determined, or until all feature data D3 does not match feature data D2. In another implementation, to effectively improve matching efficiency, during the feature library construction phase, each feature data in each completed feature library can be clustered to divide the feature data into multiple clusters; based on this, it can be determined whether there is a feature data D3 that matches feature data D2 among the feature data D3 that serves as the center point of each cluster in the first feature library.

[0038] It should be noted that when performing a matching operation on feature data D3 and feature data D2 in the first feature library, as a matching operation method, the similarity S1 between feature data D3 and feature data D2 can be determined. If the similarity S1 reaches a similarity threshold, feature data D3 and feature data D2 are considered a match. Furthermore, if feature data D3 is a vector representation of a certain feature data D1 mentioned above, or a vector representation of a combination of several feature data items in feature data D1, then the vector representation corresponding to feature data D2 can be determined, and the similarity S1 between feature data D3 and this vector representation can be calculated.

[0039] To improve matching accuracy, as an alternative matching operation, when feature data D3 includes multiple feature data (or multiple vector representations), multiple feature data of the same feature category as feature data D3 can be identified from feature data D2. Then, the similarity S2 between feature data D3 and the feature data (or vector representations) of the same feature category in the multiple feature data (or their corresponding vector representations) is determined. Based on each similarity S2, the similarity S3 between feature data D3 and the multiple feature data (or their corresponding vector representations) is calculated. If the similarity S3 reaches a similarity threshold, feature data D3 is considered a match for the multiple feature data (or their corresponding vector representations). For example, when calculating the similarity S3, the average of each similarity S2 can be used as the similarity S3; alternatively, when the first feature library is configured with weight values ​​corresponding to each feature category, the similarity S2 is weighted and summed based on these weight values ​​to obtain the similarity S3.

[0040] When calculating the similarity S1 or similarity S2 as described above, existing similarity calculation algorithms can be used, such as cosine similarity or Jaccard similarity coefficient.

[0041] Next, in step S305, based on the determination result, it is determined whether there is injection behavior in the image acquisition process P2.

[0042] Specifically, if the determination result in step S303 is yes, it can be determined that the image acquisition process P2 involves injection behavior. If the determination result in step S303 is no, if there are other feature libraries in the constructed feature libraries where the feature categories involved are subsets of the feature categories corresponding to feature data D2, then the presence of injection behavior in the image acquisition process P2 can be determined by matching feature data D2 with the feature data in the other feature libraries; if the other feature library is not present in the constructed feature libraries, then the absence of injection behavior in the image acquisition process P2 can be determined.

[0043] In one implementation, to expand the feature data in the feature library and achieve continuous updates, if it is determined that injection behavior exists in the image acquisition process P2, and feature data D2 and its matching feature data D3 are not completely identical, feature data D2 can be considered a new feature or a new variant of an existing feature, and thus feature data D2 can be stored in the first feature library. Furthermore, to ensure the validity of the feature data in the feature library, review information including feature data D2 can be provided to the reviewer before storing feature data D2 in the first feature library. Based on this, feature data D2 can be stored in the first feature library after receiving the review result from the reviewer instructing that feature data D2 be added to the first feature library.

[0044] In the embodiment corresponding to Figure 3, feature data D2 can be acquired during the image acquisition process P2 of the user equipment. This data includes at least sensor feature data corresponding to the target sensor in the user equipment, which is used to sense the movement of the user equipment. Then, it is determined whether feature data D3 matching feature data D2 exists in the first feature library. Based on the determination result, it is then determined whether injection behavior exists during the image acquisition process P2. Since the sensor feature data corresponding to the target sensor is related to user behavior, it is not easy to forge, and the cost of forgery is high. Therefore, when malicious actors conduct mass injection attacks, this sensor feature data is generally limited. By using this sensor feature data for injection attack detection, effective injection attack detection of image acquisition behavior can be achieved.

[0045] In one implementation, during the construction of the multiple feature libraries as described above, for each feature data D1 as described above, and for each feature library in the multiple feature libraries that is a subset of the feature categories corresponding to the feature data D1, when storing several feature data items in the feature data D1 corresponding to the feature categories involved in the feature library into the feature library, any one of the data sequence composed of the several feature data items, the vector representation of the data sequence, and the vector representation sequence composed of the vector representations of each feature data item in the data sequence can be stored into the feature library.

[0046] Based on this, during the injection attack detection phase, feature data D2 can be obtained during the image acquisition process P2 of the user equipment. This data includes at least sensor feature data corresponding to the target sensor in the user equipment, which is used to sense the motion of the user equipment. Then, a data sequence V1 containing this sensor feature data can be constructed based on feature data D2. For example, for several feature libraries that have been constructed where each feature category is a subset of the feature categories corresponding to feature data D2, one of these feature libraries can be used as the first feature library. For ease of description, the data sequence in the first feature library will be referred to as data sequence D3 below. When constructing data sequence V1, several feature data items from feature data D2 corresponding to each feature category involved in the first feature library can be combined to form a data sequence V1 with the same structure as each data sequence D3 in the first feature library. This "same structure" can refer to consistency in dimensions and arrangement. Next, it can be determined whether a data sequence D3 matching data sequence V1 exists in the first feature library. Then, based on the determination result, it can be determined whether injection behavior exists during the image acquisition process P2.

[0047] Furthermore, before constructing the multiple feature libraries as described above, multiple data combination strategies corresponding to these feature libraries can be configured. Each data combination strategy includes the feature categories involved in its corresponding feature library. Thus, during the feature library construction phase, for each feature data D1 as described above, a data combination strategy can be determined from the preset multiple data combination strategies that includes a subset of the feature categories corresponding to feature data D1. Then, using this data combination strategy, a data sequence is constructed based on feature data D1, such as generating a data sequence based on several feature data items in feature data D1 corresponding to the feature categories included in the data combination strategy, and storing the data sequence in the feature library corresponding to the data combination strategy.

[0048] In practice, each feature data in feature data D1 can include a timestamp, and the data combination strategy can indicate that the data is sorted in ascending order of timestamps. Based on this, the data sequence constructed using this data combination strategy can be a time series. When storing this time series in the feature library corresponding to this data combination strategy, to facilitate subsequent matching operations, for example, the Time2Vec encoding method can be used to convert the time series into a vector representation, and then the vector representation can be stored in the feature library; or, each feature data in the time series can be converted into a vector representation, resulting in a vector representation sequence, and then the vector representation sequence can be stored in the feature library.

[0049] Time2Vec is a special encoding method designed to capture the periodicity and patterns of time series data, converting timestamps into vector representations that capture the complexity of the time dimension. Unlike traditional time encoding methods such as sine and cosine functions, Time2Vec allows the model to learn how best to represent time information. A Time2Vec layer can be used as a time-series-based embedding layer or as a standalone preprocessing module. The formula for Time2Vec is shown in equation (1) below:

[0050] Where k is the Time2Vec dimension; τ is the original time series feature; F is the periodic activation function; w and F is a set of learnable parameters, essentially the weight coefficients in the embedding layer of Time2Vec. In the experiments, to enable the algorithm to capture periodic behavior in the data, F was chosen as a sine function. Meanwhile, the linear term (corresponding to the formula for i=0) represents the aperiodic progression of time, used to capture aperiodic patterns in the time input.

[0051] In the case of multiple feature libraries corresponding to multiple preset data combination strategies, when constructing data sequence V1 based on feature data D2, in one embodiment, a data combination strategy can be selected from these multiple data combination strategies. The feature categories included in this data combination strategy are subsets of the feature categories corresponding to feature data D2. Then, using this data combination strategy, data sequence V1 is constructed based on feature data D2. Furthermore, the feature library corresponding to this data combination strategy is used as the first feature library.

[0052] Considering that the more types of feature data involved in the matching, the more accurate the matching result, in another implementation, a data sequence V1 can be constructed by executing step S403 as shown in Figure 4. Figure 4 is another flowchart of the method for detecting injection attacks in an embodiment of this specification. This method can be executed by any device with computing and processing capabilities (such as the user device in step S401 below, or a server communicating with the user device, etc.), platform, or device cluster, and includes steps S401-S409 as shown below.

[0053] As shown in Figure 4, in step S401, feature data D2 is acquired during the image acquisition process P2 of the user equipment. It is acquired based on multiple preset feature categories and includes at least sensor feature data corresponding to the target sensor in the user equipment. The target sensor is used to sense the motion of the user equipment, and the sensor feature data corresponds to the first feature category among the multiple feature categories.

[0054] For an explanation of step S401, please refer to the relevant descriptions above, which will not be repeated here.

[0055] Next, in step S403, in response to the existence of a first strategy among the preset multiple data combination strategies, a data sequence V1 is constructed based on feature data D2 using the first strategy; wherein, each of the multiple data combination strategies includes a first feature category, and the included feature categories are not completely the same, and correspond to different feature libraries, and the data sequences in the different feature libraries correspond to the image acquisition process P1 in which injection behavior occurs; each feature category included in the first strategy is the same as each feature category corresponding to feature data D2.

[0056] Next, in step S405, the feature library corresponding to the first strategy is used as the first feature library.

[0057] Next, in step S407, it is determined whether there is a data sequence D3 in the first feature library that matches the data sequence V1.

[0058] Specifically, in one implementation, each data sequence D3 in the first feature library can be sequentially matched with the data sequence V1 until a data sequence D3 that matches the data sequence V1 is determined, or until it is determined that none of the data sequences D3 match the data sequence V1. In another implementation, to effectively improve matching efficiency, during the feature library construction stage, each data sequence in each completed feature library can be clustered to divide the data sequences into multiple clusters; based on this, it can be determined whether there exists a data sequence D3 that matches the data sequence V1 in each cluster of the first feature library.

[0059] It should be noted that when performing a matching operation on data sequence D3 and data sequence V1 in the first feature library, as a matching operation method, the similarity S1 between data sequence D3 and data sequence V1 can be determined. If the similarity S1 reaches a similarity threshold, data sequence D3 and data sequence V1 are considered a match. Furthermore, if data sequence D3 is a vector representation D3, the similarity S1 between vector representation D3 and the vector representation of data sequence V1 can be calculated.

[0060] To improve matching accuracy, as an alternative matching operation, when the first feature library involves multiple feature categories and each feature category has its own weight value, the similarity S2 between the feature data of the same feature category in data sequence D3 and data sequence V1 can be determined. Based on this weight value, each similarity S2 is weighted and summed to obtain a similarity S3. When the similarity S3 reaches a similarity threshold, data sequence D3 is determined to match data sequence V1. Furthermore, when data sequence D3 is specifically a vector representation sequence D3, each feature data in data sequence V1 can be converted into a vector representation, thus obtaining the vector representation sequence corresponding to data sequence V1. Then, the similarity S2 between the vector representation sequence D3 and the vector representation sequence corresponding to data sequence V1 is calculated.

[0061] Next, in step S409, based on the determination result, it is determined whether there is injection behavior in the image acquisition process P2.

[0062] For an explanation of step S409, please refer to the relevant explanation of step S305 above, which will not be repeated here.

[0063] The embodiment shown in Figure 4 provides a solution that, when a first strategy is present among multiple preset data combination strategies, utilizes the first strategy to construct a data sequence V1 based on feature data D2, and uses the feature library corresponding to the first strategy as the first feature library. Then, by matching the data sequence V1 with the data sequence D3 in the first feature library, it detects whether injection behavior exists in the image acquisition process P2. This detection process effectively improves the accuracy of the detection results, achieving effective injection attack detection for image acquisition behavior.

[0064] In one implementation, to expand the data sequences of the aforementioned multiple feature libraries and achieve continuous updates to the feature libraries, when it is determined that injection behavior exists in the image acquisition process P2, if the data sequence V1 described above and its matching data sequence D3 are not completely identical, it can be considered that the data sequence V1 is a new feature or a new variant of an existing feature, and thus the data sequence V1 can be stored in the first feature library. For example, the vector representation of the data sequence V1 can be stored in the first feature library, or a sequence of vector representations composed of the vector representations of each feature data in the data sequence V1 can be stored in the first feature library. Furthermore, to ensure the validity of the data sequences in the feature library, review information including the data sequence V1 can be provided to the reviewer before storing the data sequence V1 in the first feature library. Based on this, after receiving the review result from the reviewer instructing that the data sequence V1 be added to the first feature library, the data sequence V1 can be stored in the first feature library.

[0065] Furthermore, when feature data D2 includes multiple feature data, before or after storing data sequence V1 in the first feature library, a data sequence V2 containing sensor feature data can be constructed based on feature data D2. This data sequence V2 is not entirely identical to the feature data included in data sequence V1. Then, data sequence V2 is stored in the second feature library, where each data sequence in the second feature library has the same structure as data sequence V2. For example, when data sequence V1 is constructed using the first strategy, a second strategy can be determined from the aforementioned multiple data combination strategies. Using the second strategy, data sequence V2 is constructed based on feature data D2, and the feature library corresponding to the second strategy is determined as the second feature library. The feature categories included in the second strategy are proper subsets of the feature categories corresponding to feature data D2.

[0066] Figure 5 is a schematic diagram of the structure of the device for detecting injection attacks in an embodiment of this specification. This device can be applied to any device, platform, or device cluster with computing and processing capabilities. The device can execute the method described in Figures 3 and 4, and includes: an acquisition unit 501 configured to acquire first feature data during a first image acquisition process performed by a user device, wherein at least sensor feature data corresponding to a target sensor in the user device is included, the target sensor being used to sense the motion of the user device; a first determination unit 502 configured to determine whether second feature data matching the first feature data exists in a first feature library, the second feature data corresponding to a second image acquisition process with injection behavior; and a second determination unit 503 configured to determine whether injection behavior exists in the first image acquisition process based on the determination result of the first determination unit 502.

[0067] This specification also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed in a computer, it causes the computer to perform the methods described in Figures 3 and 4.

[0068] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method described in Figures 3 and 4.

[0069] This specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the method described in Figures 3 and 4.

[0070] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0071] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0072] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude the possibility that, with the future development of computer technology, the computer implementing the functions of the above embodiments can be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0073] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes the elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any particular order.

[0074] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, when implementing one or more of these specifications, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0075] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.

[0076] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.

[0077] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.

[0078] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0079] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0080] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0081] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0082] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0083] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0084] The above description is merely an embodiment of one or more embodiments of this specification and is not intended to limit the scope of these embodiments. Various modifications and variations can be made to these embodiments by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims.

Claims

1. A method for detecting injection attacks, comprising: Acquire first feature data during the first image acquisition process of the user equipment, wherein at least sensor feature data corresponding to a target sensor in the user equipment is included, and the target sensor is used to sense the motion of the user equipment. Determine whether there is second feature data in the first feature library that matches the first feature data, wherein the second feature data corresponds to a second image acquisition process in which injection behavior occurs; Based on the determined results, it is determined whether injection behavior exists in the first image acquisition process.

2. The method according to claim 1, further comprising: Based on the first feature data, a first data sequence containing the sensor feature data is constructed; Determining whether there is second feature data in the first feature library that matches the first feature data includes: Determine whether there exists a second data sequence in the first feature library that matches the first data sequence; wherein each second data sequence in the first feature library has the same structure as the first data sequence.

3. The method according to claim 2, wherein, The first feature data is collected based on multiple preset feature categories, and the sensor feature data corresponds to the first feature category among the multiple feature categories; the first feature category is included in multiple preset data combination strategies, and the feature categories included in the multiple data combination strategies are not completely the same and correspond to different feature libraries; The step of constructing a first data sequence containing the sensor feature data based on the first feature data includes: In response to the existence of a first strategy among the plurality of data combination strategies, the first data sequence is constructed using the first strategy and based on the first feature data; wherein, the feature categories included in the first strategy are the same as the feature categories corresponding to the first feature data; The method further includes: The feature library corresponding to the first strategy is used as the first feature library.

4. The method according to claim 2, wherein, The first feature library involves multiple feature categories and is configured with weight values ​​corresponding to each of the multiple feature categories; Determining whether a second data sequence matching the first data sequence exists in the first feature library includes: For a second data sequence in the first feature library, a first similarity is determined between the second data sequence and the feature data corresponding to the same feature category in the first data sequence. The first similarities are then weighted and summed based on the weight values ​​to obtain a second similarity. In response to the second similarity reaching a similarity threshold, the second data sequence is determined to match the first data sequence.

5. The method according to claim 1 or 2, wherein, Each second feature data in the first feature library is divided into multiple clusters; Determining whether there is second feature data in the first feature library that matches the first feature data includes: Determine whether there exists second feature data that matches the first feature data in the second feature data of each of the multiple clusters, which serves as the center point.

6. The method according to claim 2, wherein, If it is determined that injection behavior exists in the first image acquisition process, the method further includes: In response to the first data sequence not being completely identical to the matching second data sequence, the first data sequence is stored in the first feature library.

7. The method according to claim 6, wherein, The step of storing the first data sequence into the first feature library includes: Store the vector representation of the first data sequence in the first feature library; or, The vector representation sequence composed of the vector representations of each feature data in the first data sequence is stored in the first feature library.

8. The method according to claim 6, wherein, The first feature data includes multiple feature data; When or after storing the first data sequence into the first feature library, the method further includes: Based on the first feature data, a third data sequence containing the sensor feature data is constructed, which is not exactly the same as the feature data included in the first data sequence. The third data sequence is stored in the second feature library; wherein each fourth data sequence in the second feature library has the same structure as the third data sequence.

9. The method according to claim 6, wherein, Before storing the first data sequence into the first feature library, the method further includes: Provide the auditors with audit information including the first data sequence; The system receives the audit results returned by the auditors, which are used to instruct the first data sequence to be added to the first feature library.

10. The method according to claim 1, wherein, The sensor feature data includes at least one of the following: device pose information and device motion data.

11. The method according to claim 1, wherein, The first image acquisition process involves acquiring an image of the target document. The first feature data also includes document attribute feature data corresponding to the target document. The acquisition process of the document attribute feature data includes: During the process of the user equipment acquiring the image of the target document, in response to acquiring the image frame acquired by the user equipment, the document detection model is used to detect the document in the image frame to obtain a first detection result. In response to the first detection result indicating the presence of an identification document in the image frame, and including the initial position of the document, the identification document region is extracted from the image frame based on the initial position, and an identification document image is generated based on the identification document region. The document image is subjected to document attribute detection using a document attribute detection model to obtain a second detection result, which includes multiple document attribute features. After determining that the quality of the document image is qualified based on the second detection result, at least some of the document attribute features among the multiple document attribute features are combined to form the document attribute feature data.

12. The method according to claim 11, wherein, The document attribute feature data includes at least one of the following: document location, angle feature, clarity value, brightness value, integrity value, and distance from the target document to the user device.

13. The method according to claim 1 or 11, wherein, The first feature data also includes at least one of the following corresponding to the user equipment: GPS information and equipment model information.

14. An apparatus for detecting injection attacks, comprising: The acquisition unit is configured to acquire first feature data during a first image acquisition process of the user equipment, wherein at least sensor feature data corresponding to a target sensor in the user equipment is included, and the target sensor is used to sense the motion of the user equipment. The first determining unit is configured to determine whether there is second feature data in the first feature library that matches the first feature data, wherein the second feature data corresponds to a second image acquisition process in which injection behavior exists; The second determining unit is configured to determine whether injection behavior exists in the first image acquisition process based on the determining result of the first determining unit.

15. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1-13.

16. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-13.