Business simulation method, device, electronic device and storage medium
By acquiring and processing network traffic data, generating playback files for business simulation, the performance consumption problem caused by relying on host resources in the prior art is solved, and a fast and stable business simulation process is achieved.
Patent Information
- Application Number
- CN202111149418.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-09-29
AI Technical Summary
The existing business simulation methods rely on host resources, which consumes host system performance and affects stable operation.
By obtaining the target network traffic data, performing network protocol analysis and sequence reorganization, decoding the service file, and processing it according to the configuration file, generating playback files for business simulation, avoiding dependence on host resources.
It realizes rapid data collection and business simulation, avoids consuming host system performance and reduces the risk of affecting the stable operation of host system.
Smart Images

Figure CN113872810B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and more specifically, to a business simulation method, device, electronic equipment and storage medium. Background Art
[0002] With the rise of distributed architecture, mainframes are facing increasingly severe challenges. To this end, banks are actively exploring solutions to "downstream the mainframe". In the process of downstream migration, business simulation is an important link. Specifically, it collects transaction data from the mainframe, that is, network traffic data, and plays it back to the distributed platform in real time for effect verification, so that it can be used for corresponding business simulation after verification.
[0003] In existing business simulations, transaction data produced by the host system is collected mainly by the host system, which relies on host resources, consumes the performance of the host system, and easily affects the risk of stable operation of the host system. Summary of the invention
[0004] In view of this, the present invention provides a business simulation method, device, electronic device and storage medium to solve the problem in the prior art that, due to reliance on host resources, the performance of the host system is consumed, which easily affects the risk of stable operation of the host system.
[0005] A first aspect of the present invention discloses a business simulation method, the method comprising:
[0006] When receiving a service simulation request, obtaining target network traffic data, and saving the target network traffic data as an original data packet file;
[0007] When a playback start command is received, the original data packet file is subjected to network protocol analysis and sequence reorganization to obtain a service coding file, and the service coding file is decoded to obtain a service file;
[0008] When receiving the parsing instruction, obtaining a configuration file corresponding to the service indicated by the service simulation request;
[0009] Processing the business file according to the configuration file to obtain a playback file;
[0010] Corresponding business simulation is performed according to the playback file.
[0011] Optionally, when receiving the service simulation request, before obtaining the target network traffic data and saving the target network traffic data as an original data packet file, the method further includes:
[0012] Monitor network traffic data in real production environments in real time through switches;
[0013] Accordingly, when a service simulation request is received, network traffic data is obtained and saved as an original data packet file, including:
[0014] When a service simulation request is received, the network message collector is used to obtain the target network mirror number corresponding to the service simulation request from the network traffic data monitored by the switch;
[0015] The network traffic data is saved as a raw data packet file.
[0016] Optionally, when receiving the playback start command, performing network protocol analysis and sequence reorganization on the original data packet file to obtain a business coding file, and decoding the business coding file to obtain a business file, including:
[0017] When a playback start command is received, the network pointer is used to perform network protocol analysis and sequence reorganization on the original data packet file to obtain a business coding file;
[0018] The business encoding file is decoded to obtain a business file.
[0019] Optionally, the configuration file includes a data packet parsing configuration file and a data format conversion configuration file, and the processing of the business file according to the configuration information to obtain a playback file includes:
[0020] Filter the service file according to the data packet parsing configuration file to obtain a target service file;
[0021] The target business file is processed according to the data format conversion configuration file to obtain a playback file.
[0022] Optionally, the processing the target business file according to the data format conversion configuration file to obtain a playback file includes:
[0023] According to the data format conversion configuration file, the target field in the target business file is marked to obtain a playback file, wherein the target field is a field that needs to be saved or replaced when performing business simulation.
[0024] Optionally, before performing corresponding business simulation according to the playback file, the method further includes:
[0025] The playback file is saved to a preset location in the hard disk according to a preset storage logic;
[0026] Accordingly, performing corresponding business simulation according to the playback file includes:
[0027] The playback file is obtained from the preset location in the hardware, and corresponding business simulation is performed according to the playback file.
[0028] A second aspect of the present invention discloses a service simulation device, the device comprising:
[0029] A data acquisition unit, used for acquiring target network traffic data when receiving a service simulation request, and saving the target network traffic data as an original data packet file;
[0030] A data processing unit, configured to, when receiving a playback start command, perform network protocol analysis and sequence reorganization on the original data packet file to obtain a service coding file, and decode the service coding file to obtain a service file;
[0031] A configuration file acquisition unit, configured to acquire a configuration file corresponding to the service indicated by the service simulation request when a parsing instruction is received;
[0032] A file processing unit, used for processing the business file according to the configuration file to obtain a playback file;
[0033] The business simulation unit is used to perform corresponding business simulation according to the playback file.
[0034] Optionally, the device further comprises:
[0035] The monitoring unit is used to monitor the network traffic data in the real production environment in real time through the switch;
[0036] Accordingly, the data acquisition unit includes:
[0037] A data acquisition subunit, configured to, when receiving a service simulation request, use the network message collector to acquire a target network mirror number corresponding to the service simulation request from the network traffic data monitored by the switch;
[0038] The storage unit is used to store the network flow data as an original data packet file.
[0039] The third aspect of the present invention discloses an electronic device, which includes a processor and a memory, wherein the memory is used to store program code and data for business simulation, and the processor is used to call program instructions in the memory to execute a business simulation method disclosed in the first aspect of the present invention.
[0040] A fourth aspect of the present invention discloses a storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute a business simulation method disclosed in the first aspect of the present invention.
[0041] The present invention provides a business simulation method, device, electronic device and storage medium. When receiving a business simulation request, target network flow data corresponding to the received business simulation request can be obtained, and the obtained target network flow data can be saved as an original data packet file, so that when receiving a playback start command, the original data packet file is subjected to network protocol analysis and sequence reorganization to obtain a business coding file for decoding, and a business file is obtained. When receiving a parsing instruction, a configuration file corresponding to the business indicated by the business simulation request is obtained according to the received parsing instruction, so that the business file is processed according to the obtained configuration file to obtain a playback file, and corresponding business simulation is performed according to the playback file. The technical solution provided by the present invention does not rely on host resources, can not only quickly complete data acquisition, thereby quickly completing corresponding business simulation, but also can avoid consuming the performance of the host system and reduce the risk of affecting the stable operation of the host system. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A schematic diagram of the structure of a business simulation system provided by an embodiment of the present invention;
[0044] Figure 2 A flowchart of a business simulation method provided by an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the structure of a business simulation device provided by an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0049] It should be noted that the concepts such as "first" and "second" mentioned in the disclosure of the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0050] It should be noted that the modifications of "one" and "plurality" mentioned in the disclosure of the present invention are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0051] Business simulation: Simulation means that the original peripheral system is not replaced with the new core business system, and a way to access the new core is provided while maintaining the original interface and interaction method.
[0052] Network protocol analysis: When computers communicate, data is transmitted layer by layer from top to bottom. Each layer processes the data, adds different control information, and then passes it to the next layer. When data is transmitted from the lowest physical media to the destination, it is transmitted layer by layer from bottom to top. Each layer removes its own control information and then passes it to the next layer.
[0053] Therefore, the process of data delivery from top to bottom at the source station is actually a process of continuous encapsulation, and the process of data delivery from bottom to top after reaching the destination is a process of continuous unpacking. The work of protocol analysis is to unpack the data layer by layer and obtain information about protocols at different levels.
[0054] Switch mirroring: On a switch or router, the data traffic of one or more source ports is forwarded to a designated port to monitor the network. The designated port is called a "mirror port" or "destination port". The network traffic can be monitored and analyzed through the mirror port without seriously affecting the normal throughput of the source port.
[0055] Optionally, in order to implement the business simulation method provided by the present invention, an embodiment of the present invention provides a business simulation system.
[0056] like Figure 1 As shown, the business simulation system 100 provided by the embodiment of the present invention specifically includes:
[0057] Real-time data storage module 101, original data packet file module 102, parsing control module 103, data packet parsing module 104, configuration file module 105, data format processing module 106, and playback file module 107.
[0058] The real-time data storage module 101 is used to detect in real time whether a business simulation request is received after the business simulation system is started, and when a business simulation request is received, obtain the corresponding target network traffic data and save the obtained target network traffic data as an original data packet file.
[0059] The original data packet file module 102 is used to store the original data packet file.
[0060] The parsing control module 103 is used to detect in real time whether a playback start command is received. When the playback start command is received, the service coding file obtained after network protocol parsing and sequence reorganization of the original data packet file is decoded to obtain the service file, and a parsing instruction is sent to the data packet parsing module 104 at the same time.
[0061] The data packet parsing module 104 is used to obtain the configuration file corresponding to the business indicated by the business simulation request when receiving the parsing instruction sent by the parsing control module 103, and filter the business file according to the data packet parsing configuration file in the configuration file, and send the obtained target business file to the data format processing module 106.
[0062] The configuration file module 105 is used to configure a corresponding configuration file for each service, wherein the configuration file includes a data packet parsing configuration file and a data format conversion configuration file.
[0063] The data format processing module 106 is used to process the target business file according to the data format conversion configuration file to obtain a playback file.
[0064] The playback file module 107 is used to perform corresponding business simulation according to the playback file.
[0065] Based on the business simulation system provided above, an embodiment of the present invention provides a business simulation method, such as Figure 2 As shown, the business simulation method specifically includes the following steps:
[0066] S201: Monitor network traffic data in a real production environment in real time through a switch.
[0067] In the specific process of executing step S201, the network traffic data in the real production environment can be monitored in real time through the switch, that is, the network traffic data in the real production environment is collected by using the switch mirroring method.
[0068] It should be noted that network traffic data at least includes transport layer transport protocol data and application layer communication protocol data.
[0069] Among them, network traffic data refers to the data between systems in virtualized and cloud environments.
[0070] It should also be noted that network traffic data refers to the binary format network packets that are actually transmitted in the network, and the smallest unit is the Ethernet frame. For network traffic data, we use traffic analysis technology to perform layer-by-layer protocol analysis on it, and can parse business messages to see the content of each transaction.
[0071] S202: When a service simulation request is received, target network flow data is obtained from the switch, and the target network flow data is saved as an original data packet file.
[0072] During the specific execution of step S202, when a service simulation request is received, the network packet collector is used to obtain the target network traffic data corresponding to the service indicated by the service simulation request from the network traffic data monitored by the switch, and the format of the obtained target network traffic data is converted into a pcap file to obtain the original data packet file.
[0073] S203: When a playback start command is received, network protocol analysis and sequence reorganization are performed on the original data packet file to obtain a service coding file, and the service coding file is decoded to obtain a service file.
[0074] During the specific execution of step S203, when a playback start command is received, the network pointer can be used to perform network protocol analysis and sequence reorganization on the original data packet file to obtain a business coding file with complete business content, and the business coding file can be decoded to obtain a business file with complete business content.
[0075] Optionally, the transport layer protocol in the transport layer protocol data in the network pointer original data packet file and the application layer protocol in the application layer protocol data can be used to perform network protocol analysis and sequence reorganization to obtain a business coding file with complete business content.
[0076] It should be noted that the network pointer can be an MQ network pointer, a Tuxcdo network pointer, or a DRDA network pointer.
[0077] S204: When the parsing instruction is received, a configuration file corresponding to the service indicated by the service simulation request is obtained.
[0078] In the embodiment of the present application, for each service, a corresponding configuration file can be pre-set for each service, wherein the configuration file includes a data packet parsing configuration file and a data format conversion configuration file.
[0079] It should be noted that the format of the data packet parsing configuration file can be a json file or a key-value file, which can be used to save the filtering of business files.
[0080] The data format conversion configuration file is a two-dimensional table format file, the column separator is a space, and the row separator is a line feed character. It is used to save the filtered business file (target business file) to the format of the playback data and the replacement processing configuration.
[0081] It should also be noted that the data format conversion configuration file can be configured according to the alliance transaction field replacement rule to mark the fields in the target business file that need to be saved or replaced when processing the target business file, so as to replace them during the playback process. Field marking is only performed on transactions configured with sequence number replacement rules, not all transactions.
[0082] In the specific process of executing step S204, when a parsing instruction is received, a configuration file corresponding to the service indicated by the simulation request may be obtained.
[0083] S205: Process the business file according to the configuration information to obtain a playback file.
[0084] In the specific execution process of step S205, after obtaining the configuration file corresponding to the business indicated by the business simulation request, the business file can be filtered according to the data packet parsing configuration file in the configuration file to obtain the target business file; and the target business file can be processed according to the data format conversion configuration file in the configuration file to obtain the playback file.
[0085] Optionally, the configuration file may be converted according to the data format, and the target fields in the target business file may be marked to obtain a playback file.
[0086] The target field is the field that needs to be saved or replaced during business simulation.
[0087] It should be noted that the generated playback file does not exceed a preset size, wherein the preset size may be 100 MB, which may be set according to actual needs and is not limited in the present embodiment.
[0088] It should also be noted that the file format of the playback file may be a CICS protocol file format or a DB2 protocol file format.
[0089] For the CICS protocol file format, the storage format of each line (each transaction in the playback file) is as follows: (each field information is separated by a vertical line) line length (5 digits) | CICS connection ID | transaction start seconds_microseconds | transaction end seconds_microseconds | {business serial number, transaction code, CICS sequence number, transaction return code} | transaction unique number | [reserved] | [CICS message length] + transaction complete CICS message (with ctg header, binary) + line end character (0x0A).
[0090] Among them, 1. Line length: a 5-digit integer, indicating the total length of this line in the file.
[0091] 2. CICS connection ID: original IP: original port -> destination IP: destination port (i.e. 39.33.4.13:45100->39.0.0.51:19001).
[0092] 3. The 19-digit string converted by the corresponding algorithm (for example, 3575859371147572292) represents the specified CICS connection.
[0093] 4. Transaction start seconds_microseconds: transaction start time, for example: 1588803799_100529.
[0094] 5. Transaction end seconds_microseconds: transaction end time, for example: 1588803799_182034.
[0095] 6. {Business serial number, transaction code, CICS sequence number, transaction return code}, for example: {45-digit global unified serial number, SA0115400, 23927, AAAAA}.
[0096] 7. Transaction unique number: A unique number for each transaction, a 15-digit string, format: 0000000_0000189.
[0097] 8.[Reserved]: Subsequent serial number replacement, see the "Data Format Conversion Configuration File" section for details.
[0098] 9. [CICS message length]: The length of the complete CICS request message of the transaction.
[0099] 10. Transaction complete CICS message: Complete CICS transaction request message with ctg header, stored in binary form.
[0100] 11. Line terminator: Write hexadecimal 0x0A at the end of each line as the line terminator.
[0101] For the DB2 protocol file format, a single DB2 SQL statement will have multiple interactions, and to ensure the correctness of the playback, these interactions must be transmitted. Therefore, a nested structure is required to process the playback file of the DB2 protocol file format. Therefore, there are 4 types of rows in the DB2 protocol file format:
[0102] 1. Mark the start of a complete SQL statement.
[0103] 2. Record information about a request.
[0104] 3. Record a response message.
[0105] 4. Information that marks the end of a complete SQL statement.
[0106] At any time, in the same flow (that is, when the client IP+Port and the server IP+Port are the same), marking the start of a complete SQL means that the original SQL has been completed.
[0107] Among them, the information that marks the start of a complete SQL statement: 1. Line length: a 5-digit integer, indicating the total length of this line in the file; 2. SQL start seconds_microseconds: SQL start time, for example: 1588803799_100529; 3. SQL end seconds_microseconds: SQL end time, for example: 1588803799_182034; 4. SQL level response code: the final result code of the entire SQL statement; 5. Reserved field: "SQLSTART"; 6. Line terminator: hexadecimal 0x0A is written at the end of each line as the line terminator.
[0108] Record the information of a request: 1. Line length: a 5-digit integer, indicating the total length of this line in the file; 2. SQL start seconds_microseconds: SQL start time (the time when the entire SQL starts, not the start time of this request), for example: 1588803799_100529; 3. SQL end seconds_microseconds: SQL end time (the time when the entire SQL ends, not the end time of this request), for example: 1588803799_182034; 4. Reserved field: "SQLREQ"; 5. DRDA message length: the length of the complete DRDA request message; 6. SQL request message: the complete SQL request message, stored in binary form.
[0109] Record the information of a response: 1. Line length: a 5-digit integer, indicating the total length of this line in the file; 2. SQL start seconds_microseconds: SQL start time (the time when the entire SQL starts, not the start time of this request), for example: 1588803799_100529; 3. SQL end seconds_microseconds: SQL end time (the time when the entire SQL ends, not the end time of this request), for example: 1588803799_182034; 4. Response code: the response code of this response (if there are multiple codes, they are separated by ','); 5. Reserved field: "SQLRESP"; 6. DRDA message length: the length of the complete DRDA request message; 7. SQL response message: the complete SQL request message, stored in binary form.
[0110] Information that marks the end of a complete SQL statement: 1. Line length: a 5-digit integer, indicating the total length of this line in the file; 2. SQL start seconds_microseconds: SQL start time, for example: 1588803799_100529; 3. SQL end seconds_microseconds: SQL end time, for example: 1588803799_182034; 4. SQL level response code: the final result code of the entire SQL statement; 5. Reserved field: "SQLEND".
[0111] S206: Save the playback file to a preset location in the hard disk according to the preset storage logic.
[0112] In an embodiment of the present application, a storage logic for playback files is pre-set, and the pre-set storage logic indicates that the streaming message or JSON business field in the playback file is detailed and then written into the MQ queue of the pre-set simulation environment in an asynchronous manner.
[0113] In the specific process of executing step S206, after the corresponding playback file is generated, the streaming message or JSON business field in the playback file can be detailed and then written to a preset location in the hard disk in an asynchronous manner. The preset location is an MQ queue of a simulation environment pre-set in the hard disk.
[0114] S207: Obtain a playback file from a preset location in the hardware, and perform corresponding business simulation according to the playback file.
[0115] In the specific process of executing step S207, the playback file can be obtained from a preset location in the hardware by executing a preset SQL statement that matches the file format of the playback file, and corresponding business simulation is performed according to the playback file.
[0116] The present invention provides a business simulation method, when receiving a business simulation request, the target network flow data corresponding to the received business simulation request can be obtained, and the obtained target network flow data can be saved as an original data packet file, so that when receiving a playback start command, the original data packet file is subjected to network protocol analysis and sequence reorganization to obtain a business coding file for decoding, and a business file is obtained, and when receiving a parsing instruction, a configuration file corresponding to the business indicated by the business simulation request is obtained according to the received parsing instruction, so that the business file is processed according to the obtained configuration file to obtain a playback file, and corresponding business simulation is performed according to the playback file. The technical solution provided by the present invention does not rely on host resources, can not only quickly complete data acquisition, thereby quickly completing corresponding business simulation, but also can avoid consuming the performance of the host system and reduce the risk of affecting the stable operation of the host system.
[0117] Based on the business simulation method provided by the above embodiment of the present invention, the embodiment of the present invention also discloses a business simulation device, such as Figure 3 As shown, the business simulation device includes:
[0118] The data acquisition unit 31 is used to acquire target network traffic data when receiving a service simulation request, and save the target network traffic data as an original data packet file;
[0119] The data processing unit 32 is used to perform network protocol analysis and sequence reorganization on the original data packet file to obtain a business coding file, and decode the business coding file to obtain a business file when receiving a playback start command;
[0120] The configuration file acquisition unit 33 is used to acquire the configuration file corresponding to the service indicated by the service simulation request when receiving the parsing instruction;
[0121] A file processing unit 34, used to process the business file according to the configuration file to obtain a playback file;
[0122] The business simulation unit 35 is used to perform corresponding business simulation according to the playback file.
[0123] It should be noted that the various units provided in the above embodiments of the present invention may specifically be Figure 1 The components of each module in the business simulation system shown in the figure, and the specific working process of each unit can be correspondingly referred to the above embodiment of the present invention disclosed in the embodiment of the present invention. Figure 2 The corresponding steps in the illustrated business simulation method embodiment will not be described in detail here.
[0124] The present invention provides a business simulation device, which can obtain target network traffic data corresponding to the received business simulation request when receiving a business simulation request, and save the obtained target network traffic data as an original data packet file, so that when receiving a playback start command, the original data packet file is subjected to network protocol analysis and sequence reorganization to obtain a business coding file for decoding, and obtain a business file, and when receiving a parsing instruction, a configuration file corresponding to the business indicated by the business simulation request is obtained according to the received parsing instruction, so that the business file is processed according to the obtained configuration file to obtain a playback file, and corresponding business simulation is performed according to the playback file. The technical solution provided by the present invention does not rely on host resources, can not only quickly complete data acquisition, thereby quickly completing corresponding business simulation, but also can avoid consuming the performance of the host system and reduce the risk of affecting the stable operation of the host system.
[0125] Optionally, the device further comprises:
[0126] The monitoring unit is used to monitor the network traffic data in the real production environment in real time through the switch;
[0127] Accordingly, the data acquisition unit includes:
[0128] The data acquisition subunit is used to obtain the target network mirror number corresponding to the business simulation request from the network traffic data monitored by the switch by using the network message collector when receiving the business simulation request;
[0129] The saving unit is used to save the network flow data as a raw data packet file.
[0130] Optionally, a data processing unit, comprising:
[0131] The analysis and reassembly unit is used to perform network protocol analysis and sequence reassembly on the original data packet file using the network pointer to obtain a business coding file when receiving a playback start command;
[0132] The decoding unit is used to decode the business coding file to obtain the business file.
[0133] Optionally, the configuration file includes a data packet parsing configuration file and a data format conversion configuration file, and the file processing unit includes:
[0134] A filtering unit, used to filter the service file according to the data packet parsing configuration file to obtain the target service file;
[0135] The file processing subunit is used to process the target business file according to the data format conversion configuration file to obtain a playback file.
[0136] Optional file processing subunit, including:
[0137] The marking unit is used to mark the target field in the target business file according to the data format conversion configuration file to obtain a playback file, wherein the target field is the field that needs to be saved or replaced when performing business simulation.
[0138] Optionally, the device further comprises:
[0139] A storage unit, used to save the playback file to a preset location in the hard disk according to a preset storage logic;
[0140] Correspondingly, the business simulation unit is also used to obtain the playback file from a preset position in the hardware, and perform corresponding business simulation according to the playback file.
[0141] The present application embodiment provides an electronic device, such as Figure 4 As shown, the electronic device includes a processor 401 and a memory 402, the memory 402 is used to store program codes and data of business simulation, and the processor 401 is used to call program instructions in the memory to execute the steps shown in the business simulation method in the above embodiment.
[0142] An embodiment of the present application provides a storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the business simulation method shown in the above embodiment.
[0143] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0144] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may 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 the present invention.
[0145] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0146] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A business simulation method, characterized in that: The method comprises: Monitor network traffic data in a real production environment in real time through a switch; wherein the network traffic data at least includes transport layer transport protocol data and application layer communication protocol data; When a service simulation request is received, a target network mirror number corresponding to the service simulation request is obtained from the network traffic data monitored by the switch using a network message collector; Saving the network traffic data as a raw data packet file; When a playback start command is received, the network pointer is used to perform network protocol analysis and sequence reorganization on the original data packet file to obtain a business coding file, and the business coding file is decoded to obtain a business file; When receiving the parsing instruction, obtaining a configuration file corresponding to the service indicated by the service simulation request; wherein the configuration file includes a data packet parsing configuration file and a data format conversion configuration file, and the data format conversion configuration file is pre-configured based on the alliance transaction field replacement rule; Processing the business file according to the data packet parsing configuration file and the data format conversion configuration file to obtain a playback file; wherein the file format of the playback file is a CICS protocol file format or a DB2 protocol file format; The playback file is saved to a preset location in the hard disk according to a preset storage logic; wherein the preset storage logic indicates that the streaming message or JSON business field in the playback file is detailed and written to the MQ queue of the simulation environment of the hard disk in an asynchronous manner; The playback file is obtained from the preset location in the hardware, and corresponding business simulation is performed according to the playback file.
2. The method according to claim 1, characterized in that The processing of the service file according to the data packet parsing configuration file and the data format conversion configuration file to obtain a playback file includes: Filter the service file according to the data packet parsing configuration file to obtain a target service file; The target business file is processed according to the data format conversion configuration file to obtain a playback file.
3. The method according to claim 2, characterized in that The processing of the target business file according to the data format conversion configuration file to obtain a playback file includes: According to the data format conversion configuration file, the target field in the target business file is marked to obtain a playback file, wherein the target field is a field that needs to be saved or replaced when performing business simulation.
4. A business simulation device, characterized in that: The device comprises: A monitoring unit, used to monitor network traffic data in a real production environment in real time through a switch; wherein the network traffic data at least includes transport layer transport protocol data and application layer communication protocol data; A data acquisition subunit, configured to, when receiving a service simulation request, acquire a target network mirror number corresponding to the service simulation request from the network traffic data monitored by the switch using a network message collector; A storage unit, used for storing the network flow data as an original data packet file; An analysis and reassembly unit, configured to perform network protocol analysis and sequence reassembly on the original data packet file using a network pointer to obtain a service coding file when a playback start command is received; A decoding unit, used for decoding the business coding file to obtain a business file; a configuration file acquisition unit, configured to acquire a configuration file corresponding to the service indicated by the service simulation request when receiving a parsing instruction; wherein the configuration file includes a data packet parsing configuration file and a data format conversion configuration file, and the data format conversion configuration file is pre-configured based on a union transaction field replacement rule; A file processing unit, used for processing the business file according to the data packet parsing configuration file and the data format conversion configuration file to obtain a playback file; wherein the file format of the playback file is a CICS protocol file format or a DB2 protocol file format; A storage unit, used to save the playback file to a preset location in the hard disk according to a preset storage logic; wherein the preset storage logic indicates that the streaming message or JSON business field in the playback file is detailed and written to the MQ queue of the simulation environment of the hard disk in an asynchronous manner; The business simulation unit is used to obtain the playback file from the preset position in the hardware and perform corresponding business simulation according to the playback file.
5. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store program codes and data of business simulation, and the processor is used to call program instructions in the memory to execute a business simulation method as described in any one of claims 1-3.
6. A storage medium, characterized in that: The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute a business simulation method as described in any one of claims 1-3.
Citation Information
Patent Citations
Network emulation method capable of acquiring real-time service subjective effect and network emulation system capable of acquiring real-time service subjective effect
CN101662392A
Business test method , device and system
CN105099833A
Testing method and system for simulating real operation environment of computer network application program
CN106844220A
Enhanced scenario testing of an application under test
US20070022406A1
