A message adaptive verification and risk blocking method, system, device and medium
By combining adaptive format verification and multi-dimensional feature analysis, the problem of insufficient coordination between message verification and risk blocking in the power transaction payment system is solved, and efficient and automated risk identification and blocking of the power transaction payment system is achieved.
Patent Information
- Application Number
- CN202611282883.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-17
AI Technical Summary
Existing power transaction payment systems lack sufficient coordination between message verification and risk blocking when processing massive transaction messages, making it difficult to adapt to business changes and effectively identify multi-dimensional combined risks.
An adaptive format verification method is adopted, which generates verification rules based on the field features of historical legitimate messages. The transaction message is then format verified. After the verification is passed, multi-dimensional extraction and fusion analysis of time-series features, statistical features and graph features are performed to generate anomaly detection results. Finally, risk blocking is implemented when anomalies are detected.
It achieves automatic updates of adaptive format verification rules, reduces maintenance costs, improves response speed, and enhances the comprehensiveness and accuracy of risk identification through multi-dimensional feature analysis, avoiding the one-sidedness of single-dimensional detection.
Smart Images

Figure CN123122907A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of message communication security technology, and in particular to a message adaptive verification and risk blocking method, system, device and medium. Background Technology
[0002] As the informatization level of the power trading payment system continues to improve and the transaction volume grows rapidly, the requirements for real-time risk control capabilities are becoming increasingly stringent.
[0003] In existing technologies, message verification and risk blocking in payment systems mainly rely on fixed rule message format verification, static threshold risk blocking, and single-dimensional feature anomaly detection. Furthermore, verification and blocking are usually executed as separate processes.
[0004] In existing technologies, power transaction payment systems lack sufficient coordination between message verification and risk blocking when processing massive transaction messages, making it difficult to adapt to business changes and effectively identify multi-dimensional combined risks. Summary of the Invention
[0005] This application provides a message adaptive verification and risk blocking method, system, device and medium that can perform message verification and risk blocking in a coordinated manner, and can effectively identify multi-dimensional combined risks in response to business changes.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, this application provides a message adaptive verification and risk blocking method, including: Obtain transaction messages; Based on the verification rules generated from the field features of historical legitimate messages, the transaction message is subjected to adaptive format verification to obtain the verification result; When the verification result indicates that the verification is successful, the transaction message is subjected to multi-dimensional extraction and fusion analysis of time sequence features, statistical features and graph features to obtain the anomaly detection result; When the anomaly detection result indicates that the transaction message is abnormal, the transaction message is blocked due to risk.
[0007] Optionally, the step of performing adaptive format verification on the transaction message based on the verification rules generated from the field features of historical valid messages to obtain the verification result includes: Verification rules are generated based on the field characteristics of historical legitimate messages, and the current verification rules are determined. Based on the current verification rules, obtain the array of field values of the transaction message; The similarity between the array of field values and the template of the array of field values corresponding to the current validation rule is calculated to obtain a similarity value; Determine whether the similarity value is greater than the current verification threshold; When the similarity value is greater than the current verification threshold, the verification is determined to be successful, and a verification result indicating that the verification has passed is obtained.
[0008] Optionally, when the similarity value is less than or equal to the current verification threshold, the method further includes: Extract the difference field features between the field value array of the transaction message and the field value array template corresponding to the current verification rule; The field value array template is updated based on the difference field characteristics to obtain the updated field value array template; The validation rules are updated based on the updated field value array template.
[0009] Optionally, the current verification threshold can be obtained in the following ways: The initial verification threshold is set to 95%. The initial verification threshold is automatically adjusted within ±5% based on the daily verification results to obtain the adjusted verification threshold. The adjusted verification threshold is dynamically corrected according to the business scenario to obtain the corrected verification threshold. Use the corrected verification threshold as the current verification threshold.
[0010] Optionally, the step of performing multi-dimensional extraction and fusion analysis of the transaction message using time-series features, statistical features, and graph features to obtain anomaly detection results includes: Obtain the time-series feature array, statistical feature array, and graph feature array of the transaction message; The time-series feature array, statistical feature array, and graph feature array are weighted and fused to obtain a fused feature array; Based on the difference between the baseline value of the fused feature array and each item in the fused feature array, a deviation array is obtained; Based on the number of elements in the deviation array that fall within a preset range, it is determined whether the transaction message is abnormal, and an anomaly detection result is obtained.
[0011] Optionally, obtaining the time-series feature array, statistical feature array, and graph feature array of the transaction message includes: Extract the transaction time interval and transaction frequency variation trend of the transaction messages to obtain a time-series feature array; Extract the transaction amount distribution and counterparty distribution from the transaction messages to obtain a statistical feature array; Extract the node degree and clustering coefficient of the transaction message in the transaction relationship network to obtain a graph feature array.
[0012] Optionally, determining whether the transaction message is abnormal based on the number of elements in the deviation array falling within a preset range, and obtaining the abnormality detection result, includes: Obtain the number of elements in the deviation array that fall within a preset range; The anomaly detection threshold is obtained by multiplying the feature dimension size by a preset ratio; the feature dimension size is the sum of the number of dimensions of the time-series feature array, the statistical feature array, and the graph feature array. Determine whether the number of elements is greater than the anomaly detection threshold; When the number of elements is greater than the anomaly judgment threshold, it is determined that the transaction message is abnormal, and an anomaly detection result indicating that the transaction message is abnormal is obtained; When the number of elements is less than or equal to the anomaly judgment threshold, it is determined that the transaction message does not have an anomaly, and an anomaly detection result indicating that the transaction message does not have an anomaly is obtained.
[0013] Secondly, this application provides a message adaptive verification and risk blocking system, including: The message access module is used to acquire transaction messages; An adaptive verification module is used to perform adaptive format verification on the transaction message based on the verification rules generated from the field characteristics of historical legal messages, and obtain the verification result. The multi-dimensional feature fusion module is used to perform multi-dimensional extraction and fusion analysis of time-series features, statistical features and graph features on the transaction message when the verification result indicates that the verification is passed, so as to obtain the anomaly detection result. The risk blocking module is used to block the transaction message when the anomaly detection result indicates that the transaction message is abnormal.
[0014] Thirdly, this application provides a computing device, including a memory and a processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of the first aspects.
[0015] Fourthly, this application provides a computer-readable storage medium for storing a computer program for performing the method as described in any one of the first aspects.
[0016] As can be seen from the above technical solution, this application has at least the following beneficial effects: This application acquires transaction messages and performs adaptive format verification on them based on verification rules generated from the field features of historical valid messages. When the verification result indicates successful verification, the application performs multi-dimensional extraction and fusion analysis of time-series features, statistical features, and graph features to obtain anomaly detection results. When the anomaly detection results indicate anomalies in the transaction message, the application blocks the transaction message due to risk. Because the verification rules are generated based on the field features of historical valid messages, they can automatically adapt to changes in message format as historical message data accumulates, eliminating the need for manual modification of fixed rules, thus reducing maintenance costs and improving response speed. Furthermore, through multi-dimensional extraction and fusion analysis of time-series features, statistical features, and graph features, anomaly detection can be performed on messages from three different perspectives: time series patterns, data statistical patterns, and transaction network topology. This avoids the limitations of single-dimensional detection, thereby improving the comprehensiveness of risk identification, adapting to business changes, and effectively identifying multi-dimensional combined risks.
[0017] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0018] Figure 1 A schematic flowchart of a message adaptive verification and risk blocking method provided in this application embodiment; Figure 2 A schematic diagram of a message adaptive verification and risk blocking system structure is provided for an embodiment of this application; Figure 3 This is a schematic diagram of a computing device provided in an embodiment of this application. Detailed Implementation
[0019] The terms "first," "second," and "third," etc., used in this application specification and accompanying drawings are used to distinguish different objects, not to limit a specific order.
[0020] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0021] This application provides a message adaptive verification and risk blocking method, which can be executed by a processing device. The processing device can be a terminal or a server. Terminals include, but are not limited to, smartphones, tablets, laptops, personal digital assistants, or smart wearable devices. The server can be a cloud server, such as a central server in a central cloud computing cluster or an edge server in an edge cloud computing cluster. Alternatively, the server can be a server in a local data center. A local data center refers to a data center directly controlled by the user.
[0022] To make the technical solution of this application clearer and easier to understand, the following describes a message adaptive verification and risk blocking method provided by an embodiment of this application, in conjunction with the accompanying drawings. Figure 1 As shown in the figure, this is a schematic flowchart of a message adaptive verification and risk blocking method provided in an embodiment of this application. The method includes: S101, obtain transaction message.
[0023] Specifically, transaction messages from the payment system can be accessed through high-performance message queue middleware. High-performance message queue middleware is a software component capable of efficiently handling high-concurrency message transmission, such as Apache Kafka or RabbitMQ. It establishes a buffer channel between the message generation end and the processing end, ensuring that massive transaction messages are received in an orderly manner without loss. After entering the system, transaction messages are temporarily stored in a message queue awaiting processing, thereby decoupling message access from downstream processing and improving system throughput.
[0024] S102, based on the verification rules generated from the field characteristics of historical legitimate messages, perform adaptive format verification on the transaction message to obtain the verification result.
[0025] It should be noted that historically valid messages refer to messages that have been verified as correctly formatted and business-compliant in past transactions. Their field characteristics include attributes such as field name, field order, field data type, and field value range. The system automatically generates verification rules by learning from a large number of historically valid messages. These rules describe the field characteristic patterns that valid messages should satisfy.
[0026] As an optional implementation, the above-mentioned verification rules generated based on the field characteristics of historical legal messages are used to perform adaptive format verification on the transaction message to obtain the verification result, including the following steps S1021-S1025.
[0027] S1021, Generate verification rules based on the field characteristics of historical legitimate messages, and determine the current verification rules.
[0028] Specifically, all historical valid messages can be extracted from the historical valid message database. The field set contained in each message can be analyzed, and the frequency of occurrence, value distribution, and relationships between fields can be statistically analyzed to construct a field value array template that represents the format of a valid message. This field value array template is a multi-dimensional data structure, where each dimension corresponds to a field, and the value of each dimension reflects the typical value pattern of that field in valid messages. This field value array template is then bound to validation rules to form the current validation rules.
[0029] S1022, Based on the current verification rules, obtain the array of field values of the transaction message.
[0030] Specifically, when a new transaction message enters the system, the system extracts the corresponding field values from the transaction message according to the field order and data type defined in the current verification rules, and organizes them into an array of field values in the same order. For example, if the current verification rules stipulate that the message should contain four fields: transaction time, transaction amount, counterparty, and transaction type, then the system extracts the values of these four fields from the transaction message in sequence to form a one-dimensional array containing four elements.
[0031] S1023, calculate the similarity between the field value array and the field value array template corresponding to the current validation rule to obtain the similarity value.
[0032] Specifically, algorithms such as cosine similarity, Euclidean distance, or Jaccard similarity coefficient can be used to calculate the similarity between the field value array of the current transaction message and the field value array template. Taking cosine similarity as an example, the two arrays are treated as vectors in a vector space, and the cosine value of the angle between the two vectors is calculated. The closer this value is to 1, the more consistent the directions of the two vectors are, meaning that the field features of the current message are more similar to the field features of historical legitimate messages. Through similarity calculation, the system can quantify the degree of deviation between the current message and the legitimate message pattern.
[0033] It should be noted that the field values in legitimate messages naturally vary, for example, transaction amounts can vary. Similarity calculation reflects the overall closeness of field features, not absolute consistency across individual fields. Therefore, normal fluctuations will only cause a slight decrease in similarity, such as from 100% to 99.75%, without triggering false blocking. Only when field features deviate substantially, such as missing fields or illegal values, will the similarity decrease significantly, for example, from 100% to 71.64%. As a concrete example, using cosine similarity, suppose the current verification rules stipulate that a transaction message should contain four fields: transaction amount, transaction frequency, counterparty legitimacy, and field completeness. Before calculation, the values of each field are normalized to the range of 0 to 1 according to their legitimate value range, thus representing the field value array as a four-dimensional vector: First, construct a field value array template. In historical legitimate messages, the legitimate value range for transaction amount is 1000 yuan to 10000 yuan, with a typical value of 5000 yuan. According to the normalization formula... , (5000-1000) / (10000-1000)≈0.444, thus the normalized value is approximately 0.444; the legal range of transaction frequency is 1 to 10 times per hour, with a typical value of 4 times per hour. After normalization in the same way, the normalized value is approximately 0.333; in the counterparty validity field, it is 1 when the counterparty belongs to the valid counterparty database, otherwise it is 0, and this field is 1 in historical valid messages; in the field completeness field, it is 1 when all required fields are complete, and this field is 1 in historical valid messages. Thus, the vector corresponding to the field value array template is [0.444, 0.333, 1, 1].
[0034] For a normal transaction message, the transaction amount is 4800 yuan, which is 0.422 after normalization; the transaction frequency is 5 times per hour, which is 0.444 after normalization; the counterparty belongs to the legitimate counterparty database, so it is set to 1; all required fields are complete, so it is set to 1, meaning the vector corresponding to the field value array of this message is [0.422, 0.444, 1, 1]. The cosine similarity between this vector and the template vector is calculated: first, the dot product of the two vectors is calculated, i.e., 0.422 × 0.444 + 0.444 × 0.333 + 1 × 1 + 1 × 1 ≈ 2.335; then, the modulus of the two vectors is calculated separately. The modulus of the message vector is approximately 1.541, and the modulus of the template vector is approximately 1.519; the similarity = 2.335 / (1.541 × 1.519) ≈ 99.75%. Since 99.75% is greater than the current verification threshold of 95%, the judgment in S1024 is valid, and the verification is confirmed in S1025. The message then enters the multi-dimensional fusion analysis in S103.
[0035] For another abnormal transaction message, the transaction amount is 4800 yuan, which is 0.422 after normalization; the transaction frequency field is missing, so this dimension is set to 0; the counterparty does not belong to the legitimate counterparty database, so it is set to 0; one of the four required fields is missing, so the field completeness is set to 0.75, meaning the vector corresponding to the field value array of this message is [0.422, 0, 0, 0.75]. Similarly, cosine similarity is calculated: 0.422 × 0.444 + 0 + 0 + 0.75 × 1 ≈ 0.937; the modulus of the message vector is approximately 0.861, and the modulus of the template vector is approximately 1.519; similarity = 0.937 / (0.861 × 1.519) ≈ 71.64%. Since 71.64% is less than the current verification threshold of 95%, the verification fails. The system then extracts the difference field features between the message and the field value array template, and updates the field value array template based on these difference field features. It should be noted that template learning can be performed only for differences such as "field addition and value range expansion", while differences such as "field missing and illegal value" are not included in the template update. In this way, the verification rules are updated, and an adaptive learning is completed.
[0036] As can be seen from the examples above, normal messages only exhibit normal fluctuations in field values, and their similarity values decrease only slightly but remain above the verification threshold; while abnormal messages, due to missing fields or invalid field values, will have their similarity values drop significantly below the verification threshold, thus being accurately identified and triggering adaptive updates to the verification rules.
[0037] S1024, Determine whether the similarity value is greater than the current verification threshold.
[0038] It should be noted that the current verification threshold is a boundary value used to distinguish between format-compliant messages and format-identifiable messages. As an optional implementation method, the current verification threshold can be obtained by: setting an initial verification threshold to 95%; automatically adjusting the initial verification threshold within ±5% based on daily verification results to obtain an adjusted verification threshold; dynamically correcting the adjusted verification threshold according to the business scenario to obtain a corrected verification threshold; and using the corrected verification threshold as the current verification threshold.
[0039] In the embodiments provided in this application, the initial verification threshold means that a message is considered valid only when its similarity to historical valid messages reaches 95% or more. The system counts the number of messages that pass and fail verification daily. If the false positive rate is high, meaning a large number of valid messages are deemed invalid, the system automatically lowers the threshold, for example, from 95% to 93%. Conversely, if the false negative rate is high, meaning a large number of abnormal messages are deemed valid, the system raises the threshold, for example, from 95% to 97%. The fluctuation range is controlled within ±5% to avoid excessive threshold fluctuations that could lead to system instability. The adjusted verification threshold is then dynamically corrected based on the business scenario to obtain a revised verification threshold. For example, during peak transaction periods, the revised verification threshold can be appropriately lowered to reduce interceptions caused by minor format changes, while during off-peak periods, the revised verification threshold can be increased to strengthen review. The revised verification threshold is used as the current verification threshold for message verification judgment on that day.
[0040] S1025, when the similarity value is greater than the current verification threshold, the verification is determined to be successful, and a verification result indicating that the verification has passed is obtained.
[0041] At this point, the system considers the format of the transaction message to be highly consistent with historical valid messages, and there are no obvious format anomalies. Therefore, the message is allowed to proceed to the next stage of processing. The verification result is output in the form of a Boolean value or a status code, such as True or 1 indicating that the verification passed.
[0042] In the embodiments provided in this application, as an optional implementation, when the similarity value is less than or equal to the current verification threshold, the method further includes: extracting the difference field features between the field value array of the transaction message and the field value array template corresponding to the current verification rule; updating the field value array template according to the difference field features to obtain the updated field value array template; and updating the verification rule according to the updated field value array template.
[0043] Specifically, by comparing each dimension of the current field value array with that of the field value array template, fields whose values differ from the preset tolerance can be identified. The names, actual values, and expected value ranges of these fields are recorded, forming a set of difference field features. For example, if the transaction amount field in a historical valid message ranges from 1000 to 10000, while the current message has a value of 50000, this field is marked as a difference field feature. Then, this difference field feature is incorporated into the learning scope, and the field distribution of all historical valid messages, including this new feature, is re-statistically analyzed. The value range or typical value of the corresponding dimension in the field value array template is adjusted to ensure the updated field value array template is compatible with the new message format. For example, the expected upper limit of the transaction amount field can be expanded from 10000 to 50000, or a new field dimension can be added to accommodate the new message field. The updated field value array template then replaces the original template and is re-bound to the validation rules, forming a new current validation rule. Thus, the system can automatically adapt to changes in message format without manual intervention, achieving self-evolution of the validation rules. This adaptive update process enables the system to automatically learn and adjust the verification standards when faced with changes in message format due to business upgrades. This avoids the drawback of traditional fixed-rule verification requiring manual modification of each rule, significantly reducing maintenance costs and improving response speed.
[0044] S103, when the verification result indicates that the verification is successful, perform multi-dimensional extraction and fusion analysis of the transaction message's time sequence features, statistical features, and graph features to obtain the anomaly detection result.
[0045] It should be noted that temporal characteristics refer to the regularity of transaction messages over time, statistical characteristics refer to the regularity of transaction messages in numerical distribution, and graph characteristics refer to the topological properties of transaction messages in a relational network. By integrating these three types of characteristics, the system can comprehensively assess the risk level of transaction messages from multiple different perspectives.
[0046] As an optional implementation method, multi-dimensional extraction and fusion analysis of transaction messages, including temporal features, statistical features, and graph features, is performed to obtain anomaly detection results, including the following steps S1031-S1034: S1031, obtain the time-series feature array, statistical feature array, and graph feature array of the transaction message.
[0047] In the embodiments provided in this application, relevant attributes can be extracted from the transaction message and its associated transaction records and organized into an array for subsequent numerical calculations.
[0048] Specifically, the transaction time interval and transaction frequency change trend of transaction messages can be extracted to obtain a time series feature array; the transaction amount distribution and counterparty distribution of transaction messages can be extracted to obtain a statistical feature array; and the node degree and clustering coefficient of transaction messages in the transaction relationship network can be extracted to obtain a graph feature array.
[0049] It should be noted that the transaction time interval refers to the time difference between two adjacent transactions. The system records the timestamp difference between the current message and the previous transaction message, forming a time interval sequence. The transaction frequency change trend refers to the rate of change of the number of transactions per unit time. The system counts the number of transactions within the time window of the current message and compares it with the previous time window to calculate the increase or decrease in frequency. The above time intervals and frequency change trends are arranged in a fixed order to form a time series feature array. The transaction amount distribution refers to the position attribute of the amount involved in the current message within the overall transaction amount range, such as the percentage of the current amount to the historical average amount or the amount percentile of the current amount. The counterparty distribution refers to the frequency attribute of the current counterparty in the overall counterparty set, such as the proportion of the counterparty's transaction count in the past week. The above amount distribution attributes and counterparty distribution attributes are arranged in a fixed order to form a statistical feature array. A transaction relationship network is a graph structure consisting of transaction entities as nodes and transaction relationships as edges. Node degree refers to the number of edges directly connected to the initiator or receiver of the current transaction message in the network, reflecting the transaction activity of the entity. Clustering coefficient is the ratio of the actual number of edges between the entity's neighboring nodes to the maximum possible number of edges, reflecting the tightness of the transaction community to which the entity belongs. The node degree and clustering coefficient are arranged in a fixed order to form a graph feature array.
[0050] S1032, weighted fusion of time series feature array, statistical feature array and graph feature array to obtain fused feature array.
[0051] Specifically, a weight coefficient can be assigned to each feature array, and the elements in each array can be multiplied by the corresponding weight and then merged to form a new fused feature array. As an optional implementation, a weight of 0.4 can be assigned to the time series feature array, a weight of 0.35 to the statistical feature array, and a weight of 0.25 to the graph feature array.
[0052] As a specific example, suppose that step S1031 extracts the following: a time-series feature array [25, 30], where the first element is the transaction time interval of 25 seconds, i.e., the difference between the timestamp of the current transaction message and the previous transaction message is 25 seconds; the second element is the transaction frequency change trend of 30, i.e., the number of transactions in the current time window increases by 30% compared to the previous time window, and is counted in the array as a percentage of 30; and a statistical feature array [22.86, 42.86], where the first element is the transaction amount distribution of 22.86, i.e., when... The previous transaction amount accounts for 22.86% of the historical average transaction amount. The second element is the counterparty distribution of 42.86, which means that the current counterparty's transaction frequency accounts for 42.86% of the total transaction frequency in the past week. The graph feature array is [36, 44], where the first element is the node degree of 36, which means that the initiator of the current transaction message is directly connected to 36 edges in the transaction relationship network. The second element is the clustering coefficient of 44, which means that the actual number of edges between the initiator's neighboring nodes accounts for 44% of the maximum possible number of edges, and is counted in the array as a percentage of 44. In step S1032, a weight coefficient of 0.4 is assigned to the temporal feature array, a weight coefficient of 0.35 is assigned to the statistical feature array, and a weight coefficient of 0.25 is assigned to the graph feature array. The weighted temporal feature array is [10, 12]; the weighted statistical feature array is [8, 15]; and the weighted graph feature array is [9, 11]. Then, following the fixed order of temporal features, statistical features, and graph features, the three weighted arrays are concatenated end to end to obtain the fused feature array [10, 12, 8, 15, 9, 11]. The first and second elements come from temporal features, the third and fourth elements come from statistical features, and the fifth and sixth elements come from graph features.
[0053] It should be noted that the aforementioned weight values can be dynamically adjusted according to the risk scenario. For example, in scenarios where abnormally concentrated transaction times are detected, the weight of the time-series feature array can be appropriately increased to 0.5, while the weights of the other two types of features can be correspondingly decreased to highlight the detection sensitivity of the time dimension. In scenarios where abnormally frequent fluctuations in transaction amounts are detected, the weight of the statistical feature array can be increased to strengthen the detection capability of the amount dimension. Through weighted fusion, the system can unify different types of features under the same dimension, facilitating comprehensive comparison.
[0054] S1033, Obtain the deviation array based on the difference between the baseline value of the fused feature array and each item in the fused feature array.
[0055] First, a baseline value for the fused feature array can be calculated. Specifically, the baseline value can be the arithmetic mean, median, or mode of all elements in the fused feature array, representing the baseline level of the current transaction message under normal conditions. For example, the arithmetic mean of all elements in the fused feature array can be calculated and used as the baseline value.
[0056] Then, the deviation array is obtained by comparing the baseline value of the fused feature array with the difference between each item in the fused feature array. Specifically, the baseline value can be subtracted from each element in the fused feature array, and the absolute value can be taken to obtain the degree of deviation of each feature dimension from the baseline level. For example, if the fused feature array is [10, 12, 8, 15, 9, 11], and the baseline value is 10.83, then the deviation array is [0.83, 1.17, 2.83, 4.17, 1.83, 0.17]. Each element in the deviation array reflects the fluctuation range of the corresponding feature dimension; the larger the value, the higher the probability of an anomaly in that dimension.
[0057] S1034, based on the number of elements in the deviation array that fall within the preset range, determine whether there is an anomaly in the transaction message and obtain the anomaly detection result.
[0058] It should be noted that the preset range is a numerical interval used to filter out values that exceed the normal fluctuation range. Its lower limit can be set based on the normal fluctuation upper limit of the deviation values of each feature dimension in historical legitimate transaction messages, and its upper limit can be set based on the maximum tolerance deviation range for the business, for example, a preset range of 1 to 5. Specifically, the number of elements in the deviation array that fall within this range can be counted, i.e., how many feature dimensions have reached a level requiring attention. Taking the above deviation array [0.83, 1.17, 2.83, 4.17, 1.83, 0.17] as an example, the elements falling within the preset range of 1 to 5 are 1.17, 2.83, 4.17, and 1.83, i.e., the number of elements is 4.
[0059] In the embodiments provided in this application, the anomaly detection threshold can be obtained by acquiring the number of elements in the deviation array that fall within a preset range; calculating the product of the feature dimension size and the preset ratio; determining whether the number of elements is greater than the anomaly detection threshold; when the number of elements is greater than the anomaly detection threshold, determining that the transaction message is abnormal, and obtaining an anomaly detection result indicating that the transaction message is abnormal; when the number of elements is less than or equal to the anomaly detection threshold, determining that the transaction message is not abnormal, and obtaining an anomaly detection result indicating that the transaction message is not abnormal.
[0060] Specifically, each element in the deviation array can be iterated through to determine whether it is greater than or equal to the lower limit of the preset range and less than or equal to the upper limit of the preset range. If the condition is met, the count is incremented by one, and finally the total number of elements falling into the range is obtained.
[0061] Then, the product of the feature dimension size and the preset ratio is calculated to obtain the anomaly detection threshold. It should be noted that the preset ratio is a percentage parameter used to determine the minimum number of anomalies required across all feature dimensions for an overall message anomaly to be considered. As an optional implementation, the preset ratio can be set to 50%. That is, when more than half of the feature dimensions show significant deviations, the entire message is considered anomaly, thus avoiding misjudgments caused by fluctuations in a single dimension. Taking the above example, the feature dimension size is the sum of the number of dimensions in the time-series feature array, statistical feature array, and graph feature array, i.e., 2+2+2=6. Therefore, the anomaly detection threshold is 6×50%=3. Next, it is determined whether the number of elements is greater than the anomaly detection threshold. In the above example, the number of elements, 4, is greater than the anomaly detection threshold of 3, so the transaction message is determined to be anomaly, resulting in an anomaly detection result indicating anomaly in the transaction message. At this point, the system considers that the message exhibits sufficient anomaly signs across multiple feature dimensions, requiring risk blocking. In contrast, if the fusion feature array of another transaction message is [10, 11, 9, 10, 10, 11], then the baseline value is approximately 10.17, and the deviation array is [0.17, 0.83, 1.17, 0.17, 0.17, 0.83]. Among these, only 1.17 falls within the preset range of 1 to 5, and the number of elements is 1, which is less than the anomaly judgment threshold of 3. Therefore, it is determined that the transaction message does not have any anomalies, and an anomaly detection result indicating that the transaction message does not have any anomalies is obtained, allowing it to continue to participate in downstream business processing.
[0062] Through the aforementioned multi-dimensional extraction and fusion analysis, the system can perform comprehensive detection of transaction messages from three different perspectives: temporal patterns, statistical patterns, and relationship networks, avoiding the one-sidedness caused by judging risks from only a single dimension. Furthermore, through weighted fusion and dynamic threshold adjustment, the system can flexibly adjust the detection sensitivity according to actual risk scenarios, thereby improving the comprehensiveness and accuracy of risk identification.
[0063] S104: When the anomaly detection result indicates that the transaction message is abnormal, the transaction message is blocked due to risk.
[0064] Specifically, risk blocking refers to intercepting transaction messages deemed abnormal, preventing them from entering the payment system's processing stages. For example, the message can be marked as high-risk and transferred to a manual review queue, or the transaction request can be directly rejected with an error response. Simultaneously, the system saves the blocking results to a database for post-event audit analysis and rule optimization. By integrating adaptive format validation and multi-dimensional anomaly detection into the same workflow, successful validation directly leads to fusion analysis, eliminating the need for separate operations in distinct processes. This reduces the workload for operators and avoids data errors caused by asynchronous validation and blocking.
[0065] Based on the above description, this application has the following beneficial effects: This application provides a message adaptive verification and risk blocking method. By acquiring transaction messages, it performs adaptive format verification on the transaction messages according to verification rules generated based on the field features of historical legitimate messages, obtaining verification results. When the verification result indicates that the verification passed, it performs multi-dimensional extraction and fusion analysis of time-series features, statistical features, and graph features on the transaction messages to obtain anomaly detection results. When the anomaly detection results indicate that the transaction messages are abnormal, it blocks the transaction messages. Since the verification rules are generated based on the field features of historical legitimate messages, they can automatically adapt to changes in message format as historical message data accumulates, eliminating the need for manual modification of fixed rules, thereby reducing maintenance costs and improving response speed. Simultaneously, through multi-dimensional extraction and fusion analysis of time-series features, statistical features, and graph features, it can detect anomalies in messages from three different perspectives: time series patterns, data statistical patterns, and transaction network topology, avoiding the one-sidedness of single-dimensional detection and thus improving the comprehensiveness of risk identification. Furthermore, adaptive format validation and multi-dimensional extraction and fusion analysis are executed sequentially and completed within the same workflow. Once validation is successful, the process directly proceeds to multi-dimensional analysis without the need for separate operations in separate workflows. This reduces the workload of operators and avoids data errors caused by asynchronous workflows.
[0066] The above text combined Figure 1 This application provides a detailed description of a message adaptive verification and risk blocking method. The system and device provided in this application will be described below with reference to the accompanying drawings.
[0067] like Figure 2 As shown in the figure, this is a schematic diagram of a message adaptive verification and risk blocking system provided in an embodiment of this application. The message adaptive verification and risk blocking system 200 includes: Message access module 210 is used to acquire transaction messages; The adaptive verification module 220 is used to perform adaptive format verification on the transaction message according to the verification rules generated based on the field characteristics of historical legal messages, and obtain the verification result. The multi-dimensional feature fusion module 230 is used to perform multi-dimensional extraction and fusion analysis of time-series features, statistical features and graph features on the transaction message when the verification result indicates that the verification is passed, so as to obtain the anomaly detection result. The risk blocking module 240 is used to block the transaction message when the anomaly detection result indicates that the transaction message is abnormal.
[0068] Optional, the adaptive verification module 220 is specifically used for: Verification rules are generated based on the field characteristics of historical legitimate messages, and the current verification rules are determined. Based on the current verification rules, obtain the array of field values of the transaction message; The similarity between the array of field values and the template of the array of field values corresponding to the current validation rule is calculated to obtain a similarity value; Determine whether the similarity value is greater than the current verification threshold; When the similarity value is greater than the current verification threshold, the verification is determined to be successful, and a verification result indicating that the verification has passed is obtained.
[0069] Optionally, the adaptive verification module 220 is also used for: Extract the difference field features between the field value array of the transaction message and the field value array template corresponding to the current verification rule; The field value array template is updated based on the difference field characteristics to obtain the updated field value array template; The validation rules are updated based on the updated field value array template.
[0070] Optionally, the adaptive verification module 220 is also specifically used for: The initial verification threshold is set to 95%. The initial verification threshold is automatically adjusted within ±5% based on the daily verification results to obtain the adjusted verification threshold. The adjusted verification threshold is dynamically corrected according to the business scenario to obtain the corrected verification threshold. Use the corrected verification threshold as the current verification threshold.
[0071] Optional, the multi-dimensional feature fusion module 230 is specifically used for: Obtain the time-series feature array, statistical feature array, and graph feature array of the transaction message; The time-series feature array, statistical feature array, and graph feature array are weighted and fused to obtain a fused feature array; Based on the difference between the baseline value of the fused feature array and each item in the fused feature array, a deviation array is obtained; Based on the number of elements in the deviation array that fall within a preset range, it is determined whether the transaction message is abnormal, and an anomaly detection result is obtained.
[0072] Optionally, the multi-dimensional feature fusion module 230 is also specifically used for: Extract the transaction time interval and transaction frequency variation trend of the transaction messages to obtain a time-series feature array; Extract the transaction amount distribution and counterparty distribution from the transaction messages to obtain a statistical feature array; Extract the node degree and clustering coefficient of the transaction message in the transaction relationship network to obtain a graph feature array.
[0073] Optionally, the multi-dimensional feature fusion module 230 is also specifically used for: Obtain the number of elements in the deviation array that fall within a preset range; The anomaly detection threshold is obtained by multiplying the feature dimension size by a preset ratio; the feature dimension size is the sum of the number of dimensions of the time-series feature array, the statistical feature array, and the graph feature array. Determine whether the number of elements is greater than the anomaly detection threshold; When the number of elements is greater than the anomaly judgment threshold, it is determined that the transaction message is abnormal, and an anomaly detection result indicating that the transaction message is abnormal is obtained; When the number of elements is less than or equal to the anomaly judgment threshold, it is determined that the transaction message does not have an anomaly, and an anomaly detection result indicating that the transaction message does not have an anomaly is obtained.
[0074] The message adaptive verification and risk blocking system provided in this application embodiment can correspond to the execution of the method described in this application embodiment, and the other operations and / or functions of each module / unit of the message adaptive verification and risk blocking system are respectively for implementing Figure 1 For the sake of brevity, the corresponding processes of each method in the illustrated embodiments will not be described in detail here.
[0075] This application also provides a computing device.
[0076] like Figure 3 As shown in the figure, this is a schematic diagram of a computing device provided in an embodiment of this application. The computing device 300 includes a bus 301, a processor 302, a communication interface 303, and a memory 304. The processor 302, the memory 304, and the communication interface 303 communicate with each other via the bus 301.
[0077] Bus 301 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 3 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0078] The processor 302 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).
[0079] Communication interface 303 is used for communication with external devices.
[0080] Memory 304 may include volatile memory, such as random access memory (RAM). Memory 304 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0081] The memory 304 stores executable code, and the processor 302 executes the executable code to perform the aforementioned message adaptive verification and risk blocking method.
[0082] Specifically, in achieving Figure 2 In the case of the illustrated embodiment, and Figure 2 When the modules or units of the message adaptive verification and risk blocking system described in the embodiment are implemented in software, the execution... Figure 2 The software or program code required for the functions of each module / unit can be partially or entirely stored in memory 304. Processor 302 executes the program code corresponding to each unit stored in memory 304 and executes the aforementioned message adaptive verification and risk blocking method.
[0083] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the aforementioned message adaptive verification and risk blocking method.
[0084] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.
[0085] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be covered within the scope of protection of this application.
Claims
1. A message adaptive verification and risk blocking method, characterized in that, The method includes: Obtain transaction messages; Based on the verification rules generated from the field features of historical legitimate messages, the transaction message is subjected to adaptive format verification to obtain the verification result; When the verification result indicates that the verification is successful, the transaction message is subjected to multi-dimensional extraction and fusion analysis of time sequence features, statistical features and graph features to obtain the anomaly detection result; When the anomaly detection result indicates that the transaction message is abnormal, the transaction message is blocked due to risk.
2. The method according to claim 1, characterized in that, The step of performing adaptive format verification on the transaction message based on the verification rules generated from the field characteristics of historical valid messages, and obtaining the verification result, includes: Verification rules are generated based on the field characteristics of historical legitimate messages, and the current verification rules are determined. Based on the current verification rules, obtain the array of field values of the transaction message; The similarity between the array of field values and the template of the array of field values corresponding to the current validation rule is calculated to obtain a similarity value; Determine whether the similarity value is greater than the current verification threshold; When the similarity value is greater than the current verification threshold, the verification is determined to be successful, and a verification result indicating that the verification has passed is obtained.
3. The method according to claim 2, characterized in that, When the similarity value is less than or equal to the current verification threshold, the method further includes: Extract the difference field features between the field value array of the transaction message and the field value array template corresponding to the current verification rule; The field value array template is updated based on the difference field characteristics to obtain the updated field value array template; The validation rules are updated based on the updated field value array template.
4. The method according to claim 2, characterized in that, The current verification threshold is obtained through the following methods: The initial verification threshold is set to 95%. The initial verification threshold is automatically adjusted within ±5% based on the daily verification results to obtain the adjusted verification threshold. The adjusted verification threshold is dynamically corrected according to the business scenario to obtain the corrected verification threshold. Use the corrected verification threshold as the current verification threshold.
5. The method according to claim 1, characterized in that, The multi-dimensional extraction and fusion analysis of the transaction message using time-series features, statistical features, and graph features yields anomaly detection results, including: Obtain the time-series feature array, statistical feature array, and graph feature array of the transaction message; The time-series feature array, statistical feature array, and graph feature array are weighted and fused to obtain a fused feature array; Based on the difference between the baseline value of the fused feature array and each item in the fused feature array, a deviation array is obtained; Based on the number of elements in the deviation array that fall within a preset range, it is determined whether the transaction message is abnormal, and an anomaly detection result is obtained.
6. The method according to claim 5, characterized in that, The step of obtaining the time-series feature array, statistical feature array, and graph feature array of the transaction message includes: Extract the transaction time interval and transaction frequency variation trend of the transaction messages to obtain a time-series feature array; Extract the transaction amount distribution and counterparty distribution from the transaction messages to obtain a statistical feature array; Extract the node degree and clustering coefficient of the transaction message in the transaction relationship network to obtain a graph feature array.
7. The method according to claim 5, characterized in that, The step of determining whether the transaction message is abnormal based on the number of elements in the deviation array that fall within a preset range, and obtaining the abnormality detection result, includes: Obtain the number of elements in the deviation array that fall within a preset range; The anomaly detection threshold is obtained by multiplying the feature dimension size by a preset ratio; the feature dimension size is the sum of the number of dimensions of the time-series feature array, the statistical feature array, and the graph feature array. Determine whether the number of elements is greater than the anomaly detection threshold; When the number of elements is greater than the anomaly judgment threshold, it is determined that the transaction message is abnormal, and an anomaly detection result indicating that the transaction message is abnormal is obtained; When the number of elements is less than or equal to the anomaly judgment threshold, it is determined that the transaction message does not have an anomaly, and an anomaly detection result indicating that the transaction message does not have an anomaly is obtained.
8. A message adaptive verification and risk blocking system, characterized in that, The system includes: The message access module is used to acquire transaction messages; An adaptive verification module is used to perform adaptive format verification on the transaction message based on the verification rules generated from the field characteristics of historical legitimate messages, and obtain the verification result. The multi-dimensional feature fusion module is used to perform multi-dimensional extraction and fusion analysis of time-series features, statistical features and graph features on the transaction message when the verification result indicates that the verification is passed, so as to obtain the anomaly detection result. The risk blocking module is used to block the transaction message when the anomaly detection result indicates that the transaction message is abnormal.
9. A computing device, characterized in that, Including memory and processor; The memory stores one or more computer programs, the one or more computer programs including instructions; when the instructions are executed by the processor, the computing device performs the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program for performing the method as described in any one of claims 1 to 7.
