A method and system for verifying batch order settlement data
By building a distributed database and verification service unit, combining the logistic regression model to make exception judgments, the data consistency and security problems in the automated reconciliation system are solved, and efficient and accurate order settlement data verification and exception handling are achieved.
Patent Information
- Application Number
- CN202410774421.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-06-14
AI Technical Summary
The automatic reconciliation system has simple reconciliation rules in order settlement data verification, which leads to manual intervention in abnormal data processing. Centralized systems are prone to data consistency problems in high concurrency, especially when synchronizing data between multiple systems and databases, it is difficult to Ensure data consistency.
Build a distributed database, ensure data security and integrity through encryption and hashing, build verification service units for comprehensive verification, create logistic regression models for exception determination, and transmit exception data through secure protocols for processing.
Ensure data consistency and security through distributed databases, the verification service unit improves data accuracy and consistency, and the logistic regression model enhances prediction capabilities and anomaly detection capabilities, ensuring the security and confidentiality of data during transmission.
Smart Images

Figure CN118552196B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data verification, and in particular to a method and system for verifying batch order settlement data. Background Art
[0002] With the rapid development of e-commerce and Internet finance, the transaction volume has increased dramatically. In order to improve efficiency, many companies have introduced automated reconciliation systems. These systems can automatically import order data and payment data, and match and verify data through preset reconciliation rules. Common reconciliation rules include amount matching, time matching, order status matching, etc. The system will generate a reconciliation report and mark abnormal data for further processing by financial personnel;
[0003] Although the automated reconciliation system improves efficiency in order settlement data verification, the reconciliation rules of the automated reconciliation system are usually relatively simple. When the automated reconciliation system encounters abnormal data, manual intervention is usually required for processing and verification. Centralized systems are prone to data consistency problems under high concurrency conditions, especially when data needs to be synchronized between multiple systems and databases. Data inconsistencies may occur, making it difficult to ensure the consistency of all data before and after reconciliation. Summary of the invention
[0004] In view of the problems existing in the above-mentioned existing batch order settlement data verification method and system, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is that although the automated reconciliation system improves the efficiency in order settlement data verification, the reconciliation rules of the automated reconciliation system are usually relatively simple. When the automated reconciliation system encounters abnormal data, manual intervention is usually required for processing and verification. The centralized system is prone to data consistency problems under high concurrency conditions, especially when data needs to be synchronized between multiple systems and databases, data inconsistencies may occur, making it difficult to ensure the consistency of all data before and after reconciliation.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for verifying batch order settlement data, which comprises:
[0007] Build a distributed database, create and configure channels and monitor the status of each node, encrypt order data and payment data, generate corresponding hash values, and upload them to the distributed database;
[0008] Construct a verification service unit to calculate the comprehensive verification results through matching degree, time continuity integral and time difference consistency;
[0009] Create a logistic regression model to make predictions based on historical data, determine thresholds based on anomaly probabilities, and make anomaly determinations on comprehensive verification results;
[0010] Abnormal data is marked based on abnormal judgment, management personnel are notified and abnormal reports are generated, abnormal data is transmitted through security protocols and abnormal processing is performed.
[0011] As a preferred solution of the batch order settlement data verification method of the present invention, wherein: the construction of a distributed database, the creation and configuration of channels and the monitoring of the status of each node include:
[0012] Choose MongoDB as the NoSQL database and enable the audit function of MongoDB to record detailed information of all sensitive operations, which can meet the high security and reliability requirements of order settlement data verification;
[0013] Use the Prometheus server and configure the MongoDB monitoring plug-in to collect runtime data of the database;
[0014] Use Grafana to connect to Prometheus and set up a dashboard to monitor key performance indicators of the database in real time.
[0015] As a preferred solution of the batch order settlement data verification method of the present invention, wherein: the encrypted order data and payment data, and the corresponding hash value generated, uploaded to the distributed database, include:
[0016] Encrypt the order data using the RSA algorithm to generate a pair of keys, namely a public key and a private key. Set p and q as two large prime numbers for the key, calculate the product n of the two large prime numbers as the modulus, and calculate the output of the Euler function.
[0017] Select an integer e as the public key exponent and calculate the private key exponent;
[0018] Encrypt order data and payment data separately;
[0019] Select SHA-256 as the hash algorithm, concatenate the encrypted order data including order number, unit price and timestamp, and the encrypted payment data including order number, payment amount and payment time, and generate a hash value;
[0020] The encrypted order data, encrypted payment data and the corresponding hash values are uploaded through the distributed database to generate transaction records.
[0021] As a preferred solution of the batch order settlement data verification method of the present invention, wherein: the construction of the verification service unit, through matching degree calculation, time continuity integral and time difference consistency calculation comprehensive verification results, including,
[0022] Build a verification service unit on the distributed database. Whenever new order data and payment data are uploaded, the verification service unit executes the verification process.
[0023] Decrypt the encrypted data using the private key and verify the integrity of the decrypted data using the SHA-256 hash algorithm;
[0024] Based on the order data uploaded to the distributed database, the matching degree Z is calculated according to the order quantity and payment amount. i ;
[0025] Based on the time range of order data and payment data, the temporal continuity of order data and payment data is calculated by an integral function;
[0026] Calculate transaction time consistency through the time difference between order data and payment data;
[0027] Comprehensive calculation and comprehensive verification results,
[0028] Where R represents the comprehensive verification result, B i Represents the order amount of the i-th order.
[0029] The creation of a logistic regression model, making predictions based on historical data, determining a threshold value based on anomaly probability and making anomaly determinations on the comprehensive verification results include:
[0030] Use logistic regression models to make predictions on historical data;
[0031] Collect historical order and payment data, calculate the R value of each order and payment data, mark each data and construct a feature matrix F and a label vector U. The feature matrix F contains the R value of the historical data, and the label vector U contains the label of each data;
[0032] The model is trained by the feature matrix F and the label vector U, the cross entropy loss function and the Adam optimizer are set for model training, and the model parameter β is trained by minimizing the function loss;
[0033] Use the trained model to make predictions on the validation set to obtain the abnormal probability of each sample, select the threshold range and select the probability threshold based on a fixed interval, compare the abnormal probability output by the model with the probability threshold, classify samples with abnormal probability higher than the probability threshold as abnormal, and classify samples with abnormal probability equal to or lower than the probability threshold as normal, calculate the precision k and recall h of each probability threshold, and calculate the F1 score.
[0034] Store the maximum value of the F1 score and record the corresponding probability threshold, and convert it into the threshold of the R value.
[0035] Where R yis the threshold of R value, P is the probability of abnormality under a given R value, and Q represents the selected probability threshold;
[0036] Computational R y The comprehensive verification result R is judged as abnormal. When the newly calculated R is greater than or equal to R y When it is abnormal, it is less than R y When is normal.
[0037] As a preferred solution of the batch order settlement data verification method of the present invention, wherein: marking the abnormal data according to the abnormality determination, notifying the management personnel and generating an abnormality report includes:
[0038] The abnormal data is marked on the distributed database, and the mark includes the order number, payment serial number, R value and abnormal label.
[0039] The marked data is sent to the management personnel for notification, and an exception report is generated based on the exception details and processing flow, including the details of the abnormal transaction, the processing flow and the final status.
[0040] As a preferred solution of the batch order settlement data verification method of the present invention, wherein: the abnormal data is transmitted through a security protocol and abnormal processing is performed, including:
[0041] The administrator downloads the order data and payment data and backs up the data to the storage disk;
[0042] The data is transmitted via the secure file transfer protocol SFTP. After receiving the data, auditors process and audit the data based on the abnormal labels.
[0043] Another object of the present invention is to provide a system for verifying batch order settlement data, which comprises:
[0044] Distributed database configuration module, creating configuration files and monitoring the status of each node in real time;
[0045] The data encryption module encrypts the order data and payment data, generates hash values for the encrypted order data and payment data, and uploads them to the distributed database;
[0046] The verification service unit module calculates the comprehensive verification results through matching degree, time continuity integral and time difference consistency;
[0047] The anomaly prediction module uses the trained logistic regression model to determine the anomaly of the newly calculated R value;
[0048] The exception handling module marks the data that is judged to be abnormal and sends it to the management personnel;
[0049] The data transmission module uses the private key to decrypt the downloaded encrypted data, verify the data integrity, and perform secure transmission operations.
[0050] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of the above-mentioned batch order settlement data verification method when executing the computer program.
[0051] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the above-mentioned batch order settlement data verification method.
[0052] The beneficial effects of the present invention are as follows: preventing data from being tampered with during transmission and storage through a distributed database, ensuring data consistency and security; ensuring data accuracy and consistency through verification service units and calculation of comprehensive verification, based on comprehensive verification of matching degree, time continuity and time difference consistency, avoiding the occurrence of data errors and abnormal situations; determining the threshold of the comprehensive verification result based on model prediction and calculation of F1 score by using a logistic regression model, providing a basis for abnormal judgment for the calculation of the comprehensive verification result, enhancing the system's prediction ability and abnormality detection ability; and ensuring the security and confidentiality of data during transmission by transmitting marked data and generating abnormality reports. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0054] Figure 1 The figure is a flowchart of the method for verifying the settlement data of batch orders.
[0055] Figure 2 This is a schematic diagram of the structure of the verification system for batch order settlement data. DETAILED DESCRIPTION
[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0057] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0058] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments.
[0059] Example 1
[0060] Reference Figure 1 , which is the first embodiment of the present invention, and provides a method for verifying batch order settlement data. The method for verifying batch order settlement data includes:
[0061] S1, build a distributed database, create and configure channels and monitor the status of each node, encrypt order data and payment data, generate corresponding hash values, and upload them to the distributed database;
[0062] Preferably, a distributed database is constructed, channels are created and configured, and the status of each node is monitored, including:
[0063] Choose MongoDB as the NoSQL database and enable the audit function of MongoDB to record detailed information of all sensitive operations, which can meet the high security and reliability requirements of order settlement data verification;
[0064] Use the Prometheus server and configure the MongoDB monitoring plug-in to collect runtime data of the database;
[0065] Use Grafana to connect to Prometheus and set up a dashboard to monitor key performance indicators of the database in real time.
[0066] Through the configuration of distributed databases, the scalability and flexibility of the system are enhanced, and it can adapt to the settlement needs of orders of different scales and complexities. MongoDB replica sets are used to provide high data availability. Prometheus servers are used to collect runtime data from the database to improve the deployment efficiency and maintenance convenience of the system. Grafana is connected to Prometheus to monitor the status of each node in real time, which can promptly detect and handle abnormal situations in the network and ensure the stable operation of the system.
[0067] Furthermore, the order data and payment data are encrypted, and the corresponding hash values are generated and uploaded to the distributed database, including:
[0068] The order data is encrypted using the RSA algorithm to generate a pair of keys, namely a public key and a private key. p and q are set as two large prime numbers for the key, respectively. The product n of the two large prime numbers is calculated as the modulus, and the output of the Euler function is calculated, which is expressed as:
[0069] φ(n)=(p-1)×(q-1),
[0070] Where φ(n) represents the output of the Euler function;
[0071] Select an integer e as the public key exponent, satisfying 1<e<φ(n) and e and φ(n) are mutually prime, and calculate the private key exponent, expressed as:
[0072] d=e -1 modφ(n),
[0073] Set the public key to (e,n) and the private key to (d,n);
[0074] Encrypt order data and payment data separately, expressed as:
[0075] C=M e mod n,
[0076] D=Z e mod n,
[0077] Where D represents the encrypted payment data, Z represents the payment data, C represents the encrypted order data, and M represents the order data;
[0078] Select SHA-256 as the hash algorithm, concatenate the encrypted order data including order number, unit price and timestamp, and the encrypted payment data including order number, payment amount and payment time, and generate a hash value;
[0079] The encrypted order data, encrypted payment data and the corresponding hash values are uploaded through the distributed database to generate transaction records.
[0080] By encrypting uploaded data, we ensure that only authorized users can decrypt and access the data, thus protecting the privacy and security of the data. By generating corresponding hash values and uploading them with the data, we ensure the integrity and authenticity of the data as well as the transparency and traceability of the data, preventing the data from being tampered with during transmission and storage, thus enhancing the privacy protection and security of the data.
[0081] S2, build a verification service unit and calculate the comprehensive verification results through matching degree, time continuity integral and time difference consistency;
[0082] Preferably, a verification service unit is constructed to calculate the comprehensive verification results through matching degree calculation, time continuity integration and time difference consistency calculation, including:
[0083] Build a verification service unit on the distributed database. Whenever new order data and payment data are uploaded, the verification service unit executes the verification process.
[0084] Decrypt the encrypted data using the private key and verify the integrity of the decrypted data using the SHA-256 hash algorithm;
[0085] Based on the order data uploaded to the distributed database, the matching degree Z is calculated according to the order quantity and payment amount. i , expressed as:
[0086]
[0087] Where Z i represents the matching degree of the i-th payment amount, k is the standard deviation of the payment amount, and Y i represents the payment amount of the i-th order number data, and μ represents the mean of the payment amount;
[0088] Based on the time range of order data and payment data, the continuity of order data and payment data in time is calculated by the integral function, which is expressed as:
[0089]
[0090] Where S represents the continuity of order data and payment data in time, a and b represent the start time and end time of order data and payment data respectively, f(x) represents the density function of order data and payment data on the time axis, n represents the total number of orders, λ represents the standard deviation of the time interval between two orders, and t i Represents the timestamp of the i-th order, and x is any moment on the timeline;
[0091] The transaction time consistency is calculated by the time difference between order data and payment data, expressed as:
[0092]
[0093] Where X represents the transaction time consistency output, P represents the total time difference, V p Indicates the time difference between the pth order data and the payment data. represents the standard deviation of the time difference;
[0094] The comprehensive calculation and verification results are expressed as:
[0095]
[0096] Where R represents the comprehensive verification result, B i Represents the order amount of the i-th order.
[0097] By verifying the verification rules of the service unit, timely verification of each transaction data is ensured. Through matching calculation, order and payment data with inconsistent amounts can be quickly identified to ensure that each order has a corresponding accurate payment record, avoiding financial reconciliation problems caused by data errors. Through time continuity calculation, unreasonable data in time distribution can be discovered and excluded to ensure the logical consistency of order and payment data in time. Through time difference consistency calculation, inconsistencies in transaction time between order and payment data can be accurately identified to ensure that the time information of each transaction is accurate. Furthermore, through comprehensive verification calculation, data errors and abnormal situations are avoided, improving the overall verification efficiency and data credibility of the system.
[0098] S3, create a logistic regression model, make predictions based on historical data, determine the threshold according to the abnormal probability, and make abnormal judgments on the comprehensive verification results;
[0099] Preferably, a logistic regression model is created to make predictions based on historical data, a threshold is determined based on the abnormal probability, and an abnormal determination is made on the comprehensive verification results, including:
[0100] Use the logistic regression model to predict historical data, expressed as:
[0101] P = σ(F·β),
[0102] Where σ is the Sigmoid function, P represents the abnormal probability of the model output, β represents the parameters of the logistic regression model, and F represents the feature matrix;
[0103] Collect historical order and payment data, calculate the R value of each order and payment data, mark each data and construct the feature matrix F and label vector U, where abnormal labels are 1 and normal labels are 0. The feature matrix F contains the R value of historical data, and the label vector U contains the label of each data, which can be expressed as:
[0104] F=[R1,R2,Λ,R g ],
[0105] U=[U1,U2,Λ,U g ],
[0106] Where g is the total number of historical data;
[0107] The model is trained by the feature matrix F and the label vector U, the cross entropy loss function and the Adam optimizer are set for model training, and the model parameter β is trained by minimizing the function loss;
[0108] Use the trained model to make predictions on the validation set to obtain the abnormal probability of each sample, select the threshold range and select the probability threshold based on a fixed interval. The threshold range can be set to 0 to 1. Compare the abnormal probability output by the model with the probability threshold, classify samples with abnormal probability higher than the probability threshold as abnormal, and classify samples with abnormal probability equal to or lower than the probability threshold as normal. Calculate the precision k and recall h of each probability threshold. Precision and recall are two commonly used performance indicators in classification problems. Precision refers to the proportion of samples predicted to be positive that are actually positive, and recall refers to the proportion of samples that are correctly predicted to be positive among samples that are actually positive. Calculate the F1 score, which is expressed as:
[0109]
[0110] Store the maximum value of the F1 score and record the corresponding probability threshold, and convert it into the threshold of the R value, expressed as:
[0111] R y =min P,R {RP ≥ Q},
[0112] Where R y is the threshold of R value, P is the abnormal probability under a given R value, Q represents the selected probability threshold, and the minimum R value corresponding to the abnormal probability P greater than or equal to the probability threshold Q is taken as the threshold R y ;
[0113] Computational R y The comprehensive verification result R is judged as abnormal. When the newly calculated R is greater than or equal to R y When it is abnormal, it is less than R y When is normal.
[0114] By using the logistic regression model and analyzing historical data to predict abnormal transactions, the intelligence level of the system is improved. Based on the model's prediction and the calculation of the F1 score, the threshold of the comprehensive verification result is determined, providing a basis for abnormal judgment in the calculation of the comprehensive verification result, enhancing the system's prediction ability and anomaly detection ability, reducing manual intervention and error risks, and ensuring the accuracy of the comprehensive verification result judgment.
[0115] S4, marking abnormal data according to abnormal determination, notifying management personnel and generating abnormal reports, transmitting abnormal data through security protocols and performing abnormal processing;
[0116] Preferably, the abnormal data is marked according to the abnormal determination, the management personnel are notified and an abnormal report is generated, including:
[0117] The abnormal data is marked on the distributed database, and the mark includes the order number, payment serial number, R value and abnormal label.
[0118] The marked data is sent to the management personnel for notification, and an exception report is generated based on the exception details and processing flow, including the details of the abnormal transaction, the processing flow and the final status.
[0119] By sending notifications of marked data to management personnel, the response speed and processing efficiency of abnormal situations are improved. Exception reports are generated based on the exception details, and the information and processing procedures of abnormal transactions are recorded in detail, ensuring the compliance and transparency of exception handling, and preventing possible data anomalies such as tampering during the processing process, providing a basis for subsequent exception handling, and realizing timely handling of abnormal situations through automatic marking and notification.
[0120] Furthermore, abnormal data is transmitted through a security protocol and abnormal processing is performed, including,
[0121] The administrator downloads the order data and payment data and backs up the data to the storage disk;
[0122] The data is transmitted via the secure file transfer protocol SFTP. After receiving the data, auditors process and audit the data based on the abnormal labels.
[0123] Data is transmitted through the SFTP protocol, which ensures the security and confidentiality of data during transmission and avoids the risk of data leakage and tampering during transmission. After receiving the data, auditors process and audit the data based on exception labels to ensure that abnormal situations are handled in a timely and effective manner, providing a safe and reliable exception handling solution for the verification of order settlement data, realizing the safe management of abnormal data, and improving the data security and reliability of the system.
[0124] Example 2
[0125] Reference Figure 2 , which is the second embodiment of the present invention, and which is different from the previous embodiment, provides a system for verifying batch order settlement data, including:
[0126] Distributed database configuration module, creating configuration files and monitoring the status of each node in real time;
[0127] The data encryption module encrypts the order data and payment data, generates hash values for the encrypted order data and payment data, and uploads them to the distributed database;
[0128] The verification service unit module calculates the comprehensive verification results through matching degree, time continuity integral and time difference consistency;
[0129] The anomaly prediction module uses the trained logistic regression model to determine the anomaly of the newly calculated R value;
[0130] The exception handling module marks the data that is judged to be abnormal and sends it to the management personnel;
[0131] The data transmission module uses the private key to decrypt the downloaded encrypted data, verify the data integrity, and perform secure transmission operations.
[0132] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0133] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0134] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0135] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0136] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A method for verifying batch order settlement data, characterized in that: include, Build a distributed database, create and configure channels and monitor the status of each node, encrypt order data and payment data, generate corresponding hash values, and upload them to the distributed database; Construct a verification service unit to calculate the comprehensive verification results through matching degree, time continuity integral and time difference consistency; Create a logistic regression model to make predictions based on historical data, determine thresholds based on anomaly probabilities, and make anomaly determinations on comprehensive verification results; Mark abnormal data based on abnormal judgment, notify management personnel and generate abnormal reports, transmit abnormal data through security protocols and perform abnormal processing; The construction verification service unit calculates the comprehensive verification results through matching degree calculation, time continuity integration and time difference consistency calculation, including: Build a verification service unit on the distributed database. Whenever new order data and payment data are uploaded, the verification service unit executes the verification process. Decrypt the encrypted data using the private key and verify the integrity of the decrypted data using the SHA-256 hash algorithm; Based on the order data uploaded to the blockchain, the matching degree Z is calculated according to the order quantity and payment amount. i , expressed as: Where Z i represents the matching degree of the i-th payment amount, k is the standard deviation of the payment amount, and Y i represents the payment amount of the i-th order number data, and μ represents the mean of the payment amount; Based on the time range of order data and payment data, the continuity of order data and payment data in time is calculated by the integral function, which is expressed as: Where S represents the continuity of order data and payment data in time, a and b represent the start time and end time of order data and payment data respectively, f(x) represents the density function of order data and payment data on the time axis, n represents the total number of orders, λ represents the standard deviation of the time interval between two orders, and t i Represents the timestamp of the i-th order, and x is any moment on the timeline; The transaction time consistency is calculated by the time difference between order data and payment data, expressed as: Where X represents the transaction time consistency output, P represents the total time difference, V p represents the time difference between the pth order data and the payment data, and θ represents the standard deviation of the time difference; The comprehensive calculation and verification results are expressed as: Where R represents the comprehensive verification result, B i Indicates the order amount of the i-th order; The creation of a logistic regression model, making predictions based on historical data, determining a threshold value based on anomaly probability and making anomaly determinations on the comprehensive verification results include: Use the logistic regression model to predict historical data, expressed as: P = σ(F·β), Where σ is the Sigmoid function, P represents the abnormal probability of the model output, β represents the parameters of the logistic regression model, and F represents the feature matrix; Collect historical order and payment data, calculate the R value of each order and payment data, mark each data and construct a feature matrix F and a label vector U. The feature matrix F contains the R value of the historical data, and the label vector U contains the label of each data; The model is trained by the feature matrix F and the label vector U, the cross entropy loss function and the Adam optimizer are set for model training, and the model parameter β is trained by minimizing the function loss; Use the trained model to make predictions on the validation set to obtain the abnormal probability of each sample, select the threshold range and select the probability threshold based on a fixed interval, compare the abnormal probability output by the model with the probability threshold, classify samples with abnormal probability higher than the probability threshold as abnormal, and classify samples with abnormal probability equal to or lower than the probability threshold as normal, calculate the precision k and recall h of each probability threshold, and calculate the F1 score, which is expressed as: Store the maximum value of the F1 score and record the corresponding probability threshold, and convert it into the threshold of the R value, expressed as: R y =my P,R {RP≥Q}, Where R y is the threshold of R value, P is the probability of abnormality under a given R value, and Q represents the selected probability threshold; Computational R y The comprehensive verification result R is judged as abnormal. When the newly calculated R is greater than or equal to R y When it is abnormal, it is less than R y When is normal.
2. The method for verifying the batch order settlement data according to claim 1, characterized in that: The construction of a distributed database, creation and configuration of channels and monitoring of the status of each node include: Choose MongoDB as the NoSQL database and enable the audit function of MongoDB to record detailed information of all sensitive operations, which can meet the high security and reliability requirements of order settlement data verification; Use the Prometheus server and configure the MongoDB monitoring plug-in to collect runtime data of the database; Use Grafana to connect to Prometheus and set up a dashboard to monitor key performance indicators of the database in real time.
3. The method for verifying the batch order settlement data according to claim 2, characterized in that: The encrypted order data and payment data, and the corresponding hash values are generated and uploaded to the distributed database, including: Encrypt the order data using the RSA algorithm to generate a pair of keys, namely a public key and a private key. Set p and q as two large prime numbers for the key, calculate the product n of the two large prime numbers as the modulus, and calculate the output of the Euler function. Select an integer e as the public key exponent and calculate the private key exponent; Encrypt order data and payment data separately; Select SHA-256 as the hash algorithm, concatenate the encrypted order data including order number, unit price and timestamp, and the encrypted payment data including order number, payment amount and payment time, and generate a hash value; The encrypted order data, encrypted payment data and the corresponding hash values are uploaded through the distributed database to generate transaction records.
4. The method for verifying the batch order settlement data according to claim 3, characterized in that: The abnormal data is marked according to the abnormal determination, the management personnel are notified and an abnormal report is generated, including: The abnormal data is marked on the distributed database, and the mark includes the order number, payment serial number, R value and abnormal label. The marked data is sent to the management personnel for notification, and an exception report is generated based on the exception details and processing flow, including the details of the abnormal transaction, the processing flow and the final status.
5. The method for verifying the batch order settlement data according to claim 4, characterized in that: The abnormal data is transmitted through a security protocol and the abnormal processing is performed. include, The administrator downloads the order data and payment data and backs up the data to the storage disk; The data is transmitted via the secure file transfer protocol SFTP. After receiving the data, auditors process and audit the data based on the exception tags.
6. A system based on the batch order settlement data verification method according to any one of claims 1 to 5, characterized in that: include, Distributed database configuration module, creating configuration files and monitoring the status of each node in real time; The data encryption module encrypts the order data and payment data, generates hash values for the encrypted order data and payment data, and uploads them to the distributed database; The verification service unit module calculates the comprehensive verification results through matching degree, time continuity integral and time difference consistency; The anomaly prediction module uses the trained logistic regression model to determine the anomaly of the newly calculated R value; The exception handling module marks the data that is judged to be abnormal and sends it to the management personnel; The data transmission module uses the private key to decrypt the downloaded encrypted data, verify the data integrity, and perform secure transmission operations.
7. A computer device comprising: A memory and a processor; the memory stores a computer program, characterized in that: when the processor executes the computer program, the steps of the method for verifying the settlement data of batch orders described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for verifying the batch order settlement data according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Payment processing method and device
CN114493609A
Order tamper-proofing method and device, computer equipment and readable storage medium
CN116091065A