A transaction data encryption method and system based on mobile terminal
The encryption method generates a current encryption key based on last encrypted transaction data, addressing key leakage vulnerabilities and enhancing security in mobile transaction data management, with seamless transitions to new devices.
Patent Information
- Application Number
- CN202410410247.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-07
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-04-07
AI Technical Summary
Existing transaction data encryption methods using fixed keys in mobile terminals are vulnerable to key leakage, compromising data security during transmission and management.
A transaction data encryption method that generates a current encryption key based on the last encrypted transaction data, continuously updating the encryption key to enhance security, and includes user identity verification for mobile terminal replacement scenarios.
Ensures effective data security by preventing key leakage and enhancing the security level of transaction data management, allowing seamless transition to new mobile terminals while maintaining data integrity.
Smart Images

Figure CN118300847B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of transaction data management, and in particular to a transaction data encryption method and system based on a mobile terminal. Background Art
[0002] At present, as the level of intelligence of mobile terminals is getting higher and higher, users can conveniently complete mobile payments and transactions through mobile terminals. After the mobile payment and transaction are completed, a large amount of transaction data is generated and transmitted between the mobile terminal and the transaction server. Such transaction data carries a large amount of private information (such as transaction identity information, transaction amount, etc.). Once the transaction data is intercepted or leaked, the private information will be stolen, which seriously affects the security management level of the transaction data.
[0003] In the prior art, when a mobile terminal and a transaction server transmit transaction data, the transaction data is usually encrypted by data encryption to avoid leakage of private information; however, in the existing data encryption method, a fixed key is usually used to encrypt the transaction data. However, the fixed key encryption method is prone to key leakage (for example, the manager uses his position to obtain the key, or the hacker intercepts the key data, etc.), which will result in all encryption processing being ineffective, seriously affecting the data security level in the data transmission and management process. Summary of the invention
[0004] In view of the above problems, the present invention aims to provide a transaction data encryption method and system based on a mobile terminal.
[0005] The purpose of the present invention is achieved by the following technical solutions:
[0006] In a first aspect, the present invention provides a transaction data encryption method based on a mobile terminal, which is applied to a mobile terminal and a server, and comprises the following steps:
[0007] S1 During the initial transaction, the mobile terminal encrypts the transaction data based on the initial key and transmits the encrypted transaction data to the server;
[0008] S2 In subsequent transactions, the mobile terminal generates a current encryption key based on the last encrypted transaction data, and uses the current encryption key to encrypt the current transaction data to obtain the current transaction data and transmit it to the server.
[0009] Preferably, the method further comprises: S01 before the first transaction, the mobile terminal generates an initial key and transmits the initial key to the server;
[0010] Preferably, the method further comprises: S01 before the first transaction, the mobile terminal transmits the user identity information to the server, and receives an initial key sent back by the server, wherein the initial key is generated by the server according to the user identity information.
[0011] Preferably, the mobile terminal receives the encrypted transaction feedback information transmitted back by the server, and uses the received encrypted transaction feedback information as the last encrypted transaction data; wherein the encrypted transaction feedback information is obtained by the server encrypting the transaction feedback information after generating the current encryption key in the same manner based on the received encrypted transaction data; wherein the transaction feedback information is the transaction feedback information generated by the server based on the transaction data.
[0012] Preferably, after step S1, the following steps are further included:
[0013] The mobile terminal stores the encrypted transaction data locally.
[0014] The transaction data includes transaction information or transaction feedback information generated when a transaction task is completed, and the transaction information includes transaction party identity information, transaction account information, transaction amount information, and transaction product information.
[0015] The server also performs independent server storage management for transaction data. When the server receives encrypted transaction data sent by the mobile terminal or generates encrypted transaction feedback information itself, it adds the relevant transaction data or transaction feedback information to the latest server storage record.
[0016] Preferably, after step S1, the following steps are further included:
[0017] After the mobile terminal receives the encrypted transaction feedback information sent back by the server, it generates the current encryption key based on the last encrypted transaction data in the local storage record, and uses the current encryption key to decrypt the acquired transaction feedback information to obtain the decrypted transaction feedback information; and further stores the encrypted transaction feedback information locally and adds it to the latest local storage record.
[0018] Preferably, in step S2, the mobile terminal generates a current encryption key according to the last encrypted transaction data, specifically including:
[0019] Perform hash processing on the last encrypted transaction data to obtain a hash value of fixed length;
[0020] Extracting time feature value according to the recording time of the last encrypted transaction data;
[0021] The current encryption key is generated by combining the obtained hash value and time feature value.
[0022] Preferably, the method further comprises:
[0023] When the mobile terminal needs to be replaced, the new mobile terminal collects the user identity information and transmits the user identity information to the server, so that the server performs verification according to the obtained user identity information and obtains the identity verification result; when the identity verification result is passed, the server transmits the server storage record stored in itself to the new mobile terminal;
[0024] The new mobile terminal performs local storage based on the acquired server storage records.
[0025] Preferably, the method further comprises:
[0026] When the mobile terminal needs to be replaced, the mobile terminal collects the user identity information and transmits the user identity information to the server, so that the server performs verification based on the obtained user identity information and obtains the identity verification result; when the identity verification result is passed, the server returns the record transfer information to the mobile terminal;
[0027] The mobile terminal shares the record transfer information to the new mobile terminal;
[0028] The new mobile terminal sends record transfer information to the server, so that the server extracts corresponding server storage records according to the received record transfer information and transmits them to the new mobile terminal;
[0029] The new mobile terminal performs local storage based on the acquired server storage records.
[0030] Preferably, the user identity information includes a user ID and a user face image collected in real time;
[0031] The server performs verification based on the obtained user identity information, including:
[0032] The server extracts the standard face image reserved by the user during registration from the registration information according to the obtained user ID;
[0033] Perform feature extraction based on the user face image collected in real time to extract the user face features;
[0034] The extracted user facial features are compared and analyzed with the user facial features corresponding to the standard facial image. When the similarity is higher than the preset standard value, the identity authentication result is passed.
[0035] In the second aspect, the present invention shows a transaction data encryption system based on a mobile terminal, including a mobile terminal and a server; wherein the mobile terminal and the server are used to implement the transaction data encryption method based on the mobile terminal as shown in any one of the embodiments of the first aspect above.
[0036] The beneficial effects of the present invention are as follows: during the transaction data transmission between the mobile terminal and the server of the present invention, only the transaction data generated by the initial transaction needs to be encrypted and decrypted using the initial key; in the subsequent transaction data transmission process, the last encrypted transaction data is used to generate a new encryption key, and the encryption key is continuously updated. Under the premise that the specific method of generating the encryption key based on the encrypted transaction data has not been leaked, the security of the encrypted data can be effectively guaranteed, and data security problems caused by key leakage can be effectively avoided.
[0037] At the same time, the data encryption method proposed above can realize the binding of transaction data and a designated mobile terminal, further improving the security level of mobile terminal transaction data management. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The present invention is further described using the accompanying drawings, but the embodiments in the accompanying drawings do not constitute any limitation to the present invention. A person skilled in the art can obtain other drawings based on the following drawings without creative work.
[0039] Figure 1 A method flow chart of a transaction data encryption method based on a mobile terminal shown in an embodiment of the present invention;
[0040] Figure 2 This is a framework diagram of a transaction data encryption system based on a mobile terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The present invention is further described in conjunction with the following application scenarios.
[0042] See also Figure 1 The embodiment shows a transaction data encryption method based on a mobile terminal, comprising:
[0043] S1 During the initial transaction, the mobile terminal encrypts the transaction data based on the initial key and transmits the encrypted transaction data to the server;
[0044] S2 In subsequent transactions, the mobile terminal generates a current encryption key based on the last encrypted transaction data, and uses the current encryption key to encrypt the current transaction data to obtain the current transaction data and transmit it to the server.
[0045] In the above-mentioned implementation mode of the present invention, during the process of transaction data transmission between the mobile terminal and the server, it is only necessary to use the initial key to encrypt and decrypt the transaction data generated by the initial transaction; in the subsequent transaction data transmission process, the last encrypted transaction data is used to generate a new encryption key, and the encryption key is continuously updated. On the premise that the specific method of generating the encryption key based on the encrypted transaction data has not been leaked, the security of the encrypted data can be effectively guaranteed, and data security problems caused by key leakage can be effectively avoided.
[0046] At the same time, the data encryption method proposed above can realize the binding of transaction data and a designated mobile terminal, further improving the security level of mobile terminal transaction data management.
[0047] Among them, the mobile terminal includes a smart device used by the user, and according to the actual needs, the mobile terminal is installed with an application or mini-program corresponding to the transaction party, so that the mobile terminal can establish a communication connection with the transaction party's server; the mobile terminal also reserves storage space for local storage of transaction data records.
[0048] The server includes a server built by the transaction parties, where the transaction parties include securities trading merchants (such as securities trading companies, banks, etc.) and mobile payment merchants (such as WeChat, Alipay). The server can receive and store transaction data transmitted by users, or after processing the received transaction data, the server will return the obtained feedback information (such as feedback information on successful transactions, transaction confirmation information, transaction records, balance information, etc.) to the user.
[0049] Preferably, the method further comprises:
[0050] S01 Before the first transaction, the mobile terminal generates an initial key and transmits the initial key to the server.
[0051] In one scenario, the initial encryption key can be generated by a mobile terminal, and after the mobile terminal generates the initial key, the mobile terminal shares the initial key with the server. The mobile terminal generates the initial key in a manner including but not limited to: generating an initial key of a fixed length based on specific key information input by a user, or generating the initial key based on the device ID information of the mobile terminal.
[0052] Preferably, the method further comprises:
[0053] S01 Before the first transaction, the mobile terminal transmits the user identity information to the server and receives the initial key sent back by the server, wherein the initial key is generated by the server according to the user identity information.
[0054] In another scenario, the initial key can be generated by the server based on the user identity information, where the specific generation method includes but is not limited to: generating an initial key of fixed length based on the user ID, and generating the corresponding initial key after feature extraction based on the user's face image. After the initial key is generated, the server returns the initial key to the mobile terminal for sharing. After the new user completes registration, the server can also generate an initial key based on the user's identity information and return the initial key to the user's mobile terminal.
[0055] Preferably, after step S1, the following steps are further included:
[0056] The mobile terminal receives the encrypted transaction feedback information sent back by the server, and uses the received encrypted transaction feedback information as the last encrypted transaction data; wherein the encrypted transaction feedback information is obtained by the server encrypting the transaction feedback information after generating the current encryption key in the same way based on the received encrypted transaction data; wherein the transaction feedback information is the transaction feedback information generated by the server based on the transaction data.
[0057] In one scenario, after a user completes mobile payment of goods through a mobile terminal, the transaction data related to the mobile payment is encrypted and transmitted to a mobile payment server; the mobile payment server generates a first key according to the received encrypted transaction data and the specified key generation rules based on the latest encrypted transaction data in the transaction record, and uses the first key to decrypt the encrypted transaction data to obtain, record, and process the relevant transaction data. After completing the processing of the transaction data, the mobile payment server generates corresponding feedback information, and generates a second key according to the specified key generation rules based on the previously obtained encrypted transaction data, and uses the second key to encrypt the feedback information, and transmits the encrypted feedback information back to the mobile terminal. At the same time, the mobile payment server updates the obtained encrypted transaction data and encrypted feedback information to the server storage record in sequence (in the current server storage record, the encrypted feedback information is the latest transaction data). After receiving the encrypted feedback information sent back by the mobile payment server, the mobile terminal generates a second key based on the latest encrypted transaction data in the transaction record (i.e., the encrypted transaction data previously transmitted from the mobile terminal to the server) according to the specified key generation rules, and uses the second key to decrypt the encrypted feedback information to obtain relevant feedback information; at the same time, the mobile terminal updates and stores the obtained encrypted feedback information in the local storage record. In this way, the synchronous record between the mobile terminal and the server is realized. At the same time, the dynamic update of the encryption key is also guaranteed, which helps to improve the security level of transaction data encryption.
[0058] Preferably, after step S1, the following steps are further included:
[0059] The mobile terminal stores the encrypted transaction data locally.
[0060] The transaction data includes transaction information or transaction feedback information generated when a transaction task is completed, and the transaction information includes the identity information of the transaction party, transaction account information, transaction amount information, transaction product information, etc.
[0061] The server also performs independent server storage management for transaction data. When the server receives encrypted transaction data sent by the mobile terminal or generates encrypted transaction feedback information itself, it adds the relevant transaction data or transaction feedback information to the latest server storage record.
[0062] Among them, the mobile terminal and the server both independently store and manage the transaction data records of both parties, and can generate the key required for current data encryption or decryption based on the encrypted transaction data in their own current storage records.
[0063] Among them, neither the mobile terminal nor the server will directly store the current key. Instead, the key algorithm will calculate the current key based on the transaction record, and then encrypt or decrypt based on the key; avoiding storing the current key directly in the terminal or server, causing unnecessary key leakage risks.
[0064] Preferably, after step S1, the following steps are further included:
[0065] After the mobile terminal receives the encrypted transaction feedback information sent back by the server, it generates the current encryption key based on the last encrypted transaction data in the local storage record, and uses the current encryption key to decrypt the acquired transaction feedback information to obtain the decrypted transaction feedback information; and further stores the encrypted transaction feedback information locally and adds it to the latest local storage record.
[0066] Regarding the setting form of the transaction record, the transaction feedback record can also be updated into the transaction record as transaction information to achieve synchronization of the transaction record between the mobile terminal and the server, and generate the current key based on the transaction record.
[0067] Preferably, in step S2, the mobile terminal generates a current encryption key according to the last encrypted transaction data, specifically including:
[0068] Perform hash processing on the last encrypted transaction data to obtain a hash value of fixed length;
[0069] Generate the current encryption key based on the obtained hash value.
[0070] The method of generating the current encryption key based on the encrypted transaction data may be to process the encrypted transaction data by hashing according to the preset data length in the actual transaction data, and generate a hash value of the same length, so that the transaction data can be encrypted or decrypted by the hash value later. The same hash value obtained from the same data is used, so when the mobile terminal and the server generate hash values based on the same encrypted data, they can generate the same hash value, encrypt and decrypt the next transaction data based on the hash value, and realize the synchronous update of the key.
[0071] In one scenario, the key is set in 16-bit form; the initial key is key0; the encryption function uses the G(A,key) symmetric encryption function, where A represents the data to be encrypted, key represents the encryption key used, G′(A′,key′) represents the decryption function, A′ represents the data to be decrypted, and key′ represents the decryption key used; the transaction record S stores n encrypted transaction information S={text1,text2,…,text n}, the mobile terminal or server generates the current encryption key key n =Hash[G(text n ,…G(text2,Hash[G(text1,Hash[G(text1,key0),16]),16])…),16], and based on the current key key n For the current transaction information pext n+1 Perform encryption processing to obtain encrypted transaction information text n+1 =G(pext n+1 ,key n ), and encrypt the transaction information text n+1 Add to the transaction record, update the transaction record position S′={text1,text2,…,text n+1}.
[0072] Similarly, when the other end needs to decrypt, it generates the key key based on the encrypted transaction information in the transaction record S n , and use the key key n The current encrypted transaction information text n+1 Decrypt and obtain transaction information pext n+1 =G′(text n+1 ,key n );and encrypt the transaction information text n+1 Add to the transaction record, update the transaction record position S′={text1,text2,…,text n+1}.
[0073] Hash[B,16] means performing hash processing on data B to generate a 16-bit hash value.
[0074] Preferably, in step S2, the mobile terminal generates a current encryption key according to the last encrypted transaction data, specifically including:
[0075] Perform hash processing on the last encrypted transaction data to obtain a hash value of fixed length;
[0076] Extracting time feature value according to the recording time of the last encrypted transaction data;
[0077] The current encryption key is generated by combining the obtained hash value and time feature value.
[0078] Among them, in the process of generating the current encryption key based on the hash value of the encrypted transaction data, the recording time of the transaction data can be further added as a key generation parameter. When the server and the mobile terminal generate the current encryption key for the encrypted transaction data, the encryption key can be further generated based on the time characteristic value of the data, thereby improving the security performance of the key generation.
[0079] In one scenario, when a key with a data length of 16 bits needs to be generated, a hash value with a length of 8 is generated by hashing the transaction data; at the same time, an 8-bit time feature is extracted based on the recording time of the last confidential data, and the obtained hash value and time feature value are combined to obtain the current encryption key.
[0080] Preferably, the method further comprises:
[0081] When the mobile terminal needs to be replaced, the new mobile terminal collects the user identity information and transmits the user identity information to the server, so that the server performs verification according to the obtained user identity information and obtains the identity verification result; when the identity verification result is passed, the server transmits the server storage record stored in itself to the new mobile terminal;
[0082] The new mobile terminal performs local storage based on the acquired server storage records.
[0083] Under normal circumstances, users need to use the same mobile terminal to continuously complete transaction tasks (because transaction record data are all stored in the local storage records of the mobile terminal); when the user needs to change the mobile terminal, the user identity authentication can be completed through the server. After passing the user identity authentication, the user's historical transaction records are obtained from the server through the new mobile terminal to synchronize the transaction data storage records, thereby meeting the conditions for encrypting transaction data between the new mobile terminal and the server, making it convenient for the user to continue to use the new mobile terminal to complete the transaction task.
[0084] Preferably, the method further comprises:
[0085] When the mobile terminal needs to be replaced, the mobile terminal collects the user identity information and transmits the user identity information to the server, so that the server performs verification based on the obtained user identity information and obtains the identity verification result; when the identity verification result is passed, the server returns the record transfer information to the mobile terminal;
[0086] The mobile terminal shares the record transfer information to the new mobile terminal;
[0087] The new mobile terminal sends record transfer information to the server, so that the server extracts corresponding server storage records according to the received record transfer information and transmits them to the new mobile terminal;
[0088] The new mobile terminal performs local storage based on the acquired server storage records.
[0089] When a user needs to change a mobile terminal, the user identity information must be verified first. After the verification is passed, the complete transaction record must be obtained from the server or the old mobile terminal and stored in the new mobile terminal to facilitate subsequent key generation and transaction data management operations of the mobile terminal.
[0090] Preferably, the user identity information includes a user ID and a user face image collected in real time;
[0091] The server performs verification based on the obtained user identity information, including:
[0092] The server extracts the standard face image reserved by the user during registration from the registration information according to the obtained user ID;
[0093] Perform facial feature extraction and processing based on the user's facial image collected in real time to obtain the user's facial feature information;
[0094] The acquired user facial feature information is compared with the standard user facial feature information corresponding to the standard facial image for verification. When the similarity between the two meets the preset standard value, the identity authentication result is passed.
[0095] Among them, the user face features include face texture features extracted based on the user face image, including LBP features and LBPH features.
[0096] In order to ensure the authenticity and reliability of the transfer or re-request of transaction information record data (related to the security of encrypted data), when requesting to obtain transaction record information, it is necessary to first verify the user's identity information to ensure the reliability of the operating user's identity. When performing user identity authentication, the user's face image is also collected based on the mobile terminal, and the server performs identity authentication based on the user's face image obtained by the mobile terminal to improve the reliability of identity authentication and further protect the security of transaction data.
[0097] Among them, in actual operation, since the mobile terminal obtains user facial images in a variety of scenarios and is affected by the scene environment, the quality of user facial images is easily uneven, which makes the server easily interfered when performing identity authentication based on user facial images (for example, when the user collects facial images through a mobile terminal, the light emitted by the mobile terminal screen will be reflected on the user's face, causing abnormal reflective areas to appear on the face, etc.), reducing the accuracy and reliability of identity recognition based on user facial images and affecting the user experience.
[0098] Preferably, before the server performs facial feature extraction processing based on the user facial image collected in real time, it also includes:
[0099] The server performs adaptive adjustment processing on the received user face image, specifically including:
[0100] Sa1 extracts the foreground part of the acquired user face image, and acquires the foreground part of the user face image as the face area A1; and acquires the background part of the user face image as the background area A2;
[0101] Sa2 obtains edge feature information in the face region image according to the grayscale information of the pixel points in the face region image A1, extracts edge pixel points in the face region image, and records the edge pixel points into the set JH b middle;
[0102] Sa3 converts the user's face image into the HSV color space and extracts the H component value, S component value, and V component value of each pixel point respectively;
[0103] Sa4 classifies the pixels in the face area image A1 based on the obtained V component value and S component, wherein the pixel classification function used is:
[0104] source3:V(x,y)-0.1S(x,y)≤0.3
[0105] source2:V(x,y)-0.1S(x,y)>0.3 and V(x,y)<0.9
[0106] sourse1: V(x,y)≥0.9
[0107] Among them, source1, source2, and source3 represent the classification labels of the pixels. When the pixel (x, y) meets the conditional function corresponding to the classification label, the pixel (x, y) is marked as the pixel of the corresponding classification label; V(x, y) and S(x, y) represent the V component value and S component value of the pixel (x, y) respectively;
[0108] Sa5 performs a first adjustment process on the V component value of the pixel point of source1, wherein the first adjustment function used is:
[0109] V *1 (x,y)=V s(x,y)
[0110] Among them, V *1 (x, y) represents the V component value of the pixel point (x, y) after the first adjustment process, (x, y) ∈ source1; V s(x,y) Represents the average V component value of each pixel in the surrounding area of the pixel point (x, y);
[0111] Sa6 forms a temporary set JH for the pixels of source1 and source2 after the first adjustment process c , for the temporary set JH c The pixels of are sorted from large to small according to the V component value to obtain a pixel sequence Hlc, wherein in Hlc, the pixel with a larger V component value is ranked higher;
[0112] Sa7 extracts the V component value V of the top 10% of the pixel points according to the pixel point sequence Hlc Hlc-1% and temporary collection JH c The average V component value of each pixel in like Where V TH Indicates the preset standard V component value, V TH ∈[0.1,0.3]; then the second adjustment process is performed on the V component values of the first 10% of the pixels in the sorting, otherwise Then complete the temporary set JH c Adjustment of the middle pixel;
[0113] The second adjustment function used is:
[0114] V *2 (x,y)=V c(x,y)
[0115] Among them, V*2 (x, y) represents the V component value of the pixel point (x, y) after the second adjustment process, c(x, y) represents the adaptive neighborhood range centered on the pixel point (x, y), where the adaptive neighborhood range is a rectangular range centered on the pixel point (x, y) with a side length of d, where the side length d satisfies: d = argmin(num =Hlc-10% (c(x,y)) <num ≠Hlc-10% (c(x,y))), d means that the function num =Hlc-10% (c(x,y)) <num ≠Hlc-10% The minimum value for which (c(x,y)) holds, num =Hlc-10% (c(x,y)) represents the number of pixels in the top 10% of the sequence Hlc within the adaptive neighborhood centered on the pixel point (x,y). ≠Hlc-10% (c(x,y)) represents the number of pixels in the adaptive neighborhood centered on the pixel point (x,y) that are not in the top 10% of the sequence Hlc;
[0116] After the second adjustment process is completed, the V component value of the pixel point (x, y) after the second adjustment process updates the pixel point sequence Hlc to obtain a new pixel point sequence and repeats step Sa7 based on the new pixel point sequence until the temporary set JH is completed. c Adjustment of the middle pixel;
[0117] Sa9 performs a third adjustment process on the V component value of the pixel point of source3, wherein the third adjustment function used is:
[0118] V *3 (x,y)=V dt +V(x,y)×V(x,y)
[0119] Among them, V *3 (x, y) represents the V component value of the pixel point (x, y) after the third adjustment process, (x, y) ∈ source3; V(x, y) represents the V component value of the pixel point (x, y) before the third adjustment process, V dt Indicates the preset darkness V component value, where V dt ∈[0.01,0.1];
[0120] Sa10 adjusts the overall brightness of the face area image based on the current face area image, and the overall brightness adjustment function used is:
[0121]
[0122] Among them, V *Z(x, y) represents the V component value of the pixel point (x, y) after the overall brightness adjustment, V(x, y) represents the V component value of the current pixel point (x, y), V bt Indicates the preset standard V component value, V bt ∈[0.5,0.7],d a2b (x, y) represents the pixel distance between the pixel point (x, y) and its nearest edge pixel point (a, b), where (a, b) ∈ JH b ;d at Indicates the preset distance standard value, where d at ∈[3,5];
[0123] Reconverting the user face image after overall brightness adjustment to the RGB color space to obtain the user face image after adaptive adjustment;
[0124] The server further performs facial feature extraction processing based on the user's facial image after the adaptive adjustment processing to obtain the user's facial feature information.
[0125] Preferably, the foreground part extraction includes using a foreground part extraction algorithm based on edge detection, or a foreground part extraction algorithm based on depth information, etc. to complete the foreground part extraction, which is not specifically limited in the present invention.
[0126] Preferably, acquiring edge feature information based on the face region image includes detecting edge pixels using an LBP operator, a Sobel operator, a Canny operator, etc., which is not specifically limited in the present invention.
[0127] Preferably, s(x, y) represents the surrounding area of the pixel point (x, y), wherein the surrounding area includes a rectangular area with a specific side length of 3×3, 5×5, 7×7, etc. centered on the pixel point, or the entire face area.
[0128] Preferably, in Sa7, the pixel neighborhood range is a rectangular area with a side length of 5×5 centered on the pixel;
[0129] The above-mentioned embodiment of the present invention proposes a technical solution for adaptively adjusting and processing user facial images. It can perform targeted processing on the situation where the facial image of the user is reflected due to the influence of terminal screen lighting during the process of collecting user facial images through a mobile terminal, which affects the accuracy of subsequent feature extraction and facial recognition based on the user facial image, thereby effectively improving the reliability and robustness of user identity authentication.
[0130] Among them, when performing adaptive adjustment processing, the face area in the user's face image is first processed as the key part, and the texture feature information of the face area is obtained based on the grayscale features of the face area, which serves as the basis for subsequent overall adjustment; further, based on the obtained user face image, it is converted into HSV color space, and the pixels are classified based on the saturation component and brightness component characteristics of the pixels. The proposed pixel classification function can classify the pixels into sourse1 classification with obvious reflection, sourse2 classification that needs to be focused on, and sourse3 classification of heavy shadow parts. The pixels of sourse1 classification with obvious reflection are first adjusted, and the brightness of the obvious reflection points is suppressed through the idea of brightness balance to eliminate the influence of facial skin reflection or eyeball reflection. For the adjusted sourse1 pixels and sourse2 pixels, , the sign is further based on the idea of sorting the brightness values of pixels to detect the reflection phenomenon of the pixels in the face area with the largest proportion. Based on the characteristics of the reflection phenomenon (according to the reflection of the screen, a local range of brightness abnormality will appear in the face part), the part with prominent brightness abnormality is traversed and adjusted to reduce the abnormality of the pixels (reducing the probability of being misjudged as facial texture features due to the reflection situation); at the same time, based on the iterative adjustment method, it can adaptively complete the processing of abnormal reflection areas and avoid the excessive flatness of brightness caused by over-adjustment (excessive elimination of facial texture features that should have been recognized), which helps to retain the facial details to the greatest extent when removing the abnormal reflection area; finally, for the middle shadow area (such as the texture area of the facial features, such as the corners of the eyes, nostrils, lips, etc.), the reflection of the texture features is highlighted by brightness stretching to improve the performance level of the facial features. At the same time, combined with the overall brightness adjustment processing, based on the texture feature information in the face area, the brightness level of the non-texture area is adaptively increased, which helps to improve the clarity of the entire face area and improve the representation level of the facial texture features. The server finally performs further feature extraction processing based on the user face image after adaptive adjustment, which can effectively eliminate the influence of abnormal texture features caused by light reflection caused by the mobile terminal during the user face image acquisition process, improve the reliability of face feature extraction, and also improve the accuracy of user identity authentication obtained by subsequent further comparison and verification based on face features, thereby ensuring the security of transaction data extraction.
[0131] See also Figure 2 The embodiment shows a transaction data encryption system based on a mobile terminal, the system includes a mobile terminal and a server, wherein:
[0132] During the initial transaction, the mobile terminal is used to encrypt the transaction data based on the initial key and transmit the encrypted transaction data to the server;
[0133] In subsequent transactions, the mobile terminal is used to generate a current encryption key based on the last encrypted transaction data, and use the current encryption key to encrypt the current transaction data to obtain the current transaction data and transmit it to the server.
[0134] It should be noted that the transaction data encryption system based on the mobile terminal shown in the above embodiment is also used to implement the following Figure 1 The corresponding specific implementation methods of the transaction data encryption method based on the mobile terminal shown in the embodiment will not be repeated in this application.
[0135] It should be noted that each functional unit / module in each embodiment of the present invention may be integrated into one processing unit / module, or each unit / module may exist physically separately, or two or more units / modules may be integrated into one unit / module. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of software functional unit / module.
[0136] Through the description of the above implementation mode, it can be clearly understood by those skilled in the art that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code or any appropriate combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing device (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), processor, controller, microcontroller, microprocessor, other electronic units designed to implement the functions described herein or their combination. For software implementation, part or all of the process of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a computer. Computer-readable media can include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer.
[0137] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, rather than to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should analyze that the technical solution of the present invention can be modified or replaced by equivalents without departing from the essence and scope of the technical solution of the present invention.
Claims
1. A transaction data encryption method based on a mobile terminal, characterized in that: Applied to mobile terminals and servers, including the following steps: S1 During the initial transaction, the mobile terminal encrypts the transaction data based on the initial key and transmits the encrypted transaction data to the server; Wherein, after step S1, the method further includes: The mobile terminal stores the encrypted transaction data locally; The transaction data includes transaction information or transaction feedback information generated when completing a transaction task, wherein the transaction information includes transaction party identity information, transaction account information, transaction amount information, and transaction commodity information; The server also performs independent server storage management for transaction data. When the server receives encrypted transaction data sent by the mobile terminal or encrypted transaction feedback information generated by the server itself, it adds the relevant transaction data or transaction feedback information to the latest server storage record; After receiving the encrypted transaction feedback information sent back by the server, the mobile terminal generates a current encryption key based on the last encrypted transaction data in the local storage record, and uses the current encryption key to decrypt the acquired transaction feedback information to obtain the decrypted transaction feedback information; and further stores the encrypted transaction feedback information locally and adds it to the latest local storage record; S2 In subsequent transactions, the mobile terminal generates a current encryption key based on the last encrypted transaction data, and uses the current encryption key to encrypt the current transaction data, and obtains the current transaction data and transmits it to the server; The method further comprises: When the mobile terminal needs to be replaced, the new mobile terminal collects the user identity information and transmits the user identity information to the server, so that the server performs verification based on the obtained user identity information and obtains the identity verification result; when the identity verification result is passed, the server transmits the server storage record stored in itself to the new mobile terminal; The new mobile terminal performs local storage based on the acquired server storage records; The user identity information includes the user ID and the user's face image collected in real time; The server performs verification based on the obtained user identity information, including: The server extracts the standard face image reserved by the user during registration from the registration information according to the obtained user ID; Perform feature extraction based on the user face image collected in real time to extract the user face features; The extracted user facial features are compared with the user facial features corresponding to the standard facial image. When the similarity is higher than the preset standard value, the identity verification result is passed. Before the server performs facial feature extraction processing based on the user facial image collected in real time, the server also includes: The server performs adaptive adjustment processing on the received user face image, specifically including: Sa1 extracts the foreground part of the acquired user face image, and acquires the foreground part of the user face image as the face area A1; and acquires the background part of the user face image as the background area A2; Sa2 obtains edge feature information in the face region image according to the grayscale information of the pixel points in the face region image A1, extracts edge pixel points in the face region image, and records the edge pixel points into the set JH b middle; Sa3 converts the user's face image into the HSV color space and extracts the H component value, S component value, and V component value of each pixel point respectively; Sa4 classifies the pixels in the face area image A1 based on the obtained V component value and S component, wherein the pixel classification function used is: source3:V(x,y)-0.1S(x,y)≤0.3 source2:V(x,y)-0.1S(x,y)>0.3 and V(x,y)<0.9 sourse1: V(x,y)≥0.9 Among them, source1, source2, and source3 represent the classification labels of the pixels. When the pixel (x, y) meets the conditional function corresponding to the classification label, the pixel (x, y) is marked as the pixel of the corresponding classification label; V(x, y) and S(x, y) represent the V component value and S component value of the pixel (x, y) respectively; Sa5 performs a first adjustment process on the V component value of the pixel point of source1, wherein the first adjustment function used is: V *1 (x,y)=V s(x,y) Among them, V *1 (x, y) represents the V component value of the pixel point (x, y) after the first adjustment process, (x, y) ∈ source1; V s(x,y) Represents the average V component value of each pixel in the surrounding area of the pixel point (x, y); Sa6 forms a temporary set JH for the pixels of source1 and source2 after the first adjustment process c , for the temporary set JH c The pixels of are sorted from large to small according to the V component value to obtain a pixel sequence Hlc, wherein in Hlc, the pixel with a larger V component value is ranked higher; Sa7 extracts the V component value V of the top 10% of the pixel points according to the pixel point sequence Hlc Hlc-10% and temporary collection JH c The average V component value of each pixel in like Where V TH Indicates the preset standard V component value, V TH ∈[0.1,0.3]; then the second adjustment process is performed on the V component values of the first 10% of the pixels in the sorting, otherwise Then complete the temporary set JH c Adjustment of the middle pixel; The second adjustment function used is: V *2 (x,y)=V c(x,y) Among them, V *2 (x, y) represents the V component value of the pixel point (x, y) after the second adjustment process, c(x, y) represents the adaptive neighborhood range centered on the pixel point (x, y), where the adaptive neighborhood range is a rectangular range centered on the pixel point (x, y) with a side length of d, where the side length d satisfies: d = argmin(num =Hlc-10% (c(x,y)) <num ≠Hlc-10% (c(x,y))), d means that the function num =Hlc-10% (c(x,y)) <num ≠Hlc-10% The minimum value for which (c(x,y)) holds, num =Hlc-10% (c(x,y)) represents the number of pixels in the top 10% of the sequence Hlc within the adaptive neighborhood centered on the pixel point (x,y). ≠Hlc-10% (c(x,y)) represents the number of pixels in the adaptive neighborhood centered on the pixel point (x,y) that are not in the top 10% of the sequence Hlc; After the second adjustment process is completed, the V component value of the pixel point (x, y) after the second adjustment process updates the pixel point sequence Hlc to obtain a new pixel point sequence and repeats step Sa7 based on the new pixel point sequence until the temporary set JH is completed. c Adjustment of the middle pixel; Sa9 performs a third adjustment process on the V component value of the pixel point of source3, wherein the third adjustment function used is: V *3 (x,y)=V dt +V(x,y)×V(x,y) Among them, V *3 (x, y) represents the V component value of the pixel point (x, y) after the third adjustment process, (x, y) ∈ source3; V(x, y) represents the V component value of the pixel point (x, y) before the third adjustment process, V dt Indicates the preset darkness V component value, where V dt ∈[0.01,0.1]; Sa10 adjusts the overall brightness of the face area image based on the current face area image, and the overall brightness adjustment function used is: Among them, V *Z (x, y) represents the V component value of the pixel point (x, y) after the overall brightness adjustment, V(x, y) represents the V component value of the current pixel point (x, y), V bt Indicates the preset standard V component value, V bt ∈[0.5,0.7],d a2b (x, y) represents the pixel distance between the pixel point (x, y) and its nearest edge pixel point (a, b), where (a, b) ∈ JH b ;d at Indicates the preset distance standard value, where d at ∈[3,5]; Reconverting the user face image after overall brightness adjustment to the RGB color space to obtain the user face image after adaptive adjustment; The server further performs facial feature extraction processing based on the user's facial image after the adaptive adjustment processing to obtain the user's facial feature information.
2. A transaction data encryption method based on a mobile terminal according to claim 1, characterized in that: The method further includes: S01 before the first transaction, the mobile terminal generates an initial key and transmits the initial key to the server; or, S01 Before the first transaction, the mobile terminal transmits the user identity information to the server and receives the initial key sent back by the server, wherein the initial key is generated by the server according to the user identity information.
3. A transaction data encryption method based on a mobile terminal according to claim 1, characterized in that: The mobile terminal receives the encrypted transaction feedback information sent back by the server, and uses the received encrypted transaction feedback information as the last encrypted transaction data; The encrypted transaction feedback information is obtained by encrypting the transaction feedback information after the server generates the current encryption key in the same manner based on the encrypted transaction data received; The transaction feedback information is the transaction feedback information generated by the server based on the transaction data.
4. A transaction data encryption method based on a mobile terminal according to claim 1, characterized in that: In step S2, the mobile terminal generates a current encryption key based on the last encrypted transaction data, specifically including: Perform hash processing on the last encrypted transaction data to obtain a hash value of fixed length; Extracting time feature value according to the recording time of the last encrypted transaction data; The current encryption key is generated by combining the obtained hash value and time feature value.
5. A transaction data encryption system based on a mobile terminal, characterized in that: It comprises a mobile terminal and a server; wherein, the mobile terminal and the server are used to implement the transaction data encryption method based on the mobile terminal as described in any one of claims 1 to 4 above.
Citation Information
Patent Citations
Processing method for eliminating illumination unevenness of face image
CN101620667A
Method for enhancing color image
CN101742339A
Face shape classification method based on local features
CN106203263A
Data encryption method and device, computer equipment and storage medium
CN110061840A
Image processing method and device, and electronic equipment
CN110659683A
