Network data simulation device and method
By combining forward and reverse isolation devices, using file format and UDP/TCP protocol to transmit requests and results in the isolation interval, the problems of low data transmission efficiency and unknown result confirmation in the existing technology are solved, and efficient data transmission and Result acquisition.
Patent Information
- Application Number
- CN202210602503.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-30
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-05-30
AI Technical Summary
In the existing technology, the data transmission efficiency between high-level isolation areas and low-level isolation areas is low, especially when the files are large, the transmission rate is slow, and the reverse isolation device can only transmit in byte form and cannot obtain specific requests. result.
By combining the forward isolation device and the reverse isolation device, requests and results are transmitted between low-level isolation areas and high-level isolation areas in the form of files, using UDP and TCP protocols to meet the http network protocol, improve transmission efficiency, and Get specific request results.
The data transmission efficiency is improved, the specific results of the request can be obtained during the transmission process, and the problems of low transmission rate and unknown result confirmation are solved.
Smart Images

Figure CN115022013B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a network data simulation device and method. Background Art
[0002] In the prior art, the high-level isolation area and the low-level isolation area only rely on physical isolation devices to achieve one-way data transmission in a specified format. For example, the reverse isolation device can only transfer data from the low-level isolation area to the high-level isolation area in the form of files, and the reverse isolation device can only transfer data from the high-level isolation area to the low-level isolation area in the form of bytes.
[0003] However, when the reverse isolation device can only transfer data from the low-level isolation area to the high-level isolation area in the form of files, if the file is large at this time, the transmission rate will be low, which will affect the timeliness of the data. When the reverse isolation device can only transfer data from the high-level isolation area to the low-level isolation area in the form of bytes, after the data transmission is completed, in order to confirm the data of the application layer, the low-level isolation area can only return a byte as a response, and the returned value can only be 0x00 or 0xff. The return value can only determine whether the request is successful or failed. Summary of the invention
[0004] The purpose of the present invention is to provide a network data simulation device and method, which can combine a forward isolation device and a reverse isolation device together, and send requests in the form of files between a low-level isolation area and a high-level isolation area through the forward isolation device and the reverse isolation device and obtain request results, thereby improving transmission efficiency.
[0005] In order to achieve the above object, the present invention provides a network data simulation device, comprising:
[0006] The low-level isolation area is used to intercept user requests and generate request files;
[0007] The high-level isolation area is used to intercept the user's request and generate a request file from the request, and is also used to send the request file to the low-level isolation area and receive the request result from the low-level isolation area, or to receive the request file from the low-level isolation area and feed back the request result to the low-level isolation area;
[0008] a reverse isolation device, which is used to obtain the request file from the low-level isolation area and transmit the request file to the high-level isolation area by UDP transmission when the low-level isolation area sends a request file to the high-level isolation area, and is used to feed back the request result from the low-level isolation area to the high-level isolation area by UDP transmission when the high-level isolation area sends a request file to the low-level isolation area; and
[0009] A forward isolation device is used to obtain a request file from the high-level isolation area and transmit the request file to the low-level isolation area by TCP transmission when the high-level isolation area sends a request file to the low-level isolation area; and when the low-level isolation area sends a request file to the high-level isolation area, it is used to feed back the request result from the high-level isolation area to the low-level isolation area in the form of a file and simultaneously by TCP transmission.
[0010] Optionally, the network data simulation device also includes a proxy service for providing user requests.
[0011] Accordingly, the present invention also provides a network data simulation method, comprising:
[0012] The low-level isolation area sends the request file to the high-level isolation area through the reverse isolation device in the form of UDP transmission, and the high-level isolation area sends the request result to the low-level isolation area through the forward isolation device in the form of TCP transmission;
[0013] The high-level isolation area sends the request file to the low-level isolation area via TCP transmission through the forward isolation device, and the low-level isolation area sends the request result file to the high-level isolation area via UDP transmission through the reverse isolation device.
[0014] Optionally, in the network data simulation method, the time from sending a request to obtaining a request result is set, and when the actual time from sending a request to obtaining a request result exceeds the set value, the request is considered to have failed.
[0015] Optionally, in the network data simulation method, the time from sending a request to obtaining a request result is set to 60 seconds. When the actual time from sending a request to obtaining a request result exceeds 60 seconds, the request is considered to have failed.
[0016] Optionally, in the network data simulation method, the method in which the low-level isolation area sends the request file to the high-level isolation area by UDP transmission through the reverse isolation device, and the method in which the high-level isolation area sends the request result to the low-level isolation area by TCP transmission through the forward isolation device includes:
[0017] The proxy service of the low-level isolation zone intercepts the user's request and redirects the request to the proxy service interface;
[0018] Generate a file using the requested network address and parameters and place it in a first folder, and the reverse isolation device transfers the file in the first folder to a second folder;
[0019] The proxy service of the high-level isolation zone listens to the second folder, identifies and parses the files in the second folder, initiates a request through httpClient and calls the web interface service, and then returns the request result to the proxy service of the low-level isolation zone through the forward isolation device.
[0020] Optionally, in the network data simulation method, the high-level isolation area sends a request file to the low-level isolation area by TCP transmission through the forward isolation device, and the low-level isolation area sends a request result file to the high-level isolation area by UDP transmission through the reverse isolation device, including:
[0021] The proxy service of the high-level isolation zone intercepts the user's request and redirects the request to the proxy service interface;
[0022] Generate a file using the requested network address and parameters and place it in a third folder, and the forward isolation device transfers the file in the third folder to a fourth folder in bytes;
[0023] The proxy service in the low-level isolation zone monitors the fourth folder, identifies and parses the files in the fourth folder, initiates a request through httpClient and calls the web interface service, and then places the generated file of the request result into the fifth folder;
[0024] The reverse isolation device transfers the files in the fifth folder to the sixth folder;
[0025] The proxy service of the high-level isolation zone monitors the files in the sixth folder and parses the files to obtain the request result.
[0026] Optionally, in the network data simulation method, the user's request is issued by a proxy service.
[0027] Optionally, in the network data simulation method, the file generated by the request result is a file in JASON format.
[0028] Optionally, in the network data simulation method, after the proxy service of the high-level isolation zone monitors the files in the sixth folder and parses the files to obtain the request result, it also includes: returning the request result to the proxy service.
[0029] In the network data simulation device and method provided by the present invention, the forward isolation device and the reverse isolation device can be combined together, and the request is sent in the form of a file between the low-level isolation area and the high-level isolation area through the forward isolation device and the reverse isolation device. The file transmission meets the http network protocol, so the formed file is small, thereby improving the transmission efficiency. In addition, in the process of the high-level isolation area sending a request to the low-level isolation area, the high-level isolation area also obtains the request result in the form of a file through the reverse isolation device. Therefore, in addition to obtaining the result of the success or failure of the request transmission, the specific request result can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a flow chart of a network data simulation method according to an embodiment of the present invention;
[0031] Figure 2 is a flow chart of sending a file from a low-level isolation area to a high-level isolation area according to an embodiment of the present invention;
[0032] Figure 3 is a schematic diagram of a low-level isolation area sending a file to a high-level isolation area according to an embodiment of the present invention;
[0033] Figure 4 is a flow chart of sending a file from a high-level isolation area to a low-level isolation area according to an embodiment of the present invention;
[0034] Figure 5 is a schematic diagram of a high-level isolation area sending a file to a low-level isolation area according to an embodiment of the present invention;
[0035] In the figure: 110-low-level isolation area, 120-first folder, 130-reverse isolation device, 140-second folder, 150-high-level isolation area, 160-Web interface service, 170-forward isolation device, 210-high-level isolation area, 220-third folder, 230-forward isolation device, 240-fourth folder, 250-low-level isolation area, 260-Web interface service, 270-fifth folder, 280-reverse isolation device, 290-sixth folder. DETAILED DESCRIPTION
[0036] The specific implementation of the present invention will be described in more detail below in conjunction with the schematic diagram. The advantages and features of the present invention will become clearer based on the following description. It should be noted that the drawings are all in a very simplified form and are not in exact proportions, and are only used to facilitate and clearly assist in explaining the purpose of the embodiments of the present invention.
[0037] Hereinafter, the terms "first", "second", etc. are used to distinguish between similar elements and are not necessarily used to describe a particular order or chronological sequence. It is to be understood that these terms used in this manner are interchangeable where appropriate. Similarly, if the method described herein includes a series of steps, the order of these steps presented herein is not necessarily the only order in which these steps can be performed, and some of the steps described may be omitted and / or some other steps not described herein may be added to the method.
[0038] The present invention provides a network data simulation device, comprising:
[0039] The low-level isolation area is used to intercept user requests and generate request files;
[0040] The high-level isolation area is used to intercept the user's request and generate a request file from the request, and is also used to send the request file to the low-level isolation area and receive the request result from the low-level isolation area, or to receive the request file from the low-level isolation area and feed back the request result to the low-level isolation area;
[0041] a reverse isolation device, which is used to obtain the request file from the low-level isolation area and transmit the request file to the high-level isolation area by UDP transmission when the low-level isolation area sends a request file to the high-level isolation area, and is used to feed back the request result from the low-level isolation area to the high-level isolation area by UDP transmission when the high-level isolation area sends a request file to the low-level isolation area; and
[0042] A forward isolation device is used to obtain a request file from the high-level isolation area and transmit the request file to the low-level isolation area by TCP transmission when the high-level isolation area sends a request file to the low-level isolation area; and when the low-level isolation area sends a request file to the high-level isolation area, it is used to feed back the request result from the high-level isolation area to the low-level isolation area in the form of a file and simultaneously by TCP transmission.
[0043] Furthermore, the network data simulation device also includes a proxy service for providing user requests. The user sends his request through the proxy service, and the service of the low-level isolation zone or the high-level isolation zone intercepts the user's request and redirects it to its own proxy service interface. Then the request is generated into a request file, and the file is transmitted to another isolation zone in the form of HTTP network transmission, and the request result is obtained from the other isolation zone, and then the request result is returned to the proxy service to let the user know.
[0044] Please refer to Figure 1 Accordingly, the present invention also provides a network data simulation method, comprising:
[0045] S1: The low-level isolation area sends the request file to the high-level isolation area via UDP transmission through the reverse isolation device, and the high-level isolation area sends the request result to the low-level isolation area via TCP transmission through the forward isolation device;
[0046] S2: The high-level isolation area sends the request file to the low-level isolation area via the forward isolation device using TCP transmission, and the low-level isolation area sends the request result file to the high-level isolation area via the reverse isolation device using TCP transmission.
[0047] Preferably, the time from sending a request to obtaining a request result is set, and when the actual time from sending a request to obtaining a request result exceeds the set value, the request is considered to have failed. For example, the time from sending a request to obtaining a request result can be set to 60s, and when the actual time from sending a request to obtaining a request result exceeds 60s, the request is considered to have failed. In other embodiments of the present invention, the set time can also be other times. By setting the time, it is possible to know whether the request has failed in the event that the entire system is damaged or the transmission fails due to other reasons, thereby avoiding wasting extra time waiting for the request result.
[0048] Preferably, please refer to Figure 2 and Figure 3 The method in which the low-level isolation area sends the request file to the high-level isolation area through the reverse isolation device in the form of UDP transmission, and the high-level isolation area sends the request result to the low-level isolation area through the forward isolation device in the form of TCP transmission includes:
[0049] S11: The proxy service of the low-level isolation area 110 intercepts the user's request and redirects the request to the proxy service interface;
[0050] S12: Generate a file with the requested network address and parameters and put it into the first folder 120, and the reverse isolation device 130 transfers the file in the first folder 120 to the second folder 140;
[0051] S13: The proxy service of the high-level isolation area 150 monitors the second folder 140, identifies and parses the files in the second folder 140, initiates a request through httpClient and calls the web interface service 160, and then returns the request result to the proxy service of the low-level isolation area 110 through the forward isolation device 170.
[0052] Preferably, please refer to Figure 4 and Figure 5 The method in which the high-level isolation area sends the request file to the low-level isolation area through the forward isolation device in the form of TCP transmission, and the low-level isolation area sends the request result file to the high-level isolation area through the reverse isolation device in the form of UDP transmission includes:
[0053] S21: The proxy service of the high-level isolation area 210 intercepts the user's request and redirects the request to the proxy service interface;
[0054] S22: Generate a file with the requested network address and parameters and put it into the third folder 220, and the forward isolation device 230 transfers the file in the third folder 220 to the fourth folder 240 in bytes;
[0055] S23: The proxy service of the low-level isolation area 250 monitors the fourth folder 240, identifies the files in the fourth folder 240 and parses the files, initiates a request through httpClient and calls the web interface service 260, and then places the request result generated file into the fifth folder 270;
[0056] S24: the reverse isolation device 280 transfers the files in the fifth folder 270 to the sixth folder 290;
[0057] S25: The proxy service of the high-level isolation area 210 monitors the files in the sixth folder 290 and parses the files to obtain the request result.
[0058] Preferably, after the proxy service of the high-level isolation zone monitors the files in the sixth folder and parses the files to obtain the request result, the network data simulation method further includes: returning the request result to the proxy service. The request is issued by the user, so the request result needs to be returned to the user.
[0059] In the embodiment of the present invention, the user's request is sent by the proxy service, and the request result is also received in the end.
[0060] In the embodiment of the present invention, the file generated by the request result is a file in JASON format. In the prior art, the returned value can only be 0x00 or 0xff, which can only be used as a verification of success or failure. The embodiment of the present invention can return a specific request result, which is a file in JASON format, and obtain a specific request result according to the specific content of the user's request.
[0061] In summary, in the network data simulation device and method provided by the embodiment of the present invention, the forward isolation device and the reverse isolation device can be combined together, and the request is sent in the form of a file between the low-level isolation area and the high-level isolation area through the forward isolation device and the reverse isolation device. The file transmission meets the http network protocol, so the formed file is small, thereby improving the transmission efficiency. In addition, in the process of the high-level isolation area sending a request to the low-level isolation area, the high-level isolation area also obtains the request result in the form of a file through the reverse isolation device. Therefore, in addition to obtaining the result of the success or failure of the request transmission, the specific request result can be obtained.
[0062] The above is only a preferred embodiment of the present invention and does not limit the present invention in any way. Any technician in the relevant technical field, without departing from the scope of the technical solution of the present invention, makes any form of equivalent replacement or modification to the technical solution and technical content disclosed in the present invention, which does not depart from the content of the technical solution of the present invention and still falls within the protection scope of the present invention.
Claims
1. A network data simulation device, characterized in that: include: The low-level isolation area is used to intercept user requests and generate request files; The high-level isolation area is used to intercept the user's request and generate a request file from the request, and is also used to send the request file to the low-level isolation area and receive the request result from the low-level isolation area, or to receive the request file from the low-level isolation area and feed back the request result to the low-level isolation area; A reverse isolation device, when the low-level isolation area sends a request file to the high-level isolation area, used to obtain the request file from the low-level isolation area and transmit the request file to the high-level isolation area by UDP transmission, and when the high-level isolation area sends a request file to the low-level isolation area, used to feed back the request result from the low-level isolation area to the high-level isolation area by UDP transmission; as well as A forward isolation device is used to obtain a request file from the high-level isolation area and transmit the request file to the low-level isolation area by TCP transmission when the high-level isolation area sends a request file to the low-level isolation area; and when the low-level isolation area sends a request file to the high-level isolation area, it is used to feed back the request result from the high-level isolation area to the low-level isolation area in the form of a file and simultaneously by TCP transmission.
2. The network data simulation device according to claim 1, characterized in that: Also included is a proxy service for serving user requests.
3. A network data simulation method using the network data simulation device according to any one of claims 1 to 2, characterized in that: include: The low-level isolation area sends the request file to the high-level isolation area through the reverse isolation device in the form of UDP transmission, and the high-level isolation area sends the request result to the low-level isolation area through the forward isolation device in the form of TCP transmission; The high-level isolation area sends the request file to the low-level isolation area via TCP transmission through the forward isolation device, and the low-level isolation area sends the request result file to the high-level isolation area via UDP transmission through the reverse isolation device.
4. The network data simulation method according to claim 3, characterized in that: Set the time from sending a request to getting the request result. When the actual time from sending a request to getting the request result exceeds the set value, the request is considered failed.
5. The network data simulation method according to claim 4, characterized in that: Set the time from sending a request to obtaining the request result to 60s. If the actual time from sending a request to obtaining the request result exceeds 60s, the request is considered failed.
6. The network data simulation method according to claim 3, characterized in that: The method in which the low-level isolation area sends a request file to the high-level isolation area by UDP transmission through the reverse isolation device, and the high-level isolation area sends the request result to the low-level isolation area by TCP transmission through the forward isolation device includes: The proxy service of the low-level isolation zone intercepts the user's request and redirects the request to the proxy service interface; Generate a file using the requested network address and parameters and place it in a first folder, and the reverse isolation device transfers the file in the first folder to a second folder; The proxy service in the high-level isolation zone monitors the second folder, identifies and parses the files in the second folder, initiates a request through httpClient and calls the web interface service, and returns the request result to the proxy service in the low-level isolation zone through the forward isolation device.
7. The network data simulation method according to claim 3, characterized in that: The method in which the high-level isolation area sends a request file to the low-level isolation area by TCP transmission through the forward isolation device, and the low-level isolation area sends a request result file to the high-level isolation area by UDP transmission through the reverse isolation device includes: The proxy service of the high-level isolation zone intercepts the user's request and redirects the request to the proxy service interface; Generate a file using the requested network address and parameters and place it in a third folder, and the forward isolation device transfers the file in the third folder to a fourth folder in bytes; The proxy service in the low-level isolation zone monitors the fourth folder, identifies and parses the files in the fourth folder, initiates a request through httpClient and calls the web interface service, and then places the generated file of the request result into the fifth folder; The reverse isolation device transfers the files in the fifth folder to the sixth folder; The proxy service of the high-level isolation zone monitors the files in the sixth folder and parses the files to obtain the request result.
8. The network data simulation method according to claim 6 or claim 7, characterized in that: The user's request is issued by a proxy service.
9. The network data simulation device according to claim 8, characterized in that: The file generated by the request result is a file in JASON format.
10. The network data simulation method according to claim 7, characterized in that: After the proxy service of the high-level isolation zone monitors the files in the sixth folder and parses the files to obtain the request result, it also includes: returning the request result to the proxy service.
