A microservice interface data transmission method based on intranet node penetration technology
By listening to the TCP port in the server and forwarding data packets according to the node number, the problems of limited data transmission speed, poor stability and difficult to guarantee security in traditional intranet penetration technology are solved, and efficient, flexible and secure data transmission is achieved.
Patent Information
- Application Number
- CN202411899694.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-04
AI Technical Summary
Traditional intranet penetration technology has problems such as limited data transmission speed, poor stability, difficulty in ensuring security, and complex configuration and management.
By listening to the TCP port in the server to obtain reception requests, recombining data packets, and forwarding them to the corresponding node terminals according to the node number, decompression and unpacking and resource description information processing, efficient data transmission and secure encrypted communication are achieved.
It improves the efficiency and flexibility of data transmission, enhances the stability and security of the system, avoids resource waste, and provides a new intranet data communication solution.
Smart Images

Figure CN119766886A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network communication technology, and specifically relates to a microservice interface data transmission method based on intranet node penetration technology. Background Art
[0002] In modern distributed systems, many companies use microservice architecture to enhance the flexibility and maintainability of the system. However, due to the limitations of the intranet, these services are usually not directly accessible to the external network, so intranet penetration technology is needed.
[0003] Intranet penetration technology allows services in the intranet to be accessed from the external network in a specific way. Common implementation methods include reverse proxy, port mapping, third-party intranet penetration services (such as ngrok, frp) and self-built penetration services. ngrok is an open source tool that can expose local ports to public domain names, allowing external users to access services on local servers through the domain name; while frp is a fast reverse proxy project that supports multiple protocols, is easy to configure and is free.
[0004] Traditional intranet penetration methods may cause data transmission speed to be limited by the bandwidth of the transit server, especially in the case of large traffic. In addition, although point-to-point penetration can reduce the traffic burden, its stability is poor and is easily affected by complex network environments. Since intranet penetration involves the transmission of data on the public network, security is an important factor that cannot be ignored; access rights need to be strictly controlled, HTTPS encryption needs to be configured, and external access records need to be monitored regularly. Although using third-party intranet penetration services (such as ngrok) is convenient and fast, there is a risk of relying on third-party platforms. For example, there is a security warning page in the new version of ngrok, which requires users to manually click to access the website. In addition, some platforms may stop service or change policies at any time, which may affect the normal use of the service. Although self-built intranet penetration services provide higher flexibility, they require certain technical thresholds and server resources. For users who lack relevant experience, the configuration and management process may be more complicated and prone to configuration errors or improper management. Summary of the invention
[0005] In order to solve the above problems existing in the prior art, the present invention provides a microservice interface data transmission method based on intranet node penetration technology;
[0006] The purpose of the present invention can be achieved through the following technical solutions:
[0007] A microservice interface data transmission method based on intranet node penetration technology, comprising:
[0008] Obtaining a receiving request by monitoring a TCP port in the server, and reorganizing and merging the data packets of the receiving request to obtain a transmission reconstructed data packet;
[0009] Suspending and waiting the process of the receiving request corresponding to the transmission reconstruction data packet;
[0010] Forwarding the transmission reconstruction data packet to the corresponding node terminal according to the node number, and after receiving the data packet, the node terminal decompresses and unpacks the data packet to obtain resource description information; according to the resource description information, sending the transmission reconstruction data packet to the resource server in the network where the node terminal is located for processing;
[0011] The node terminal generates result information data after receiving the feedback processed by the resource server, reorganizes and merges the result information data to obtain a feedback data packet and sends it to the server;
[0012] After receiving the feedback data packet, the server decompresses and unpacks the packet to obtain the requested resource description information, and restores the suspended task process according to the GUID task identifier in the requested resource description information.
[0013] Specifically, the received request includes the number of the intranet target node client, and the numbered node client is configured to access the server and establish a mapping comparison table; the mapping comparison table of the node number is maintained on the server side and supports dynamic updates. When a new node is added or the node status changes, the server updates the mapping comparison table in real time.
[0014] Specifically, the reorganization and merging method is:
[0015] The resource description information in the transmission reconstruction data packet is integrated by constructing a reorganization and merging protocol, and the reorganization and merging protocol includes a starting identifier, a request type, a protocol header length, a header data packet, and an actual data packet; the starting identifier is a 32-bit GUID task identifier, and the request type distinguishes different request types through a 1-byte identifier, and the request types include data requests, status updates, and error reports; the protocol header length is used to indicate the byte length of the protocol header part to ensure that the receiver can correctly parse the subsequent data packet content; the header data packet contains the data packet sequence number and timestamp; and the actual data packet carries the resource description information in the transmission reconstruction data packet.
[0016] Specifically, the suspend waiting operation is a synchronous waiting of a single request, and the transmission reconstruction data packet is pushed in a single PACK mode.
[0017] Specifically, the node client communicates with the server through a socket channel module, which includes a TCP handshake, an exchange of node authentication information, and a construction of a node number comparison relationship; after the node client and the server complete the TCP handshake, the authentication information is exchanged; after the authentication information is exchanged, a mapping comparison table between the node and the server is established by using the node number as the node unique identifier; the mapping comparison table enables the server to quickly locate a specific node according to the node number.
[0018] Specifically, the protocol header in the reorganization and merging protocol is divided into an error detection code for verifying whether an error occurs in the transmission process of the data packet.
[0019] Specifically, the transmission reconstruction data packet performs encrypted communication processing during transmission, and each byte of the data packet is updated through an 8-bit dynamic nonlinear unit to replace the input bit with the output bit.
[0020] Specifically, the dynamic nonlinear unit converts the ASCII code of each character into binary by inputting an 8-character cryptographic key, and generates a random number through a circle mapping equation to expand the cryptographic key to 64 characters. The random number generation calculation formula is:
[0021] θ n+1 =θ n +Ω-k / 2π*sin(2πθ n ),
[0022] Among them, θ n is the angular position of the nth time step, which is a random number generated for each iteration to describe the position of the system. n+1 is the random number corrected by introducing nonlinear factors under the current system position, Ω is the driving phase, which is used to set the angle amount increased by the system in each iteration, and k is the coupling strength, which is used to control the angle amount reduced by the system in each iteration;
[0023] The cryptographic key (64 characters) is converted into a binary sequence (512 bits), and the first 16 bits of the binary sequence are extracted and converted into an integer. The extracted 16 bits are then left-shifted 15 times to obtain the corresponding integer. The calculation formula is:
[0024]
[0025] Among them, B j Indicates the integer value corresponding to j left shift operations, b i Represents the binary value of the corresponding bit in the extracted 16-bit binary sequence;
[0026] Repeating the integer conversion of the next 16 bits of the binary sequence until 512 bits of conversion are completed to obtain a conversion sequence;
[0027] Remove duplicate integers in the conversion sequence, and supplement the missing unique numbers in the conversion sequence from the range of 0 to 255, so as to ensure that the conversion sequence is a sequence of 256 unique integers; and arrange them into a two-dimensional matrix of 8 rows and 32 columns;
[0028] The elements of each two-dimensional matrix are permuted through the initial permutation table of the DES algorithm to complete the replacement of input bits and output bits.
[0029] The beneficial effects of the present invention are:
[0030] By listening to the TCP port in the server and obtaining the receiving request, the network connection request can be effectively managed. This mechanism allows the server to process quickly after receiving the request, reducing the delay and waiting time of data transmission. The transmission reconstruction data packet is forwarded to the corresponding node terminal according to the node number, making data processing more efficient. This on-demand allocation method can ensure the rational use of resources and avoid resource waste; after the node terminal receives the data packet, it is decompressed and unpacked to obtain resource description information, and the data packet is sent to the resource server for processing based on this information. This process improves the flexibility and scalability of data processing, so that the system can better cope with different data processing requirements; and adds a highly random and complex key sequence during the transmission of a single data packet, which improves the security of data transmission; the microservice interface data transmission method of the present invention is based on the intranet node penetration technology, which can effectively solve the limitations of traditional intranet data transmission. It allows the microservice interface in the intranet to achieve safe and efficient data exchange without being directly exposed to the external network, thereby providing a new solution for data communication in the intranet environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.
[0032] Figure 1 The present invention is a flowchart of a microservice interface data transmission method based on intranet node penetration technology.
[0033] Figure 2 This is a data flow diagram of a microservice interface data transmission method based on intranet node penetration technology of the present invention. DETAILED DESCRIPTION
[0034] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.
[0035] See also Figure 1-2 , a microservice interface data transmission method based on intranet node penetration technology, comprising:
[0036] Obtaining a receiving request by monitoring a TCP port in the server, and reorganizing and merging the data packets of the receiving request to obtain a transmission reconstructed data packet;
[0037] Suspending and waiting the process of the receiving request corresponding to the transmission reconstruction data packet;
[0038] Forwarding the transmission reconstruction data packet to the corresponding node terminal according to the node number, and after receiving the data packet, the node terminal decompresses and unpacks the data packet to obtain resource description information; according to the resource description information, sending the transmission reconstruction data packet to the resource server in the network where the node terminal is located for processing;
[0039] The node terminal generates result information data after receiving the feedback processed by the resource server, reorganizes and merges the result information data to obtain a feedback data packet and sends it to the server;
[0040] After receiving the feedback data packet, the server decompresses and unpacks the packet to obtain the requested resource description information, and restores the suspended task process according to the GUID task identifier in the requested resource description information.
[0041] In this embodiment, a single data packet is used to realize intranet penetration of microservice interface; the TCP port is listened in the server and waits for receiving requests. The protocol composition header data rule includes a 32-bit GUID task identifier, a 1-byte request type, a 2-byte resource path length, a resource path data packet, a 2-byte header data length, and a header data packet. The device for realizing intranet node penetration of microservice interface using a single data packet is applied to an external network server or a network upper layer server, and mainly includes: a socket channel module, which is used to establish channel communication between nodes and servers, and also includes a TCP handshake, node authentication information exchange, and a node number comparison relationship; a suspension management module, which is used to suspend the request thread in a waiting state, and continue to execute subsequent business logic after obtaining the node response data; a data packaging module, which is used to re-packetize data and combine the original data requested by the user into a byte array according to the specified rules; a forwarding module, which is used to send a new data packet to the terminal of the corresponding node and receive the data responded by the node. The client applied to the node intranet includes: a sending module, which is used to send the ID card information after successfully communicating with the server through handshake; a data unpacking module, which is used to unpack the combined package data after receiving it and obtain the resource description information of the requester; a processing module, which is used to perform subsequent logical processing after obtaining the resource description information, such as executing scripts, executing other interface requests, and obtaining the data after the execution response for feedback processing.
[0042] Specifically, the received request includes the number of the intranet target node client, and the numbered node client is configured to access the server and establish a mapping comparison table; the mapping comparison table of the node number is maintained on the server side and supports dynamic updates. When a new node is added or the node status changes, the server updates the mapping comparison table in real time.
[0043] Specifically, the reorganization and merging method is:
[0044] The resource description information in the transmission reconstruction data packet is integrated by constructing a reorganization and merging protocol, and the reorganization and merging protocol includes a starting identifier, a request type, a protocol header length, a header data packet, and an actual data packet; the starting identifier is a 32-bit GUID task identifier, and the request type distinguishes different request types through a 1-byte identifier, and the request types include data requests, status updates, and error reports; the protocol header length is used to indicate the byte length of the protocol header part to ensure that the receiver can correctly parse the subsequent data packet content; the header data packet contains the data packet sequence number and timestamp; and the actual data packet carries the resource description information in the transmission reconstruction data packet.
[0045] Specifically, the suspend waiting operation is a synchronous waiting of a single request, and the transmission reconstruction data packet is pushed in a single PACK mode.
[0046] Specifically, the node client communicates with the server through a socket channel module, which includes a TCP handshake, an exchange of node authentication information, and a construction of a node number comparison relationship; after the node client and the server complete the TCP handshake, the authentication information is exchanged; after the authentication information is exchanged, a mapping comparison table between the node and the server is established by using the node number as the node unique identifier; the mapping comparison table enables the server to quickly locate a specific node according to the node number.
[0047] Specifically, the protocol header in the reorganization and merging protocol is divided into an error detection code for verifying whether an error occurs in the transmission process of the data packet.
[0048] Specifically, the transmission reconstruction data packet performs encrypted communication processing during transmission, and each byte of the data packet is updated through an 8-bit dynamic nonlinear unit to replace the input bit with the output bit.
[0049] Specifically, the dynamic nonlinear unit converts the ASCII code of each character into binary by inputting an 8-character cryptographic key, and generates a random number through a circle mapping equation to expand the cryptographic key to 64 characters. The random number generation calculation formula is:
[0050] θ n+1 =θ n +Ω-k / 2π*sin(2πθ n ),
[0051] Among them, θ n is the angular position of the nth time step, which is a random number generated for each iteration to describe the position of the system. n+1 is the random number corrected by introducing nonlinear factors under the current system position, Ω is the driving phase, which is used to set the angle amount increased by the system in each iteration, and k is the coupling strength, which is used to control the angle amount reduced by the system in each iteration;
[0052] The cryptographic key (64 characters) is converted into a binary sequence (512 bits), and the first 16 bits of the binary sequence are extracted and converted into an integer. The extracted 16 bits are then left-shifted 15 times to obtain the corresponding integer. The calculation formula is:
[0053]
[0054] Among them, B j Indicates the integer value corresponding to j left shift operations, b i Represents the binary value of the corresponding bit in the extracted 16-bit binary sequence;
[0055] Repeating the integer conversion of the next 16 bits of the binary sequence until 512 bits of conversion are completed to obtain a conversion sequence;
[0056] Remove duplicate integers in the conversion sequence, and supplement the missing unique numbers in the conversion sequence from the range of 0 to 255, so as to ensure that the conversion sequence is a sequence of 256 unique integers; and arrange them into a two-dimensional matrix of 8 rows and 32 columns;
[0057] The elements of each two-dimensional matrix are permuted through the initial permutation table of the DES algorithm to complete the replacement of input bits and output bits.
[0058] In this embodiment, the encryption algorithm of the data transmission process uses the DES algorithm for encryption. When using the initial permutation, the plaintext needs to be arranged in an 8x8 matrix from left to right and from top to bottom, and then the permutation operation is performed according to the initial permutation table. After the permutation operation is completed, each 8-bit binary number will be converted into a corresponding decimal number to form a new 8x8 matrix. Then, according to the encryption process of the DES algorithm, the data in this matrix is iterated for 16 rounds. Each round of iteration is operated by the dynamic nonlinear unit. In the iterative process, the generation of subkeys is a crucial step. First, the original key is permuted and selected 1 operation is performed, and then 16 subkeys are generated according to the key scheduling algorithm. Each subkey is 48 bits long and is used to perform an XOR operation with the extended permuted data. After completing all iterations, the obtained output matrix is once again subjected to the final permutation to convert the data back to a 64-bit binary sequence. This sequence is the encrypted ciphertext, which can be safely transmitted through the intranet node. In order to further enhance security, this embodiment also adopts a key exchange mechanism. Before data transmission, the two communicating parties negotiate a shared key through a secure key exchange protocol (such as Diffie-Hellman key exchange). This shared key is used to generate the original key required by the DES algorithm, ensuring the secure distribution of the key.
[0059] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
[0060] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0061] The program code included on the computer readable medium can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, RF, etc., or any suitable combination of the above. The computer program code for performing the operation of the present invention can be written in one or more programming languages or their combinations, and the programming language includes object-oriented programming languages-such as Java, Smalltalk, C++, and also includes conventional procedural programming languages-such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0062] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A microservice interface data transmission method based on intranet node penetration technology, characterized in that: include: Obtaining a receiving request by monitoring a TCP port in the server, and reorganizing and merging the data packets of the receiving request to obtain a transmission reconstructed data packet; Suspending and waiting the process of the receiving request corresponding to the transmission reconstruction data packet; Forwarding the transmission reconstruction data packet to the corresponding node terminal according to the node number, and after receiving the data packet, the node terminal decompresses and unpacks the data packet to obtain resource description information; according to the resource description information, sending the transmission reconstruction data packet to the resource server in the network where the node terminal is located for processing; The node terminal generates result information data after receiving the feedback processed by the resource server, reorganizes and merges the result information data to obtain a feedback data packet and sends it to the server; After receiving the feedback data packet, the server decompresses and unpacks the packet to obtain the requested resource description information, and restores the suspended task process according to the GUID task identifier in the requested resource description information.
2. The method according to claim 1, characterized in that The received request includes the number of the intranet target node client, and the numbered node client is configured to access the server and establish a mapping comparison table; the mapping comparison table of the node number is maintained on the server side and supports dynamic updates. When a new node is added or the node status changes, the server updates the mapping comparison table in real time.
3. The method according to claim 1, characterized in that The reorganization and merger method is: The resource description information in the transmission reconstruction data packet is integrated by constructing a reorganization and merging protocol, and the reorganization and merging protocol includes a starting identifier, a request type, a protocol header length, a header data packet, and an actual data packet; the starting identifier is a 32-bit GUID task identifier, and the request type distinguishes different request types through a 1-byte identifier, and the request types include data requests, status updates, and error reports; the protocol header length is used to indicate the byte length of the protocol header part to ensure that the receiver can correctly parse the subsequent data packet content; the header data packet contains the data packet sequence number and timestamp; and the actual data packet carries the resource description information in the transmission reconstruction data packet.
4. The method according to claim 1, characterized in that The suspend waiting operation is a synchronous waiting of a single request, and the transmission reconstruction data packet is pushed in a single PACK mode.
5. The method according to claim 2, characterized in that: The node client communicates with the server through a socket channel module, which includes TCP handshake, node authentication information exchange, and building a node number comparison relationship; authentication information exchange is performed after the node client and the server complete the TCP handshake; After the authentication information is exchanged, a mapping table between nodes and servers is established by using the node number as the unique identifier of the node; The mapping table enables the server to quickly locate a specific node according to the node number.
6. The method according to claim 3, characterized in that: The protocol header in the reorganization and merging protocol is divided into an error detection code for verifying whether an error occurs in the transmission process of the data packet.
7. The method according to claim 1, characterized in that The transmission reconstruction data packet performs encrypted communication processing during transmission, and updates each byte of the data packet through an 8-bit dynamic nonlinear unit to replace the input bit with the output bit.
8. The method according to claim 7, characterized in that The dynamic nonlinear unit converts the ASCII code of each character into binary by inputting an 8-character cryptographic key, and generates a random number through a circle mapping equation to expand the cryptographic key to 64 characters. The random number generation calculation formula is: i n+1 =θ n +Ω-k / 2π*sin(2πθ n ), Among them, θ n is the angular position of the nth time step, which is a random number generated for each iteration to describe the position of the system. n+1 is the random number corrected by introducing nonlinear factors under the current system position, Ω is the driving phase, which is used to set the angle amount increased by the system in each iteration, and k is the coupling strength, which is used to control the angle amount reduced by the system in each iteration; The cryptographic key (64 characters) is converted into a binary sequence (512 bits), and the first 16 bits of the binary sequence are extracted and converted into an integer. The extracted 16 bits are then left-shifted 15 times to obtain the corresponding integer. The calculation formula is: Among them, B j Indicates the integer value corresponding to j left shift operations, b i Represents the binary value of the corresponding bit in the extracted 16-bit binary sequence; Repeating the integer conversion of the next 16 bits of the binary sequence until 512 bits of conversion are completed to obtain a conversion sequence; Remove duplicate integers in the conversion sequence, and supplement the missing unique numbers in the conversion sequence from the range of 0 to 255, so as to ensure that the conversion sequence is a sequence of 256 unique integers; and arrange them into a two-dimensional matrix of 8 rows and 32 columns; The elements of each two-dimensional matrix are permuted through the initial permutation table of the DES algorithm to complete the replacement of input bits and output bits.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, it implements the microservice interface data transmission method based on intranet node penetration technology as described in any one of claims 1 to 8.
10. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the microservice interface data transmission method based on intranet node penetration technology as described in any one of claims 1 to 8 when executed by a computer processor.