A trading system testing and verification method and device
By deploying debug processing interfaces and permission tokens on computer system nodes, the problems of automated test data acquisition and environment reproduction are solved, and high-security debugging and data sandboxing functions are realized, ensuring the security and data integrity of the operation environment.
Patent Information
- Application Number
- CN202111181142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-11
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
It is difficult for existing systems to obtain a large amount of data during automated testing, and the problem is difficult to reproduce the test and operation environment, and the impact range of testing on system data is difficult to determine, and there are security risks and operational risks.
Deploy debugging and processing interfaces in all nodes of the computer system, achieve high security debugging through permission tokens, provide data sandbox functions and encrypted link logs, ensure that tests do not affect the operation environment, and use the high security design of permission tokens Prevent attacks.
It realizes high security debugging in the operation environment, ensures that production and testing do not affect each other, provides accurate simulation and estimation results, and does not destroy data, improving data security and access security.
Smart Images

Figure CN113821446B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system debugging, and in particular to a test and verification method and device for a transaction system. Background Art
[0002] Testing is essential in the software development process. Developers verify the correctness of the entire system function by letting the computer system process test data and test messages. There are at least the following problems in the existing system testing process:
[0003] 1. During the automated testing process, it is difficult to obtain data in large quantities for some functions. For example, the information generated by the USB shield during the testing of the bank transaction system. Since it depends on the hardware and the information generated by each USB shield is different, it is difficult to obtain a large amount of case data during the general testing process.
[0004] 2. Generally, software testing and production operations use two (or more) different computer system images, called the test environment and the operation environment. In the long-term practice, people have found that sometimes a problem occurs in the operation environment, but cannot be reproduced in the test environment. However, due to business operation reasons, the operation environment usually does not have the conditions for testing or debugging. This results in the situation where problems are discovered passively in the operation environment and difficult to analyze and troubleshoot.
[0005] 3. Some business function verification or testing can be performed in the operational environment, but the limitations are great. For example, it is difficult to manage the test transaction permissions. If the test permissions are too high, it will cause operational risks, and if they are too low, it will be difficult to complete the test function. The test will have an impact on the system data, the scope of the impact is difficult to determine, and the original data is difficult to restore.
[0006] In summary, there is an urgent need for a technical solution that can overcome the above problems, ensure that production and testing do not affect each other, do not need to invade the operating environment with processing results, and ensure security. Summary of the invention
[0007] In order to solve the problems existing in the prior art, the present invention proposes a test verification method and device for a transaction system. The present invention implements high-security debugging in a formal operating environment by deploying a debugging processing interface in all nodes of a computer system. A tester can initiate a transaction for debugging or functional verification without interrupting the business. Normal transactions can all support the execution of the test mode. A test authority token is attached to a normal transaction to give it a debugging attribute. When encountering a debugging attribute instruction, some specific operations will be performed to ensure that the test proceeds smoothly. The authority token adopts a high-security design. On the one hand, it can grant high authority to complete the test. On the other hand, due to its high security, attackers cannot use this mechanism to attack in the operating environment. A local data sandbox function is provided. The data sandbox flag is encrypted in the authority token. When the flag is received, only simulation processing is performed, and the operating environment data will not be affected. An encrypted link log is provided. After receiving the test token, each processing node can output the debugging log in turn. The log is encrypted in a unified manner. The present invention can achieve a different transaction password each time. In a distributed system, a transaction or a user operation is often processed in turn by each server in the system to finally obtain a result. The purpose of this log is to allow each processing node to generate a debug log in turn, and finally obtain the processing result of the entire link. This function can be used for problem finding, link analysis, performance analysis, etc.
[0008] In a first aspect of an embodiment of the present invention, a test and verification method for a trading system is proposed, the method comprising:
[0009] Acquire debugging transaction data initiated by the client, wherein the debugging transaction data is accompanied by an authorization token;
[0010] When the debug transaction data is transmitted to one or more servers in the transaction system, the authorization token is verified by the server;
[0011] If the verification is successful, the debugging transaction data is processed; the transaction is executed according to the debugging transaction data, and the sandbox test is performed according to the setting information in the authority token. After debugging, the debugging log is encrypted, and after the processing is completed, the transaction execution result and the encrypted debugging log are obtained;
[0012] If the verification fails, the transaction will be rejected;
[0013] If multiple servers process the debugging transaction data, after the last server completes the processing, the transaction execution results are summarized and the encrypted debugging log is summarized to form an encrypted link log and fed back to the client.
[0014] In a second aspect of an embodiment of the present invention, a test verification device for a trading system is provided, wherein the test verification device is configured in a server of the trading system, wherein the test verification device comprises:
[0015] An acquisition module, used for acquiring debugging transaction data initiated by a client, wherein the debugging transaction data is accompanied by an authorization token;
[0016] A verification module for verifying the authorization token when debugging transaction data is passed to one or more servers in the trading system;
[0017] The debugging module is used to process the debugging transaction data if the verification is passed; wherein, the transaction is executed according to the debugging transaction data, the sandbox test is performed according to the setting information in the authority token, the debugging log is encrypted after debugging, and the transaction execution result and the encrypted debugging log are obtained after the processing is completed;
[0018] If the verification fails, the transaction will be rejected;
[0019] If multiple servers process the debugging transaction data, after the last server completes the processing, the transaction execution results are summarized and the encrypted debugging log is summarized to form an encrypted link log and fed back to the client.
[0020] In a third aspect of an embodiment of the present invention, a computer device is proposed, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a test and verification method for a trading system when executing the computer program.
[0021] In a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, a test and verification method for a trading system is implemented.
[0022] The transaction system testing and verification method and device proposed in the present invention can be used for an architecture in which the test function and the formal function share the same environment. By using debugging tools in the operating environment, production and testing can be carried out simultaneously without affecting each other. The permission token generation and verification strategy are used to replace the traditional login name and password operation, which has high security. The data security and access security of the operating environment can be guaranteed, and local sandbox operations are created in the operating environment. It is possible to test some tasks that other tools cannot complete. At the same time, there is no need to invade the operating environment with the processing results. The simulation estimation results obtained through simulation processing have high accuracy, do not damage the data, and will not affect the operating environment data. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 It is a flowchart of a test and verification method for a trading system according to a first embodiment of the present invention.
[0025] Figure 2 It is a flowchart of a test and verification method for a trading system according to a second embodiment of the present invention.
[0026] Figure 3 It is a detailed flow chart of the client initiating a transaction.
[0027] Figure 4 This is a detailed flowchart for verifying the authorization token.
[0028] Figure 5 It is a detailed flowchart of sandbox testing.
[0029] Figure 6 This is a detailed flowchart of debug log encryption processing.
[0030] Figure 7 It is a detailed flowchart of the client's result analysis.
[0031] Figure 8 It is a schematic diagram of the architecture of a testing and verification device for a trading system according to an embodiment of the present invention.
[0032] Fig. 9 It is a schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0034] Those skilled in the art will appreciate that the embodiments of the present invention may be implemented as a system, device, apparatus, method or computer program product. Therefore, the present disclosure may be specifically implemented in the following forms, namely: complete hardware, complete software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0035] For the development and testing of trading systems, ① there is currently a lack of safe and effective means of debugging the operating environment, and generally a mirror environment with high similarity is used for simulation testing. ② Generally, it is easier to configure high permissions in the test environment, but in the operating environment, high permissions need to be issued with caution. Generally, users and passwords are used in conjunction with the permission management system. ③ In a system without a test token configuration, if the username and password are used to complete the authentication, a complex password can generally improve security slightly. Strict permission management configuration can reduce the impact of risks. ④ Most systems need to record the original data content during debugging, and restore the original data after the operation is completed, and do not have a sandbox function. Or the environment uses a baffle program during testing to avoid affecting the data, but the baffle program is usually not deployed in the operating environment. ⑤ Most system debug logs are distributed on each server and run separately. When you need to find a specific transaction log, you usually use a tool to download each of them and display them in series.
[0036] Based on the above solutions, the following problems exist: ① It is impossible for a mirror environment with high similarity to be 100% identical to the original environment. In practice, problems cannot be reproduced from time to time. In addition, each establishment of a mirror environment consumes a certain amount of financial, human and time costs. In the worst case, after synchronizing the mirror environment, the problem cannot be analyzed, and the loss is relatively large. ② For distributed systems, transaction and problem analysis require obtaining transaction permissions and server log or parameter access permissions respectively. Traditional methods such as manual allocation and permission management system are difficult to achieve one secret for one thing during the debugging process, and the allocation process is more cumbersome. It is not easy to recover permissions after allocation, and it is difficult to prevent replay attacks. ③ In the existing technology, the transaction layer generally only verifies and manages permissions through user identity. It is necessary to use a common account for the testing process, and the system cannot distinguish between debugging transactions and normal transactions (the sandbox and debugging log functions are based on the identification of debugging transactions). Permissions cannot be recovered or abandoned in time. ④ The existing system does not have a sandbox function, and data needs to be manually restored after debugging. ⑤ The existing system only has independent logs for each server, and no transaction link log function. In addition, log encryption management needs to be configured separately on each server, and there is no unified management function.
[0037] In this regard, the present invention proposes a test verification method and device for a transaction system, which relates to the technical field of system debugging. The present invention ① realizes high-security debugging in a formal operating environment by deploying a debugging processing interface in all nodes of a computer system. The system can be debugged or functionally verified by a tester when the business is not interrupted. ② All normal transactions of the system can support the execution of the test mode. A test authority token (TestAuthority Token) is attached to the normal transaction to make it have a debugging attribute. When the system encounters a debugging attribute instruction, some specific operations will be performed to ensure that the test proceeds smoothly. ③ The authority token adopts a high-security design. On the one hand, it can grant high authority to complete the test. On the other hand, due to its high security, attackers cannot use this mechanism to attack in the operating environment. ④ The system provides a local data sandbox function. The data sandbox flag is encrypted in the authority token. When the system receives the flag, it only performs simulation processing and does not affect the operating environment data. ⑤ The system provides an encrypted link log. After receiving the test token, each processing node can output the debugging log in turn. The log is encrypted in a unified manner. The system can achieve a different transaction password for each transaction. In a distributed system, a transaction or a user operation is often processed by each server in the system in sequence to finally get the result. The purpose of this log is to allow each processing node to generate a debug log in sequence, and finally get the processing result of the entire link. This function is often used in problem finding, link analysis, performance analysis, etc.
[0038] In the embodiments of the present invention, the terms that need to be explained are:
[0039] National cryptographic algorithm: a domestic cryptographic algorithm approved by the State Cryptography Administration. SM stands for commercial cryptography, where SM2 is an asymmetric encryption algorithm, meaning the encryption key is different from the decryption key. SM3 is a hashing algorithm, used to generate a summary of a piece of information, usually to prevent information from being tampered with. SM4 is a symmetric key, meaning the encryption and decryption key values are the same.
[0040] Electronic signature: A piece of information is encrypted using a private key. This information can be decrypted by a public key. Since the public key is available to the public, the encrypted information can be decrypted and read by everyone, but it cannot be generated by others. This technology is often used for identity authentication on the Internet.
[0041] Digital envelope technology: a technology used to transmit data in a two-layer encryption system. First, the symmetric key is used to encrypt the data, and then the asymmetric key is used to encrypt the symmetric key. This technology can simultaneously take advantage of the high efficiency of symmetric encryption (the decryption efficiency of asymmetric algorithms is very low and is not suitable for large-scale data transmission) and the good confidentiality of asymmetric algorithms (asymmetric algorithms have strong confidentiality during key exchange. Symmetric keys may be leaked during exchange).
[0042] Symmetric encryption: An encryption method that uses a single-key system, where the same key can be used for both encryption and decryption of information.
[0043] The principle and spirit of the present invention are explained in detail below with reference to several representative embodiments of the present invention.
[0044] Figure 1 FIG. 1 is a flow chart of a test and verification method for a trading system according to a first embodiment of the present invention. Figure 1 As shown, the method includes:
[0045] S101, obtaining debugging transaction data initiated by a client, wherein the debugging transaction data is accompanied by an authorization token.
[0046] S102, when the debugging transaction data is transmitted to one or more servers in the transaction system, the server verifies the authority token.
[0047] S103, if the verification is passed, the debugging transaction data is processed; wherein, the transaction is executed according to the debugging transaction data, a sandbox test is performed according to the setting information in the authority token, the debugging log is encrypted after debugging, and the transaction execution result and the encrypted debugging log are obtained after the processing is completed.
[0048] S104: If the verification fails, the transaction is rejected.
[0049] S105, if the debugging transaction data is processed by multiple servers, after the last server completes the processing, the transaction execution results are summarized and the encrypted debugging log is summarized to form an encrypted link log and fed back to the client.
[0050] In order to explain the test and verification method of the above trading system more clearly, a detailed description is given below in conjunction with multiple embodiments.
[0051] In the second embodiment, reference Figure 2 , is a flow chart of a test and verification method for a trading system according to a second embodiment of the present invention. Figure 2 As shown, the method also includes:
[0052] S200, configure the client's public key certificate in each server for signature verification.
[0053] refer to Figure 3 , is a detailed flow chart of the client initiating a transaction. Figure 3 As shown, in S101, the debugging transaction data initiated by the client is obtained, including:
[0054] S301, when a customer initiates a transaction through a client, the client writes the setting information into the original text of the authorization token.
[0055] S302, the client uses the signature private key to digitally sign the authority token, where an electronic signature can be used.
[0056] S303, packing the original text and the digital signature into the debugging transaction data.
[0057] The setting information of the permission token includes at least:
[0058] Execution user, transaction serial number, execution start time, permission validity period, permission level, sandbox operation flag, link log flag, log encryption key and other extended control parameters. The log encryption key can use the national secret asymmetric public key of the national secret algorithm.
[0059] For example, the setting information of the permission token is:
[0060] AdminUser|00000001|202105112037180001|15|01|Y|Y|7675177cae04a7e1ce745d394309d4a0939a981640 93d9ebe6bf8da5725de171a5a9557767959fbf7a796397df9ad98ebec77bc99f2953319c0c6327d0b387bf|***
[0061] The authority token is digitally signed with a national secret signature. The signature result is:
[0062] MEUCIQC3ozY1I64cH2xnOXYVi5BghcyXj8UypnEg6mnIqstukgIgR / QQ1rwttAzaC1m+ek7v / V7EuFk3BgW6pB6vEg1yamo=
[0063] Refer to Table 1, which is a permission token, including the original token and the signature:
[0064] Table 1 Authorization Token
[0065]
[0066] The meaning of the above permission token is:
[0067] Initiated by user AdminUser, serial number is 00000001, valid from date 202105112037180001, valid for 15 seconds, permission is 01, sandbox is enabled at runtime, debug log is enabled at runtime, debug log encryption key is:
[0068] 7675177cae04a7e1ce745d394309d4a0939a98164093d9ebe6bf8da5725de171a5a9557767959fbf7a796397df9ad98ebec77bc99f2953319c0c6327d0b387bf (asymmetric public key), *** are other extended control parameters.
[0069] Send the authorization token along with the transaction data to the server.
[0070] refer to Figure 4 , is a detailed flowchart of verifying the authorization token. Figure 4 As shown, in S102, when the debugging transaction data is transmitted to one or more servers in the transaction system, the server verifies the authorization token, including:
[0071] S401, judging whether the original text of the authority token and the digital signature match each other, and verifying the authenticity of the authority token.
[0072] Since the token is digitally signed by the initiating user using his / her private key, no one else can forge the signature, nor can anyone modify the original content of the token (if modified, the signature verification will fail. This also prevents attackers from illegally gaining permissions by modifying the token content).
[0073] S402, judging whether it is within the validity period according to the execution start time, the validity period of the permission and the current time of the server, and verifying the validity of the permission token.
[0074] The current server compares the system time with the token validity period. If it is within the validity period, it will be executed smoothly, otherwise it will be rejected. (The validity period is usually set at 3-15 seconds, and it will be invalidated immediately after execution, which prevents attackers from using existing tokens to re-initiate transactions and other operations).
[0075] S403: Determine whether the permission level meets the set permission level according to the permission level, and verify the permission of the permission token.
[0076] This feature allows the application to define its own permission level.
[0077] Since the permission token is attached to the transaction message, each server will receive the permission token at the same time when executing the transaction; each server in the path will verify and execute according to the content of the permission token in turn.
[0078] Furthermore, the sandbox function provided by the present invention can enable the trading system to complete normal execution without updating the database. After the operation is completed, it can still be restored to the state before execution.
[0079] refer to Figure 5 , which is a detailed flow chart of sandbox testing. Figure 5 As shown in the figure, the detailed process of sandbox testing includes:
[0080] S501, checking the sandbox operation flag in the permission token.
[0081] S502, if it is running in the sandbox, during the process of executing transactions on the current server, when encountering a write database operation, change the operation target to the image data table.
[0082] S503, after the transaction is executed, the transaction execution result is recorded in the image data table.
[0083] That is, after executing a transaction, when the database needs to be updated, the original database is not updated, but the update results are recorded in the image data table.
[0084] S504, when a data recovery or data change instruction is obtained, the image data table is cleared according to the data recovery instruction and the changed content is reset; according to the data change instruction, the transaction execution result in the image data table is updated to the database.
[0085] Among them, during the sandbox testing process, if single transaction debugging is required, the updated data in the image data table is loaded according to the transaction serial number; in this regard, in the single transaction debugging mode, the changes are only valid for the transaction itself, and the sandbox can support multiple people using it at the same time without affecting each other.
[0086] In the global debugging function, the update records of all transaction serial numbers are loaded by default. In this mode, the transaction results of any transaction in the sandbox are also valid for transactions in other sandboxes.
[0087] When it is necessary to read data from a database table, if there is no record of the database table in the image data table, the database data is directly read;
[0088] If the image data table contains records of the database table, the content of the image data table is used as the reading result.
[0089] Specifically, the image data table at least includes a transaction serial number, a modified database name, and modified data.
[0090] Further, regarding the encrypted link log proposed by the present invention:
[0091] During the debugging process, the trading system is often required to return debugging information. However, when the operating environment is debugged, since the debugging information often contains sensitive data (including but not limited to system information, user information, and account information for the financial industry, etc.), a strict storage strategy needs to be implemented for the log. The encrypted link log in the present invention can generate a log of debugging information separately, separated from other logs; at the same time, each node of the link can be encrypted separately, and the key is separated, which has high security and convenience as a whole.
[0092] Link log initiation: When a user initiates a transaction on the terminal, he or she can choose to return the link log;
[0093] The user terminal stores a pair of asymmetric encryption public and private keys, and the public key is attached to the extended parameters of the authority token.
[0094] Log generation and encryption: When executing a transaction, each server will use the preset debugging module to summarize the specified data and server operation information into a log (LOG) during the execution process, and then use digital envelope technology to generate a random symmetric key to encrypt the log, and then use the public key in the authority token to encrypt the random symmetric key (the above is the standard asymmetric encryption message process).
[0095] When multiple servers are processing, each server generates a random key separately, encrypts the message separately, and finally encrypts the random symmetric key with the same public key, thus ensuring that the message encryption keys are different; among them, all logs are saved in the return results.
[0096] Log reading: When the entire debugging transaction is completed, all logs are returned to the user operation terminal; the terminal uses the private key to decrypt the random symmetric key, and then uses the random symmetric key to decrypt each encrypted log. The final user obtains all link debugging logs.
[0097] refer to Figure 6 , is a detailed flowchart of the debug log encryption process. Figure 6 As shown in the figure, the detailed process of debugging log encryption includes:
[0098] S601, check the link log flag in the authority token. If the debugging log is enabled, the current server generates a log plain text during the transaction execution process.
[0099] S602, generate a random symmetric key, encrypt the log plaintext and generate the log ciphertext.
[0100] S603: Use the encrypted public key in the authority token to encrypt the random symmetric key.
[0101] S604, attaching the log ciphertext and the encrypted random symmetric key to the transaction execution result.
[0102] S605, when the current server summarizes the transaction execution results, an encrypted link log is generated according to all debugging logs.
[0103] S606, when the last server (usually the egress gateway) completes the processing, the encrypted link log is fed back to the client, and the client uses the local private key to decrypt the encrypted link log to obtain the entire log plaintext.
[0104] refer to Figure 7 , which is a detailed flow chart of the client's result analysis. Figure 7 As shown in the figure, the detailed process of result analysis includes:
[0105] S701: The client summarizes the encrypted link logs.
[0106] S702, calculate the start time and end time of the node according to the timestamp of each link log node in the log plaintext, and generate processing time series data.
[0107] S703, tracking the processing process through the log content in each link log node in the log plaintext.
[0108] Taking the tracking amount as an example, the amount value in each log section is analyzed in turn to generate a change table. Users can analyze or troubleshoot problems based on the results in the table (this function requires application support).
[0109] Compared with the prior art, the test and verification method of the transaction system proposed in the present invention has at least the following improvements:
[0110] 1. Test functions and official functions share the same environment to ensure that the official functions are tested normally.
[0111] 2. Use permission tokens to replace the traditional username and password authentication strategy, which can coexist and be different from the permission management in the operating environment.
[0112] 3. Use permission tokens to prevent attackers from stealing test permissions and disrupting the operating environment (the digital signature mechanism cannot be forged by attackers).
[0113] 4. Use the validity period of the permission token to prevent it from being stolen by attackers (the permission token expires after a few seconds and cannot be stolen by attackers).
[0114] 5. The local sandbox design is used to enhance the testing function without affecting the operating environment.
[0115] 6. Use encrypted link logs to protect logs from illegal reading, improve log usage efficiency, and provide additional analysis functions.
[0116] It should be noted that, although the operations of the method of the present invention are described in a specific order in the above embodiments and the accompanying drawings, this does not require or imply that the operations must be performed in the specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0117] After introducing the method of the exemplary embodiment of the present invention, next, refer to Figure 8 A test and verification device for a transaction system according to an exemplary embodiment of the present invention is introduced.
[0118] The implementation of the test verification device of the trading system can refer to the implementation of the above method, and the repeated parts will not be repeated. The term "module" or "unit" used below can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0119] Based on the same inventive concept, the present invention also proposes a test and verification device for a trading system, such as Figure 8 As shown, the test verification device is configured in the server of the trading system, wherein the test verification device includes:
[0120] The acquisition module 810 is used to acquire the debugging transaction data initiated by the client, wherein the debugging transaction data is accompanied by an authorization token;
[0121] A verification module 820 for verifying the authorization token when the debugging transaction data is transmitted to one or more servers in the transaction system;
[0122] The debugging module 830 is used to process the debugging transaction data if the verification is passed; wherein, the transaction is executed according to the debugging transaction data, the sandbox test is performed according to the setting information in the authority token, the debugging log is encrypted after debugging, and the transaction execution result and the encrypted debugging log are obtained after the processing is completed;
[0123] If the verification fails, the transaction will be rejected;
[0124] If multiple servers process the debugging transaction data, after the last server completes the processing, the transaction execution results are summarized and the encrypted debugging log is summarized to form an encrypted link log and fed back to the client.
[0125] Specifically, the client can use an existing user terminal PC, or deploy a separate PC to install the terminal module software. Its function is to process user instructions, generate permission tokens, and decrypt and hand over the debug link log to the user after receiving it. The user terminal can also provide various auxiliary functions based on the sandbox and link log, such as data processing result analysis, link time distribution and other data.
[0126] The test verification device can be configured in an existing cloud server system. That is, install the test verification device in the existing cloud server system. After installation, the sandbox service can be automatically completed by the underlying system without the application being aware of it. The link log is a public mechanism. When obtaining the existing system logs, it can be automatically completed through configuration. When additional debugging logs are needed, developers need to add additional log outputs in the original server application.
[0127] It should be noted that although several modules of the test and verification device of the trading system are mentioned in the above detailed description, this division is only exemplary and not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided into multiple modules for embodiment.
[0128] Based on the above invention concept, Fig. 9 As shown, the present invention also proposes a computer device 900, including a memory 910, a processor 920, and a computer program 930 stored in the memory 910 and executable on the processor 920, wherein the processor 920 implements the test and verification method of the aforementioned trading system when executing the computer program 930.
[0129] Based on the aforementioned inventive concept, the present invention proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the test and verification method of the aforementioned trading system is implemented.
[0130] The test and verification method and device for the transaction system proposed in the present invention can realize an architecture in which the test function and the formal function share the same environment. By using debugging tools in the operating environment, production and testing can be carried out simultaneously without affecting each other. The permission token generation and verification strategy are used to replace the traditional login name and password operation, which has high security. The data security and access security of the operating environment can be guaranteed, and local sandbox operations are created in the operating environment. It is possible to test some tasks that other tools cannot complete. At the same time, there is no need to invade the operating environment with the processing results. The simulation estimation results obtained through simulation processing have high accuracy, do not damage the data, and will not affect the operating environment data.
[0131] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0132] The present invention is described with reference to flowcharts and / or block diagrams of methods and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0133] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0134] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0135] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A test and verification method for a trading system, characterized in that: The method includes: Acquire debugging transaction data initiated by the client, wherein the debugging transaction data is accompanied by an authorization token; When the debug transaction data is transmitted to one or more servers in the transaction system, the authorization token is verified by the server; If the verification is successful, the debugging transaction data is processed; the transaction is executed according to the debugging transaction data, and the sandbox test is performed according to the setting information in the authority token. After debugging, the debugging log is encrypted, and after the processing is completed, the transaction execution result and the encrypted debugging log are obtained; If the verification fails, the transaction will be rejected; If multiple servers process the debugging transaction data, after the last server completes the processing, the transaction execution results are summarized and the encrypted debugging log is summarized to form an encrypted link log and fed back to the client; Among them, the debugging transaction data initiated by the client is obtained, including: When a customer initiates a transaction through the client, the client writes the setting information into the original text of the permission token; The client uses the signature private key to digitally sign the permission token; Pack the original text and digital signature into the debugging transaction data; When the debugging transaction data is transmitted to one or more servers in the transaction system, the server verifies the authorization token, including: Determine whether the original text of the permission token matches the digital signature, and verify the authenticity of the permission token; Based on the execution start time, the validity period of the permission and the current server time, determine whether it is within the validity period and verify the validity of the permission token; According to the permission level, determine whether it meets the set permission level and verify the permission of the permission token; Among them, the sandbox testing methods include: Check the sandbox flag in the permission token; If running in the sandbox, when the current server executes a transaction and encounters a database write operation, change the operation target to the image data table; After the transaction is completed, the transaction execution results are recorded in the image data table; When a data recovery or data change instruction is obtained, the image data table is cleared according to the data recovery instruction and the changed content is reset; according to the data change instruction, the transaction execution results in the image data table are updated to the database; During the sandbox test, if single transaction debugging is required, load the updated data in the image data table according to the transaction serial number; In the global debugging function, the update records of all transaction serial numbers are loaded by default; The debug log encryption methods include: Check the link log flag in the authorization token. If the debugging log is enabled, the current server generates log plain text during the transaction execution. Generate a random symmetric key, encrypt the log plaintext and generate the log ciphertext; Encrypt the random symmetric key using the encrypted public key in the authority token; Attach the log ciphertext and the encrypted random symmetric key to the transaction execution result; When the current server summarizes the transaction execution results, an encrypted link log is generated based on all debug logs; When the last server completes processing, it feeds the encrypted link log back to the client, which then uses the local private key to decrypt the encrypted link log and obtain the entire log in plain text.
2. The test and verification method of the trading system according to claim 1, characterized in that: The method includes: Configure the client's public key certificate on each server to verify the signature.
3. The test and verification method of the trading system according to claim 2, characterized in that: The setting information of the permission token includes at least: Execution user, transaction serial number, execution start time, permission validity period, permission level, sandbox operation flag, link log flag, log encryption key and other extended control parameters.
4. The test and verification method of the trading system according to claim 3, characterized in that: The method further includes: When it is necessary to read data from a database table, if there is no record of the database table in the image data table, the database data is directly read; If the image data table contains records of the database table, the content of the image data table is used as the reading result.
5. The test and verification method of the trading system according to claim 4, characterized in that: The image data table at least includes a transaction serial number, a modified database name and modified data.
6. The test and verification method of the trading system according to claim 1, characterized in that: The method further includes: The client aggregates the encrypted link logs; According to the timestamp of each link log node in the log plaintext, the start time and end time of the node are calculated to generate processing time series data; The processing process is tracked through the log content in each link log node in the log plaintext.
7. A test and verification device for a trading system, characterized in that: The test verification device is configured in a server of the transaction system, wherein the test verification device comprises: An acquisition module, used for acquiring debugging transaction data initiated by a client, wherein the debugging transaction data is accompanied by an authorization token; A verification module for verifying the authorization token when debugging transaction data is passed to one or more servers in the trading system; The debugging module is used to process the debugging transaction data if the verification is passed; wherein, the transaction is executed according to the debugging transaction data, the sandbox test is performed according to the setting information in the authority token, the debugging log is encrypted after debugging, and the transaction execution result and the encrypted debugging log are obtained after the processing is completed; If the verification fails, the transaction will be rejected; If multiple servers process the debugging transaction data, after the last server completes the processing, the transaction execution results are summarized and the encrypted debugging log is summarized to form an encrypted link log and fed back to the client; The acquisition module is specifically used for: When a customer initiates a transaction through the client, the client writes the setting information into the original text of the permission token; The client uses the signature private key to digitally sign the permission token; Pack the original text and digital signature into the debugging transaction data; The verification module is specifically used for: Determine whether the original text of the permission token matches the digital signature, and verify the authenticity of the permission token; Based on the execution start time, the validity period of the permission and the current server time, determine whether it is within the validity period and verify the validity of the permission token; According to the permission level, determine whether it meets the set permission level and verify the permission of the permission token; The debugging module is specifically used for: Check the sandbox flag in the permission token; If running in the sandbox, when the current server executes a transaction and encounters a database write operation, change the operation target to the image data table; After the transaction is completed, the transaction execution results are recorded in the image data table; When a data recovery or data change instruction is obtained, the image data table is cleared according to the data recovery instruction and the changed content is reset; according to the data change instruction, the transaction execution results in the image data table are updated to the database; Among them, during the sandbox test, if single transaction debugging is required, load the updated data in the image data table according to the transaction serial number; In the global debugging function, the update records of all transaction serial numbers are loaded by default; The debugging module is specifically used for: Check the link log flag in the authorization token. If the debugging log is enabled, the current server generates log plain text during the transaction execution. Generate a random symmetric key, encrypt the log plaintext and generate the log ciphertext; Encrypt the random symmetric key using the encrypted public key in the authority token; Attach the log ciphertext and the encrypted random symmetric key to the transaction execution result; When the current server summarizes the transaction execution results, an encrypted link log is generated based on all debug logs; When the last server completes processing, it feeds the encrypted link log back to the client, which then uses the local private key to decrypt the encrypted link log and obtain the entire log in plain text.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
