Resource transfer detection method and device, storage medium and equipment
By extracting target text and texture information from the QR code image, and using text detection model scores and weighted scores, the problem of low accuracy of resource transfer detection is solved, and more efficient resource transfer security detection is achieved.
Patent Information
- Application Number
- CN202410018936.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-03
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, the accuracy of resource transfer detection is low, and it is impossible to effectively identify malicious molecules by adjusting the displayed content in the resource transfer scenario to deceive, resulting in insufficient resource transfer security detection.
By obtaining the target text information in the QR code image, encoding it to obtain the target text features, and inputting a pre-trained text detection model, determining the resource transfer detection result based on the target text security score value, and at the same time, double detection is performed in combination with texture information to improve detection accuracy.
It improves the accuracy of resource transfer detection, can better identify malicious behavior, adapt to the changing resource transfer scenarios, and enhances the security of resource transfer process.
Smart Images

Figure CN120258024A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of resource transfer, and particularly relates to a resource transfer detection method, device, storage medium and equipment. Background Art
[0002] Currently, with the development of Internet technology, mobile resource transfer has become a popular way of resource transfer for the public and permeates all aspects of life. However, with the continuous expansion and deepening of mobile resource transfer services, more and more malicious elements have begun to use mobile resource transfer to defraud the public of their property, and resource transfer security faces serious challenges.
[0003] In related technologies, resource transfer security detection is often achieved by relying on the basic attributes of an account (including the registration duration of the account, the number of cancellations, etc.) and the resource transfer flow attributes of the account (including the historical transfer average value of the account, etc.). This security detection method is called numerical detection.
[0004] However, although numerical detection can reflect some basic situations of the object and the accounts it owns, there are limitations in accurately identifying malicious behaviors. It can only judge the transfer security of the object from the object side. Malicious elements can deceive users' trust by adjusting the resource transfer display content in different resource transfer scenarios. Therefore, the related technical means cannot fit the increasingly changing resource transfer scenarios, resulting in a low accuracy rate of resource transfer detection. Summary of the Invention
[0005] Embodiments of this application provide a resource transfer detection method, device, storage medium and equipment, which can improve the accuracy rate of resource transfer detection.
[0006] To solve the above technical problems, the embodiments of this application provide the following technical solutions:
[0007] The first aspect of the embodiments of this application provides a resource transfer detection method, including:
[0008] Obtain a two-dimensional code image corresponding to resource transfer. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it. At least target text information is included in the preset range area of the two-dimensional code area;
[0009] Extract the target text information in the two-dimensional code image, and encode the target text information to obtain target text features;
[0010] Input the target text features into a pre-trained text detection model to obtain the target text security score value of the two-dimensional code image;
[0011] Determine the resource transfer detection result of the two-dimensional code image according to the size of the target text security score value.
[0012] In a second aspect of the embodiments of the present application, a resource transfer detection method is provided, including:
[0013] Collect an image of a two-dimensional code area and a preset range area around it to obtain a two-dimensional code image, where at least target text information is included in the preset range area of the two-dimensional code area;
[0014] Send the two-dimensional code image to a server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines a resource transfer detection result of the two-dimensional code image according to the size of the target text security score value;
[0015] Receive the resource transfer detection result sent by the server, and perform a resource transfer operation when the resource transfer detection result meets the transfer conditions.
[0016] In a third aspect of the embodiments of the present application, a resource transfer detection device is provided, including:
[0017] An image acquisition unit, configured to acquire a two-dimensional code image corresponding to resource transfer, where the two-dimensional code image is an image including a two-dimensional code area and a preset range area around it, and at least target text information is included in the preset range area of the two-dimensional code area;
[0018] A feature extraction unit, configured to extract the target text information in the two-dimensional code image and encode the target text information to obtain a target text feature;
[0019] A security scoring unit, configured to input the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image;
[0020] A detection result determination unit, configured to determine a resource transfer detection result of the two-dimensional code image according to the size of the target text security score value.
[0021] In some embodiments, the feature extraction unit is configured to:
[0022] Segment the target text information to obtain a plurality of keywords;
[0023] Encode the plurality of keywords to obtain corresponding plurality of token features;
[0024] Perform word embedding processing on the plurality of token features respectively to obtain corresponding plurality of word embedding features, and combine the plurality of word embedding features to obtain a target text feature.
[0025] In some embodiments, the resource transfer detection device further includes a model training unit, and the model training unit is configured to:
[0026] Obtain a sample image corresponding to the resource transfer, where the sample image is an image including a sample two-dimensional code area and a preset range area around it, at least sample text information is included within the preset range area of the sample two-dimensional code area, and the sample image has a corresponding sample label;
[0027] Extract the sample text information from the sample image, and encode the sample text information to obtain a sample text feature;
[0028] Input the sample text feature into an initial text detection model to obtain a sample text security score value of the sample image;
[0029] Determine a sample loss value according to the difference between the sample text security score value and the sample label, and train the initial text detection model based on the sample loss value until the sample loss value converges to obtain the pre-trained text detection model.
[0030] In some embodiments, the model training unit is further configured to:
[0031] Obtain a verification image, where the verification image is an image including a verification two-dimensional code area and a preset range area around it, at least verification text information is included within the preset range area of the verification two-dimensional code area, and the acquisition time of the verification image is later than the acquisition time of the sample image;
[0032] Extract the verification text information from the verification image, and encode the verification text information to obtain a verification text feature;
[0033] Input the verification text feature into the pre-trained text detection model to obtain a verification text security score value of the verification image;
[0034] Determine a cross-time verification result of the text detection model based on the verification text security score value, and re-train the text detection model when the cross-time verification result meets the update condition.
[0035] In some embodiments, target texture information is further included within the preset range area of the two-dimensional code area, and the detection result determination unit is configured to:
[0036] Extract the target texture information from the two-dimensional code image, and encode the target texture information to obtain a target texture feature;
[0037] Input the target texture feature into a pre-trained texture detection model to obtain the target texture security score value of the QR code image;
[0038] Jointly determine the resource transfer detection result of the QR code image according to the magnitudes of the target text security score value and the target texture security score value.
[0039] In some embodiments, the detection result determination unit is further configured to:
[0040] Obtain a first weight parameter of the preset target text security score value, and determine a corresponding second weight parameter according to the magnitude of the target texture security score value;
[0041] Weight the target text security score value and the target texture security score value respectively according to the first weight parameter and the second weight parameter to obtain a total score value;
[0042] Determine the resource transfer detection result of the QR code image according to the magnitude of the total score value.
[0043] In some embodiments, the detection result determination unit is further configured to:
[0044] When the target texture security score value is less than a preset texture score threshold, set the second weight parameter corresponding to the target texture security score value to zero;
[0045] When the target texture security score value is less than the preset texture score threshold, use the target texture security score value as the corresponding second weight parameter.
[0046] In some embodiments, the security score unit is configured to:
[0047] When the target text security score value is greater than a preset text score threshold, determine a matching target abnormal control policy from a preset policy library according to the magnitude of the target text security score value;
[0048] Send the target abnormal control policy to the terminal so that the terminal performs corresponding abnormal handling operations according to the target abnormal control policy.
[0049] In some embodiments, the security score unit is further configured to:
[0050] Identify the QR code area in the QR code image to determine the current resource transfer amount;
[0051] When the resource transfer amount is greater than a preset amount threshold, determine a matching target abnormal control policy from a preset policy library according to the magnitude of the target text security score value.
[0052] In the fourth aspect of the embodiments of the present application, a resource transfer detection device is provided, including:
[0053] An image acquisition unit, configured to acquire an image of a two-dimensional code area and a preset range area around it to obtain a two-dimensional code image, where at least target text information is included in the preset range area of the two-dimensional code area;
[0054] A sending unit, configured to send the two-dimensional code image to a server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, and then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines a resource transfer detection result of the two-dimensional code image according to the magnitude of the target text security score value;
[0055] A receiving unit, configured to receive the resource transfer detection result sent by the server, and perform a resource transfer operation when the resource transfer detection result meets the transfer condition.
[0056] In the fifth aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the resource transfer detection method in the first aspect of the above embodiments, or the steps in the resource transfer detection method in the second aspect of the above embodiments.
[0057] In the sixth aspect of the embodiments of the present application, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps in the resource transfer detection method in the first aspect of the above embodiments, or the steps in the resource transfer detection method in the second aspect of the above embodiments are implemented.
[0058] In the seventh aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a storage medium. The processor of the computer device reads the computer instructions from the storage medium, and the processor executes the computer instructions, so that the steps in the resource transfer detection method in the first aspect of the above embodiments, or the steps in the resource transfer detection method in the second aspect of the above embodiments are implemented.
[0059] In an embodiment of the present application, a QR code image corresponding to resource transfer is obtained. The QR code image is an image including a QR code area and a preset range area around it, and at least target text information is included in the preset range area of the QR code image. The target text information in the QR code image is extracted, and the target text information is encoded to obtain a target text feature. The target text feature is input into a pre-trained text detection model to obtain a target text security score value of the QR code image. The resource transfer detection result of the QR code image is determined according to the magnitude of the target text security score value. Thus, since at least target text information is included in the preset range area around the QR code area of the QR code image, and these target text information can reflect the security situation of the resource transfer process. Therefore, in order to identify these texts, the extracted target text information needs to be input into the text detection model for identification, so as to obtain the target text security score value of the QR code image. The magnitude of the target text security score value can represent the security level of the resource transfer process. Compared with the scheme of numerically detecting the resource transfer security level in the related art, even if a malicious person adjusts the resource transfer display content in the QR code image under different resource transfer scenarios, the embodiment of the present application can identify the text information attached to the image. Therefore, it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the QR code image can be determined according to the magnitude of the target text security score value, thereby improving the accuracy of resource transfer detection.
[0060] Other features and advantages of the present disclosure will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present disclosure. The objectives and other advantages of the present disclosure can be achieved and obtained by the structures specifically pointed out in the specification, the claims, and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, without creative efforts, other drawings can be obtained according to these drawings.
[0062] Figure 1 It is a schematic diagram of the scenario of the resource transfer detection method implementation environment provided by the embodiment of the present application;
[0063] Figure 2 It is a flowchart of the resource transfer detection method provided by the embodiment of the present application;
[0064] Figure 3 It is a schematic diagram of the positional relationship between different areas in the QR code image provided by the embodiment of the present application;
[0065] Figure 4 It is a schematic diagram of the QR code image provided by an embodiment of the present application. In this QR code image;
[0066] Figure 5 It is a schematic structural diagram of the word embedding model provided by an embodiment of the present application;
[0067] Figure 6 It is a schematic diagram of the QR code image containing target texture information provided by an embodiment of the present application;
[0068] Figure 7 It is a schematic diagram of the QR code image containing target icon information provided by an embodiment of the present application;
[0069] Figure 8 It is a schematic diagram of the deployment process of the resource transfer detection system provided by an embodiment of the present application;
[0070] Figure 9 It is a schematic diagram of the complete process of the resource transfer detection method provided by an embodiment of the present application;
[0071] Figure 10 It is a schematic structural diagram of the text detection model provided by an embodiment of the present application;
[0072] Figure 11 It is another schematic diagram of the process of the resource transfer detection method provided by an embodiment of the present application;
[0073] Figure 12 It is a schematic structural diagram of the resource transfer detection device provided by an embodiment of the present application;
[0074] Figure 13 It is another schematic structural diagram of the resource transfer detection device provided by an embodiment of the present application;
[0075] Figure 14 It is a schematic structural diagram of the terminal provided by an embodiment of the present application. Detailed implementation manners
[0076] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0077] It is understandable that in the specific embodiments of the present application, data related to QR code images and the like are involved. When the above embodiments of the present application are applied to specific products or technologies, object permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards.
[0078] In addition, when the embodiments of the present application require data related to QR code images and the like, a separate permission or separate consent for the data related to QR code images and the like will be obtained by means of a pop-up window or jumping to a confirmation page. After clearly obtaining the separate permission or separate consent for the data related to QR code images and the like, the necessary data related to QR code images and the like for the normal operation of the embodiments of the present application will be obtained.
[0079] It should be noted that in some processes described in the specification, claims, and the above-mentioned drawings, multiple steps appear in a specific order. However, it should be clearly understood that these steps may not be executed in the order in which they appear in this document or may be executed in parallel. The step numbers are only used to distinguish different steps, and the numbers themselves do not represent any execution order. In addition, descriptions such as "first", "second", "initial", or "target" in this document are used to distinguish similar objects and do not necessarily describe a specific order or sequence.
[0080] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be fully or partially implemented by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of that module or unit.
[0081] Before further elaborating on the embodiments of the present disclosure, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are applicable to the following explanations:
[0082] Artificial Intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling machines to have the functions of perception, reasoning, and decision-making. Artificial intelligence technology is an interdisciplinary subject with a wide range of fields, including both hardware-level technologies and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model, also known as the large model or the foundation model, can be widely applied to downstream tasks in various directions of artificial intelligence after fine-tuning. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0083] A neural network model is a computational model used in machine learning and artificial intelligence, which is inspired by the human brain's neuron network. The neural network model consists of multiple interconnected artificial neurons (also called nodes or units), and information is transmitted and processed between these neurons through weights. The neural network model is usually organized into different hierarchical structures, including the input layer, hidden layer, and output layer. The input layer receives external input data, the hidden layer processes the input data and extracts features, and the output layer generates the final prediction result. Each neuron receives the input from the neurons in the previous layer and performs calculations based on the input and its own weights. These calculation results are non-linearly transformed through an activation function and then passed to the neurons in the next layer. Through repeated forward propagation and backpropagation algorithms, the neural network model continuously adjusts the weights to enable it to learn and adapt to the patterns and rules of the input data.
[0084] Neural network models are widely used in various fields such as image recognition, speech recognition, natural language processing, recommendation systems, etc. Different types of neural network models, such as feedforward neural networks, convolutional neural networks, recurrent neural networks, etc., have different structures and application scopes, but they all rely on the connections between neurons and weight adjustment to process information and learn.
[0085] A two-dimensional code, also known as a QR code, is a graph composed of specific geometric figures distributed in a certain pattern on a plane (in two-dimensional directions), with various colors alternating, and recording data symbol information. In code compilation, it cleverly utilizes the concept of "0" and "1" bit streams that form the internal logic basis of a computer, uses several geometric figures corresponding to binary to represent text numerical information, and realizes automatic information processing through automatic reading by an image input device or an optoelectronic scanning device. The two-dimensional code has some commonalities with bar code technology. Each code system has its specific character set, each character occupies a certain width, and has a certain verification function, etc. At the same time, it also has the function of automatically identifying information in different rows and processing the rotation change points of the graph.
[0086] Resource transfer refers to the process of transferring virtual resources, manpower, materials, etc. from one place to another under certain conditions. It usually involves the flow of virtual resources, such as resource transfer behaviors between individuals or entities. An individual or entity can transfer the amount of virtual resources in one account to another account.
[0087] Currently, with the development of Internet technology, mobile resource transfer has become a common way of resource transfer for the public and penetrated into all aspects of life. However, with the continuous expansion and in-depth development of mobile resource transfer services, the activities of more and more malicious elements have become increasingly active. They begin to use mobile resource transfer to defraud the public's property, especially in social scenarios, which has a particularly serious impact, causing significant losses to the public, affecting the public's confidence in mobile resource transfer, and posing a serious challenge to resource transfer security.
[0088] In related technologies, resource transfer security detection is often achieved by relying on the basic attributes of an account (including the registration duration of the account, the number of cancellations, etc.) and the resource transfer flow attributes of the account (including the historical transfer average value of the account, etc.). This security detection method is called numerical detection. The models used in the detection process include simple machine learning models such as the Logistic Regression (LR) model and the tree model.
[0089] However, although numerical detection can reflect some basic situations of the object and the account it owns, there are limitations in accurately identifying malicious behaviors. It can only judge the transfer security of the object from the object side, with poor correlation. Malicious elements can deceive users' trust by adjusting the resource transfer display content in different resource transfer scenarios. Therefore, the related technical means cannot fit the increasingly changing resource transfer scenarios, resulting in a low accuracy rate of resource transfer detection.
[0090] Embodiments of this application propose a resource transfer detection method, device, storage medium, and equipment to solve the above problems and improve the accuracy rate of resource transfer detection.
[0091] Please refer to Figure 1 , Figure 1 which is a schematic diagram of the scenario of the resource transfer detection method implementation environment provided by the embodiment of the present application, including: a terminal 101 and a server 102, where the terminal 101 and the server 102 are connected through a communication network.
[0092] Exemplarily, the server 102 can obtain a two-dimensional code image corresponding to the resource transfer sent by the terminal 101. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it, and at least target text information is included in the preset range area; extract the target text information in the two-dimensional code image, and encode the target text information to obtain a target text feature; input the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image; determine the resource transfer detection result of the two-dimensional code image according to the size of the target text security score value. Finally, the server 102 can send the resource transfer detection result to the terminal 101, and the terminal 101 performs a resource transfer operation based on the resource transfer detection result.
[0093] The server 102 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In addition, the server 102 can also be a node server in a blockchain network.
[0094] The terminal 101 can be a mobile phone, a computer, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, an aircraft, etc., but is not limited thereto. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication methods, and the embodiments of the present application do not limit this here.
[0095] It should be noted that Figure 1 the schematic diagram of the scenario of the resource transfer detection system shown is only an example. The resource transfer detection system and scenario described in the embodiments of the present application are for more clearly explaining the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art know that with the evolution of the resource transfer detection system and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
[0096] The embodiments of the present application can be applied to various scenarios, including but not limited to scenarios such as cloud technology, artificial intelligence, intelligent transportation, assisted driving, and intelligent healthcare.
[0097] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of the resource transfer detection method provided by the embodiments of the present application. This resource transfer detection method can be applied to the server in the above embodiments, or jointly executed by the terminal and the server. The resource transfer detection method includes steps 201 to 204:
[0098] In step 201, obtain a two-dimensional code image corresponding to the resource transfer;
[0099] Among them, the two-dimensional code image is an image including the two-dimensional code area and a preset range area around it. At least the target text information is included in the preset range area of the two-dimensional code area.
[0100] Among them, the two-dimensional code image is an image containing a two-dimensional code. The image can be divided into multiple areas, including the two-dimensional code area. The two-dimensional code area is the area where the two-dimensional code is located in the image. Moreover, in the embodiments of the present application, outside the two-dimensional code area of the two-dimensional code image, there are other areas, such as a preset range area around the two-dimensional code area. At least the target text information is included in this preset range area. In addition to the target text information, other information can also be included in the preset range area of the two-dimensional code image, which is not specifically limited here.
[0101] It should be noted that the preset range area is the area within the preset range from the two-dimensional code area in the two-dimensional code image. The preset range is a preset range threshold used to define the size of the preset range area around the two-dimensional code area. In the embodiments of the present application, the size of the preset range can be defined by pre-configuration to meet subsequent test requirements, and the size of the preset range can be adjusted according to the test effect, so as to flexibly adjust the size of the preset range area around the two-dimensional code area. When the preset range area is large enough, it can cover the entire two-dimensional code image, which is not specifically limited here.
[0102] Furthermore, the shapes of the two-dimensional code area and the preset range area around it can be various. For example, the two-dimensional code area can be a rectangular area or a circular area, and the preset range area around the two-dimensional code area can also be rectangular or circular. The embodiments of the present application do not specifically limit their shapes.
[0103] Please refer to Figure 3 , Figure 3 which is a schematic diagram of the positional relationship between different areas in the two-dimensional code image provided by the embodiments of the present application. In the embodiments of the present application, only taking the two-dimensional code area as a rectangular area including the two-dimensional code as an example, in Figure 3The middle image is a QR code image. There is a QR code in the QR code image. The rectangular area where the QR code is located is called the QR code area. As shown in the schematic diagram on the left, this shaded area is the QR code area. And as shown in the schematic diagram on the right, the preset range area around the QR code area is an annular area. This annular area is formed by another rectangle with both length and width greater than the QR code area around the QR code area.
[0104] The target text information is the text information contained in the preset range area around the QR code area in the QR code image. The word "target" is used to indicate that these text information belong to the QR code image. Specifically, the target text information is the text information contained in the QR code image that can reflect the security situation of the resource transfer process. And the target text information will vary according to the application scenario, but it is related to the resource transfer and may include, but is not limited to, the name, quantity, source, destination, operation instructions, verification information, guidance information, etc. of the resource. The existence of these text information can help judge the security of the resource transfer process.
[0105] Exemplarily, when the resource transfer detection method in the embodiment of the present application is applied to a server, the QR code image can be sent by a terminal to the server. The terminal can call the camera to capture the QR code to form a QR code image and send the QR code image to the server for recognition, so as to implement the resource transfer operation. This process can also be called "scanning code transfer".
[0106] It should be noted that the QR code in the scanning code scenario in the embodiment of the present application must have its physical carrier medium, such as a printed paper QR code, a QR code on a mobile phone screen, a QR code posted on a website, etc. And in malicious behaviors, these physical carrier media often contain text information with malicious features. For example, if it is a QR code posted on some malicious websites, there is often a large amount of malicious text information around it. When the user scans the code, the scanned picture (image) will record the surrounding text information together. Please refer to Figure 4 , Figure 4 is a schematic diagram of the QR code image provided by the embodiment of the present application. In this QR code image, within the preset range area around the QR code area, there is target text information displayed. These target text information are inducing words such as "Scan the code and you will be rewarded with XX million" and "Come and scan the code quickly". However, the text information of this QR code attachment medium is rarely used for corresponding detection at present. Therefore, the embodiment of the present application can subsequently detect the text information of the QR code attachment medium.
[0107] Above, the specific process of step 201 is introduced. Next, step 202 after step 201 is introduced:
[0108] In step 202, the target text information in the QR code image is extracted, and the target text information is encoded to obtain target text features.
[0109] Among them, the target text features are a representation obtained by encoding the extracted target text information. Specifically, the target text features can be text feature vectors extracted by text recognition technology or other forms of numerical expressions. These features can capture the important attributes and characteristics of the target text information, and after being input into the text detection model, they can help the model perform accurate security scoring.
[0110] Exemplarily, in the embodiments of the present application, the target text information in the QR code image can be extracted by text recognition, and there are various text recognition methods. For example, the target text information in the QR code image can be extracted by optical character recognition (OCR) technology. Through OCR technology, the attached text of the QR code medium (picture) during scanning can be recognized and the corresponding sentence-form text can be obtained; or, a convolutional recurrent neural network (CRNN) can also be used to extract the target text information in the QR code image. Through CRNN, the local features and sequence information of the image can be processed simultaneously, so as to achieve accurate recognition of the text.
[0111] Exemplarily, the method for encoding to obtain the target text features in the embodiments of the present application may vary according to specific text encoding methods and algorithms. Text embedding techniques (such as Word2Vec, GloVe, etc.) or other custom feature extraction methods can be used to obtain the required target text features.
[0112] Next, the process of specifically encoding to obtain the target text features in step 202 will be described in detail:
[0113] In some embodiments, the target text features are obtained after word segmentation and word embedding processing of the target text information, including:
[0114] (1) Perform word segmentation on the target text information to obtain multiple keywords;
[0115] (2) Encode the multiple keywords to obtain corresponding multiple word segmentation features;
[0116] (3) Perform word embedding processing on the multiple word segmentation features respectively to obtain corresponding multiple word embedding features, and combine the multiple word embedding features to obtain the target text features.
[0117] In the process of target text feature extraction, it is first necessary to perform word segmentation on the target text information. Word segmentation is the process of splitting a continuous text sequence into lexical units with independent meanings. The purpose of word segmentation is to convert the text into discrete lexical units for subsequent processing and feature representation. Therefore, in the embodiments of the present application, the target text information can be segmented, and the Chinese text in the form of sentences recognized in the QR code medium can be converted into a list of keywords through word segmentation.
[0118] For example, for a Chinese text "I ate corn in the morning", a list of keywords can be obtained through Chinese word segmentation technology: [I, morning, ate, corn], where "I", "morning", "ate", and "corn" are all keywords. By converting the text into a list of keywords, it is beneficial for subsequent text word embedding representation learning.
[0119] Next, it is necessary to encode multiple keywords. Encoding the segmented keywords can map each vocabulary into a numerical feature and obtain corresponding multiple segmented features. Exemplarily, the segmented features can be obtained through one-hot encoding or the bag-of-words model. Among them, one-hot encoding represents each keyword as a sparse vector, the length of the vector is equal to the size of the vocabulary, and only one element is 1, indicating the existence of the vocabulary, and the other elements are 0; while the bag-of-words model can represent each keyword as a vector, each dimension of the vector represents a vocabulary in the vocabulary, and the number of times or frequency of the vocabulary appearing in the target text is counted.
[0120] Finally, word embedding is a technique that maps discrete vocabulary into a continuous vector space, that is, representing an object with a vector, which can be a word, a commodity, a movie, etc., and is used to represent the semantics and context information of words. Performing word embedding processing on words is to learn a vector to represent words, and each segmented feature can be converted into a fixed-length vector, that is, a word embedding feature. Exemplarily, the embodiments of the present application can use different word embedding methods, including models such as Word2Vec, GloVe, and FastText. Through these models, each segmented feature of the target text can be converted into a corresponding word embedding feature.
[0121] Exemplarily, taking the Word2Vec model as an example, after obtaining the word segmentation features, the number of words is essentially limited. Suppose there are a total of N possible words, then all words can be represented by an N-dimensional one-hot encoding. Each index of the N-dimensional one-hot encoding corresponds to a word. For the vector corresponding to each word, except for taking 1 at its corresponding index, all other positions take the value of 0. However, the dimension of this representation method is too high (N is usually very large), so it generally cannot be directly used. Based on this, this application uses a word embedding model obtained based on Word2Vec for word embedding processing.
[0122] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of the word embedding model provided by the embodiments of this application. The word embedding model in the embodiments of this application can essentially be regarded as a dimensionality reduction algorithm. As Figure 5 shown, the word embedding model includes an input layer (Input Layer), a hidden layer (Hidden Layer), and an output layer (Output Layer). The input layer is the one-hot encoding of the action, and the dimension of the hidden layer can be much smaller than N. After the word embedding model is trained, all word segmentation features will be encoded. And the weight matrix W of the word embedding model shown above is output as its encoded vocabulary. The dimension of the weight matrix W is W*N, and each row of its N-dimensional vector is a dimensionality reduction representation of the corresponding one-hot encoding, that is, the encoded representation of the corresponding word. Finally, the word embedding model outputs word embedding features, and the target text features are obtained by combining multiple word embedding features. Due to the processing of the word embedding model, the mathematical properties of these vectors in space correspond to the nature of the action itself. For example, in practice, the distances of similar actions in the vector space should also be close, etc.
[0123] Above, the specific process of step 202 was introduced. Next, step 203 after step 202 will be introduced:
[0124] In step 203, the target text features are input into a pre-trained text detection model to obtain the target text security score value of the QR code image.
[0125] The text detection model is used to identify the target text information in the QR code image and evaluate the security level of the resource transfer process based on this information. The text detection model is obtained through pre-training and can identify the text in the image. Specifically, the text detection model can be obtained using deep learning techniques, such as Convolutional Neural Network (CNN) or Recurrent Neural Networks (RNN), and can also be other deep learning models that can process text, such as the transform model, etc., to identify the text information in the image.
[0126] The target text security score value is a numerical value used to evaluate and measure the target text information in the QR code image. It is the result obtained by inputting the target text features into a pre-trained text detection model, and can reflect the reliability and security degree of the target text information in the image. Specifically, the text detection model will identify the text based on the features and context information of the target text, and give the security score value of the target text. This score value can be used to judge the authenticity and credibility of the target text, and further determine the resource transfer detection result of the QR code image.
[0127] It can be understood that the target text security score value is a relative indicator, and different text detection models and evaluation methods may have different scoring rules and standards. Therefore, when using the target text security score value, it is necessary to interpret and judge it in combination with the specific model and application scenario, and the embodiments of this application do not make specific limitations on this.
[0128] Exemplarily, in the embodiments of this application, a text convolutional neural network (Text Convolutional Neural Network, textCNN) is used as the text detection model. By identifying the text attached to the QR code medium and using the textCNN network for text analysis, the abnormality degree of different resource transfer scenarios during scanning can be identified, and suspicious malicious behaviors can be confirmed in a timely manner, improving the accuracy and stability of malicious behavior recognition and the security of resource transfer.
[0129] Next, the process of specifically training the text detection model in step 203 will be described in detail:
[0130] In some embodiments, the text detection model needs to be pre-trained according to sample data, including:
[0131] (1) Obtain sample images corresponding to resource transfer;
[0132] Among them, the sample image is an image including the sample QR code area and a preset range area around it. The preset range area of the sample QR code area includes at least sample text information, and the sample image has a corresponding sample label;
[0133] (2) Extract the sample text information in the sample image and encode the sample text information to obtain sample text features;
[0134] (3) Input the sample text features into the initial text detection model to obtain the sample text security score value of the sample image;
[0135] (4) Determine the sample loss value according to the difference between the sample text security score value and the sample label, and train the initial text detection model based on the sample loss value until the sample loss value converges to obtain a pre-trained text detection model.
[0136] Among them, the initial text detection model is the model before training and is the training target. The purpose of training is to generate the text detection model required in the application process. The reason for naming it "initial" is to distinguish it from the text detection model after subsequent training.
[0137] The sample image is also an image containing a QR code. The image can be divided into multiple regions, including the sample QR code region, which is the region where the QR code is located in the image. Moreover, in addition to the sample QR code region in the sample image of the embodiment of the present application, there are other regions, such as a preset range region around the sample QR code region. Within this preset range region, there is at least sample text information. In addition to the sample text information, other information may also be included within the preset range region of the sample image, which is not specifically limited here.
[0138] It should be noted that the sample image also has a preset range region similar to the QR code image in the application process. The description of the preset range region is similar to that in the above embodiment and will not be repeated here.
[0139] The sample text information is the text information contained in the preset range region around the sample QR code region in the sample image. The word "sample" is used to indicate that these text information belongs to the sample image. Specifically, the sample text information is the text information contained in the sample image that can reflect the security situation of the resource transfer process. And the sample text information will vary according to the application scenario, but it is related to the resource transfer and is similar to the target text information. The existence of the sample text information can help judge the security of the resource transfer process.
[0140] Exemplarily, the sample image is similar to the QR code image. The difference is that the sample image is the image obtained during the training process, and the QR code image is the image obtained during the application process. And the method of obtaining the sample image during the training process can also be similar to the method of obtaining the QR code image during the application process, which will not be repeated here.
[0141] Since the sample image is an image in the training process, the sample image has a corresponding sample label. The sample label refers to the security-related annotation or label included in the sample image, which can be manually annotated or automatically labeled by professionals. There are two types of sample labels, which can be represented by different numerical values. For example, when the sample label is 0, it means that the resource transfer operation process in the sample image is safe, that is, the sample text information is safe. When the sample label is 1, it means that the resource transfer operation process in the sample image is unsafe, that is, the sample text information is malicious.
[0142] The sample text feature is a representation obtained by encoding the extracted sample text information. Specifically, the sample text feature can be a text feature vector extracted by text recognition technology or other forms of numerical expressions. These features can capture the important attributes and characteristics of the sample text information, and after being input into the initial text detection model, they can help the model perform accurate security scoring.
[0143] Exemplarily, in the embodiments of the present application, the sample text information in the sample image can be extracted by text recognition, and the sample text feature can be obtained by encoding the sample text information. The process can be similar to step 202 in the above application process, and will not be elaborated here.
[0144] The sample text security score value is a numerical value for evaluating and measuring the sample text information in the sample image. Similar to the target text security score value in the above embodiments, it is the result obtained by inputting the sample text feature into the initial text detection model, and can reflect the reliability and security degree of the sample text information in the image. Specifically, the initial text detection model will identify the text according to the features and context information of the sample text, and give the security score value of the sample text. This score value can be used to judge the authenticity and credibility of the sample text, and further determine the resource transfer detection result of the sample image.
[0145] The sample loss value is calculated by comparing the difference between the sample text security score value and the sample label. The sample loss value reflects the deviation degree between the prediction of the initial text detection model for the sample image and the true annotation. The greater the difference, the greater the deviation degree between the prediction of the initial text detection model and the true situation.
[0146] Therefore, in the embodiments of the present application, by training the initial text detection model based on the sample loss value, the model can gradually adjust its parameters to reduce the deviation between the prediction result and the true annotation. The initial text detection model can use the backpropagation algorithm to update and optimize the parameters according to the magnitude of the loss value, so as to improve the accuracy and generalization ability of the model. When the sample loss value gradually stabilizes and reaches the preset convergence condition, it indicates that the model has learned the rules and features in the sample data and can better predict the security of the target text information. At this time, the model is considered to be a pre-trained text detection model. Through training, the recognition accuracy and security evaluation ability of the text detection model for the target text information during the resource transfer process can be improved.
[0147] In some embodiments, after the text detection model is trained, it can also perform cross-time verification, and the model is put into the application process only after passing the cross-time verification. The process of cross-time verification includes:
[0148] (1) Obtain verification images;
[0149] Among them, the verification image is an image containing the verification QR code area and the surrounding preset range area. The preset range area of the verification QR code area includes at least verification text information, and the acquisition time of the verification image is later than the acquisition time of the sample image;
[0150] (2) Extract the verification text information in the verification image and encode the verification text information to obtain verification text features;
[0151] (3) Input the verification text features into the pre-trained text detection model to obtain the verification text security score value of the verification image;
[0152] (4) Determine the cross-time verification result of the text detection model based on the verification text security score value, and retrain the text detection model when the cross-time verification result meets the update condition.
[0153] The verification image is also an image containing a QR code. The image can be divided into multiple regions, including the verification QR code region. The verification QR code region is the region where the QR code is located in the image. Moreover, in the embodiments of the present application, outside the verification QR code region of the verification image, there are other regions, such as including the preset range region around the verification QR code region. In this preset range region, at least verification text information is included. In addition to the verification text information, other information may also be included in the preset range region of the verification image, which is not specifically limited here.
[0154] It should be noted that the verification image also has a preset range region similar to the QR code image in the application process. The description of the preset range region is similar to that in the above embodiments and will not be repeated here.
[0155] The verification text information is the text information contained in a preset range area around the QR code area in the verification image. The term "verification" is used to indicate that this text information belongs to the verification image. Specifically, the verification text information is the text information contained in the verification image that can reflect the security situation of the resource transfer process. And the verification text information varies according to the application scenario, but it is related to the resource transfer and is similar to the target text information. The existence of the verification text information can help judge the security of the resource transfer process.
[0156] Exemplarily, the verification image is similar to the QR code image. Different from it, the verification image is the image obtained during the cross-time verification process after training is completed, and the QR code image is the image obtained during the application process. And the way to obtain the verification image during the cross-time verification process can also be similar to the way to obtain the QR code image during the application process, which will not be elaborated here.
[0157] It should be noted that in the embodiments of this application, the sample image is used to train the text detection model, while the verification image is used to cross-time verify the performance and accuracy of the model. By using the verification image whose acquisition time is later than the sample image, the scenario of newly emerging QR code images in actual applications can be simulated. The purpose of doing this is to ensure that the text detection model can adapt to new data and scenarios, to verify the stability and robustness of the model at different time points, to better evaluate the performance of the text detection model, and to timely discover and correct possible problems of the model on new data.
[0158] The verification text feature is a representation obtained by encoding the extracted verification text information. Specifically, the verification text feature can be a text feature vector extracted by text recognition technology or other forms of numerical expressions. These features can capture the important attributes and characteristics of the verification text information, and after being input into the trained text detection model, they can help the model perform accurate security scoring.
[0159] Exemplarily, in the embodiments of this application, the verification text information in the verification image can be extracted by text recognition, and the verification text information is encoded to obtain the verification text feature. The process can be similar to step 202 in the above application process, which will not be elaborated here.
[0160] The verification text security score value is a numerical value used to evaluate and measure the verification text information in the verification image. Similar to the verification text security score value in the above embodiments, it is the result obtained by inputting the verification text features into the trained text detection model, and can reflect the reliability and security degree of the verification text information in the image. Specifically, the trained text detection model will identify the text based on the features and context information of the verification text, and give the security score value of the verification text. This score value can be used to judge the authenticity and credibility of the verification text, and further determine the cross-time verification result of the text detection model.
[0161] The cross-time verification result is the conclusion drawn based on the verification text security score value. According to the size of the verification text security score value, the accuracy and reliability of the text detection model in processing cross-time images can be judged. Exemplarily, if the verification text security score value is relatively high, it indicates that the text detection model performs well on new data and has high accuracy and reliability; while if the verification text security score value is relatively low, the model may need to be further optimized or updated to improve its performance.
[0162] During the cross-time verification process, if it is found that the performance of the text detection model on new data is not as expected, or the model has been used for a long time and needs to be updated, the text detection model needs to be retrained. Therefore, when the cross-time verification result meets the update conditions, the text detection model will be retrained. The update conditions refer to some pre-set conditions, such as the recognition rate of the model in processing new data drops by more than a certain degree, or the model has been used for a certain period of time and needs to be updated. When the cross-time verification result reaches the update conditions, it means that the text detection model has reached a certain limit in processing new data and needs to be updated or optimized to improve its performance and accuracy.
[0163] The process of retraining the text detection model can use new data to train the model and evaluate and improve the model according to the verification results. The purpose of retraining the model is to enable it to better adapt to new data and scenarios and provide a more accurate and reliable resource transfer inspection service.
[0164] Based on this, in the embodiments of the present application, cross-time verification is performed on the trained text detection model, and the data at future time points is used to verify the model to evaluate the generalization ability and stability of the model. By cross-time verification, it is checked whether the text detection model can effectively process the data at future time points, so as to verify its application value in the real world, and finally improve the accuracy of resource detection in the application process.
[0165] Above, the process of obtaining the document detection model in step 203 through training and other operations was introduced. Next, other operations after obtaining the target text security score value in step 203 will be described in detail:
[0166] In some embodiments, after obtaining the target text security score value, a corresponding risk control strategy can also be matched for resource transfer based on the target text security score value, including:
[0167] (1) When the target text security score value is greater than the preset text score threshold, determine the matching target abnormal control strategy from the preset policy library according to the size of the target text security score value;
[0168] (2) Send the target abnormal control strategy to the terminal so that the terminal performs corresponding abnormal handling operations according to the target abnormal control strategy.
[0169] The preset policy library refers to a predefined set of abnormal control strategy sets, which contains various possible abnormal situations and corresponding coping strategies. When the target text security score value exceeds the preset text score threshold, the system can select the matching target abnormal control strategy from the preset policy library according to the size of the target text security score value. The target abnormal control strategy is an operation or measure taken to address possible security issues during the resource transfer process.
[0170] Exemplarily, there can be multiple target abnormal control strategies. The specific target abnormal control strategy should be determined according to the specific scenario of resource transfer, relevant laws and regulations, and actual requirements. For example, the target abnormal control strategy can be an interception and prevention operation. When the target text security score value is high, an interception and prevention strategy can be adopted, that is, to prevent the resource transfer from proceeding and notify relevant personnel for further investigation and handling; or, the target abnormal control strategy can be a reminder and warning. When the target text security score value is high, a notification can be sent to relevant personnel in the form of a reminder and warning to attract their attention and take corresponding measures.
[0171] Furthermore, when the sizes of the target text security score values are different, it indicates that the security levels of the current resource transfer operations are different, and corresponding target abnormal control strategies of different levels can also be obtained, which will not be specifically limited here.
[0172] When the security score value of the target text exceeds the preset text score threshold, the embodiments of the present application can send corresponding policies to the terminal according to the target abnormal control policy matched in the preset policy library, so that the terminal can perform corresponding abnormal handling operations according to the policies. Specifically, sending the target abnormal control policy to the terminal can enable the terminal to respond quickly and take appropriate measures to reduce potential security problems. For example, when the security score value of the target text exceeds the preset text score threshold, the system may select the policy of intercepting and blocking and send the corresponding command to the terminal, requiring the terminal to immediately stop the resource transfer and notify relevant personnel for further investigation and handling. In this case, if the terminal can execute the command in time, potential security problems can be effectively avoided.
[0173] In some embodiments, the operation of policy distribution is only performed when the resource transfer amount during the resource transfer process exceeds a certain threshold, including:
[0174] (1) Identify the two-dimensional code area in the two-dimensional code image to determine the current resource transfer amount;
[0175] (2) When the resource transfer amount is greater than the preset amount threshold, determine the matched target abnormal control policy from the preset policy library according to the size of the security score value of the target text.
[0176] Identifying the two-dimensional code area in the two-dimensional code image means extracting the two-dimensional code area in the two-dimensional code image through image processing and two-dimensional code decoding technology and performing decoding operations to obtain the information contained therein. In this process, the current resource transfer amount can be determined.
[0177] Exemplarily, the operation of identifying and decoding the two-dimensional code image can be divided into two-dimensional code detection, extraction and decoding operations. Among them, first, image processing algorithms can be used to detect the possible two-dimensional code areas in the image, which can be achieved through technologies such as finding the characteristic patterns of two-dimensional codes, edge detection and corner detection; then, once the two-dimensional code area is detected, it can be extracted from the image to form an independent image area; subsequently, decoding operations are performed on the extracted two-dimensional code image area to restore the information therein into readable data; finally, according to the decoded two-dimensional code information, the current resource transfer amount can be determined.
[0178] The quota threshold refers to a limit value set in the system to control the quota of resource transfer. The setting of the quota threshold can be adjusted according to different situations and requirements. On the one hand, setting too low a quota threshold may impose unnecessary restrictions on the normal operations of users; on the other hand, setting too high a quota threshold may increase potential anomalies and security threats. Therefore, the setting of the quota threshold needs to comprehensively consider factors such as user requirements, security issues, and system capabilities, and the embodiments of this application do not make specific limitations in this regard.
[0179] When the resource transfer quota is greater than the preset quota threshold, the embodiments of this application will pay more attention to potential abnormal situations because large - amount resource transfers may involve higher security threats. Therefore, in this case, more strict and detailed abnormal control strategies need to be adopted to ensure the security of users' virtual resources and information. And the size of the target text security score value is an important indicator for judging the security of the target text. By comparing the security score value of the target text with the preset security score threshold, the security level of the target text can be judged. When the resource transfer quota exceeds the preset quota threshold, determining the matching target abnormal control strategy according to the security score value of the target text can more accurately locate potential anomalies and take corresponding control measures.
[0180] Based on this, in the embodiments of this application, by performing recognition and decoding operations on the QR - code area in the QR - code image, the current resource transfer quota information can be obtained in real time. In this way, in the subsequent operation of issuing the abnormal control strategy, it can be determined whether corresponding abnormal control measures need to be taken according to the current resource transfer quota and the target text security score value.
[0181] Above, the specific process of step 203 was introduced. Next, step 204 after step 203 will be introduced:
[0182] In step 204, determine the resource transfer detection result of the QR - code image according to the size of the target text security score value.
[0183] The resource transfer detection result is obtained by recognizing and performing a security score on the target text information in the QR - code image, and can represent the security level of the resource transfer process. According to the size of the target text security score value, the resource transfer detection result of the QR - code image can be determined. Exemplarily, when the target text security score value is relatively high, it indicates that there are certain security problems or threats in the resource transfer process; when the score value is relatively low, it indicates that the resource transfer process is relatively secure.
[0184] Therefore, there are two types of resource transfer detection results. When the security score value of the target text is relatively high, that is, greater than or equal to the preset judgment threshold, the obtained resource transfer detection result is safe. On the contrary, when the security score value of the target text is relatively low, that is, less than the preset judgment threshold, the obtained resource transfer detection result is dangerous. At this time, it is judged that malicious behavior occurs in the resource transfer process.
[0185] Based on this, in the embodiments of the present application, since the two-dimensional code image includes at least target text information within a preset range area around the two-dimensional code area, and these target text information can reflect the security situation of the resource transfer process. Therefore, in order to identify these texts, it is necessary to input the extracted target text information into a text detection model for identification, so as to obtain the security score value of the target text of the two-dimensional code image. The size of the security score value of the target text can represent the security level of the resource transfer process. Compared with the scheme of numerically detecting the security level of resource transfer in the related art, even when malicious elements adjust the resource transfer display content in the two-dimensional code image under different resource transfer scenarios, the embodiments of the present application can identify the text information attached to the image. Therefore, it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the two-dimensional code image can be determined according to the size of the security score value of the target text, thereby improving the accuracy of resource transfer detection.
[0186] Next, a detailed description will be given on how to obtain the resource transfer detection result in step 204:
[0187] In some embodiments, in addition to determining the resource transfer detection result according to the size of the security score value of the target text, the preset range area of the two-dimensional code area also includes target texture information. In order to further improve the accuracy of resource transfer detection, the texture information in the image can also be combined, and the resource transfer detection result can be obtained by judging according to the texture information together, including:
[0188] (1) Extract the target texture information in the two-dimensional code image and encode the target texture information to obtain the target texture feature;
[0189] (2) Input the target texture feature into a pre-trained texture detection model to obtain the security score value of the target texture of the two-dimensional code image;
[0190] (3) Jointly determine the resource transfer detection result of the two-dimensional code image according to the sizes of the security score value of the target text and the security score value of the target texture.
[0191] The target texture information refers to the texture features in the two-dimensional code image, that is, features such as texture patterns, structures, and morphologies. In resource transfer detection, by extracting the target texture information in the two-dimensional code image and encoding it, it can be used to judge the security situation of the resource transfer process.
[0192] Exemplarily, there can be various types of target texture information. For example, it can refer to the texture repeatability in an image, such as grids, stripes, spots, etc.; it can also refer to the texture arrangement in the image, such as horizontal, vertical, diagonal, etc.; it can also refer to the texture shape, size, and direction in the image, such as circular, square, rectangular, etc.; it can also refer to the color pattern in the image.
[0193] It can be understood that when malicious elements generally use malicious means to defraud resource transfer, the design of their QR code media all contains typical styles. For example, it contains a large number of elements such as black and gold to appear "high-class and luxurious". Therefore, in the embodiments of the present application, these features can be combined to assist in detecting the security of the resource transfer process.
[0194] Please refer to Figure 6 , Figure 6 is a schematic diagram of a QR code image containing target texture information provided by an embodiment of the present application. In this QR code image, within a preset range area around the QR code area, target text information and target texture information are displayed. These target text information are inducement texts such as "Scan the code to get a reward of XX million" and "Come and scan the code quickly", and the target texture information is a gradient pattern (such as a black-gold texture pattern). Therefore, in the subsequent embodiments of the present application, the text information and texture information of the QR code attachment medium can be detected.
[0195] The target texture feature refers to the feature extracted from the QR code image for describing the texture information, which is a representation obtained by encoding the extracted target texture information. Specifically, the target texture feature can be a texture feature vector or other forms of numerical expressions obtained by different encoding methods. These features can capture the important attributes and characteristics of the target texture information, and after being input into the texture detection model, they can help the model perform accurate security scoring.
[0196] Exemplarily, there are various ways to encode the target texture information to obtain the target texture feature. For example, the gradient feature of the target texture information can be obtained, and by calculating the gradient amplitude and direction of each pixel point in the image, the edge and texture direction information of the texture can be obtained; the local binary map of the target texture information can also be calculated, comparing each pixel of the image with its neighboring pixels, and generating a binary code according to the comparison result to describe the local features of the texture; the scale-invariant feature transform feature of the target texture information can also be obtained, by detecting the key points in the image and the local feature descriptors around them to describe the local features and morphological information of the texture; the histogram of oriented gradients of the target texture information can also be obtained, by calculating the gradient direction and intensity histogram in each region of the image to describe the global features of the texture.
[0197] The texture detection model is a model used to analyze and judge the texture features in an image. It can be trained to learn the relationships between different texture patterns, structures, and morphologies, and evaluate the security level of the resource transfer process based on this information. The texture detection model is obtained through pre-training and can identify the textures in an image. Specifically, the text detection model can be obtained using deep learning techniques, such as a texture detection model based on Convolutional Neural Networks (CNN). Through multiple layers of convolution, pooling, and fully connected layers, it can automatically learn discriminative texture feature representations from image data. It can also be a texture detection model based on Generative Adversarial Networks (GAN), which consists of a generator and a discriminator. The generator is used to generate realistic image samples, while the discriminator is used to distinguish between real images and generated images. Through adversarial training, it can learn to generate images with high-quality textures.
[0198] The target texture security score value is a numerical value used to evaluate and measure the target texture information in the QR code image. It is the result obtained by inputting the target texture features into a pre-trained texture detection model and can reflect the reliability and security level of the target texture information in the image. Specifically, the texture detection model will identify the texture based on the features of the target texture and give the security score value of the target texture. This score value can be used to judge the authenticity and credibility of the target texture, and thus assist in determining the resource transfer detection result of the QR code image.
[0199] The resource transfer detection in the embodiments of this application not only involves the text information in the image but also needs to consider the texture information contained in the image. By jointly considering the target text security score value and the target texture security score value, the reliability of the resource transfer detection can be improved. For example, when the target text security score value is low and the target texture security score value is high, it may indicate that the QR code image contains harmful text information and the image texture has been maliciously tampered with; on the contrary, it may indicate that the QR code image is relatively safe. Considering the two score values comprehensively can more comprehensively evaluate the security of the QR code image, achieve dual detection, comprehensively judge the resource transfer security level of the QR code image, and thus improve the accuracy of the resource transfer detection.
[0200] In some embodiments, it is necessary to assign corresponding weight parameters to the target text security score value and the target texture security score value, and then jointly obtain the required resource transfer detection result, including:
[0201] (1) Obtain the first weight parameter of the pre-set target text security score value and determine the corresponding second weight parameter according to the size of the target texture security score value;
[0202] (2) Weight the target text security score value and the target texture security score value respectively according to the first weight parameter and the second weight parameter to obtain the total score value;
[0203] (3) Determine the resource transfer detection result of the two-dimensional code image according to the magnitude of the total score value.
[0204] The first weight parameter refers to the weight parameter set for the target text security score value, which is used to measure the importance of the target text in resource transfer detection. The specific value needs to be determined according to the actual situation, and the weight value in different scenarios can be determined through experiments or professional knowledge. The larger the weight value, the greater the proportion of the target text in the resource transfer detection result and the higher the impact on the result.
[0205] The second weight parameter refers to the weight parameter determined according to the magnitude of the target texture security score value, which is used to measure the importance of the target texture in resource transfer detection. The determination method of this weight parameter can be adjusted according to actual needs and scenarios, and the specific value needs to be determined through experiments or professional knowledge. The larger the weight value, the greater the proportion of the target texture in the resource transfer detection result and the higher the impact on the result.
[0206] It can be understood that the first weight parameter is set in advance because it is used to measure the importance of the target text in resource transfer detection. In the embodiments of the present application, the target text information is emphasized because the target text information can better reflect the security level of resource transfer, and the target texture information is only an auxiliary judgment. Therefore, the value of the first weight parameter can be determined according to factors such as the understanding of the target text, actual needs, and professional knowledge. The second weight parameter is determined according to the magnitude of the target texture security score value because the security score value of the target texture can reflect whether the texture feature is related to resource transfer. As an auxiliary judgment, when the texture is normal, the corresponding second weight parameter is lower. On the contrary, when the texture is abnormal, the corresponding second weight parameter is higher, that is, higher than the value when the texture is normal, indicating that the resource transfer is less secure.
[0207] Finally, determine the resource transfer detection result of the two-dimensional code image according to the magnitude of the total score value. For example, a judgment threshold can be set as the judgment criterion. When the total score value exceeds the judgment threshold, the two-dimensional code image is determined to be safe in the resource transfer process; when the total score value is lower than or equal to the judgment threshold, it is determined that there is a potential abnormality in the resource transfer process. Making a judgment according to the magnitude of the total score value can also simplify the complex evaluation result into a binary classification problem, which is convenient for subsequent processing and decision-making.
[0208] It should be noted that the selection of specific judgment thresholds should be combined with specific application scenarios and requirements for resource transfer detection, and reasonable verification and adjustment are required to ensure that indicators such as accuracy and recall are comprehensively considered to achieve better resource transfer detection results.
[0209] In the embodiments of the present application, by determining the second weight parameter according to the magnitude of the target texture security score value, the importance of the target texture for the resource transfer detection result can be more accurately reflected. This method can dynamically adjust the weight value according to the actual texture feature situation, improving the accuracy and flexibility of resource transfer detection.
[0210] In some embodiments, it is necessary to select an appropriate second weight parameter according to the magnitude of the target texture security score value, including:
[0211] (1) When the target texture security score value is less than the preset texture score threshold, set the second weight parameter corresponding to the target texture security score value to zero;
[0212] (2) When the target texture security score value is greater than or equal to the preset texture score threshold, use the target texture security score value as the corresponding second weight parameter.
[0213] Furthermore, in the embodiments of the present application, the texture only assists in the judgment of the text, and the judgment of the text is more accurate. When the target texture security score value is less than the preset texture score threshold, it indicates that the target texture features in the preset range area around the QR code area in the detected QR code image are normal at this time. At this time, it is impossible to judge whether the resource transfer is safe based on the texture. Then, in order not to affect the judgment of the main task, that is, not to affect the judgment of the text, it is necessary to set the second weight parameter corresponding to the target texture security score value to zero. At this time, because the relevant values of the texture are not considered, the detection is simply based on the magnitude of the target text security score value.
[0214] On the contrary, if the target texture security score value is greater than or equal to the preset texture score threshold, it indicates that through texture detection, it is initially considered that there are security problems in the resource transfer process. Because the higher the score value, the lower the security. Then, when judging the security of the resource transfer process based on the target text security score value obtained from text detection, it is very necessary to combine the detection results of the texture for joint judgment. Therefore, the target texture security score value can be directly used as the corresponding second weight parameter.
[0215] It can be understood that when the target texture security score value is greater than or equal to the preset texture score threshold, due to the intervention of the target texture security score value, the weighted total score value will definitely be larger. Then, when the judgment threshold remains unchanged, it is easier to identify malicious behaviors, thereby more accurately judging the security of the resource transfer process.
[0216] It can be understood that when the target texture security score value is greater than or equal to the preset texture score threshold, the target texture security score value is used as the corresponding second weight parameter. At this time, the second weight parameter is greater than 0, that is, the value higher than when the texture is normal as mentioned in the above embodiment.
[0217] Furthermore, in addition to combining the texture information in the image, there is also icon information in the middle of the two-dimensional code area. Therefore, the embodiment of the present application can also combine the icon information in the image and jointly determine the resource transfer detection result according to the icon information, including:
[0218] (1) Extract the target icon information in the two-dimensional code image and encode the target icon information to obtain the target icon feature;
[0219] (2) Input the target icon feature into the pre-trained icon detection model to obtain the target icon security score value of the two-dimensional code image;
[0220] (3) Jointly determine the resource transfer detection result of the two-dimensional code image according to the magnitudes of the target icon security score value, the target texture security score value, and the target icon security score value.
[0221] The target icon information refers to the icon located in the middle position of the two-dimensional code image. Generally speaking, this icon is the identifier of the resource transfer object or the identifier of the resource transfer platform. In the embodiment of the present application, by learning and judging malicious object identifiers and malicious platform identifiers, it can assist in judging the security of the resource transfer process.
[0222] Please refer to Figure 7 , Figure 7 which is a schematic diagram of a two-dimensional code image containing target icon information provided by the embodiment of the present application. In this two-dimensional code image, within a preset range area around the two-dimensional code area, target text information is displayed, and target icon information is displayed in the middle of the two-dimensional code area. These target text information are inducement texts such as "Scan the code to get a reward of XX million" and "Come and scan the code quickly". Therefore, the embodiment of the present application can subsequently detect the text information and icon information (texture is not elaborated here) of the two-dimensional code attachment medium.
[0223] The target icon feature refers to the feature extracted from the two-dimensional code image for describing the icon information, which is a representation obtained by encoding the extracted target icon information. Specifically, the target icon feature can be an icon feature vector obtained by different encoding methods or other forms of numerical expressions. These features can capture the important attributes and characteristics of the target icon information and can help the model perform accurate security scoring after being input into the icon detection model.
[0224] Exemplarily, there are multiple ways to encode the target icon information to obtain the target icon features. The process is similar to the way of encoding the target texture information to obtain the target texture features in the above embodiments, and will not be elaborated here.
[0225] The icon detection model is a model used to analyze and judge the icon features in an image. It can be trained to learn the relationships between different icon structures, colors, and shapes, and evaluate the security level of the resource transfer process based on this information. The icon detection model is obtained through pre-training and can identify the icons in the image. Specifically, the icon detection model can be obtained using deep learning techniques, which is similar to the texture detection model in the above embodiments and will not be elaborated here.
[0226] The target icon security score value is a numerical value used to evaluate and measure the target icon information in the QR code image. It is the result obtained by inputting the target icon features into a pre-trained icon detection model and can reflect the reliability and security level of the target icon information in the image. Specifically, the icon detection model will identify the icon based on the features of the target icon and give the security score value of the target icon. This score value can be used to judge the authenticity and credibility of the target icon, and further assist in determining the resource transfer detection result of the QR code image.
[0227] In the embodiments of the present application, the resource transfer detection not only involves the text information in the image, but also needs to consider the texture information and icon information contained in the image. By jointly considering the target text security score value, the target texture security score value, and the target icon security score value, similarly, the third weight parameter can be assigned to the target icon security score value according to the size of the target icon security score value, and based on the first weight parameter, the second weight parameter, and the third weight parameter, the target text security score value, the target texture security score value, and the target icon security score value are weighted respectively to obtain the total score value. Finally, based on the size of the total score value, the resource transfer detection result of the QR code image is determined, realizing multiple detections and comprehensively judging the resource transfer security level of the QR code image, thereby improving the accuracy of resource transfer detection.
[0228] Further, when the target icon security score value is less than the preset icon score threshold, the third weight parameter corresponding to the target icon security score value can also be set to zero. When the target icon security score value is greater than or equal to the preset icon score threshold, the target icon security score value is used as the corresponding third weight parameter. The principle is the same as the reason for determining the second weight parameter in the above embodiments and will not be elaborated here.
[0229] In summary, through the above steps 201 to 204, in the embodiment of the present application, a two-dimensional code image corresponding to resource transfer is obtained. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it, and at least the target text information is included in the preset range area of the two-dimensional code image; the target text information in the two-dimensional code image is extracted, and the target text information is encoded to obtain a target text feature; the target text feature is input into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image; the resource transfer detection result of the two-dimensional code image is determined according to the size of the target text security score value. In this way, since at least the target text information is included in the preset range area around the two-dimensional code area of the two-dimensional code image, and these target text information can reflect the security situation of the resource transfer process, therefore, in order to identify these texts, the extracted target text information needs to be input into the text detection model for identification, so as to obtain the target text security score value of the two-dimensional code image. The size of the target text security score value can represent the security level of the resource transfer process. Compared with the scheme of numerically detecting the resource transfer security level in the related art, even if malicious elements adjust the resource transfer display content in the two-dimensional code image in different resource transfer scenarios, the embodiment of the present application can identify the text information attached to the image, so it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the two-dimensional code image can be determined according to the size of the target text security score value, thereby improving the accuracy of resource transfer detection.
[0230] Combined with the method described in the above embodiments, the following will give further detailed examples.
[0231] To better illustrate the embodiments of the present application, please refer to Figure 8 as shown in Figure 8 FIG. 10 is a schematic diagram of the deployment process of the resource transfer detection system provided by the embodiment of the present application. The resource transfer detection system is deployed with the resource transfer detection method described in the above embodiments.
[0232] Among them, the resource transfer detection system first needs to be deployed offline, and the text detection model is trained through the offline process. In the offline deployment, first, the text attached to the two-dimensional code medium needs to be recognized to obtain the sample text information in the training process. This process can be extracted through OCR technology. Then, the sample text information is input into the initial text detection model for model training. The trained text detection model also needs to be evaluated for model effect and verified across time, and finally deployed.
[0233] During the process of deploying the model, the trained text detection model is deployed to the resource transfer detection system here. The resource transfer detection system can be built based on database technologies (such as CKV) and storage platform technologies (such as TSSD), which are not specifically limited here, and the resource transfer detection system is configured with an exception control strategy.
[0234] Finally, on the resource transfer platform, when an object scans a code, a QR code image can be obtained. The resource transfer system can then perform anomaly recognition on the code scanning process to obtain the final resource transfer detection result. When it is recognized that a high degree of malicious behavior exists in a certain resource transfer operation, the system will perform risk control operations such as reminders / interceptions.
[0235] To better illustrate the embodiments of the present application, please refer to Figure 9 as shown in Figure 9 is a complete flow schematic diagram of the resource transfer detection method provided by the embodiments of the present application. The complete flow of the resource transfer detection method includes the following steps:
[0236] In step 901, the attached text of the QR code medium is recognized.
[0237] Taking the code scanning scenario in resource transfer as an example, the QR code required for code scanning must have its physical carrier medium, such as a printed paper QR code, a QR code on a mobile phone screen, a QR code posted on a website, etc. In malicious behavior, the medium often contains text information with malicious features. For example, if it is a QR code posted on some malicious websites, there is often a large amount of malicious text information around it, and the picture (image) scanned by the user when scanning the code will record the surrounding text information together.
[0238] Then, through image OCR technology, the attached text of the QR code medium (image) during code scanning is recognized and the corresponding text in sentence form is obtained, realizing the recognition of characters from printed or handwritten text images and converting them into machine-readable text data.
[0239] In step 902, word segmentation.
[0240] All the Chinese text in sentence form recognized from the QR code media in the training samples is converted into a list of keywords through word segmentation. For example, for a Chinese text sentence "I ate corn this morning", through Chinese word segmentation technology, a list of keywords can be obtained: [I, this morning, ate, corn], where "I", "this morning", "ate", and "corn" are all keywords. By converting the text into a keyword list, it is beneficial for subsequent text word embedding representation learning.
[0241] In step 903, word embedding representation learning.
[0242] Word embedding means representing an object with a vector, which can be a word, a product, a movie, etc. Here, for word embedding, it is to learn a vector to represent a word.
[0243] After the word segmentation representation in step 902, the number of possible words is essentially finite. Suppose there are a total of N possible words, then all words can be represented by an N-dimensional one-hot encoding. Each index of the N-dimensional one-hot encoding corresponds to a word. For the vector corresponding to each word, except for taking 1 at its corresponding index, all other positions take the value of 0. However, the dimension of this representation method is too high (N is usually very large), so it generally cannot be directly used. Based on this, this application uses a word embedding model obtained based on Word2Vec for word embedding processing.
[0244] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of the word embedding model provided by the embodiments of this application. The word embedding model in the embodiments of this application can essentially be regarded as a dimensionality reduction algorithm. As Figure 5 shown, the word embedding model includes an input layer (Input Layer), a hidden layer (Hidden Layer), and an output layer (Output Layer). The input layer is the one-hot encoding of the action, and the dimension of the hidden layer can be much smaller than N. After the word embedding model is trained, all word segmentation features will be encoded. And the weight matrix W of the word embedding model as shown above is output as its encoding vocabulary. The dimension of the weight matrix W is W*N, and each row of its N-dimensional vector is the dimensionality reduction representation of the corresponding one-hot encoding, that is, the encoding representation of the corresponding word. Finally, the word embedding model outputs an embedding vector. (The training process can form corresponding sample text features, and the application process is to obtain the target text features according to the combination of multiple word embedding features).
[0245] In step 904, the text detection model is trained.
[0246] After converting the word list obtained in step 902 into the corresponding embedding vectors in step 903, the sentence recognized by the two-dimensional code medium will be converted into a word feature matrix. Input this word feature matrix into the initial text detection model for binary classification network learning and training.
[0247] Please refer to Figure 10 shown, Figure 10It is a schematic structural diagram of the text detection model provided by an embodiment of the present application. The text detection model includes an input module, several convolutional modules (two are taken as examples in the figure), a fully connected module, and an output module. The word feature matrix obtained in step 903 above is input into the input module. Specifically, assuming that the medium-attached text segmentation recognized in one code scanning contains T words, and each word can be represented as x after the word embedding process in step 903 above i , representing the i-th word. Therefore, arranging these words in sequence, the input of the model can be obtained:
[0248] X = [x1, x2,..., x T
[0249] where X represents all the attached text on the two-dimensional code medium. The training process is all the text within the preset range around the sample two-dimensional code area in the sample image, and in the application process, it is all the text within the preset range around the two-dimensional code area in the two-dimensional code image.
[0250] After the convolutional processing of the convolutional module and the fully connected module maps the output of the entire network to a single value for returning the calculation of the network reconstruction error, finally, a score value is output through the output module. Specifically, the network will output a predicted score p, whose value range is [0, 1], representing the suspicious degree of the user behavior sequence. The larger the value, the higher the suspicious degree.
[0251] The training process learns the network parameters by optimizing the objective function L:
[0252]
[0253] where S is the number of all samples, p i is the safety score value of the sample text, and y i is the sample label.
[0254] In step 905, resource transfer detection is performed according to the trained text detection model.
[0255] When the trained text detection model is obtained and deployed, when a new code scanning behavior occurs, the matrix obtained by embedding the OCR result segmentation of the corresponding two-dimensional code medium is input into the trained text detection model, and the model can output the target text safety score value. According to the preset judgment threshold, if the target text safety score value is greater than or equal to the judgment threshold, the model expects that the current code scanning resource transfer behavior has certain security problems, and the system can output corresponding abnormal prompts, such as reminding / intercepting the user, etc. On the contrary, if the target text safety score value is less than the preset judgment threshold, it is considered that the current resource transfer behavior is safe.
[0256] Please refer to Figure 11 , Figure 11 which is another flowchart of the resource transfer detection method provided by the embodiments of this application. This resource transfer detection method can be applied to the terminal in the above embodiments, or jointly executed by the terminal and the server. The resource transfer detection method includes steps 1101 to 1104:
[0257] In step 1101, an image of the two-dimensional code area and a preset range area around it is collected to obtain a two-dimensional code image;
[0258] Among them, at least the target text information is included in the preset range area of the two-dimensional code area;
[0259] In step 1102, the two-dimensional code image is sent to the server;
[0260] Among them, after receiving the two-dimensional code image, the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, and then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines the resource transfer detection result of the two-dimensional code image according to the size of the target text security score value;
[0261] In step 1103, the resource transfer detection result sent by the server is received, and a resource transfer operation is performed when the resource transfer detection result meets the transfer condition.
[0262] The resource transfer detection method in the embodiments of this application is similar to the resource transfer detection method in steps 201 to 204 in the above embodiments. The difference is that it is applied to the terminal or jointly executed by the terminal and the server. The same parts as the above embodiments will not be elaborated here.
[0263] Among them, the transfer condition is a pre-set condition. For example, only when it is determined that the resource transfer detection result is safe does it meet the transfer condition, and the terminal can then normally perform the resource transfer operation; on the contrary, if the resource transfer detection result is dangerous, it does not meet the resource transfer condition, and the terminal needs to issue a prompt or receive a target abnormal control policy sent by the server. Finally, the terminal stops performing the resource transfer operation, or determines whether to continue performing the resource transfer operation based on other input operations of the client, which is not specifically limited here.
[0264] In summary, through the above steps 1101 to 1103, in the embodiment of the present application, an image of a two-dimensional code area and a preset range area around it is collected to obtain a two-dimensional code image. The preset range area of the two-dimensional code area includes at least target text information. The two-dimensional code image is sent to the server so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, and then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines a resource transfer detection result of the two-dimensional code image according to the size of the target text security score value. The resource transfer detection result sent by the server is received, and a resource transfer operation is performed when the resource transfer detection result meets the transfer condition. Therefore, since the two-dimensional code image includes at least target text information in the preset range area around the two-dimensional code area, and these target text information can reflect the security situation of the resource transfer process. Therefore, in order to identify these texts, the extracted target text information needs to be input into the text detection model for identification, so as to obtain the target text security score value of the two-dimensional code image. The size of the target text security score value can represent the security level of the resource transfer process. Compared with the related art of numerically detecting the security level of resource transfer, even if malicious elements adjust the resource transfer display content in the two-dimensional code image in different resource transfer scenarios, the embodiment of the present application can identify the text information attached to the image, so it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the two-dimensional code image can be determined according to the size of the target text security score value, thereby improving the accuracy of resource transfer detection.
[0265] To facilitate better implementation of the resource transfer detection method provided in the embodiment of the present application, the embodiment of the present application also provides a device based on the above resource transfer detection method. The meanings of the nouns are the same as those in the above resource transfer detection method, and the specific implementation details can refer to the description in the method embodiment.
[0266] Please refer to Figure 12 , Figure 12 FIG. is a schematic structural diagram of the resource transfer detection device provided in the embodiment of the present application. The resource transfer detection device is applied to the server in the above embodiment, or jointly executed by the terminal and the server. The resource transfer detection device may include an image acquisition unit 1201, a feature extraction unit 1202, a security scoring unit 1203, a detection result determination unit 1204, etc. Specifically as follows:
[0267] The image acquisition unit 1201 is configured to acquire a two-dimensional code image corresponding to resource transfer. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it. The preset range area of the two-dimensional code area includes at least target text information;
[0268] A feature extraction unit 1202, configured to extract target text information from a two-dimensional code image and encode the target text information to obtain target text features;
[0269] A security scoring unit 1203, configured to input the target text features into a pre-trained text detection model to obtain a target text security scoring value of the two-dimensional code image;
[0270] A detection result determination unit 1204, configured to determine a resource transfer detection result of the two-dimensional code image according to the magnitude of the target text security scoring value.
[0271] In some embodiments, the feature extraction unit 1202 is configured to:
[0272] Perform word segmentation on the target text information to obtain a plurality of keywords;
[0273] Encode the plurality of keywords to obtain corresponding word segmentation features;
[0274] Perform word embedding processing on the plurality of word segmentation features respectively to obtain corresponding word embedding features, and combine the plurality of word embedding features to obtain target text features.
[0275] In some embodiments, the resource transfer detection device further includes a model training unit (not labeled), and the model training unit is configured to:
[0276] Obtain a sample image corresponding to resource transfer, where the sample image is an image including a sample two-dimensional code area and a preset range area around it, and at least sample text information is included in the preset range area of the sample two-dimensional code area, and the sample image has a corresponding sample label;
[0277] Extract sample text information from the sample image and encode the sample text information to obtain sample text features;
[0278] Input the sample text features into an initial text detection model to obtain a sample text security scoring value of the sample image;
[0279] Determine a sample loss value according to the difference between the sample text security scoring value and the sample label, and train the initial text detection model based on the sample loss value until the sample loss value converges to obtain a pre-trained text detection model.
[0280] In some embodiments, the model training unit is further configured to:
[0281] Obtain a verification image, where the verification image is an image including a verification two-dimensional code area and a preset range area around it, and at least verification text information is included in the preset range area of the verification two-dimensional code area, and the acquisition time of the verification image is later than the acquisition time of the sample image;
[0282] Extract the verification text information from the verification image, and encode the verification text information to obtain verification text features;
[0283] Input the verification text features into a pre-trained text detection model to obtain the verification text security score value of the verification image;
[0284] Determine the cross-time verification result of the text detection model based on the verification text security score value, and retrain the text detection model when the cross-time verification result meets the update condition.
[0285] In some embodiments, the preset range area of the two-dimensional code area further includes target texture information, and the detection result determination unit 1204 is used for:
[0286] Extract the target texture information from the two-dimensional code image, and encode the target texture information to obtain target texture features;
[0287] Input the target texture features into a pre-trained texture detection model to obtain the target texture security score value of the two-dimensional code image;
[0288] Jointly determine the resource transfer detection result of the two-dimensional code image according to the magnitudes of the target text security score value and the target texture security score value.
[0289] In some embodiments, the detection result determination unit 1204 is further used for:
[0290] Obtain the first weight parameter of the preset target text security score value, and determine the corresponding second weight parameter according to the magnitude of the target texture security score value;
[0291] Weight the target text security score value and the target texture security score value respectively according to the first weight parameter and the second weight parameter to obtain the total score value;
[0292] Determine the resource transfer detection result of the two-dimensional code image according to the magnitude of the total score value.
[0293] In some embodiments, the detection result determination unit 1204 is further used for:
[0294] When the target texture security score value is less than the preset texture score threshold, set the second weight parameter corresponding to the target texture security score value to zero;
[0295] When the target texture security score value is greater than or equal to the preset texture score threshold, use the target texture security score value as the corresponding second weight parameter.
[0296] In some embodiments, the security scoring unit 1203 is used for:
[0297] When the security score value of the target text is greater than the preset text score threshold, determine a matching target exception control policy from the preset policy library according to the size of the security score value of the target text;
[0298] Send the target exception control policy to the terminal so that the terminal performs corresponding exception handling operations according to the target exception control policy.
[0299] In some embodiments, the security scoring unit 1203 is further configured to:
[0300] Identify the two-dimensional code area in the two-dimensional code image to determine the current resource transfer amount;
[0301] When the resource transfer amount is greater than the preset amount threshold, determine a matching target exception control policy from the preset policy library according to the size of the security score value of the target text.
[0302] For the specific implementation of each of the above units, reference may be made to the previous embodiments, which will not be elaborated herein.
[0303] As can be seen from the above, the image acquisition unit 1201 of the embodiment of the present application obtains a two-dimensional code image corresponding to resource transfer. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it. The preset range area of the two-dimensional code area includes at least target text information; the feature extraction unit 1202 extracts the target text information in the two-dimensional code image and encodes the target text information to obtain a target text feature; the security scoring unit 1203 inputs the target text feature into a pre-trained text detection model to obtain the security score value of the target text of the two-dimensional code image; the detection result determination unit 1204 determines the resource transfer detection result of the two-dimensional code image according to the size of the security score value of the target text. Thus, since the two-dimensional code image includes at least target text information in the preset range area around the two-dimensional code area, and these target text information can reflect the security situation of the resource transfer process. Therefore, in order to identify these texts, the extracted target text information needs to be input into the text detection model for identification, so as to obtain the security score value of the target text of the two-dimensional code image. The size of the security score value of the target text can represent the security level of the resource transfer process. Compared with the solution of numerically detecting the security level of resource transfer in the related art, even if malicious elements adjust the resource transfer display content in the two-dimensional code image in different resource transfer scenarios, the embodiment of the present application can identify the text information attached to the image. Therefore, it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the two-dimensional code image can be determined according to the size of the security score value of the target text, thereby improving the accuracy of resource transfer detection.
[0304] Please refer to Figure 13 , Figure 13A structural schematic diagram of the resource transfer detection device provided by an embodiment of the present application. This resource transfer detection device is applied in the terminal in the above embodiment or jointly executed by the terminal and the server. The resource transfer detection device may include an image acquisition unit 1301, a sending unit 1302, a receiving unit 1303, etc. Specifically as follows:
[0305] The image acquisition unit 1301 is configured to acquire an image of a two-dimensional code area and a preset range area around it to obtain a two-dimensional code image. At least the target text information is included in the preset range area of the two-dimensional code area;
[0306] The sending unit 1302 is configured to send the two-dimensional code image to the server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines a resource transfer detection result of the two-dimensional code image according to the magnitude of the target text security score value;
[0307] The receiving unit 1303 is configured to receive the resource transfer detection result sent by the server and perform a resource transfer operation when the resource transfer detection result meets the transfer condition.
[0308] For the specific implementation of each of the above units, reference may be made to the previous embodiments and will not be elaborated here.
[0309] As described above, the image acquisition unit 1301 of the embodiment of the present application obtains a two-dimensional code image by acquiring images of the two-dimensional code area and a preset range area around it. The preset range area of the two-dimensional code area includes at least target text information. The sending unit 1302 sends the two-dimensional code image to the server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, and then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines a resource transfer detection result of the two-dimensional code image according to the size of the target text security score value. The receiving unit 1303 receives the resource transfer detection result sent by the server and performs a resource transfer operation when the resource transfer detection result meets the transfer condition. Thus, since the two-dimensional code image includes at least target text information in the preset range area around the two-dimensional code area, and these target text information can reflect the security situation of the resource transfer process. Therefore, in order to identify these texts, it is necessary to input the extracted target text information into the text detection model for identification, so as to obtain the target text security score value of the two-dimensional code image. The size of the target text security score value can represent the security level of the resource transfer process. Compared with the solution of numerically detecting the resource transfer security level in the related art, even if malicious elements adjust the resource transfer display content in the two-dimensional code image under different resource transfer scenarios, the embodiment of the present application can identify the text information attached to the image, so it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the two-dimensional code image can be determined according to the size of the target text security score value, thereby improving the accuracy of resource transfer detection.
[0310] The embodiment of the present application further provides a computer device, which can be a terminal, such as Figure 14 shown, which shows a schematic structural diagram of the terminal involved in the embodiment of the present application. Specifically:
[0311] The computer device may include a radio frequency (RF) circuit 1401, a memory 1402 including one or more computer-readable storage media, an input unit 1403, a display unit 1404, a sensor 1405, an audio circuit 1406, a wireless fidelity (WiFi) module 1407, a processor 1408 including one or more processing cores, and a power supply 1409 and other components. Those skilled in the art can understand that Figure 14 the terminal structure shown in
[0312] The RF circuit 1401 can be used for receiving and transmitting information or signals during a call. Specifically, after receiving the downlink information from the base station, it is handed over to one or more processors 1408 for processing. Additionally, data related to the uplink is sent to the base station. Generally, the RF circuit 1401 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 1401 can also communicate with the network and other devices via wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.
[0313] The memory 1402 can be used to store software programs and modules. The processor 1408 executes various functional applications and information retrieval by running the software programs and modules stored in the memory 1402. The memory 1402 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, applications required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the terminal (such as audio data, a phone book, etc.). In addition, the memory 1402 can include a high-speed random access memory and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. Correspondingly, the memory 1402 can also include a memory controller to provide access to the memory 1402 for the processor 1408 and the input unit 1403.
[0314] The input unit 1403 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to object settings and function controls. Specifically, in a specific embodiment, the input unit 1403 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touchpad, can collect touch operations of an object on or near it (such as operations of an object using any suitable object or accessory such as a finger or a stylus on or near the touch-sensitive surface), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the object, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1408, and can receive and execute the commands sent by the processor 1408. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch-sensitive surface. In addition to the touch-sensitive surface, the input unit 1403 may further include other input devices. Specifically, the other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0315] The display unit 1404 can be used to display the information input by the object or the information provided to the object, as well as various graphical object interfaces of the terminal. These graphical object interfaces can be composed of graphics, text, icons, videos, and any combination thereof. The display unit 1404 may include a display panel. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface can cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 1408 to determine the type of touch event. Subsequently, the processor 1408 provides corresponding visual output on the display panel according to the type of touch event. Although in Figure 14 it, the touch-sensitive surface and the display panel are implemented as two independent components to achieve input and input functions, in some embodiments, the touch-sensitive surface and the display panel can be integrated to achieve input and output functions.
[0316] The terminal may further include at least one sensor 1405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor can turn off the display panel and / or the backlight when the terminal is moved to the ear. As a kind of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used in applications for identifying the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. As for other sensors that the terminal may also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be elaborated here.
[0317] The audio circuit 1406, the speaker, and the microphone can provide an audio interface between the object and the terminal. The audio circuit 1406 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output. On the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 1406 and then converted into audio data. After the audio data is output and processed by the processor 1408, it is sent via the RF circuit 1401 to, for example, another terminal, or the audio data is output to the memory 1402 for further processing. The audio circuit 1406 may also include an earphone jack to provide communication between the peripheral earphone and the terminal.
[0318] WiFi belongs to short - range wireless transmission technology. The terminal can help the object send and receive emails, browse the web, and access streaming media through the WiFi module 1407. It provides the object with wireless broadband Internet access. Although Figure 14 the WiFi module 1407 is shown, it can be understood that it does not belong to an essential component of the terminal and can be omitted entirely within the scope of not changing the essence of the invention according to needs.
[0319] The processor 1408 is the control center of the terminal. It connects various parts of the entire mobile phone using various interfaces and lines. By running or executing the software programs and / or modules stored in the memory 1402, and by calling the data stored in the memory 1402, it executes various functions of the terminal and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 1408 may include one or more processing cores. Preferably, the processor 1408 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, the object interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above - mentioned modem processor may not be integrated into the processor 1408 either.
[0320] The terminal further includes a power supply 1409 (such as a battery) for powering each component. Preferably, the power supply can be logically connected to the processor 1408 through a power management system, so as to manage functions such as charging, discharging, and power consumption management through the power management system. The power supply 1409 may further include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.
[0321] Although not shown, the terminal may further include a camera, a Bluetooth module, etc., which will not be elaborated here. Specifically, in this embodiment, the processor 1408 in the terminal will load the executable files corresponding to the processes of one or more application programs into the memory 1402 according to the following instructions, and the processor 1408 will run the application programs stored in the memory 1402 to implement various functions:
[0322] Obtain a two-dimensional code image corresponding to resource transfer. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it. At least the target text information is included in the preset range area of the two-dimensional code area;
[0323] Extract the target text information in the two-dimensional code image, and encode the target text information to obtain a target text feature;
[0324] Input the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image;
[0325] Determine the resource transfer detection result of the two-dimensional code image according to the size of the target text security score value. Or:
[0326] Collect an image of the two-dimensional code area and the preset range area around it to obtain a two-dimensional code image. At least the target text information is included in the preset range area of the two-dimensional code area;
[0327] Send the two-dimensional code image to the server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines the resource transfer detection result of the two-dimensional code image according to the size of the target text security score value;
[0328] Receive the resource transfer detection result sent by the server, and perform a resource transfer operation when the resource transfer detection result meets the transfer conditions.
[0329] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not elaborated in a certain embodiment, reference may be made to the detailed description of the resource transfer detection method above, which will not be elaborated here.
[0330] As can be seen from the above, the computer device according to the embodiment of the present application can obtain a two-dimensional code image by collecting images of the two-dimensional code area and a preset range area around it. The preset range area of the two-dimensional code area includes at least target text information. Send the two-dimensional code image to the server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, and then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determine the resource transfer detection result of the two-dimensional code image according to the size of the target text security score value. Receive the resource transfer detection result sent by the server, and perform a resource transfer operation when the resource transfer detection result meets the transfer conditions. Thus, since the two-dimensional code image includes at least target text information in the preset range area around the two-dimensional code area, and these target text information can reflect the security situation of the resource transfer process. Therefore, in order to identify these texts, it is necessary to input the extracted target text information into a text detection model for identification, so as to obtain the target text security score value of the two-dimensional code image. The size of the target text security score value can represent the security level of the resource transfer process. Compared with the scheme of numerically detecting the resource transfer security level in the related art, even if malicious elements adjust the resource transfer display content in the two-dimensional code image in different resource transfer scenarios, the embodiment of the present application can identify the text information attached to the image. Therefore, it is more suitable for the increasingly changing resource transfer scenarios. Finally, the resource transfer detection result of the two-dimensional code image can be determined according to the size of the target text security score value, thereby improving the accuracy of resource transfer detection.
[0331] Those of ordinary skill in the art can understand that all or part of the steps in the above methods of the embodiments can be completed by instructions, or by instructions controlling related hardware. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0332] Therefore, the embodiment of the present application provides a computer-readable storage medium, which stores multiple instructions that can be loaded by a processor to execute the steps in any of the resource transfer detection methods provided by the embodiment of the present application. For example, the instructions can perform the following steps:
[0333] Obtain a two-dimensional code image corresponding to resource transfer. The two-dimensional code image is an image including a two-dimensional code area and a preset range area around it. The preset range area of the two-dimensional code area includes at least target text information;
[0334] Extract the target text information in the two-dimensional code image, and encode the target text information to obtain a target text feature;
[0335] Input the target text feature into a pre-trained text detection model to obtain the target text security score value of the QR code image;
[0336] Determine the resource transfer detection result of the QR code image according to the magnitude of the target text security score value. Or:
[0337] Collect images of the QR code area and a preset range area around it to obtain a QR code image. At least the target text information is included in the preset range area of the QR code area;
[0338] Send the QR code image to the server so that the server extracts the target text information in the QR code image, encodes the target text information to obtain the target text feature, then inputs the target text feature into a pre-trained text detection model to obtain the target text security score value of the QR code image, and determine the resource transfer detection result of the QR code image according to the magnitude of the target text security score value;
[0339] Receive the resource transfer detection result sent by the server, and perform a resource transfer operation when the resource transfer detection result meets the transfer conditions.
[0340] According to one aspect of the present application, there is provided a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various alternative implementation manners provided in the above embodiments.
[0341] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, and details are not described herein again.
[0342] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.
[0343] Since the instructions stored in the computer-readable storage medium can execute the steps in any of the resource transfer detection methods provided in the embodiments of the present application, the beneficial effects that can be achieved by any of the resource transfer detection methods provided in the embodiments of the present application can be realized. For details, reference may be made to the previous embodiments, and details are not described herein again.
[0344] The above has introduced in detail a resource transfer detection method, device, storage medium and equipment provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
Claims
1. A resource transfer detection method, characterized in that, Including: Obtain a QR code image corresponding to resource transfer, where the QR code image is an image including a QR code area and a preset range area around it, and at least target text information is included within the preset range area of the QR code area; Extract the target text information from the QR code image, and encode the target text information to obtain a target text feature; Input the target text feature into a pre-trained text detection model to obtain a target text security score value of the QR code image; Determine the resource transfer detection result of the QR code image according to the magnitude of the target text security score value.
2. The resource transfer detection method according to claim 1, wherein The encoding the target text information to obtain a target text feature includes: Segment the target text information to obtain multiple keywords; Encode the multiple keywords to obtain corresponding multiple segmented word features; Perform word embedding processing on the multiple segmented word features respectively to obtain corresponding multiple word embedding features, and combine the multiple word embedding features to obtain a target text feature.
3. The resource transfer detection method according to claim 1, wherein The text detection model is trained through the following steps: Obtain a sample image corresponding to resource transfer, where the sample image is an image including a sample QR code area and a preset range area around it, at least sample text information is included within the preset range area of the sample QR code area, and the sample image has a corresponding sample label; Extract the sample text information from the sample image, and encode the sample text information to obtain a sample text feature; Input the sample text feature into an initial text detection model to obtain a sample text security score value of the sample image; Determine a sample loss value according to the difference between the sample text security score value and the sample label, and train the initial text detection model based on the sample loss value until the sample loss value converges to obtain the pre-trained text detection model.
4. The resource transfer detection method according to claim 3, wherein After obtaining the pre-trained text detection model, the resource transfer detection method further includes: Obtain a verification image, where the verification image is an image including a verification QR code area and a preset range area around it, at least verification text information is included within the preset range area of the verification QR code area, and the acquisition time of the verification image is later than the acquisition time of the sample image; Extract the verification text information from the verification image, and encode the verification text information to obtain a verification text feature; Input the verification text feature into the pre-trained text detection model to obtain a verification text security score value of the verification image; Determine a cross-time verification result of the text detection model based on the verification text security score value, and re-train the text detection model when the cross-time verification result meets the update condition.
5. The resource transfer detection method according to claim 1, wherein, The preset range area of the QR code area further includes target texture information, and the determining the resource transfer detection result of the QR code image according to the magnitude of the target text security score value includes: Extract the target texture information from the QR code image, and encode the target texture information to obtain a target texture feature; Input the target texture feature into a pre-trained texture detection model to obtain the target texture security score value of the two-dimensional code image; Jointly determine the resource transfer detection result of the two-dimensional code image according to the magnitudes of the target text security score value and the target texture security score value.
6. The resource transfer detection method according to claim 5, wherein The jointly determining the resource transfer detection result of the two-dimensional code image according to the magnitudes of the target text security score value and the target texture security score value includes: Obtain a first weight parameter of the target text security score value set in advance, and determine a corresponding second weight parameter according to the magnitude of the target texture security score value; According to the first weight parameter and the second weight parameter, perform weighting on the target text security score value and the target texture security score value respectively to obtain a total score value; Determine the resource transfer detection result of the two-dimensional code image according to the magnitude of the total score value.
7. The resource transfer detection method according to claim 6, wherein The determining the corresponding second weight parameter according to the magnitude of the target texture security score value includes: When the target texture security score value is less than a preset texture score threshold, set the second weight parameter corresponding to the target texture security score value to zero; When the target texture security score value is less than the preset texture score threshold, use the target texture security score value as the corresponding second weight parameter.
8. The resource transfer detection method according to claim 1, wherein After obtaining the target text security score value of the two-dimensional code image, the resource transfer detection method further includes: When the target text security score value is greater than a preset text score threshold, determine a matching target abnormal control strategy from a preset policy library according to the magnitude of the target text security score value; Send the target abnormal control strategy to the terminal so that the terminal performs corresponding abnormal handling operations according to the target abnormal control strategy.
9. The resource transfer detection method according to claim 8, wherein The determining the matching target abnormal control strategy from the preset policy library according to the magnitude of the target text security score value includes: Identify the two-dimensional code area in the two-dimensional code image to determine the current resource transfer amount; When the resource transfer amount is greater than a preset amount threshold, determine a matching target abnormal control strategy from the preset policy library according to the magnitude of the target text security score value.
10. A resource transfer detection method, characterized in that Includes: Collect images of the two-dimensional code area and a preset range area around it to obtain a two-dimensional code image. The preset range area of the two-dimensional code area includes at least target text information; Send the two-dimensional code image to the server so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, then inputs the target text feature into a pre-trained text detection model to obtain the target text security score value of the two-dimensional code image, and determine the resource transfer detection result of the two-dimensional code image according to the magnitude of the target text security score value; Receive the resource transfer detection result sent by the server, and perform a resource transfer operation when the resource transfer detection result meets the transfer condition.
11. A resource transfer detection device, characterized in that, Includes: An image acquisition unit, configured to acquire a two-dimensional code image corresponding to resource transfer, where the two-dimensional code image is an image including a two-dimensional code area and a preset range area around it, and at least target text information is included in the preset range area of the two-dimensional code area; A feature extraction unit, configured to extract the target text information in the two-dimensional code image and encode the target text information to obtain a target text feature; A security scoring unit, configured to input the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image; A detection result determination unit, configured to determine a resource transfer detection result of the two-dimensional code image according to the magnitude of the target text security score value.
12. A resource transfer detection device, characterized in that, Including: An image acquisition unit, configured to acquire an image of a two-dimensional code area and a preset range area around it to obtain a two-dimensional code image, where at least target text information is included in the preset range area of the two-dimensional code area; A sending unit, configured to send the two-dimensional code image to a server, so that the server extracts the target text information in the two-dimensional code image, encodes the target text information to obtain a target text feature, then inputs the target text feature into a pre-trained text detection model to obtain a target text security score value of the two-dimensional code image, and determines a resource transfer detection result of the two-dimensional code image according to the magnitude of the target text security score value; A receiving unit, configured to receive the resource transfer detection result sent by the server and perform a resource transfer operation when the resource transfer detection result meets the transfer condition.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps in the resource transfer detection method according to any one of claims 1 to 9, or execute the steps in the resource transfer detection method according to claim 10.
14. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps in the resource transfer detection method according to any one of claims 1 to 9, or executes the steps in the resource transfer detection method according to claim 10.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps in the resource transfer detection method according to any one of claims 1 to 9, or executes the steps in the resource transfer detection method according to claim 10.