A joint debugging test method and device based on payment anomaly

By receiving payment test requests and obtaining abnormal information from the preset database, the problem of difficulty in simulating complex payment abnormal scenarios in joint debugging testing in the existing technology is solved, and a more efficient joint debugging and testing capability is achieved.

CN110457221BActive Publication Date: 2024-10-22SHENZHEN TENCENT COMP SYST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910731260.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-08
Publication Date
2024-10-22
Estimated Expiration
2039-08-17

AI Technical Summary

Technical Problem

Existing joint debugging tests are difficult to simulate complex payment exception scenarios, especially timeout and return exception scenarios, and cannot effectively simulate back-end zombies and error scenarios in multiple interactions.

Method used

By receiving the payment test request, obtain the identifier carried by the request, obtain the corresponding payment exception information from the preset payment exception database, obtain the normal response from the preset response database for modification, generate the corresponding payment exception information, and return the test results to respond to requests.

Benefits of technology

The scenario diversity of joint debugging testing has been expanded, the testing capabilities have been improved, and a variety of payment exception scenarios can be simulated in a more refined manner, including freezing, timeout and invalid exceptions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110457221B_ABST
    Figure CN110457221B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a joint debugging test method and device based on payment exceptions, including: receiving a first initial payment test request, and processing the first initial payment test request to obtain a first payment test request; obtaining an identifier carried by the first payment test request, and obtaining a first payment exception corresponding to the identifier; obtaining a first response corresponding to the first initial payment test request, and modifying the first response to obtain first payment exception information corresponding to the first payment exception; testing the first payment exception information and returning the test result. By obtaining the payment exception corresponding to the above identifier, obtaining a normal response corresponding to the above payment test request, and modifying it to obtain the corresponding payment exception information, and then testing and returning the test result. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified, and the ability of the joint debugging test is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a joint debugging test method and device based on payment anomaly. Background Art

[0002] Joint debugging and testing: A large project will involve multiple departments, or even multiple systems of multiple companies, and the systems interact with each other through interfaces or middleware. During project development, the work of each system is parallel, and each system is developed according to the protocol documents. After the internal functional modules are tested, the system joint debugging and testing of the entire project is required.

[0003] Joint debugging relies on the response from the other end. Since the deployment and parameters of the other end's system cannot be adjusted, there is only a single response. Limited by the fact that payment calls to real currency and other resources, when the request does not meet payment conditions such as encryption / amount, it is easy to fail to pass the authentication and fail to simulate the real business scenario. Therefore, the existing simulation scenarios are very simple.

[0004] The current simulation methods of both timeout and failure have the following problems that cannot be solved:

[0005] For timeout scenarios, only network anomalies can be simulated. Since it is impossible to access the peer machine to execute the kill-STOP command, the backend freeze scenario cannot be simulated. For return exception scenarios, since it takes time to connect to the process to be tested and then set breakpoints and return values, the backend or frontend often times out before the settings are completed. Summary of the invention

[0006] The embodiments of the present application provide a joint debugging test method and device based on payment anomalies, which can realize the diversification of joint debugging test scenarios and improve the joint debugging test capabilities.

[0007] A first aspect of an embodiment of the present application provides a joint debugging test method based on payment anomalies, the method comprising:

[0008] receiving a first initial payment test request, and processing the first initial payment test request to obtain a first payment test request;

[0009] Obtaining a first identifier carried in the first payment test request, and obtaining a first payment exception corresponding to the first identifier from a preset payment exception database;

[0010] Acquire a first response corresponding to the first initial payment test request from a preset response database, and modify the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception;

[0011] The first payment exception information is tested and the test result is returned to respond to the first initial payment test request.

[0012] As an optional implementation manner, the processing the first initial payment test request to obtain the first payment test request includes:

[0013] confirming whether the protocol of the first initial payment test request belongs to a preset protocol;

[0014] If it does not belong to the preset protocol, confirm whether the source code database stores source code corresponding to the protocol of the first initial payment test request;

[0015] If yes, the protocol of the first initial payment test request is decoded according to the source code to obtain a first payment test request.

[0016] As an optional implementation, it also includes:

[0017] If the source code database does not store source code corresponding to the protocol of the first initial payment test request, the packet header of the protocol of the first initial payment test request is removed to obtain the first payment test request.

[0018] As an optional implementation, before receiving the first initial payment test request, the method includes:

[0019] Obtain multiple historical payment test requests and multiple historical responses corresponding to the multiple historical payment test requests;

[0020] The multiple historical payment test requests and the multiple historical responses are stored correspondingly to obtain the preset response database.

[0021] As an optional implementation manner, obtaining the first identifier carried by the first payment test request, and obtaining the first payment exception corresponding to the first identifier from a preset payment exception database includes:

[0022] Using a regular expression to match different fields of the first payment test request to obtain a first identifier carried by the first payment test request;

[0023] According to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained.

[0024] As an optional implementation manner, obtaining the first identifier carried by the first payment test request, and obtaining the first payment exception corresponding to the first identifier from a preset payment exception database includes:

[0025] confirming whether the first payment test request corresponds to an initial connection request;

[0026] If yes, obtaining the number of interactions currently corresponding to the first payment test request to obtain a first identifier carried by the first payment test request;

[0027] According to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained.

[0028] A second aspect of an embodiment of the present application provides a joint debugging test device based on payment anomalies, the device comprising:

[0029] A processing module, configured to receive a first initial payment test request, and process the first initial payment test request to obtain a first payment test request;

[0030] an acquisition module, configured to acquire a first identifier carried in the first payment test request, and acquire a first payment exception corresponding to the first identifier from a preset payment exception database;

[0031] a modification module, configured to obtain a first response corresponding to the first initial payment test request from a preset response database, and modify the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception;

[0032] A testing module is used to test the first payment exception information and return the test result to respond to the first initial payment test request.

[0033] Optionally, the receiving module is used for:

[0034] confirming whether the protocol of the first initial payment test request belongs to a preset protocol;

[0035] If it does not belong to the preset protocol, confirm whether the source code database stores source code corresponding to the protocol of the first initial payment test request;

[0036] If yes, the protocol of the first initial payment test request is decoded according to the source code to obtain a first payment test request.

[0037] A third aspect of an embodiment of the present application provides a server, comprising a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the described method.

[0038] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method described.

[0039] Implementing the embodiments of the present application has at least the following beneficial effects:

[0040] Through the embodiment of the present application, the received payment test request is processed to obtain the identifier carried by the corresponding request, and the payment exception corresponding to the above identifier is obtained from the preset payment exception database, and the normal response corresponding to the above payment test request is obtained from the preset response database, and the above response is modified to obtain the payment exception information corresponding to the above payment exception, and then the above payment exception information is tested and the test result is returned to respond to the above payment test request. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified and the ability of joint debugging test is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0042] in:

[0043] Figure 1 An interactive schematic diagram of a joint debugging test method based on payment anomalies provided by an embodiment of the present invention;

[0044] Figure 2 It is a schematic diagram of the network architecture of a joint debugging test method based on payment anomaly provided by an embodiment of the present invention;

[0045] Figure 3 It is a flow chart of a joint debugging test method based on payment anomaly provided by an embodiment of the present invention;

[0046] Figure 4 It is a flow chart of a joint debugging test method based on payment anomaly provided by an embodiment of the present invention;

[0047] Figure 5 It is a structural diagram of a server provided by an embodiment of the present invention;

[0048] Figure 6 It is a structural diagram of a joint debugging test device based on payment anomaly provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0050] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0051] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0052] See also Figure 1 , Figure 1 The present invention provides an interactive schematic diagram of a joint debugging test method based on payment anomalies. Figure 1 As shown, it may include a system to be jointly debugged 101, an agent module 102 and an external system 103, wherein the system to be jointly debugged 101 is a system for performing a simulated joint debugging test, which may be a server or terminal that can perform a simulated joint debugging test; the agent module 102 is a response that can change a normal payment response to obtain corresponding payment exception information, and the above-mentioned agent module 102 may be a server, etc.; the external system 103 is a system that needs to be accessed in the joint debugging test, such as an external server, etc.

[0053] In the payment joint debugging test, the joint debugging system 101 receives multiple normal payment requests, and the proxy module 102 obtains the joint debugging interaction request, parses and stores the obtained request. The above multiple normal payment requests arrive at the external system 103 and are processed by the external system to obtain corresponding multiple normal payment responses. The proxy module 102 also obtains and stores the joint debugging interaction responses accordingly. When conducting a joint debugging test of payment anomalies, the system to be jointly debugged 101 receives an initial payment test request and sends it to the external system 103, wherein the proxy module 102 can intercept the initial payment test request from the middle, parse the initial payment test request to obtain the payment test request, and obtain the identifier carried by the payment test request, wherein the identifier can be used to match with the preset payment anomaly, and when the match is successful, the payment anomaly corresponding to the initial payment test request is obtained; such as the first identifier corresponding to the payment freeze anomaly, the second identifier corresponding to the payment timeout anomaly, the third identifier corresponding to the payment invalid anomaly, etc.; wherein, by obtaining the pre-stored normal payment response corresponding to the initial payment test request, and then tampering with the normal payment response to obtain the payment anomaly information, and sending the payment anomaly information to the system to be jointly debugged 101 to respond to the above-mentioned initial payment test request. By obtaining the corresponding payment anomaly and then expanding the test scenario, it is realized to provide multiple abnormal simulation scenarios for the system to be jointly debugged 101 to improve the simulation capability of the system to be jointly debugged.

[0054] See also Figure 2 , Figure 2 A schematic diagram of a network architecture of a joint debugging test method based on payment anomalies is provided for an embodiment of the present application. The network architecture may include multiple servers, such as Figure 2 As shown, it specifically includes a proxy server 200a, a server to be jointly debugged and tested 200b, and an external server 200c. The server to be jointly debugged and tested 200b can receive a joint debugging test request and transmit data, and the proxy server 200a monitors the test request received by the server to be jointly debugged and tested 200b, parses and stores it. Among them, the proxy server 200a parses the test request and matches the preset identifier. If the match is successful, the response is tampered based on the corresponding abnormal situation to obtain a response corresponding to the abnormal situation that is successfully matched, and returns it to the server to be jointly debugged and tested 200b; if the match is unsuccessful, the received test request is sent to the external server 200c to obtain a response.

[0055] Through the embodiment of the present application, the received payment test request is processed to obtain the identifier carried by the corresponding request, and the payment exception corresponding to the above identifier is obtained from the preset payment exception database, and the normal response corresponding to the above payment test request is obtained from the preset response database, and the above response is modified to obtain the payment exception information corresponding to the above payment exception, and then the above payment exception information is tested and the test result is returned to respond to the above payment test request. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified and the ability of joint debugging test is improved.

[0056] See also Figure 3 , Figure 3 A flow chart of a joint debugging test method based on payment anomalies is provided for the embodiment of the present application. Figure 3 As shown, it may include steps 301-304, which are specifically as follows:

[0057] 301. Receive a first initial payment test request, and process the first initial payment test request to obtain a first payment test request;

[0058] Among them, when conducting the payment joint debugging test, the requesting party sends a first initial payment test request to the system to be joint debugged, the proxy module monitors the first initial payment test request and obtains it through pcap, and then the proxy module parses the above-mentioned first initial payment test request through the dpkt unit, decodes and stores the above-mentioned first initial payment test request according to the protocol.

[0059] 302. Obtain a first identifier carried in the first payment test request, and obtain a first payment exception corresponding to the first identifier from a preset payment exception database;

[0060] Among them, the above-mentioned first identifier can be a keyword identifier or a number or a number, etc.; the above-mentioned preset payment exception database stores different payment exceptions corresponding to different identifiers, and the payment exception can be a payment freeze exception, or a payment timeout exception, or a payment invalid exception, etc.; different identifiers correspond to different exception scenarios.

[0061] The step of obtaining the first identifier carried in the first payment test request and obtaining the first payment exception corresponding to the first identifier from a preset payment exception database may include:

[0062] Using a regular expression to match different fields of the first payment test request to obtain a first identifier carried by the first payment test request;

[0063] Using regular expressions to match data in a data stream is particularly suitable for protocols that can be parsed, wherein the regular expression matching can be a key field matching.

[0064] According to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained.

[0065] Alternatively, you can also use the following methods:

[0066] confirming whether the first payment test request corresponds to an initial connection request;

[0067] If yes, obtaining the number of interactions currently corresponding to the first payment test request to obtain a first identifier carried by the first payment test request;

[0068] According to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained.

[0069] By matching the number of requests, for example, for the return simulation timeout scenario of the third interaction, in the case of multiple interactions and multiple systems to be tested, it is necessary to ensure that the number of statistics is correct. The statistical count can be automatically started from 0 by adding a thread for each new request connection. For multiple interactions with a single connection, the number of interactions is increased by 1 each time, which can ensure the correctness of the number statistics. This method is especially suitable for situations where the protocol cannot be parsed.

[0070] Furthermore, the above two methods can be combined to obtain payment anomalies that meet the conditions. If the Nth update operation is matched, there is no need to consider other factors such as heartbeat requests. The update operation can be matched by regular expression, and the update operation is the Nth operation.

[0071] 303. Obtaining a first response corresponding to the first initial payment test request from a preset response database, and modifying the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception;

[0072] Among them, the preset response database is for the proxy module to obtain multiple historical payment test requests, and multiple historical responses corresponding to the multiple historical payment test requests; the historical payment test request can be a payment test request within a preset time, and can be any payment test request before the current first initial payment test request, and the multiple historical responses are responses corresponding to the above multiple historical payment test requests, wherein the historical payment test request can correspond to a normal request, and the historical response can correspond to a normal response. The preset response database is obtained by storing the multiple historical payment test requests and the multiple historical responses in correspondence, so as to obtain the first response corresponding to the first initial payment test request from the preset response database according to the first initial payment test request, wherein the first response is a normal response.

[0073] After obtaining the first response corresponding to the first initial payment test request, the first response is modified according to the obtained first payment exception to obtain the first payment exception information corresponding to the first payment exception. The above modification can be to analyze the corresponding request protocol according to the relationship between the configuration mapping port and the protocol, and further use the protocol to modify the package body of the first response. The modification here is to obtain the abnormal scenario, so as to meet the multi-scenario test of the joint debugging test.

[0074] Among them, step 303 can be to modify the response after obtaining the first initial payment test request in real time; it can also be modified in advance to obtain different tampered responses corresponding to different test requests, that is, different payment exception information, and save them. When the corresponding initial payment test request is obtained, it can be directly obtained from the saved payment exception information.

[0075] 304. Test the first payment exception information and return the test result to respond to the first initial payment test request.

[0076] The first payment exception information corresponding to the first payment exception obtained by the above extension is sent to the system to be debugged 101 for simulation testing, and then a test result corresponding to the first payment exception can be obtained, wherein the test result can be a return failure.

[0077] Through the embodiment of the present application, the received payment test request is processed to obtain the identifier carried by the corresponding request, and the payment exception corresponding to the above identifier is obtained from the preset payment exception database, and the normal response corresponding to the above payment test request is obtained from the preset response database, and the above response is modified to obtain the payment exception information corresponding to the above payment exception, and then the above payment exception information is tested and the test result is returned to respond to the above payment test request. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified and the ability of joint debugging test is improved.

[0078] See also Figure 4 , Figure 4 A flow chart of a joint debugging test method based on payment anomalies is provided for the embodiment of the present application. Figure 4 As shown, it may include steps 401-407, which are specifically as follows:

[0079] 401. Receive a first initial payment test request;

[0080] The first initial payment test request may be a payment request, and the payment request may be data of any binary stream;

[0081] 402. Confirm whether the protocol of the first initial payment test request belongs to a preset protocol;

[0082] According to the above-mentioned first initial payment test request, confirm whether the protocol of the first initial payment test request belongs to the preset protocol, wherein the protocol of the first initial payment test request can be compared with the protocol of the preset protocol library to confirm whether it belongs to the preset protocol. The protocol of the first initial payment test request can be confirmed according to the requested port, and different ports can correspond to different protocols; such as confirming whether the protocol of the first initial payment test request is HTTP, protobuf or a private protocol. Among them, pcap is used to intercept the data stream, and the general python library dpkt is used to identify TCP / UDP to identify protocols such as tcp / udp / http / gzip / ssl. If the confirmation cannot be identified, the corresponding protocol is confirmed to be a private protocol.

[0083] 403. If it does not belong to the preset protocol, confirm whether the source code database stores source code corresponding to the protocol of the first initial payment test request;

[0084] 404. If yes, decode the protocol of the first initial payment test request according to the source code to obtain a first payment test request;

[0085] For those with corresponding source codes that can be parsed, the corresponding source code method is used for parsing. If the parsing is successful, the parsed content and protocol type are stored. Alternatively, the existing open source protocol + structure parsing can be used. Although some protocols are open source protocols, the package content also has a corresponding structure and needs to be further disassembled. Therefore, the existing open source protocol + structure parsing is used. If the parsing is successful, the parsed content and protocol type are stored.

[0086] If the source code database does not store source code corresponding to the protocol of the first initial payment test request, the packet header of the protocol of the first initial payment test request is removed to obtain the first payment test request.

[0087] That is, if there is no parsing method, remove the packet header and directly store the requested binary data stream. If it cannot be parsed, set the protocol type to binary.

[0088] 405. Obtain a first identifier carried in the first payment test request, and obtain a first payment exception corresponding to the first identifier from a preset payment exception database;

[0089] Among them, the above-mentioned first identifier can be a keyword identifier or a number or a number, etc.; the above-mentioned preset payment exception database stores different payment exceptions corresponding to different identifiers, and the payment exception can be a payment freeze exception, or a payment timeout exception, or a payment invalid exception, etc.; different identifiers correspond to different exception scenarios.

[0090] Among them, in the prior art, when a request triggers multiple interactions, it is impossible to finely simulate the Nth interaction. No matter it is a failure or timeout scenario, except for the first call to the backend which is relatively easy to simulate, the subsequent multiple calls cannot be simulated by traditional methods (if the backend is directly set to be unreadable, or the backend process is killed, only the scenario of query failure can be covered, and the actual modification of the backend cannot be simulated), and each call will return a different error code, and the business logic is different.

[0091] Based on this, the obtaining of the first identifier carried in the first payment test request and obtaining the first payment exception corresponding to the first identifier from a preset payment exception database may include:

[0092] Confirm whether the first payment test request corresponds to the first connection request; if so, obtain the number of interactions currently corresponding to the first payment test request to obtain the first identifier carried by the first payment test request; according to the mapping relationship between the preset identifier and the payment exception, obtain the first payment exception corresponding to the first identifier.

[0093] By matching the number of requests, for example, for the return simulation timeout scenario of the third interaction, in the case of multiple interactions and multiple systems to be tested, it is necessary to ensure that the number of statistics is correct. The statistical count can be automatically started from 0 by adding a thread for each new request connection. For multiple interactions with a single connection, the number of interactions is increased by 1 each time, which can ensure the correctness of the number statistics. This method is especially suitable for situations where the protocol cannot be parsed.

[0094] 406. Obtain a first response corresponding to the first initial payment test request from a preset response database, and modify the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception;

[0095] Among them, this step can be to modify the response after obtaining the first initial payment test request in real time; it can also be modified in advance to obtain different tampered responses corresponding to different test requests, that is, different payment exception information, and save them. When the corresponding initial payment test request is obtained, it can be directly obtained from the saved payment exception information.

[0096] 407. Test the first payment exception information and return the test result to respond to the first initial payment test request.

[0097] Through the embodiment of the present application, the received payment test request is processed to obtain the identifier carried by the corresponding request, and the payment exception corresponding to the above identifier is obtained from the preset payment exception database, and the normal response corresponding to the above payment test request is obtained from the preset response database, and the above response is modified to obtain the payment exception information corresponding to the above payment exception, and then the above payment exception information is tested and the test result is returned to respond to the above payment test request. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified and the ability of joint debugging test is improved.

[0098] For the above embodiments, please refer to Figure 5 , Figure 5 A structural diagram of a server provided in an embodiment of the present application, as shown in the figure, includes a processor, an input device, an output device and a memory, the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program includes program instructions, the processor is configured to call the program instructions, and the program includes instructions for executing the following steps;

[0099] receiving a first initial payment test request, and processing the first initial payment test request to obtain a first payment test request;

[0100] Obtaining a first identifier carried in the first payment test request, and obtaining a first payment exception corresponding to the first identifier from a preset payment exception database;

[0101] Acquire a first response corresponding to the first initial payment test request from a preset response database, and modify the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception;

[0102] The first payment exception information is tested and the test result is returned to respond to the first initial payment test request.

[0103] Through the embodiment of the present application, the received payment test request is processed to obtain the identifier carried by the corresponding request, and the payment exception corresponding to the above identifier is obtained from the preset payment exception database, and the normal response corresponding to the above payment test request is obtained from the preset response database, and the above response is modified to obtain the payment exception information corresponding to the above payment exception, and then the above payment exception information is tested and the test result is returned to respond to the above payment test request. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified and the ability of joint debugging test is improved.

[0104] The above program also includes instructions for performing the following steps:

[0105] confirming whether the protocol of the first initial payment test request belongs to a preset protocol;

[0106] If it does not belong to the preset protocol, confirm whether the source code database stores source code corresponding to the protocol of the first initial payment test request;

[0107] If yes, the protocol of the first initial payment test request is decoded according to the source code to obtain a first payment test request.

[0108] Also includes:

[0109] If the source code database does not store source code corresponding to the protocol of the first initial payment test request, the packet header of the protocol of the first initial payment test request is removed to obtain the first payment test request.

[0110] include:

[0111] Obtain multiple historical payment test requests and multiple historical responses corresponding to the multiple historical payment test requests;

[0112] The multiple historical payment test requests and the multiple historical responses are stored correspondingly to obtain the preset response database.

[0113] The obtaining the first identifier carried in the first payment test request, and obtaining the first payment exception corresponding to the first identifier from a preset payment exception database, includes:

[0114] Using a regular expression to match different fields of the first payment test request to obtain a first identifier carried by the first payment test request;

[0115] According to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained.

[0116] The obtaining the first identifier carried in the first payment test request, and obtaining the first payment exception corresponding to the first identifier from a preset payment exception database, includes:

[0117] confirming whether the first payment test request corresponds to an initial connection request;

[0118] If yes, obtaining the number of interactions currently corresponding to the first payment test request to obtain a first identifier carried by the first payment test request;

[0119] According to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained.

[0120] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the execution process on the method side. It is understandable that in order to realize the above functions, the terminal includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments provided herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0121] The embodiment of the present application can divide the terminal into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0122] In line with the above, see Figure 6 , Figure 6 A schematic diagram of the structure of a joint debugging test device based on payment anomaly is provided for the embodiment of the present application. It includes a processing module 601, an acquisition module 602, a modification module 603 and a test module 604, which are as follows:

[0123] The processing module 601 is used to receive a first initial payment test request and process the first initial payment test request to obtain a first payment test request;

[0124] An acquisition module 602 is configured to acquire a first identifier carried in the first payment test request, and acquire a first payment exception corresponding to the first identifier from a preset payment exception database;

[0125] A modification module 603 is used to obtain a first response corresponding to the first initial payment test request from a preset response database, and modify the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception;

[0126] The testing module 604 is used to test the first payment exception information and return the test result to respond to the first initial payment test request.

[0127] It can be seen that through the embodiment of the present application, the identifier carried by the corresponding request is obtained by processing the received payment test request, and the payment exception corresponding to the above identifier is obtained from the preset payment exception database, and the normal response corresponding to the above payment test request is obtained from the preset response database, and the above response is modified to obtain the payment exception information corresponding to the above payment exception, and then the above payment exception information is tested and the test result is returned to respond to the above payment test request. By adopting this method, by expanding multiple payment exception scenarios, the joint debugging test scenarios are diversified and the ability of joint debugging test is improved.

[0128] Optionally, the receiving module 601 is used to confirm whether the protocol of the first initial payment test request belongs to a preset protocol; if it does not belong to the preset protocol, confirm whether the source code database contains source code corresponding to the protocol of the first initial payment test request; if so, decode the protocol of the first initial payment test request according to the source code to obtain the first payment test request.

[0129] The receiving module 601 is further configured to: if the source code database does not store source code corresponding to the protocol of the first initial payment test request, remove the header of the protocol of the first initial payment test request to obtain the first payment test request.

[0130] It also includes a storage module, which is used to obtain multiple historical payment test requests and multiple historical responses corresponding to the multiple historical payment test requests before receiving the first initial payment test request; and store the multiple historical payment test requests and the multiple historical responses in correspondence with each other to obtain the preset response database.

[0131] The acquisition module 602 can be used to: use a regular expression to match different fields of the first payment test request to obtain a first identifier carried by the first payment test request; and obtain a first payment exception corresponding to the first identifier according to a preset mapping relationship between the identifier and the payment exception.

[0132] The acquisition module 602 can also be used to: confirm whether the first payment test request corresponds to a first connection request; if so, obtain the number of interactions currently corresponding to the first payment test request to obtain a first identifier carried by the first payment test request; and obtain a first payment exception corresponding to the first identifier based on a mapping relationship between a preset identifier and a payment exception.

[0133] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, and the computer program enables a computer to execute part or all of the steps of any one of the joint debugging and testing methods based on payment anomalies recorded in the above method embodiments.

[0134] An embodiment of the present application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program enables a computer to execute part or all of the steps of any one of the joint debugging and testing methods based on payment anomalies recorded in the above method embodiments.

[0135] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0136] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0137] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.

[0138] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0139] In addition, the functional units in the various embodiments of the application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software program modules.

[0140] If the integrated unit is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0141] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, which can include: a flash drive, a read-only memory, a random access memory, a magnetic disk or an optical disk, etc.

[0142] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A joint debugging test method based on payment anomaly, characterized in that: Applied to a network architecture including a system to be jointly debugged and an agent module, the method includes: The system to be jointly debugged receives a first initial payment test request, the proxy module monitors and obtains the first initial payment test request, and decodes the first initial payment test request according to a protocol to obtain a first payment test request; If it is confirmed that the protocol of the first initial payment test request does not belong to the preset protocol, confirm whether the source code database contains source code corresponding to the protocol of the first initial payment test request; if so, decode the protocol of the first initial payment test request according to the source code to obtain the first payment test request; if not, remove the packet header of the protocol of the first initial payment test request to obtain the first payment test request; A regular expression is used to match different fields of the first payment test request to obtain a first identifier carried by the first payment test request, and whether the first payment test request corresponds to a first connection request is determined by combination. If so, the number of interactions currently corresponding to the first payment test request is obtained to obtain the first identifier carried by the first payment test request, and according to a mapping relationship between a preset identifier and a payment exception, a first payment exception corresponding to the first identifier is obtained from a preset payment exception database; different payment exceptions corresponding to different identifiers are stored in the preset payment exception database, and the different identifiers correspond to different exception scenarios; Obtaining a first response corresponding to the first initial payment test request from a preset response database, where the first response is a normal response; and modifying the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception; the modification is to analyze and obtain a protocol corresponding to the request according to the relationship between the configuration mapping port and the protocol so as to modify the package body of the first response; The first payment exception information is tested and the test result is returned to respond to the first initial payment test request.

2. The method according to claim 1, characterized in that Before receiving the first initial payment test request, the method includes: Obtain multiple historical payment test requests and multiple historical responses corresponding to the multiple historical payment test requests; The multiple historical payment test requests and the multiple historical responses are stored correspondingly to obtain the preset response database.

3. A joint debugging test device based on payment anomaly, characterized in that: Applied to a network architecture including a system to be jointly debugged and an agent module, the device includes: A processing module, used for the system to be debugged to receive a first initial payment test request, the proxy module to monitor and obtain the first initial payment test request, and to decode the first initial payment test request according to the protocol to obtain a first payment test request; a receiving module, configured to confirm whether the protocol of the first initial payment test request belongs to a preset protocol; if not, confirm whether a source code database contains source code corresponding to the protocol of the first initial payment test request; if so, decode the protocol of the first initial payment test request according to the source code to obtain a first payment test request; if not, remove the packet header of the protocol of the first initial payment test request to obtain a first payment test request; an acquisition module, configured to match different fields of the first payment test request using a regular expression to acquire a first identifier carried by the first payment test request, and to confirm whether the first payment test request corresponds to a first connection request by combining, and if so, to acquire the number of interactions currently corresponding to the first payment test request to obtain the first identifier carried by the first payment test request, and to acquire a first payment exception corresponding to the first identifier from a preset payment exception database according to a mapping relationship between a preset identifier and a payment exception; the preset payment exception database stores different payment exceptions corresponding to different identifiers, and the different identifiers correspond to different exception scenarios; a modification module, configured to obtain a first response corresponding to the first initial payment test request from a preset response database, wherein the first response is a normal response; and modify the first response according to the first payment exception to obtain first payment exception information corresponding to the first payment exception; the modification is to analyze and obtain a protocol corresponding to the request according to a relationship between a configuration mapping port and a protocol so as to modify the package body of the first response; A testing module is used to test the first payment exception information and return the test result to respond to the first initial payment test request.

4. A server, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method as claimed in claim 1 or 2.

5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method of claim 1 or 2.

Citation Information

Patent Citations

  • A method and device for constructing an abnormal test scene

    CN109558313A

  • Debug method and device for handling exceptions and interrupts

    US20150006869A1