Data transmission method and device based on open system interconnection, equipment and medium

By deploying a tunneling protocol at the transport layer to encrypt SQL statements, the compatibility issues between transparent database encryption and application aspect-oriented encryption in existing technologies are resolved, achieving efficient and secure data transmission and reducing system transformation costs.

CN121770880APending Publication Date: 2026-03-31CETC CYBERSPACE SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-31
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies have limitations in security during data transmission. Transparent encryption technology for databases has security limitations, while aspect-oriented encryption technology may cause database disorder. Both technologies require modification of application or database configuration, resulting in high development costs and poor system compatibility.

Method used

By deploying a tunneling protocol at the transport layer and encrypting SQL statements using the Open Systems Interconnection (OSI) model, encrypted data packets can be generated without modifying application layer code or server-side database configuration, directly encrypting the target SQL statement.

Benefits of technology

It reduces encryption computation overhead, improves the security and stability of data transmission, lowers system modification and deployment costs, adapts to different development languages ​​and database types, and improves compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121770880A_ABST
    Figure CN121770880A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method and device based on open system interconnection, equipment and a medium, and relates to the technical field of data security, and the method comprises the steps: determining a data reading request for target data in a preset database of a server, and generating a corresponding target structured query statement, encrypting the target structured query statement through a transmission layer of an open system interconnection model by using a preset tunnel protocol to obtain encrypted information, transmitting a first data packet generated based on the encrypted information to a server side by using the open system interconnection model, and receiving target data returned by the server side; wherein the preset tunnel protocol is a network protocol constructed based on a transmission control protocol or a user datagram protocol between the client and the server. The tunnel protocol is directly deployed on the transmission layer to encrypt the SQL statement, full encryption does not need to be performed on the whole data packet, the calculation overhead is reduced, application layer service codes and server database configuration do not need to be changed, and the universality of the technical scheme is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security technology, and in particular to data transmission methods, apparatus, devices and media based on Open Systems Interconnection. Background Technology

[0002] With the rapid development of information technology, data security has become an important issue of concern for enterprises and individuals, especially critical information stored in databases, such as mobile phone numbers, ID cards, and other sensitive information.

[0003] To ensure data security, many security solutions and technologies have been developed. For example, transparent database encryption works within the database itself, encrypting data while it's on disk, but keeping it plaintext during memory operations. This means data is encrypted when written to disk and automatically decrypted upon retrieval, eliminating the need for additional encoding operations by applications and users. However, because encryption occurs at storage time, the data remains plaintext throughout its flow before being stored, limiting security. Furthermore, the increased resource consumption of encryption and decryption can impact database performance and extend recovery time. Application-oriented encryption, on the other hand, operates within enterprise applications. It deploys data security plugins in application service middleware, intercepting incoming SQL (Structured Query Language) queries and using policies from a bypass management platform to encrypt data before storing it in the database. However, due to the fault tolerance and diversity of databases, data not processed through application-oriented encryption can lead to more complex problems, such as data corruption, potentially resulting in irreversible data loss. It also requires support from the application or database for specific scenarios, such as application adaptations or database changes to table structures or data field types. Therefore, how to provide a more effective data encryption technology to achieve secure transmission of sensitive information is a problem that needs to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a data transmission method, apparatus, device, and medium based on Open Systems Interconnection (OSI), which directly deploys a tunneling protocol at the transport layer to encrypt SQL statements, eliminating the need for full encryption of the entire data packet, reducing computational overhead, and requiring no modification to application-layer business code and server-side database configuration, thus improving the versatility of the technical solution. The specific solution is as follows:

[0005] Firstly, this application provides a data transmission method based on Open Systems Interconnection (OSI), applied to a client, including:

[0006] A data read request for the target data is determined, and a corresponding target structured query statement is generated based on the data read request; the target data is data in a preset database on the server.

[0007] The target structured query statement is encrypted using a preset tunneling protocol through the transport layer of the Open Systems Interconnection model to obtain encrypted information, and a first data packet is generated based on the encrypted information; the preset tunneling protocol is a network protocol built on the Transmission Control Protocol or User Datagram Protocol between the client and the server.

[0008] The first data packet is transmitted to the server using the Open Systems Interconnection model, and the target data returned by the server is received; the target data is the data queried by the server based on the target structured query statement corresponding to the first data packet.

[0009] Optionally, the step of encrypting the target structured query statement through the transport layer of the Open Systems Interconnection model using a preset tunneling protocol to obtain encrypted information includes:

[0010] Using the transport layer of the Open Systems Interconnection model, determine whether the target structured query statement is a statement used to query the target data in the preset database of the server;

[0011] If so, the target structured query statement is encrypted using the preset tunneling protocol to obtain the encrypted information.

[0012] Optionally, encrypting the target structured query statement using the preset tunneling protocol to obtain the encrypted information includes:

[0013] The target structured query statement is parsed, and the first information and the second information in the target structured query statement are determined based on the parsing results; the first information is sensitive information determined based on preset sensitive information determination rules.

[0014] The first information is encrypted using the preset encryption algorithm corresponding to the preset tunnel protocol to obtain the encrypted first information.

[0015] The encrypted information is constructed based on the encrypted first information and the second information.

[0016] Optionally, generating the first data packet based on the encrypted information includes:

[0017] Determine the packet header information and packet encapsulation format corresponding to the preset tunnel protocol; the packet encapsulation format includes packet verification information, and the packet header information includes a packet sequence number;

[0018] The first data packet is generated based on the encrypted information using the data packet header information and the data packet encapsulation format.

[0019] Optionally, before receiving the target data returned by the server, the method further includes:

[0020] If an error message is received from the server, the first data packet is transmitted back to the server using the Open Systems Interconnection model.

[0021] The data error information is generated by the server after it fails to verify the data packet verification information in the first data packet.

[0022] Optionally, before receiving the target data returned by the server, the method further includes:

[0023] If a data loss information is received from the server, a new first data packet is determined based on the data loss information, and the new first data packet is transmitted to the server using the Open Systems Interconnection model.

[0024] The data loss information is generated by the server after detecting the sequence number of the data packet in the first data packet.

[0025] Optionally, receiving the target data returned by the server includes:

[0026] Receive the second data packet returned by the server; the second data packet is a data packet obtained by the server after encrypting the target data through the transport layer of the Open Systems Interconnection model using the preset tunneling protocol;

[0027] The second data packet is decrypted to obtain the target data.

[0028] Secondly, this application provides a data transmission device based on Open Systems Interconnection (OSI), applied to a client, comprising:

[0029] The statement generation module is used to determine the data reading request for the target data and generate a corresponding target structured query statement based on the data reading request; the target data is data in a preset database on the server.

[0030] The statement encryption module is used to encrypt the target structured query statement through the transport layer of the Open Systems Interconnection model using a preset tunneling protocol to obtain encrypted information, and generate a first data packet based on the encrypted information; the preset tunneling protocol is a network protocol built based on the Transmission Control Protocol or User Datagram Protocol between the client and the server.

[0031] The data receiving module is used to transmit the first data packet to the server using the Open Systems Interconnection model, and to receive the target data returned by the server; the target data is the data queried by the server based on the target structured query statement corresponding to the first data packet.

[0032] Thirdly, this application provides an electronic device, which includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the aforementioned data transmission method based on Open Systems Interconnection.

[0033] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned data transmission method based on Open Systems Interconnection.

[0034] This application can determine a data read request for target data in a preset database on the server, generate a corresponding target structured query statement based on the data read request, encrypt the target structured query statement through the transport layer of the Open Systems Interconnection (OSI) model using a preset tunneling protocol to obtain encrypted information, generate a first data packet based on the encrypted information, transmit the first data packet to the server using the OSI model, and receive the target data retrieved by the target structured query statement corresponding to the first data packet returned by the server; wherein, the preset tunneling protocol is a network protocol built based on the Transmission Control Protocol or User Datagram Protocol between the client and the server.

[0035] In other words, this application mainly utilizes the transport layer of the Open Systems Interconnection (OSI) model to achieve secure data processing. The client can determine the read request for target data in the server's preset database, generate the corresponding SQL statement accordingly, and then call the preset tunnel protocol to perform encryption on the target structured query statement in the transport layer of the OSI model, generating a first data packet that can be transmitted over the network. The first data packet is then sent to the server through the OSI model. After the server completes the data query based on the encrypted query statement in the data packet, it receives the target data returned by the server. This approach solves the problems of high development costs and poor system compatibility caused by the need for separate encryption plugins to be adapted for different application systems in existing application-layer encryption schemes. The tunnel protocol can be deployed directly at the transport layer without modifying the client application layer code, adapting to various application systems. It directly encrypts the target SQL statements at the transport layer, ensuring that database query commands are encrypted throughout the transmission process, without requiring full encryption of the entire data packet. This reduces the client's encryption computation overhead, avoids transmission delays caused by excessive encryption, and guarantees the response efficiency of data read requests. At the same time, the tunnel protocol retains the reliable or efficient transmission characteristics of the transport layer, balancing security and transmission stability. Furthermore, it requires no modification to the application layer business code or server-side database configuration, adapting to client applications with different programming languages ​​and different types of server-side databases, significantly reducing system modification and deployment costs and improving compatibility. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0037] Figure 1 A flowchart illustrating a data transmission method based on Open Systems Interconnection (OSI) provided in this application;

[0038] Figure 2 A schematic diagram of an open systems interconnection model provided in this application;

[0039] Figure 3 A schematic diagram of a data transmission device based on Open Systems Interconnection (OSI) provided for this application;

[0040] Figure 4 This application provides a structural diagram of an electronic device. Detailed Implementation

[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0043] Currently, among relevant data encryption technologies, transparent database encryption encrypts data during storage, but the data remains in plaintext throughout the data flow before being stored in the database, which has certain limitations in terms of security. Application-oriented encryption is used in internal enterprise applications, but due to the fault tolerance and diversity of databases, more complex problems such as data corruption may occur when data is not processed through application-oriented encryption. This application, however, can directly deploy a tunneling protocol at the transport layer without modifying the client application layer code, adapting to various application systems. It also directly encrypts the target SQL statement at the transport layer, ensuring that database query commands are encrypted throughout the transmission process. Furthermore, it significantly reduces system modification and deployment costs and improves versatility.

[0044] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0045] See Figure 1 As shown, this embodiment of the invention discloses a data transmission method based on Open Systems Interconnection (OSI), applied to a client, including:

[0046] Step S11: Determine the data read request for the target data, and generate a corresponding target structured query statement based on the data read request; the target data is data in the preset database of the server.

[0047] In this embodiment, data transmission can be achieved based on Open Systems Interconnection (OSI, Open Systems Internet Model), such as... Figure 2As shown, the network mainly includes: external network, internal network, and the OSI model. The external network refers to the user's operating terminal; as the user requesting party, its operation and use cannot be directly interfered with. The internal network includes: application systems, which act as the called end, i.e., the server; the called application systems are internal applications of the server; application servers and application data, which are used to identify the information carrying the internal applications, and their content cannot be directly interfered with. Network data transmission is based on the OSI model. The OSI model is a standardized framework for understanding and describing computer network architecture. This model divides computer network communication into seven different layers, each performing a specific function, and each layer depends on the services of the layer below it. Specifically, it includes: the OSI model's first layer, the physical layer, whose main function is to provide physical connections for the data link layer using transmission media, enabling transparent transmission of bit streams; the OSI model's second layer, the data link layer, responsible for establishing and managing links between nodes, whose main function, based on the bit streams provided by the physical layer, uses error control and flow control methods to transform error-prone physical lines into error-free data links; and the OSI model's third layer, the network layer, which provides services to resource subnets based on the lower two layers, whose main function, in addition to the data frame transmission function provided by the data link layer between two adjacent endpoints, further manages data communication in the network and controls information forwarding between the data link layer and the transport layer. In other words, data from the data link layer is converted into data packets at this layer, and then, through path selection, segmentation and reassembly, and sequencing control, information is transmitted from one network device to another. The fourth layer, the transport layer, acts as a bridge between the lower three layers of the OSI model for data communication and the upper three layers for data application. Its main function is to provide end-to-end data transmission services, ensuring data reliability and integrity. The transport layer contains many core modules, such as connection management, end-to-end and reassembly, sequence numbering and acknowledgment, flow control, and transport layer tunneling protocol modules. The transport layer tunneling protocol module is mainly responsible for data carrying and subsequent service implementation. The fifth layer, the session layer, is the interface between user applications and the network. Its main function is to organize and coordinate communication between two session processes and manage data exchange. The sixth layer, the presentation layer, is mainly responsible for data formatting and encoding / decoding, as well as data encryption and decryption. It is mainly suitable for situations requiring general data protection, such as SSL / TLS (Secure Sockets Layer / Transport Layer Security) and WinRAR. The seventh layer, the application layer, is the interface between computer users and various applications and the network. Its main function is to provide network services for user applications and enable users to perform various tasks on the network.

[0048] Based on the above, this embodiment first determines the data read request for the target data and generates a corresponding target structured query statement, i.e., SQL, based on the data read request. The target data is data in a pre-set database on the server. It is understood that SQL parsing is based on the encryption and decryption of sensitive database data. Therefore, this embodiment primarily focuses on the database operation layer. Sensitive information data in the SQL can be extracted using this SQL parsing capability, and custom encryption and decryption functions are then applied to this sensitive information data. This ensures that only the sensitive data under database operations is encrypted during the entire transmission process, while the contents of other original packets remain visible. It should be noted that the above operation is not limited to the specific scenario of reading database information; other data transmission scenarios can also be implemented using this embodiment, which will not be elaborated upon here. Furthermore, the technical solution in this embodiment can be applied to scenarios where databases require key protection, scenarios integrating multiple database services, scenarios with distributed databases deployed in multiple locations, and enterprise intranet database scenarios, etc.

[0049] Step S12: Encrypt the target structured query statement through the transport layer of the Open Systems Interconnection model using a preset tunneling protocol to obtain encrypted information, and generate a first data packet based on the encrypted information; the preset tunneling protocol is a network protocol built based on the Transmission Control Protocol or User Datagram Protocol between the client and the server.

[0050] In this embodiment, a preset tunneling protocol can be used to encrypt the target structured query statement through the transport layer of the Open Systems Interconnection (OSI) model to obtain encrypted information, and a first data packet is generated based on the encrypted information. It should be noted that the aforementioned preset tunneling protocol is a network protocol built on the Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) between the client and server. Specifically, based on the previous step, this embodiment mainly focuses on the database operation layer. Therefore, the transport layer of the OSI model can be used to determine whether the target structured query statement is a statement used to query target data in a preset database on the server; if so, the preset tunneling protocol is used to encrypt the target structured query statement to obtain encrypted information.

[0051] Specifically, the target structured query statement can be parsed, and the first and second information in the target structured query statement can be determined based on the parsing results. The first information is sensitive information determined based on preset sensitive information determination rules, such as "mobile phone number" and "ID card number". Then, the first information is encrypted using a preset encryption algorithm corresponding to a preset tunnel protocol to obtain encrypted first information. Then, encrypted information is constructed based on the encrypted first and second information. In this embodiment, by integrating external, internal, and general encryption and decryption components, and combining them with the parsed original data packet content, custom encryption and decryption of specified data can be completed. This allows sensitive data in the data packet to be subject to targeted security rules. In addition, with the padding of the data packet, the entire data packet can be generated according to certain internal rules, thereby achieving a high level of security in the entire data transmission process. Therefore, when generating the first data packet based on the encrypted information, the data packet header information and data packet encapsulation format corresponding to the preset tunnel protocol can be determined. The data packet encapsulation format includes data packet verification information, and the data packet header information includes the data packet sequence number. Then, the first data packet is generated based on the encrypted information using the data packet header information and the data packet encapsulation format. In this way, since this embodiment is based on sensitive data encryption and decryption during network transmission, it does not rely on applications or databases. The encryption and decryption operations are completed within the network. For the database, sensitive data is ciphertext upon entry and decrypted during transmission, making it plaintext for the application. This achieves the goal of being unaware of and non-intrusive to both the application and the database, solving the compatibility issues of application-oriented encryption / decryption and transparent database encryption / decryption, and effectively improving the solution's compatibility. Furthermore, this embodiment can reconstruct the content and structure of data packets during transmission. The simpler the database structure, the faster the performance optimization during network transmission. For example, when using the Hypertext Transfer Protocol (HTTP) for encrypted transmission, the information in the data packet is ciphertext, and the original packet size increases exponentially, significantly degrading performance during frequent interactions. However, this embodiment uses a custom transmission channel structure, greatly optimizing the length of transmitted data packets, increasing data transmission rate, and contributing to network performance optimization.

[0052] In other words, this embodiment can utilize a custom tunneling protocol, i.e., a preset tunneling protocol, to achieve encrypted data transmission. This custom tunneling protocol operates above the transport layer, creating a tunnel to encapsulate the original data packets, enabling their transmission over the network. It is a network protocol built on TCP or UDP and possesses specific functions. Through this tunneling protocol, capabilities such as data interception, encryption / decryption, user privacy, security protection, threat blocking, and network optimization can be provided. Furthermore, when a custom tunneling protocol is suitable for providing a dedicated, potentially more complex and secure transmission mechanism for a more specific application or data stream, it can offer additional data-level functionality and finer-grained control. Meanwhile, the custom tunnel protocol mainly includes the following structure: header information, including version number, encapsulation type, sequence number, length, etc.; encryption / decryption and authentication, defining custom encryption / decryption and authentication algorithms and methods, such as those based on ECB (Electronic Codebook), FPE (Format-Preserving Encryption), GCM (Galois / Counter Mode), etc.; encapsulation format, encapsulating the original data packet, including header, trailer, padding, etc., which can form its own communication by adding content or information, preventing illegal use after packet capture, and achieving functions such as privacy protection, attack protection, and danger blocking; and error handling mechanism, handling errors and packet loss during transmission. In this way, by using custom encryption / decryption algorithms to encrypt sensitive data and using custom padding technology for network communication, data security can be effectively improved. At the same time, the custom tunnel protocol can improve the overall efficiency and performance of network communication, and simultaneously achieve custom security protection and user privacy in network communication.

[0053] Step S13: Use the Open Systems Interconnection model to transmit the first data packet to the server and receive the target data returned by the server; the target data is the data queried by the server based on the target structured query statement corresponding to the first data packet.

[0054] In this embodiment, the Open Systems Interconnection (OSI) model can be used to transmit the first data packet to the server and receive the target data returned by the server. The target data is the data retrieved by the server based on the target structured query statement corresponding to the first data packet. Furthermore, the custom tunneling protocol from the previous step is used to handle transmission errors and packet loss. Specifically, before receiving the target data returned by the server, if data error information is received from the server, the first data packet is retransmitted to the server using the OSI model; the data error information is generated by the server after failing to verify the data packet verification information in the first data packet. Also, before receiving the target data returned by the server, if data loss information is received from the server, a new first data packet is determined based on the data loss information, and the new first data packet is transmitted to the server using the OSI model; the data loss information is generated by the server after detecting the data packet sequence number in the first data packet.

[0055] It should be noted that the transport layer encryption scheme in this embodiment applies not only to the client but also to the server. That is, after receiving the target data packet, the server can decrypt it to obtain the corresponding SQL, query the database for the relevant data, and then encrypt the sensitive data within the queried data using its own transport layer before returning it to the client. The client's transport layer then receives the encrypted sensitive data, decrypts it, and obtains the target data. Specifically, receiving the target data returned by the server requires receiving a second data packet from the server. This second data packet is obtained by the server encrypting the target data through the transport layer of the Open Systems Interconnection (OSI) model using a preset tunneling protocol. The second data packet is then decrypted to obtain the target data.

[0056] In a specific embodiment, assuming the above technical solution is applied to a target enterprise, this enterprise has two core systems: a front-end application, i.e., the system used by employees; and a back-end database, which stores customer information. The sensitive data requiring protection are "customer mobile phone numbers" and "ID card numbers." Through the technical solution in this embodiment, when employees query customer information, the data transmission is not eavesdropped on, and no code changes or adjustments to the table structures of the two databases are required. Specifically, the employee first initiates a database operation request, such as "query information for customer ID=XXXX." After clicking "query," an SQL statement is generated and sent to the database. This request can be transmitted through the network protocol stack, passing through the application layer and presentation layer, and finally reaching the transport layer of the OSI model. Then, the transport layer uses a custom tunnel to intercept data packets. The tunnel protocol detects this request being sent to the database through port and protocol characteristics, i.e., parses the SQL statement, obtains the corresponding sensitive fields, and calls the GCM encryption algorithm to encrypt the sensitive data, while keeping the ordinary data in plaintext. This is then encapsulated in a custom format to form a secure data packet, which is transmitted from the transport layer through the network layer and link layer to the database server. At this point, when the secure data packet is transmitted over the public network or the enterprise intranet, even if it is captured, it cannot be cracked. Existing database transparent encryption technology still uses plaintext for sensitive data in this packet. Later, when the secure data packet reaches the database server's transport layer, a custom tunnel protocol intercepts the packet again. It first verifies the trailing checksum to confirm the packet's security, then decrypts it using the corresponding key based on the encryption algorithm identifier in the header, restoring the original SQL statement. This is then directly forwarded to the database for query execution. Therefore, since the database receives the plaintext SQL, it does not need to change its configuration or table structure. After the database executes the query and returns the result, it packages the result into a data packet and transmits it from the database to the transport layer. At this point, the custom tunnel intercepts again, encrypts the "phone number" and "ID number," encapsulates them into a secure data packet, and transmits it to the user system's transport layer. The user system's transport layer receives this packet, decrypts it, and restores the plaintext result to display normal information.

[0057] Through the above technical solution, this embodiment can intercept and parse database operations during data transmission at the transport layer, and perform customized encryption and decryption on sensitive data accordingly. This not only protects static database data but also safeguards data security during transmission, preventing interception and eavesdropping, and effectively protecting database data security. In other words, this embodiment ensures controllable and secure data transmission through transport-layer-based encryption and decryption. By incorporating a custom encryption algorithm, it extracts key database SQL operations from the original data packets, performs SQL parsing, extracts sensitive data, and encrypts and decrypts the sensitive data, ensuring data transmission security. Furthermore, transport-layer-based encrypted data transmission is not limited by the database or application, effectively improving compatibility. It is also not directly related to the database itself or system applications, enabling non-intrusive database data encryption and decryption.

[0058] See Figure 3 As shown in the embodiments, this application also discloses a data transmission device based on Open Systems Interconnection (OSI), applied to a client, including:

[0059] The statement generation module 11 is used to determine a data reading request for the target data and generate a corresponding target structured query statement based on the data reading request; the target data is data in a preset database on the server.

[0060] The statement encryption module 12 is used to encrypt the target structured query statement through the transport layer of the Open Systems Interconnection model using a preset tunneling protocol to obtain encrypted information, and generate a first data packet based on the encrypted information; the preset tunneling protocol is a network protocol built based on the Transmission Control Protocol or User Datagram Protocol between the client and the server.

[0061] The data receiving module 13 is used to transmit the first data packet to the server using the Open Systems Interconnection model, and to receive the target data returned by the server; the target data is the data queried by the server based on the target structured query statement corresponding to the first data packet.

[0062] In this embodiment, data security processing is achieved using the transport layer of the Open Systems Interconnection (OSI) model. The client determines a read request for target data in a preset database on the server and generates a corresponding SQL statement accordingly. Then, a preset tunneling protocol is invoked to encrypt the target structured query statement at the transport layer of the OSI model, generating a first data packet that can be transmitted over the network. The first data packet is then sent to the server via the OSI model. After the server completes the data query based on the encrypted query statement in the data packet, it receives the target data returned by the server. This approach allows for direct deployment of the tunneling protocol at the transport layer without modifying the client application layer code. It adapts to various application systems and directly encrypts the target SQL statements at the transport layer, ensuring that database query commands remain encrypted throughout transmission. Furthermore, it eliminates the need for full encryption of the entire data packet, reducing client-side encryption overhead and avoiding transmission delays caused by excessive encryption. This guarantees efficient response to data read requests. Simultaneously, the tunneling protocol retains the reliable or efficient transmission characteristics of the transport layer, balancing security and transmission stability. Moreover, it requires no modification to the application layer business code or server-side database configuration, making it adaptable to client applications using different programming languages ​​and different types of server-side databases. This significantly reduces system modification and deployment costs and enhances the versatility of the technical solution.

[0063] In some specific embodiments, the statement encryption module 12 specifically includes:

[0064] The statement encryption submodule is used to determine whether the target structured query statement is a statement used to query the target data in the preset database of the server using the transport layer of the Open Systems Interconnection model; if so, the target structured query statement is encrypted using the preset tunneling protocol to obtain the encrypted information.

[0065] In some specific embodiments, the statement encryption submodule specifically includes:

[0066] The statement parsing unit is used to parse the target structured query statement and determine the first information and the second information in the target structured query statement based on the obtained parsing results; the first information is sensitive information determined based on preset sensitive information determination rules;

[0067] The information encryption unit is used to encrypt the first information using a preset encryption algorithm corresponding to the preset tunnel protocol to obtain the encrypted first information.

[0068] An information construction unit is used to construct the encrypted information based on the encrypted first information and the second information.

[0069] In some specific embodiments, the statement encryption module 12 specifically includes:

[0070] The format determination unit is used to determine the data packet header information and data packet encapsulation format corresponding to the preset tunnel protocol; the data packet encapsulation format includes data packet verification information, and the data packet header information includes a data packet sequence number;

[0071] The information encapsulation unit is used to generate the first data packet based on the encrypted information using the data packet header information and the data packet encapsulation format.

[0072] In some specific embodiments, the data receiving module 13 further includes:

[0073] The first data transmission unit is configured to, if it receives data error information returned by the server, retransmit the first data packet to the server using the Open Systems Interconnection model; wherein the data error information is generated by the server after failing to verify the data packet verification information in the first data packet.

[0074] In some specific embodiments, the data receiving module 13 further includes:

[0075] The second data transmission unit is configured to, if it receives data loss information returned by the server, determine a new first data packet based on the data loss information, and transmit the new first data packet to the server using the Open Systems Interconnection model; wherein the data loss information is information generated by the server after detecting the data packet sequence number in the first data packet.

[0076] In some specific embodiments, the data receiving module 13 specifically includes:

[0077] A data receiving unit is configured to receive a second data packet returned by the server; the second data packet is a data packet obtained by the server after encrypting the target data through the transport layer of the Open Systems Interconnection model using the preset tunneling protocol;

[0078] A data decryption unit is used to decrypt the second data packet to obtain the target data.

[0079] Furthermore, embodiments of this application also disclose an electronic device, Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0080] Figure 4This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the data transmission method based on Open Systems Interconnection disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0081] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0082] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0083] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the open systems interconnect-based data transmission method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0084] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned data transmission method based on Open Systems Interconnection (OSI). Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0085] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0086] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0087] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0088] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0089] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data transmission method based on open systems interconnection, characterized by, The application is applied to a client, comprising: determining a data read request for target data, and generating a corresponding target structured query statement based on the data read request; the target data is data in a preset database of a server; encrypting the target structured query statement through a transmission layer of an open system interconnection model using a preset tunnel protocol to obtain encrypted information, and generating a first data packet based on the encrypted information; the preset tunnel protocol is a network protocol constructed based on a transmission control protocol or a user datagram protocol between the client and the server; transmitting the first data packet to the server using the open system interconnection model, and receiving the target data returned by the server; the target data is data queried by the server based on the target structured query statement corresponding to the first data packet.

2. The OSI-based data transmission method of claim 1, wherein, The method comprises the following steps: determining whether the target structured query statement is a statement for querying the target data in the preset database of the server using the transmission layer of the open system interconnection model; if yes, encrypting the target structured query statement using the preset tunnel protocol to obtain the encrypted information.

3. The OSI-based data transmission method of claim 2, wherein, The method comprises the following steps: parsing the target structured query statement, and determining first information and second information in the target structured query statement based on the obtained parsing result; the first information is sensitive information determined based on a preset sensitive information determination rule; encrypting the first information using a preset encryption algorithm corresponding to the preset tunnel protocol to obtain encrypted first information; constructing the encrypted information based on the encrypted first information and the second information.

4. The data transmission method based on open system interconnection according to claim 3, wherein, The method comprises the following steps: determining data packet header information and data packet encapsulation format corresponding to the preset tunnel protocol; the data packet encapsulation format comprises data packet check information, and the data packet header information comprises a data packet sequence number; generating the first data packet based on the encrypted information using the data packet header information and the data packet encapsulation format.

5. The OSI-based data transmission method of claim 4, wherein, Before receiving the target data returned by the server, the method further comprises the following steps: if data error information returned by the server is received, retransmitting the first data packet to the server using the open system interconnection model; wherein the data error information is information generated after the server fails to check the data packet check information in the first data packet.

6. The OSI-based data transmission method of claim 4, wherein, Before receiving the target data returned by the server, the method further comprises the following steps: if data loss information returned by the server is received, determining a new first data packet based on the data loss information, and transmitting the new first data packet to the server using the open system interconnection model; wherein the data loss information is information generated after the server detects the data packet sequence number in the first data packet.

7. The data transmission method based on open systems interconnection according to any one of claims 1 to 6, characterized in that, The receiving the target data returned by the server comprises: receiving a second data packet returned by the server; the second data packet is a data packet obtained by the server encrypting the target data through the transmission layer of the open system interconnection model using the preset tunnel protocol; decrypting the second data packet to obtain the target data.

8. An OSI-based data transmission apparatus, characterized by Applied to a client, comprising: a statement generation module configured to determine a data read request for target data and generate a corresponding target structured query statement based on the data read request; the target data is data in a preset database of a server; a statement encryption module configured to encrypt the target structured query statement through the transmission layer of the open system interconnection model using a preset tunnel protocol to obtain encrypted information, and generate a first data packet based on the encrypted information; the preset tunnel protocol is a network protocol constructed based on a transmission control protocol or a user datagram protocol between the client and the server; a data receiving module configured to transmit the first data packet to the server using the open system interconnection model, and receive the target data returned by the server; the target data is data queried by the server based on the target structured query statement corresponding to the first data packet.

9. An electronic device, comprising: The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, the computer program is loaded and executed by the processor to realize the open system interconnection based data transmission method as claimed in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer program is used to save, which is executed by a processor to realize the open system interconnection based data transmission method as claimed in any one of claims 1 to 7.