Data transmission method, gateway component, device, equipment and storage medium

By setting up a gateway component in the terminal, serializing and copying business data to the stack area, and transmitting it through the cloud server, combined with the encrypted session mechanism and interception filter mode, the problem of poor data transmission security in the existing technology is solved and the data is realized. Efficient and reliable transmission.

CN118784259APending Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310402588.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-06
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

In the existing technology, the data transmission security between the application and the business backend server is poor, the accuracy and integrity of the data cannot be effectively guaranteed, and the data transmission is susceptible to the risk of third-party tampering.

Method used

Set up a gateway component in the terminal to obtain and serialize business data, copy it to the stack area to protect the data from tampering, and send the data to the business backend server through the cloud server, using the encrypted session mechanism and interception filter mode to ensure data transmission security.

Benefits of technology

It effectively prevents data from being tampered with before transmission, improves the security and accuracy of data transmission, reduces the probability of network failure, and enhances the data protection mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118784259A_ABST
    Figure CN118784259A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method, a gateway component, a device, equipment and a storage medium, and relates to the technical field of network security. The method is executed by a terminal through a gateway component in a terminal device. The method comprises the following steps: acquiring first service data generated by a target application program in the terminal; generating a first target object corresponding to the first business data; copying the first target object to obtain a second target object, and storing the second target object to a stack area of the gateway component; the stack area is used for protecting the second target object from being tampered; and sending the second target object to a cloud server of the gateway component. According to the scheme, the security of data transmission can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of network security technology, and in particular to a data transmission method, gateway component, device, equipment and storage medium. Background Art

[0002] With the continuous development of network technology, many applications currently need to interact with business backend servers on the network side for business data.

[0003] In the related art, the data security between the application and the business backend server is mainly achieved through network security devices. Specifically, for example, the sender and the receiver are each provided with a network security device. On the sending side, the sender's security device overwrites the specific fields of the sender's source Media Access Control (MAC) address and / or source Internet Protocol (IP) address in the data packet based on the pre-stored address overwriting strategy of the two communicating parties, and generates a virtualized MAC address and / or a virtualized IP address; on the receiving side, the receiver parses and identifies the receiver's virtualized MAC address and / or virtualized IP address in the received data packet based on the above-mentioned address overwriting strategy of the two communicating parties, and authenticates the receiver based on the parsing and identification results.

[0004] However, in the above scheme, the receiver can only determine whether the sender is correct through the address of the data packet, and cannot guarantee the accuracy of the data, resulting in poor security of business data. Summary of the invention

[0005] The embodiments of the present application provide a data transmission method, a gateway component, an apparatus, a device, and a storage medium, which can improve the security of data transmission. The technical solution is as follows:

[0006] According to one aspect of an embodiment of the present application, a data transmission method is provided, the method being executed by a terminal through a gateway component in the terminal device, the method comprising:

[0007] Acquire first service data generated by a target application in the terminal;

[0008] Generate a first target object corresponding to the first business data; the first target object includes serialized data obtained by serializing the first business data;

[0009] Copying the first target object to obtain a second target object and storing the second target object in a stack area of ​​the gateway component; the stack area is used to protect the second target object from being tampered with;

[0010] The second target object is sent to the cloud server of the gateway component so that the cloud server sends the second target object to the business backend server of the target application.

[0011] According to one aspect of an embodiment of the present application, a data transmission method is provided, the method being executed by a cloud server of a gateway component in a terminal device, the method comprising:

[0012] receiving a second target object sent by the terminal; the second target object is a target object obtained by the gateway component from first business data generated by a target application in the terminal, generating a first target object corresponding to the first business data, copying the first target object and storing it in a stack area of ​​the gateway component; the first target object includes serialized data obtained by serializing the first business data; the stack area is used to protect the second target object from being tampered with;

[0013] Determine the business backend server of the target application;

[0014] Send the second target object to the business backend server.

[0015] According to one aspect of an embodiment of the present application, a gateway component is provided, the gateway component comprising:

[0016] A data acquisition module, used to acquire first business data generated by a target application in a terminal;

[0017] An object generation module, configured to generate a first target object corresponding to the first business data; the first target object includes serialized data obtained by serializing the first business data;

[0018] An object copy module, used to copy the first target object, obtain a second target object and store it in a stack area of ​​the gateway component; the stack area is used to protect the second target object from being tampered with;

[0019] The sending module is used to send the second target object to the cloud server of the gateway component, so that the cloud server sends the second target object to the business background server of the target application.

[0020] In a possible implementation, the object generation module is used to:

[0021] In response to receiving a network request generated by the target application and containing the first business data, creating a filter chain corresponding to the network request; the filter chain includes at least one business data filter; the business data filter is used to assemble a corresponding business data structure;

[0022] Inputting the first business data into the filter chain;

[0023] The filter chain is assembled into the first target object.

[0024] In a possible implementation manner, the device further includes:

[0025] The obfuscation module is used to obfuscate the device name called by the target object during the filter chain transmission process.

[0026] In a possible implementation, the object generation module is used to:

[0027] Verifying the serialized data;

[0028] In response to the serialized data being verified to be passed, the filter chain is assembled into the first target object.

[0029] In a possible implementation, the object generation module is used to:

[0030] Acquire a verification rule corresponding to the business type of the first business data;

[0031] Based on the verification rule, verify the serialized data;

[0032] The verification rule includes at least one of the following information:

[0033] Data structure, data type, value range and data length.

[0034] In a possible implementation manner, the device further includes:

[0035] A failure information output module, configured to output verification failure information in response to failure of verification of the serialized data;

[0036] The verification failure information is used to indicate at least one of the following information:

[0037] The first business data, the business corresponding to the first business data, the network request corresponding to the first business data, and the verification rule of the verification failure.

[0038] In a possible implementation manner, in response to the first service data satisfying a specified condition, the apparatus further includes:

[0039] A key acquisition module, used to acquire a first key of a first service corresponding to the first service data;

[0040] The sending module is used to send the first key and the second target object to the cloud server, so that the cloud server encrypts the first key by using the first public key to obtain an encryption key, encrypts the serialized data in the second target object by using the first key to obtain the encrypted second target object, and sends the encryption key and the encrypted second target object to the business backend server of the target application;

[0041] The device also includes:

[0042] A receiving module, used to receive the encrypted session identifier returned by the cloud server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key with the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier with the first key;

[0043] A decryption module, used for decrypting the encrypted session identifier according to the first key to obtain the session identifier;

[0044] A transmission module is used to transmit the first service between the cloud server and the service backend server based on the session identifier and the first key.

[0045] In a possible implementation, the specified condition includes at least one of the following conditions:

[0046] The first service data is service data corresponding to the first network request of the first service initiated after the target application is started;

[0047] Currently, there is no session corresponding to the first service;

[0048] Currently, a session of the first service exists, and the establishment duration of the current session of the first service reaches a specified duration.

[0049] According to one aspect of an embodiment of the present application, a data transmission device is provided, the device comprising:

[0050] The object receiving module is used to receive a second target object sent by the terminal; the second target object is a target object in the stack area of ​​the gateway component that obtains first business data generated by a target application in the terminal, generates a first target object corresponding to the first business data, copies the first target object and stores it in the first target object; the first target object contains serialized data obtained by serializing the first business data; the stack area is used to protect the second target object from being tampered with;

[0051] A determination module, used to determine the business backend server of the target application;

[0052] A sending module is used to send the second target object to the business backend server.

[0053] In a possible implementation, the object receiving module is configured to receive a first key of a first service corresponding to the first service data and the second target object, which are sent by the terminal;

[0054] The device also includes:

[0055] An encryption module, configured to encrypt the first secret key by using a first public key to obtain an encryption key; and encrypt the serialized data in the second target object by using the first secret key to obtain the encrypted second target object;

[0056] The sending module is used to send the encryption key and the encrypted second target object to the business backend server;

[0057] The device also includes:

[0058] an identifier receiving module, used to receive the encrypted session identifier returned by the business backend server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key with the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier with the first key;

[0059] The sending module is also used to send the encrypted session identifier to the terminal, so that the terminal decrypts the encrypted session identifier according to the first key to obtain the session identifier, and based on the session identifier and the first key, transmits the first business between the cloud server and the business backend server.

[0060] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the above data transmission method.

[0061] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the above-mentioned data transmission method.

[0062] On the other hand, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the data transmission method provided in the above-mentioned various optional implementations.

[0063] The technical solution provided by the embodiments of the present application may have the following beneficial effects:

[0064] A gateway component is set up in the terminal for execution. The gateway component can obtain the first business data generated by the target application in the terminal, and generate a first target object including serialized data obtained by serializing the first business data; and copy the first target object to obtain the second target object and store it in the stack area of ​​the gateway component to protect the second target object from being tampered with, and then send the second target object to the business background server of the target application through the cloud server; in the above scheme, after the gateway component serializes the business data, it copies it to the stack area, and then sends the data in the stack area to the business background server through the cloud server. Since the data in the stack area can be prevented from being tampered with, this avoids the situation where the gateway component tampered with the data by a third party before sending it to the network, thereby improving data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

[0066] Figure 2 is a flow chart of a data transmission method provided by an embodiment of the present application;

[0067] Figure 3 It is a data transmission framework diagram involved in this application;

[0068] Figure 4 is a flow chart of a data transmission method provided by an embodiment of the present application;

[0069] Figure 5 yes Figure 4 A framework diagram of filter chain components involved in the illustrated embodiment;

[0070] Figure 6 is a flow chart of a data transmission method provided by an embodiment of the present application;

[0071] Figure 7 yes Figure 6 A schematic diagram of a data transmission process involved in the illustrated embodiment;

[0072] Figure 8 yes Figure 6A schematic diagram of the connection establishment and encrypted transmission process involved in the illustrated embodiment;

[0073] Fig. 9 It is a data transmission framework diagram involved in this application;

[0074] Fig.10 is a block diagram of a gateway component provided by an embodiment of the present application;

[0075] Fig.11 is a block diagram of a data transmission device provided by an embodiment of the present application;

[0076] Fig.12 is a structural block diagram of a computer device provided by an embodiment of the present application;

[0077] Fig.13 It is a structural block diagram of a computer device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0078] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0079] 1) Mobile Gateway: Mobile Gateway is a component product that connects the client and server API interfaces. It simplifies the data protocol and communication protocol of the API interface, and can significantly improve development efficiency and network communication efficiency. The mobile gateway of this solution is used to ensure that the business data generated by the customer's application is securely transmitted to the entire link of the business backend.

[0080] 2) Intercepting filter mode: used to do some pre-processing / post-processing on the application's request or response. Define filters and apply them to requests before passing them to the actual target application. Filters can do authentication / authorization / logging, or track requests, and then pass them to the corresponding handler. This solution uses the intercepting filter mode to provide client developers with a callable program interface for processing business data and standardizing return error codes.

[0081] 3) Cloud technology: refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or local area network to achieve data computing, storage, processing and sharing.

[0082] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0083] 4) Cloud Security: refers to the general term for security software, hardware, users, organizations, and security cloud platforms based on cloud computing business model applications. Cloud security integrates emerging technologies and concepts such as parallel processing, grid computing, and unknown virus behavior judgment. Through a large number of networked clients, it monitors abnormal software behavior in the network, obtains the latest information on Trojans and malicious programs on the Internet, and sends it to the server for automatic analysis and processing, and then distributes virus and Trojan solutions to each client.

[0084] The main research directions of cloud security include: 1. Cloud computing security, which mainly studies how to ensure the security of the cloud itself and various applications on the cloud, including cloud computer system security, secure storage and isolation of user data, user access authentication, information transmission security, network attack protection, compliance auditing, etc.; 2. Cloudification of security infrastructure, which mainly studies how to use cloud computing to build and integrate security infrastructure resources and optimize security protection mechanisms, including building a large-scale security event, information collection and processing platform through cloud computing technology, realizing the collection and correlation analysis of massive information, and improving the control ability of security events and risk control capabilities of the entire network; 3. Cloud security services, which mainly studies various security services provided to users based on cloud computing platforms, such as antivirus services.

[0085] Figure 1 A schematic diagram of an implementation environment provided by an exemplary embodiment of the present application is shown. The implementation environment may include: a first terminal 110, a cloud server 120, and a business backend server 130.

[0086] Among them, the server involved above can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.

[0087] Specifically, the first terminal 110 installs and runs an application 111 and a gateway component 112, and the application 111 may be an application that has data interaction requirements with the business backend server 130. For example, the application 111 may be a financial application, a shopping application, an audio and video application, a game application, and the like.

[0088] Figure 1 Only one terminal is shown, but in different embodiments, there are multiple other terminals that can access the server 120. Optionally, there are one or more terminals corresponding to developers, and a development platform for developing the above-mentioned application 111 and gateway component 112 is installed on the terminal.

[0089] The first terminal 110 and other terminals are connected to the cloud server 120 via a wireless network or a wired network. The cloud server 120 is connected to the business backend server 130 via a wireless network or a wired network.

[0090] The cloud server 120 includes at least one of a single server, a server cluster consisting of multiple servers, a cloud computing platform, and a virtualization center. The cloud server 120 can provide a mobile gateway background function for the application running in the terminal. Optionally, the cloud server 120 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, the cloud server 120 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, the cloud server 120 and the terminal adopt a distributed computing architecture for collaborative computing. For example, the above-mentioned cloud server 120 can be a server corresponding to the gateway component 112.

[0091] In an illustrative example, the cloud server 120 includes a memory 121, a processor 122, a user account database 123, a gateway service module 124, and a user-oriented input / output interface (I / O interface) 125. The processor 122 is used to load instructions stored in the server 120 and process data in the user account database 123 and the gateway service module 124; the user account database 123 is used to store data of user accounts used by the first terminal 110 and other terminals, such as the user account's avatar, the user account's name, and the user account's level; the gateway service module 124 is used to provide mobile gateway background services (such as routing forwarding, signature verification, key exchange management, address scheduling, session management), etc.; the user-oriented I / O interface 125 is used to establish communication and exchange data with the first terminal 110 through a wireless network or a wired network.

[0092] The business backend server 130 includes at least one of a single server, a server cluster consisting of multiple servers, a cloud computing platform, and a virtualization center. The business backend server 130 may include providing background services for the application 111 running in the terminal. For example, the application 111 may put business data to the business backend server 130, which is processed by the business backend server 130. Accordingly, the business backend server 130 may return business data to the application 111 in the terminal. Optionally, the business backend server 130 undertakes the main computing work, and the terminal undertakes the secondary computing work; or, the business backend server 130 undertakes the secondary computing work, and the terminal undertakes the main computing work; or, the business backend server 130 and the terminal adopt a distributed computing architecture for collaborative computing.

[0093] In an illustrative example, the business backend server 130 includes a memory 131, a processor 132, a user account database 133, a business service module 134, and a user-oriented input / output interface (I / O interface) 135. The processor 132 is used to load instructions stored in the server 130 and process data in the user account database 133 and the business service module 134; the user account database 133 is used to store data of user accounts used by the first terminal 110 and other terminals, such as the user account's avatar, the user account's name, and the user account's level; the business service module 134 is used to provide background business processing services (for example, returning requested data to the application 111, updating the user's information or status, etc.), etc.; the user-oriented I / O interface 135 is used to establish communication and exchange data with the first terminal 110 through a wireless network or a wired network.

[0094] In the related art, the data transmission scheme between the application and the business backend server usually has the following two disadvantages:

[0095] 1) The business data sent by the network security device / gateway of the terminal to the business backend server may be data that has been tampered with inside the terminal. For example, the network security device obtains business data through hook hijacking technology and sends it to the business backend server, and other components or third-party libraries in the terminal may also use hook hijacking technology to obtain the above business data, and the hook function is generally loaded by the compilation order of the program. Therefore, in the above scheme, there is a situation where the hook function of other components or third-party libraries is compiled first, and the hook function of the network security device is compiled later. If other components or third-party libraries tamper with the hooked business data, the subsequent business data sent by the network security device to the business backend server is tampered data; this situation may cause user losses. For example, if the application is a bank or financial application, other components or third-party libraries may hijack the data of the transfer request or password modification request, and tamper with the transfer destination account or modified password in the request, resulting in property loss to the user.

[0096] 2) When network security devices are added to both the terminal side and the business backend server side, it is equivalent to compiling the address through a 2-layer proxy gateway, which will increase the probability of network failure, especially in poor network conditions, network request failure is likely to occur, thereby affecting the execution efficiency of the request.

[0097] The solutions shown in the subsequent embodiments of the present application can be applied in the field of cloud security. Through the mobile gateway service, business data in the terminal can be protected before and during the sending process to ensure data security in the transmission system.

[0098] Please refer to Figure 2 , which shows a flow chart of a data transmission method provided by an embodiment of the present application. For the sake of convenience, only the computer device that executes each step is introduced and described. The above-mentioned computer device may include a terminal, a cloud server and a business backend server; the above-mentioned terminal may run a target application and a gateway component; the above-mentioned terminal may be the above-mentioned Figure 1 The first terminal 110 shown in the figure, the cloud server and the business backend server can be the above Figure 1 The server 120 shown; the method may include the following steps:

[0099] Step 210: The terminal obtains first service data generated by a target application in the terminal.

[0100] The gateway component in the terminal may obtain the first business data generated by the target application in the terminal.

[0101] For example, after the target application generates the first business data, it can call an application programming interface (Application Programming Interface, API) in the gateway component to send the first business data to the gateway component.

[0102] The above-mentioned gateway component may be built into the target application, or the above-mentioned gateway component may also run outside the target application.

[0103] For example, the above-mentioned gateway component can be run in the terminal in the form of a plug-in or middleware of the target application.

[0104] Among them, the above-mentioned first business data can be generated by the target application and then sent to the gateway component; for example, the gateway component provides an API interface for submitting a network request to the target application, and the target application can call the API interface after generating the first business data. The gateway component obtains the above-mentioned first business data based on the target application's calling behavior of the API interface.

[0105] Step 220: The terminal generates a first target object corresponding to the first business data; the first target object includes serialized data obtained by serializing the first business data.

[0106] Among them, the gateway component in the terminal can generate a first target object corresponding to the first business data.

[0107] Among them, data serialization refers to converting the structure of an object / data into a specific format so that it can be transmitted over the network or stored in memory or a file.

[0108] The opposite operation of serialization is called deserialization, which refers to restoring objects / data from serialized data.

[0109] The data format of the serialized data may be a binary format, an Extensible Markup Language (XML) format, or a JavaScript Object Notation (JSON) format.

[0110] Step 230: The terminal copies the first target object, obtains the second target object and stores it in the stack area of ​​the gateway component; the stack area is used to protect the second target object from being tampered with.

[0111] The gateway component in the terminal may copy the first target object, obtain the second target object, and store the second target object in the stack area of ​​the gateway component.

[0112] In an embodiment of the present application, the above-mentioned gateway component can reject other components / third-party libraries, or reject any component / third-party library to change the data in the stack area (including modification, deletion, writing and other change operations).

[0113] A stack (English: stack), also known as a stack directly, is a special serial data structure in computer science. Its special feature is that it can only allow the addition of data (push) and output of data (pop) at one end of the linked serial or array (called the top pointer of the stack, in English, top). In addition, the stack can also be completed in the form of a one-dimensional array or a linked serial. Another relative operation mode of the stack is called a queue. Since the stack data structure only allows operations at one end, it operates according to the Last In First Out (LIFO) principle. A stack is a storage component, that is, the writing and reading of data does not require the provision of addresses, but the order of reading is determined by the order of writing.

[0114] In an embodiment of the present application, the gateway component copies the first target object, obtains the second target object and stores it in the stack area of ​​the gateway component. The stack area of ​​the gateway component protects the second target object to be sent to the business backend server from being tampered with. That is to say, after copying the first target object, the object subsequently sent by the gateway component becomes the second target object in the stack area, and the original first target object will not be sent by the gateway component. Even if the first target object is tampered with before the first business data is sent, it will not affect the data received by the business backend server.

[0115] In addition, the above-mentioned gateway component obtains the second target object by copying the first target object. In addition to protecting the business data to be sent from being tampered with, it can also avoid affecting the use of the first business data in the terminal. Specifically, after the target application generates the first business data, other legitimate components or third-party libraries in the terminal may also access the first business data due to business / functional needs. If the first target object is directly protected, it will affect the legitimate access of other components / third-party libraries to the first business data, thereby causing other legitimate processing operations of the first business data in the terminal to be unable to be executed, thereby affecting the normal operation of other functions that need to access the first business data. The solution shown in the embodiment of the present application, after copying the first target object, protects the obtained second target object, and does not add the first target object to the stack area of ​​the gateway component. After such processing, other components / third-party libraries in the terminal can also access the first target object, so that the functions that need to access the first business data can be normally executed.

[0116] In addition, the above scheme also includes: when retransmitting the first service data, the gateway component reads the second target object in the stack area and retransmits it.

[0117] Among them, if the network component fails to send the first business data to the cloud server, or the cloud server fails to send the second target object to the business background server, the network component may need to retransmit the above-mentioned second target object. At this time, the network component can directly reuse the second target object already existing in the stack for retransmission.

[0118] The above-mentioned gateway component copies the first target object, obtains the second target object, and stores the second target object in the stack area of ​​the gateway component. In addition to protecting the business data to be sent from being tampered with, when the first business data fails to be transmitted for the first time and the first business data is subsequently retransmitted, the second target object in the stack area can be directly reused. There is no need to re-serialize the first business data, and there is no need to worry about the first business data in the terminal being tampered with between the first transmission and the retransmission. Therefore, when the first business data needs to be retransmitted, the data security is guaranteed.

[0119] Step 240: The terminal sends the second target object to the cloud server of the gateway component, and the cloud server receives the second target object.

[0120] In an embodiment of the present application, the gateway component in the terminal can call an API interface provided by the cloud server to send the second target object to the cloud server.

[0121] The cloud server may be a backend server corresponding to the gateway component. In some scenarios, the gateway component and the cloud server may constitute a mobile gateway. The cloud server may provide the gateway component with a callable API interface for data transmission. When sending the second target object, the gateway component may call the API interface to send the second target object to the cloud server.

[0122] Step 250: The cloud server sends the second target object to the business backend server of the target application; the business backend server receives the second target object.

[0123] For example, the cloud server may parse the destination address of the data packet carrying the second target object, and send the second target object to the business backend server of the target application according to the destination address.

[0124] Optionally, after the business backend server receives the second target object and extracts the first business data therein (for example, deserializing the serialized data in the second target object to obtain the first business data), it can perform background business processing on the first business data. If a response to the first business data is required, the cloud server can also return the response data to the terminal through the cloud server.

[0125] To summarize, the scheme shown in the embodiment of the present application is to set a gateway component in the terminal for execution. The gateway component can obtain the first business data generated by the target application in the terminal, and generate a first target object containing serialized data obtained by serializing the first business data; and copy the first target object to obtain the second target object and store it in the stack area of ​​the gateway component to protect the second target object from being tampered with, and then send the second target object to the business background server of the target application through the cloud server; in the above scheme, the gateway component serializes the business data, copies it to the stack area, and then sends the data in the stack area to the business background server through the cloud server. Since the data in the stack area can be prevented from being tampered with, this avoids the situation where the gateway component is tampered with by a third party before sending the data to the network, thereby improving data security.

[0126] Based on the above Figure 2 For the examples shown, please refer to Figure 3, which shows a data transmission framework diagram involved in this application. Take the above-mentioned terminal, cloud server and business background server as an example, which are the terminal 31, gateway background 32 and business background 33 in the data transmission system respectively. Among them, the terminal 31 has the target application 31a and gateway component 31b installed and running; the gateway background 32 provides background services for the gateway component 31b, and the two cooperate to realize the function of the mobile gateway; the business background 33 provides background business processing services for the target application 31a. Figure 3 As shown, the data transmission process from the terminal 31 to the service background 33 is as follows:

[0127] S1, the target application 31a generates business data 31c;

[0128] S2, the target application 31a calls the API interface of the gateway component 31b and sends the business data 31c to the gateway component 31b;

[0129] S3, the gateway component 31b serializes the business data 31c to obtain a first target object 31d;

[0130] S4, the gateway component 31b copies the first target object 31d, and stores the obtained second target object 31e in the stack area 31f of the gateway component 31b;

[0131] S5, the gateway component 31b calls the API interface of the gateway backend 32, and sends the second target object 31e in the stack area 31f to the gateway backend 32;

[0132] S6, the gateway backend 32 forwards the second target object 31e to the business backend 33;

[0133] S7, optionally, if the transmission of the second target object 31e fails, the gateway component 31b calls the API interface of the gateway backend 32 to reuse the second target object 31e in the stack area 31f for retransmission;

[0134] S8, optionally, other components / third-party libraries 31g in the terminal 31 can access the first business data by accessing the first target object 31d.

[0135] Among them, due to the influence of factors such as network bandwidth or network environment, there is usually a certain interval between the serialization of business data generated by the application and the transmission of the serialized data to the network side. If a transmission failure occurs and retransmission is required, it will take longer. If the serialized data is tampered with during this period, it may cause errors in the business background processing at the least, or even cause loss of user data / property at the worst.

[0136] In the above process, from the time the second target object 31e is copied from the gateway component 31b to the time the gateway component 31b sends the second target object 31e to the gateway backend 32, the second target object 31e in the stack area will not be tampered with by other components / third-party libraries 31g, thereby achieving the effect of improving data security during data transmission between the terminal and the server.

[0137] based on Figure 2 For the examples shown, please refer to Figure 4 , which shows a flow chart of a data transmission method provided by an embodiment of the present application. Figure 4 As shown above Figure 2 Step 220 in the illustrated embodiment may be implemented as steps 220a to 220c:

[0138] Step 220a: In response to receiving a network request generated by a target application and containing first business data, create a filter chain corresponding to the network request; the filter chain includes at least one business data filter; the business data filter is used to assemble the corresponding business data structure.

[0139] In network applications, multiple filters can be deployed. If these filters intercept the same target resource, they form a filter chain (also called filter chain). Each filter in the filter chain is responsible for specific operations and tasks, and the client's request is passed between these filters until it is delivered to the target resource.

[0140] The solution shown in the embodiment of the present application can provide a callable interface to client developers by using the mobile gateway created by the interception filter mode.

[0141] Please refer to Figure 5 , which shows a filter chain component framework diagram involved in the embodiment of the present application. Figure 5 As shown, when the gateway component 50 receives a network request from the target application, it can create a business data filter (BusinessData Filter, BDF) to assemble business data structures, such as, for bank customers, including but not limited to assets, liabilities, sales, costs, profits, macro variables, yields and other data. The gateway component 50 can serialize the input business data in the BDF so that the values ​​therein are encoded to form a fixed file format. Optionally, each business data structure can correspond to a filter, and BDFs of different business data structure types form a filter chain 51.

[0142] Step 220b: Input the first business data into the filter chain.

[0143] When creating a filter chain, the gateway component may input the first business data into the filter chain for serialization.

[0144] Step 220c: Assemble the filter chain into a first target object.

[0145] like Figure 5 As shown, the gateway component can assemble the filter chain into a target object (Target object) 52, that is, the first target object mentioned above.

[0146] The solution shown in the embodiment of the present application utilizes an interception filter mode to provide a callable API interface to the developers of the target application for processing pre-sending steps such as serialization of business data, thereby reducing the complexity of docking between the target application and the gateway component and improving the development efficiency of the target application and the gateway component.

[0147] In a possible implementation, the method further includes:

[0148] The endpoint obfuscates the names of methods called by the target object during the filter chain transmission process.

[0149] For example, the terminal uses the gateway component to obfuscate the method names called by the target object during the filter chain transmission process.

[0150] Optionally, when the gateway component obfuscates the method name called by the target object during the filter chain transmission process, the method name called may be replaced, for example, with other symbols / strings.

[0151] The network device may obfuscate the method name called by the Target object during the filter chain transmission process during the entire process from creating the filter chain to copying the second target object and storing it in the stack area.

[0152] In computer language, a method may refer to a function called by an object; in a terminal, other components / third-party libraries may obtain the data involved when a specified method is called by hooking or reflecting the method name of the specified method; and the above-mentioned Target object will call a series of methods during the filter chain transmission process. In order to further improve data security, the network component can also replace the method name called by the Target object during the filter chain transmission process with other symbols / strings to achieve method name obfuscation; through the above-mentioned obfuscation processing, from the time the gateway component starts to create the filter chain until the second target object is copied to the stack area, other components / third-party libraries cannot access or modify the first business data being processed by the gateway component by hooking or reflecting, thereby ensuring the security of the business data serialization and assembly process.

[0153] In a possible implementation, assembling the filter chain into a first target object includes:

[0154] The terminal verifies the serialized data; in response to the serialized data being verified, the filter chain is assembled into a first target object.

[0155] Among them, if the API interface provided by the gateway component for serialization and assembly of business data is illegally called by other components, or when the target application calls the API interface, its internal logic is wrong (such as a data error), the target object finally assembled by the gateway component will be an invalid object; in order to avoid this situation as much as possible, the gateway component can verify the serialized data obtained during the process of assembling the Target object. If the verification passes, the Target object is assembled. The above verification process avoids the generation of invalid objects and improves the efficiency and accuracy of data processing.

[0156] In a possible implementation, the verification of serialized data includes:

[0157] Acquire a verification rule corresponding to a business type of the first business data;

[0158] Verify serialized data based on verification rules;

[0159] The verification rule includes at least one of the following information:

[0160] Data structure, data type, value range and data length.

[0161] For business data of different business types, the data structure, data type, value range, data length and other attributes of the serialized data will be different.

[0162] For example, taking the business data corresponding to a transfer request as an example, the business data may include user ID, transfer source account, transfer target account, transfer amount, transaction password, user notes and other information. After the above various information is serialized, they can have their own data structure, data type, value range and data length; for example, the transfer amount is a binary structure and the data type is an integer; the transaction password is 6 bits long, and the value range of each bit is 0 to Z, and so on.

[0163] Based on the above characteristics, the developers of the gateway component can set corresponding verification rules in advance for the composition of the business data corresponding to various business types in the target application, that is, set the data structure, data type, value range and data length and other rules of the corresponding business data after serialization; in the process of serializing the first business data, the gateway component can determine the corresponding verification rules according to the business type corresponding to the first business data, and then verify the obtained serialized data through the determined verification rules to verify whether the data structure, data type, value range and data length and other information of the serialized data meet the above-mentioned acquired rules. If so, the verification is passed and the corresponding Target object is assembled, otherwise it is determined that the verification fails. The above scheme provides a specific verification scheme for serialized data to improve the efficiency and accuracy of data processing.

[0164] Optionally, when the verification fails, the gateway component may not assemble the first target object.

[0165] In a possible implementation, the method further includes:

[0166] In response to the serialized data verification failing, the terminal outputs verification failure information;

[0167] The verification failure information is used to indicate at least one of the following information:

[0168] The first business data, the business corresponding to the first business data, the network request corresponding to the first business data, and the verification rule for verification failure.

[0169] In an embodiment of the present application, when the gateway component fails to verify the serialized data, it can also output verification failure information to facilitate developers to handle exceptions, or to facilitate users to standardize operations.

[0170] Specifically, the above solution can be applied in the development and testing phase of the gateway component or the target application, and can also be applied in the deployment and application phase of the target application and the gateway component.

[0171] During the development and testing phase, when the gateway component is serializing business data and assembling Target objects, if the serialized data verification fails, it can output verification failure information. The verification failure information can indicate which business data is wrong, which business is wrong, which request is wrong, and which specific errors have occurred (that is, which rules are not met, such as data type definition errors, data structure errors, numerical range errors, data length errors, etc.), so that developers can conduct targeted code troubleshooting to eliminate exceptions.

[0172] During the application deployment phase, when the gateway component serializes the business data and assembles the Target object, if the serialized data verification fails, it can also output verification failure information to facilitate users to perform standardized operations. For example, taking the business data of setting a password as an example, the new password is pre-set in the verification rules to contain at least one numeric value and at least two letters, and at least two letters must contain both uppercase and lowercase letters. If the new password entered by the user does not meet the above rules, the gateway component will output verification failure information to prompt the user that the new password entered does not meet the above rules so that the user can reset a new password.

[0173] Through the above solution, the gateway component can complete the preliminary inspection of the serialized business data. On the one hand, it can improve the development and testing efficiency and ensure the correctness of user operations. On the other hand, preliminary verification can be used to eliminate business data anomalies under the rules of data structure, data type, value range, and data length as early as possible, avoid subsequent meaningless processing, and improve the accuracy and efficiency of business processing.

[0174] like Figure 5 As shown, the serialized data is verified during the assembly process. If the data encoded according to the corresponding encoding format does not conform to the data preset by the caller, an exception is thrown (for example, data structure exception, data type exception, value range exception, and data length exception, etc.). Among them, if the data encoded according to the corresponding encoding format does not conform to the data preset by the caller, the Target object opened as an interface may cause illegal calls to other modules or invalid data due to internal logic errors of the caller.

[0175] like Figure 5 As shown in the figure, after the Target object is assembled, a copy is made and stored in the stack area of ​​the gateway component, and the method name called by the Target in the filter chain transmission process is obfuscated. In addition to preventing the data to be sent from being tampered with, the data copy storage can also be reused when the network request is retried. Obfuscating the method name can prevent external access and modification of data through hooks or reflection.

[0176] In a possible implementation manner, the terminal generates a first target object corresponding to the first service data, including:

[0177] In response to receiving the call request for sending the first service data, the terminal authenticates the call request based on the authentication priority of the API interface called by the call request;

[0178] In response to the calling request being passed, the terminal generates a first target object corresponding to the first business data.

[0179] The gateway component can also support API authorization management. For example, the API interface policy is divided into three priorities: PRIORITY_HIGH, PRIORITY_DEFAULT, and PRIORITY_LOW. The default value is PRIORITY_DEFAULT. If the interface policy is PRIORITY_HIGH, it means that the interface supports the specified authentication interface. If the authentication fails, the service is directly rejected to filter invalid requests for the backend service. PRIORITY_DEFAULT indicates optional authentication (for example, under this authentication priority, the gateway component can authenticate the service request according to a certain percentage, for example, 50% of the service requests are authenticated), and PRIORITY_LOW indicates that no authentication is required (for example, under this authentication priority, the gateway component can authenticate the service request according to a lower percentage, for example, 10% of the service requests are authenticated; the authentication priority is usually used in the development and testing phase). The configured authorizer needs to determine the name, authorizer interface, authorization cache, cache survival time, identity source and other restrictions.

[0180] In addition, during the data transmission process between the gateway component and the business backend (i.e., the business backend server), at least one of the gateway component and the cloud server can also perform request analysis at the network layer, including detecting the legitimacy of the URL, DNS resolution, network status monitoring, etc., and return the error information to the caller in the form of error code definition + error code. Common error codes can be shown in the following Table 1:

[0181] Table 1

[0182]

[0183]

[0184] based on Figure 2 For the examples shown, please refer to Figure 6 , which shows a flow chart of a data transmission method provided by an embodiment of the present application. Figure 6 As shown above Figure 2 In the illustrated embodiment, step 240 includes step 232 before step 240, and step 240 can be implemented as step 240a. Step 250 includes step 242 and step 244 before step 250, and step 250 can be implemented as step 250a. Step 260 to step 280 are included after step 250:

[0185] Step 232: In response to the first service data satisfying a specified condition, the terminal obtains a first key of the first service corresponding to the first service data.

[0186] In an embodiment of the present application, under specified conditions, the gateway component can assist the target application and the business backend service in establishing an encrypted session connection. In this process, the target application or the gateway component can generate a first key for the first business corresponding to the first business data in a random manner.

[0187] For example, the gateway component can open a random function API interface to the target application for calling a random function. When the first business data meets the above specified conditions, the target application can call the above API interface of the gateway component to request the gateway component to generate a random first key for the first business.

[0188] Alternatively, the target application may also generate a random first key by itself and send the generated first key to the gateway component. For example, the gateway component may open a key transfer API interface for transferring keys to the target application. When the first business data meets the above specified conditions, the target application generates a random first key and calls the above key transfer API interface to send the generated first key to the gateway component.

[0189] The first key may also be generated by other methods other than random generation, for example, the gateway component or the target application may generate the first key according to a preset key generation rule. The embodiment of the present application does not limit the generation algorithm of the first key.

[0190] In the embodiment of the present application, each service in the target application may correspond to a key, that is, have a session connection.

[0191] Alternatively, various services in the target application may correspond to the same key, that is, various services in the target application share one session connection.

[0192] Alternatively, among the various services in the target application, some services may correspond to the same key; that is, the target application may correspond to multiple keys, and each key may be shared by one or more services in the target application.

[0193] In a possible implementation, the specified condition includes at least one of the following conditions:

[0194] 1) The first service data is the service data corresponding to the first network request of the first service initiated after the target application is started.

[0195] In an embodiment of the present application, when the first network request of the first service occurs after the target application is started, the gateway component can initiate the establishment of an encrypted session corresponding to the first service, that is, obtain the first key of the first service.

[0196] Among them, on the one hand, the gateway component can establish an encrypted session corresponding to the first business when the first business actually occurs in the target application, avoiding the establishment of unused encrypted sessions and reducing the consumption of processing resources; on the other hand, an encrypted session is established during the Monkey Brother network request process of the first business, and the encrypted session can continue to be used by the first business subsequently, without the need to establish an encrypted session for each business request, thereby improving the efficiency of encrypted transmission.

[0197] 2) There is currently no session corresponding to the first service.

[0198] In an embodiment of the present application, the encrypted session established before the first service can be canceled; for example, when the duration of the encrypted session established before the first service reaches a certain duration, the encrypted session corresponding to the first service can be canceled. At this time, if the network request corresponding to the first service is generated again, the gateway component can re-acquire the first key corresponding to the first service; this scheme can automatically determine whether to establish a new encrypted session based on the existence of the service session and the service request, thereby ensuring the efficiency of encrypted transmission.

[0199] 3) There is currently a session for the first service, and the establishment duration of the current session for the first service reaches a specified duration.

[0200] In an embodiment of the present application, an encrypted session previously established for the first service can be reset; for example, when a new network request corresponding to the first service is generated, if an encrypted session has been established for the first service before, but the duration of the encrypted session has reached a specified duration, key leakage may occur during this process. At this time, if the previous encrypted session continues to be used for transmission, the data security is low. In this regard, in an embodiment of the present application, when a new network request corresponding to the first service is generated, if the encrypted session previously established for the first service has existed for a long time, the encrypted session can be updated and the first key corresponding to the first service can be re-acquired so as to re-establish the encrypted session for the first service; in this scheme, the encrypted session can be automatically updated according to the duration of the service session and the service request situation, thereby improving the security of data encryption transmission.

[0201] Step 240a: Send the first key and the second target object to the cloud server, and the cloud server receives the first key and the second target object.

[0202] In an embodiment of the present application, the cloud server may also open a key upload API interface for sending keys to the gateway component; the gateway component may send the first key to the cloud server by calling the key upload API interface.

[0203] Alternatively, the gateway component may also send the first key and the second target object together to the cloud server. For example, the gateway component may call the same API interface of the cloud server and send the first key and the second target object together to the cloud server.

[0204] In addition to sending the first key to the cloud server, the gateway component also stores the first key locally.

[0205] Step 242: The cloud server encrypts the first key using the first public key to obtain an encryption key.

[0206] In an embodiment of the present application, the first public key may be pre-set in a cloud server.

[0207] For example, the first public key may be a public key pre-registered in the cloud server by developers of the target application and the gateway component.

[0208] The cloud server can asymmetrically encrypt the first key through the first public key, for example, asymmetrically encrypt the first key through the SM2 encryption algorithm to obtain an encryption key.

[0209] Step 244: The cloud server encrypts the serialized data in the second target object using the first key to obtain an encrypted second target object.

[0210] The cloud server also encrypts the serialized data in the second target object by using the first key, for example, by symmetrically encrypting the serialized data in the second target object by using the SM4 encryption algorithm.

[0211] Step 250a: The cloud server sends the encryption key and the encrypted second target object to the business backend server; the business backend server receives the encryption key and the encrypted second target object.

[0212] In the embodiment of the present application, the cloud server sends the encrypted encryption key and the encrypted second target object to the business backend server.

[0213] Step 260: The cloud server receives the encrypted session identifier returned by the business backend server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key with the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier with the first key.

[0214] In an embodiment of the present application, after the business backend server receives the above-mentioned encryption key and the encrypted second target object, it first decrypts the above-mentioned encryption key using the first private key corresponding to the above-mentioned first public key to obtain the first key; then, the business backend server assigns a session identifier to the first business of the target application, and establishes a binding relationship between the session identifier and the first key in the business backend server; thereafter, the business backend server also encrypts the generated session identifier using the first key, and after obtaining the encrypted session identifier, sends the encrypted session identifier to the cloud server.

[0215] In addition, the business backend server also decrypts the encrypted second target object using the first key obtained through decryption, deserializes the obtained second target object, and obtains the first business data.

[0216] Optionally, if the business backend server needs to return response data (such as second business data) to the terminal after processing the above-mentioned first business data, the business backend server can also encrypt the second business data using the first key to obtain the encrypted second business data, and then send the encrypted second business data together with the above-mentioned encrypted session identifier to the cloud server.

[0217] Optionally, the above session identifier may also be sent directly by the business backend server without encryption.

[0218] The above-mentioned second business data can also be encrypted and transmitted after being serialized on the business background server side.

[0219] Step 270: The cloud server sends the encrypted session identifier to the terminal; the terminal receives the encrypted session identifier.

[0220] After receiving the encrypted session identifier, the cloud server may forward the encrypted session identifier to the gateway component in the terminal.

[0221] Optionally, if there is encrypted second service data, the cloud server may also forward the encrypted second service data to the gateway component in the terminal.

[0222] Step 280: The terminal decrypts the encrypted session identifier according to the first key to obtain the session identifier, and transmits the first service between the cloud server and the service backend server based on the session identifier and the first key.

[0223] In an embodiment of the present application, after the gateway component in the terminal receives the above-mentioned encrypted session identifier, it can decrypt the encrypted session identifier through the locally stored first key, obtain the session identifier assigned to the first business by the business background server, and store the session identifier and the first key in correspondence as relevant information of the session connection of the first business. Subsequently, the business data corresponding to the first business can be encrypted and transmitted through the session identifier and the first key.

[0224] Specifically, when the gateway component subsequently sends new business data (such as the third business data) of the first business, the third business data is encrypted by the first key during or after the serialization assembly process, and the session identifier is encapsulated in the data packet and sent to the cloud server, which is forwarded to the business backend server; the business backend server parses the session identifier in the data packet, locally queries the first key corresponding to the session identifier, encrypts and deserializes the data packet by the queried first key, and obtains the third business data; accordingly, after the fourth business data is serialized, it is encrypted by the first key, and the encrypted data packet of the fourth business data is sent to the cloud server, which is forwarded to the gateway component of the terminal by the cloud server. The gateway component determines the local first key according to the business type, decrypts the encrypted fourth business data by the first key, and submits it to the target application.

[0225] Optionally, if the session identifier is not encrypted, the gateway component in the terminal may directly obtain the session identifier.

[0226] For the business data transmission process, the cloud server can provide a mobile gateway development tool (such as a software development kit (SDK)), which can be used by customer developers (for example, the customers here can be R&D personnel of customers such as banks, securities, insurance and exchanges) and built into the customer's terminal or application client. The customer configures the interface program that calls the above development tool to realize the secure transmission of business data.

[0227] The process diagram of the above data transmission can be shown as follows Figure 7 As shown. Figure 7 In the example, business data is generated by the client's application 71, and the business backend 72 is managed by the client's server backend. The business data is encrypted by the gateway component 73 and forwarded by the gateway backend 74 to the business backend 72. The business data here can be generated by the bank's smart terminal, Bluetooth, Internet of Vehicles, or mobile terminals.

[0228] On the technical side, the terminal and the server negotiate the key when the program starts. Before that, the customer's developers can configure the gateway tool, gateway backend, and business backend based on the mobile gateway interface. For example, configure a callable random function in the gateway tool to generate the first key, configure the first public key in the gateway backend, and configure the first private key in the business backend. The customer's developers can load the terminal's gateway tool into the application and provide the encrypted private key to the business backend. The gateway component in the terminal dynamically obtains the key and sessionId; please refer to Figure 8 , which shows a schematic diagram of the connection establishment and encrypted transmission process involved in the embodiment of the present application. Figure 8 As shown, the process can:

[0229] S81, the terminal calls the random function in the gateway component to randomly generate a key randomKey, and transmits the randomKey to the cloud server corresponding to the gateway backend of the gateway component.

[0230] S82, the cloud server uses the SM2 public key to asymmetrically encrypt randomKey to obtain secret, which can be expressed as: secret = SM2_enc (publicKey, randomKey); and uses randomKey to perform SM4 symmetric encryption on the business data, which can be expressed as: reqPlaylaod = SM4_enc (reqData, randomKey); then sends secret and reqPlaylaod to the business backend server.

[0231] S83, the business backend server uses the corresponding SM2 private key to decrypt the secret to obtain randomKey, which can be expressed as: randomKey = SM2_dec (privateKey, secret).

[0232] S84, the business backend server assigns an identifier sessionId to randomKey, and stores the mapping relationship between sessionId and randomKey (the storage operation here is to distinguish terminal devices, such as multiple devices may communicate with the same business backend).

[0233] S85, the business backend server uses randomKey to perform SM4 symmetric decryption on the business data, which can be expressed as: reqData=SM4_dec(randomKey, reqPlaylaod).

[0234] S86, the service data returned by the service backend server is also encrypted by SM4 using randomKey, which can be expressed as: respPlaylaod = SM4_dec (randomKey, respData), and the encrypted sessionId (which can be expressed as: secSessionId = SM4_dec (randomKey, sessionId)) is returned to the terminal together with the service data. Optionally, the above sessionId can also be unencrypted.

[0235] S87, after the terminal receives the response, each subsequent request will carry the sessionId, and the sessionId storage is saved by the gateway component and stored in the memory; and the data is encrypted by SM4 with randomKey.

[0236] S88, after receiving the request, the business backend server finds the randomKey according to the sessionId and uses the randomKey to perform SM4 decryption on the data.

[0237] S89, the reply data from the business backend server is also encrypted by SM4 using randomKey.

[0238] Through the scheme shown in the above-mentioned embodiment of the present application, the gateway component establishes a session connection between the target application and the business backend server for the first business during the network request processing of the first business in the target application; in this process, on the one hand, the data transmission process between the target application and the business backend server in the network is protected by means of encrypted sessions to avoid data leakage during network transmission; on the other hand, the above-mentioned scheme protects data during data transmission by means of mobile gateways and encrypted sessions, and a double-layer proxy gateway must be set up to ensure the success rate of data transmission; in addition, the above-mentioned scheme integrates the process of establishing an encrypted session with the process of business data transmission, and does not require additional requests specifically for the establishment of encrypted sessions, and can also avoid unnecessary session establishment, which can reduce the consumption of computing and bandwidth resources during session establishment.

[0239] Based on the above Figure 2 , Figure 4 as well as Figure 6 For at least one of the embodiments shown, please refer to Fig. 9, which shows a data transmission framework diagram involved in this application. Taking the above-mentioned terminal, cloud server and business backend server as the terminal 91, gateway backend 92 and business backend 93 in the data transmission system, the supplier of the mobile gateway can provide the SDK of the mobile gateway to customers (such as banks and other customers), and provide the interface specifications for the development and access of the gateway components, and provide the gateway backend 92 for customers to access; the implementation of the data transmission system includes the following three stages:

[0240] 1. Development and testing phase:

[0241] S1, the client's developers develop the target application 91a, and develop the gateway component 91b based on the SDK of the mobile gateway, including configuring the calling and called interfaces in the gateway component 91b, the business types corresponding to the business data filters, the verification rules corresponding to various business types, etc.;

[0242] S2, the customer's developer also accesses the gateway backend 92, sets a predetermined first public key in the gateway backend 92, and finds the set predetermined first private key in the business backend 93.

[0243] The client's developers publish the developed target application 91 a and gateway component 91 b so that users can download and install them through the terminal 91 .

[0244] 2. Encrypted session establishment phase (if the encrypted session of the first service has not been established):

[0245] S1, the target application 91a generates business data 91c of the first business;

[0246] S2, the target application 91a calls the API interface of the gateway component 91b, sends the business data 91c to the gateway component 91b, and triggers the gateway component 91b to generate a random first key 91h;

[0247] S3, the gateway component 91b serializes the business data 91c to obtain a first target object 91d;

[0248] S4, the gateway component 91b copies the first target object 91d, and stores the obtained second target object 91e in the stack area 91f of the gateway component 91b;

[0249] S5, the gateway component 91b calls the API interface of the gateway backend 92, and sends the second target object 91e in the stack area 91f and the first key 91h to the gateway backend 92;

[0250] S6, the gateway backend 92 encrypts the first key 91h using the first public key to obtain an encrypted key 91i;

[0251] S7, the gateway backend 92 encrypts the second target object 91e by using the first key 91h to obtain an encrypted second target object 91j;

[0252] S8, the gateway backend 92 forwards the encryption key 91i and the encrypted second target object 91j to the business backend 93;

[0253] S9, the business backend 93 decrypts the encryption key 91i using the first private key to obtain the first key 91h;

[0254] S10, the service background 93 generates a session identifier 91k for the first service and binds it to the first key 91h;

[0255] S11, the business backend 93 decrypts the encrypted second target object 91j using the first key 91h to obtain the second target object 91j, and performs subsequent deserialization and business processing;

[0256] S12, the business background 93 generates second business data 91m in response to the first business data;

[0257] S13, the service backend 93 encrypts the second service data 91m and the session identifier 91k by using the first key 91h to obtain the encrypted second service data 91n and the encrypted session identifier 91p;

[0258] S14, the business backend 93 sends the encrypted second business data 91n and the encrypted session identifier 91p to the gateway component 91b through the gateway backend 92;

[0259] S15, the gateway component 91b decrypts the encrypted second business data 91n and the encrypted session identifier 91p through the first key 91h, wherein the decrypted second business data 91m is submitted to the target application 91a; the decrypted session identifier 91k is stored in the gateway component 91b together with the first key 91h.

[0260] 3. Encrypted transmission stage (if the encrypted session of the first service has been established):

[0261] S1, the target application 91a generates business data 91c of the first business;

[0262] S2, the target application 91a calls the API interface of the gateway component 91b and sends the business data 91c to the gateway component 91b;

[0263] S3, the gateway component 91b serializes the business data 91c to obtain a first target object 91d;

[0264] S4, the gateway component 91b copies the first target object 91d, and stores the obtained second target object 91e in the stack area 91f of the gateway component 91b;

[0265] S5, before storing the second target object 91e in the stack area 91f, or before sending the second target object 91e to the gateway backend 92, the gateway component 91b encrypts the second target object 91e using the first key 91h to obtain the encrypted second target object 91j;

[0266] S6, the gateway component 91b calls the API interface of the gateway backend 92, and sends the encrypted second target object 91j and the session identifier 91k to the gateway backend 92;

[0267] S7, the gateway backend 92 forwards the encrypted second target object 91j and the session identifier 91k to the business backend 93;

[0268] S8, the business backend 93 queries the first key 91h through the session identifier 91k;

[0269] S9, the business backend 93 decrypts the encrypted second target object 91j using the first key 91h to obtain the second target object 91e;

[0270] S10, the business background 93 generates second business data 91m in response to the first business data;

[0271] S11, the business backend 93 encrypts the second business data 91m using the first key 91h to obtain the encrypted second business data 91n;

[0272] S12, the business backend 93 sends the encrypted second business data 91n to the gateway component 91b through the gateway backend 92;

[0273] S13, the gateway component 91b uses the first key 91h to decrypt the encrypted second business data 91n, and submits the decrypted second business data 91m to the target application 91a.

[0274] The solution provided in the above-mentioned embodiment of the present application utilizes the interception filter mode to create a mobile gateway, which is built into the client application. When the program starts, the terminal and the server negotiate the dynamic key + SessionKey mechanism, which is developed by the customer's developers so that the application can transmit data through the interface of the mobile gateway.

[0275] Based on the solutions shown in the above embodiments of the present application, the following effects can be achieved:

[0276] 1) Using only one layer of gateway service can effectively improve the success rate of network data transmission.

[0277] 2) The dynamic key + SessionKey mechanism can ensure the security of data transmission during the communication process. Combined with API authentication, it can prevent third parties from simulating gateway requests and reduce the pressure on business servers.

[0278] 3) The gateway created by the interception filter mode protects hooks and reflection calls. It is built into the mobile terminal and provided to developers in the form of an interface, which can reduce the cost of developers and meet the relevant specifications of business data security.

[0279] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0280] Please refer to Fig.10 , which shows a block diagram of a gateway component provided by an embodiment of the present application. The gateway component may include:

[0281] The data acquisition module 1001 is used to acquire first business data generated by a target application in a terminal;

[0282] The object generation module 1002 is used to generate a first target object corresponding to the first business data; the first target object includes serialized data obtained by serializing the first business data;

[0283] The object copy module 1003 is used to copy the first target object, obtain the second target object and store it in the stack area of ​​the gateway component; the stack area is used to protect the second target object from being tampered with;

[0284] The sending module 1004 is used to send the second target object to the cloud server of the gateway component, so that the cloud server sends the second target object to the business background server of the target application.

[0285] In a possible implementation, the object generation module 1002 is used to:

[0286] In response to receiving a network request generated by the target application and containing the first business data, creating a filter chain corresponding to the network request; the filter chain includes at least one business data filter; the business data filter is used to assemble a corresponding business data structure;

[0287] Inputting the first business data into the filter chain;

[0288] The filter chain is assembled into the first target object.

[0289] In a possible implementation manner, the device further includes:

[0290] The obfuscation module is used to obfuscate the device name called by the target object during the filter chain transmission process.

[0291] In a possible implementation, the object generation module 1002 is used to:

[0292] Verifying the serialized data;

[0293] In response to the serialized data being verified to be passed, the filter chain is assembled into the first target object.

[0294] In a possible implementation, the object generation module 1002 is used to:

[0295] Acquire a verification rule corresponding to the business type of the first business data;

[0296] Based on the verification rule, verify the serialized data;

[0297] The verification rule includes at least one of the following information:

[0298] Data structure, data type, value range and data length.

[0299] In a possible implementation manner, the device further includes:

[0300] A failure information output module, configured to output verification failure information in response to failure of verification of the serialized data;

[0301] The verification failure information is used to indicate at least one of the following information:

[0302] The first business data, the business corresponding to the first business data, the network request corresponding to the first business data, and the verification rule of the verification failure.

[0303] In a possible implementation manner, in response to the first service data satisfying a specified condition, the apparatus further includes:

[0304] A key acquisition module, used to acquire a first key of a first service corresponding to the first service data;

[0305] The sending module 1004 is used to send the first key and the second target object to the cloud server, so that the cloud server encrypts the first key by using the first public key to obtain an encryption key, encrypts the serialized data in the second target object by using the first key to obtain the encrypted second target object, and sends the encryption key and the encrypted second target object to the business backend server of the target application;

[0306] The device also includes:

[0307] A receiving module, used to receive the encrypted session identifier returned by the cloud server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key with the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier with the first key;

[0308] A decryption module, used for decrypting the encrypted session identifier according to the first key to obtain the session identifier;

[0309] A transmission module is used to transmit the first service between the cloud server and the service backend server based on the session identifier and the first key.

[0310] In a possible implementation, the specified condition includes at least one of the following conditions:

[0311] The first service data is service data corresponding to the first network request of the first service initiated after the target application is started;

[0312] Currently, there is no session corresponding to the first service;

[0313] Currently, a session of the first service exists, and the establishment duration of the current session of the first service reaches a specified duration.

[0314] Please refer to Fig.11 , which shows a block diagram of a data transmission device provided by an embodiment of the present application. The device may include:

[0315] The object receiving module 1101 is used to receive a second target object sent by a terminal; the second target object is a target object in a stack area of ​​the gateway component that obtains first business data generated by a target application in the terminal, generates a first target object corresponding to the first business data, copies the first target object and stores it in the first target object; the first target object contains serialized data obtained by serializing the first business data; the stack area is used to protect the second target object from being tampered with;

[0316] The sending module 1102 is used to send the second target object to the business backend server of the target application.

[0317] In a possible implementation, the object receiving module 1101 is configured to receive a first key of a first service corresponding to the first service data and the second target object sent by the terminal;

[0318] The device also includes:

[0319] An encryption module, configured to encrypt the first secret key by using a first public key to obtain an encryption key; and encrypt the serialized data in the second target object by using the first secret key to obtain the encrypted second target object;

[0320] The sending module 1102 is used to send the encryption key and the encrypted second target object to the business backend server;

[0321] The device also includes:

[0322] an identifier receiving module, used to receive the encrypted session identifier returned by the business backend server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key with the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier with the first key;

[0323] The sending module 1102 is also used to send the encrypted session identifier to the terminal, so that the terminal decrypts the encrypted session identifier according to the first key to obtain the session identifier, and based on the session identifier and the first key, transmits the first business between the cloud server and the business backend server.

[0324] Fig.12 The following is a block diagram of a computer device 1200 provided by an exemplary embodiment of the present application. The computer device 1200 may be a terminal device, such as a VR device, an AR device, a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), or an MP4 player (Moving Picture Experts Group Audio Layer IV). The computer device 1200 may also be referred to as a user device, a portable terminal, or other names.

[0325] Typically, the computer device 1200 includes a processor 1201 and a memory 1202 .

[0326] The memory 1202 may include one or more computer-readable storage media, which may be tangible and non-transitory. The memory 1202 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1202 is used to store at least one instruction, which is used to be executed by the processor 1201 to implement all or part of the steps performed by the terminal device in the method provided in the embodiment of the present application.

[0327] In some embodiments, the computer device 1200 may further include: a peripheral device interface 1203 and at least one peripheral device. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1204 , a touch display screen 1205 , a camera 1206 , an audio circuit 1207 and a power supply 1208 .

[0328] In some embodiments, the computer device 1200 further includes one or more sensors 1209 , including but not limited to: an acceleration sensor 1210 , a gyroscope sensor 1211 , a pressure sensor 1212 , an optical sensor 1213 , and a proximity sensor 1214 .

[0329] Those skilled in the art will appreciate that the structure shown above does not constitute a limitation on the computer device 1200 , and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component arrangement.

[0330] Fig.13 The structural block diagram of a computer device 1300 shown in an exemplary embodiment of the present application is shown. The computer device can be implemented as a cloud server or a business backend server in the above-mentioned solution of the present application. The computer device 1300 includes a central processing unit (CPU) 1301, a system memory 1304 including a random access memory (RAM) 1302 and a read-only memory (ROM) 1303, and a system bus 1305 connecting the system memory 1304 and the central processing unit 1301. The computer device 1300 also includes a mass storage device 1306 for storing an operating system 1309, an application program 1310, and other program modules 1311.

[0331] The mass storage device 1306 is connected to the central processing unit 1301 through a mass storage controller (not shown) connected to the system bus 1305. The mass storage device 1306 and its associated computer readable medium provide non-volatile storage for the computer device 1300. That is, the mass storage device 1306 may include a computer readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0332] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will know that the computer storage medium is not limited to the above. The above-mentioned system memory 1304 and mass storage device 1306 can be collectively referred to as memory.

[0333] According to various embodiments of the present disclosure, the computer device 1300 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1300 can be connected to the network through a network interface unit 1307 connected to the system bus 1305, or the network interface unit 1307 can be used to connect to other types of networks or remote computer systems (not shown).

[0334] The memory also includes at least one computer program, which is stored in the memory. The central processing unit 1301 implements all or part of the steps performed by the cloud server or the business backend server in the methods shown in the above embodiments by executing the at least one computer program.

[0335] In an exemplary embodiment, a computer-readable storage medium is also provided for storing at least one computer program, which is loaded and executed by a processor to implement all or part of the steps in the methods shown in the above embodiments. For example, the computer-readable storage medium can be a read-only memory, a random access memory, a read-only optical disk, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0336] In an exemplary embodiment, a computer program product is also provided, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes all or part of the steps in the methods shown in the above embodiments.

[0337] Before collecting relevant user data and during the process of collecting relevant user data, the present application can display a prompt interface, pop-up window or output voice prompt information. The prompt interface, pop-up window or voice prompt information is used to prompt the user that its relevant data is currently being collected, so that the present application starts to execute the relevant steps of obtaining relevant user data only after obtaining the user's confirmation operation on the prompt interface or pop-up window. Otherwise (that is, when the user's confirmation operation on the prompt interface or pop-up window is not obtained), the relevant steps of obtaining relevant user data are terminated, that is, the user's relevant data is not obtained.

[0338] In other words, all user data collected by this application is collected with the user's consent and authorization, and the collection, use and processing of relevant user data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0339] The above user-related data includes information (including but not limited to user accounts), data (including but not limited to text data entered by users, stored text / image data, displayed text / image data, etc.) and signal data. For example, the user data involved in this application is obtained with full authorization.

[0340] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0341] The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data transmission method, characterized in that: The method is executed by a terminal through a gateway component in the terminal device, and the method includes: Acquire first service data generated by a target application in the terminal; Generate a first target object corresponding to the first business data; the first target object includes serialized data obtained by serializing the first business data; Copying the first target object to obtain a second target object and storing the second target object in a stack area of ​​the gateway component; the stack area is used to protect the second target object from being tampered with; The second target object is sent to the cloud server of the gateway component so that the cloud server sends the second target object to the business backend server of the target application.

2. The method according to claim 1, characterized in that: The generating a first target object corresponding to the first business data includes: In response to receiving a network request generated by the target application and containing the first business data, creating a filter chain corresponding to the network request; the filter chain includes at least one business data filter; the business data filter is used to assemble a corresponding business data structure; Inputting the first business data into the filter chain; The filter chain is assembled into the first target object.

3. The method according to claim 2, characterized in that The method further comprises: Obfuscates the names of methods called on the target object during the filter chain pass.

4. The method according to claim 2, characterized in that: Assembling the filter chain into the first target object comprises: Verifying the serialized data; In response to the serialized data being verified to be passed, the filter chain is assembled into the first target object.

5. The method according to claim 4, characterized in that The verifying the serialized data includes: Acquire a verification rule corresponding to the business type of the first business data; Based on the verification rule, verify the serialized data; The verification rule includes at least one of the following information: Data structure, data type, value range and data length.

6. The method according to claim 4, characterized in that The method further comprises: In response to the serialized data failing to be verified, outputting verification failure information; The verification failure information is used to indicate at least one of the following information: The first business data, the business corresponding to the first business data, the network request corresponding to the first business data, and the verification rule of the verification failure.

7. The method according to claim 1, characterized in that In response to the first service data satisfying a specified condition, the method further includes: Acquire a first key for a first service corresponding to the first service data; The sending the second target object to the cloud server of the gateway component includes: Sending the first key and the second target object to the cloud server, so that the cloud server encrypts the first key by using the first public key to obtain an encryption key, encrypts the serialized data in the second target object by using the first key to obtain the encrypted second target object, and sends the encryption key and the encrypted second target object to the business backend server of the target application; The method further comprises: receiving an encrypted session identifier returned by the cloud server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key using the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier using the first key; Decrypting the encrypted session identifier according to the first key to obtain the session identifier; Based on the session identifier and the first key, the first service is transmitted between the cloud server and the service backend server.

8. The method according to claim 7, characterized in that The specified conditions include at least one of the following conditions: The first service data is service data corresponding to the first network request of the first service initiated after the target application is started; Currently, there is no session corresponding to the first service; Currently, a session of the first service exists, and the establishment duration of the current session of the first service reaches a specified duration.

9. A data transmission method, characterized in that: The method is executed by a cloud server of a gateway component in a terminal device, and the method includes: receiving a second target object sent by the terminal; the second target object is a target object obtained by the gateway component from first business data generated by a target application in the terminal, generating a first target object corresponding to the first business data, copying the first target object and storing it in a stack area of ​​the gateway component; the first target object includes serialized data obtained by serializing the first business data; the stack area is used to protect the second target object from being tampered with; The second target object is sent to the business backend server of the target application.

10. The method according to claim 9, characterized in that The receiving a second target object sent by the terminal includes: receiving a first key of a first service corresponding to the first service data and the second target object sent by the terminal; The method further comprises: Encrypting the first key by using the first public key to obtain an encryption key; Encrypting the serialized data in the second target object by using the first key to obtain the encrypted second target object; The sending the second target object to the business backend server of the target application program includes: Sending the encryption key and the encrypted second target object to the business backend server; The method further comprises: receiving an encrypted session identifier returned by the business backend server; the encrypted session identifier is obtained by the business backend server decrypting the encryption key using the first private key to obtain the first key, allocating a session identifier to the target application, and encrypting the session identifier using the first key; The encrypted session identifier is sent to the terminal so that the terminal decrypts the encrypted session identifier according to the first key to obtain the session identifier, and based on the session identifier and the first key, transmits the first service between the cloud server and the service backend server.

11. A gateway component, characterized in that: The gateway components include: A data acquisition module, used to acquire first business data generated by a target application in a terminal; An object generation module, configured to generate a first target object corresponding to the first business data; the first target object includes serialized data obtained by serializing the first business data; An object copy module, used to copy the first target object, obtain a second target object and store it in a stack area of ​​the gateway component; the stack area is used to protect the second target object from being tampered with; The sending module is used to send the second target object to the cloud server of the gateway component, so that the cloud server sends the second target object to the business background server of the target application.

12. A data transmission device, characterized in that: The device comprises: The object receiving module is used to receive a second target object sent by the terminal; the second target object is a target object in the stack area of ​​the gateway component that obtains the first business data generated by the target application in the terminal, generates a first target object corresponding to the first business data, copies the first target object and stores it in the stack area of ​​the gateway component; the first target object contains serialized data obtained by serializing the first business data; the stack area is used to protect the second target object from being tampered with; A sending module is used to send the second target object to the business background server of the target application.

13. A computer device, characterized in that: The computer device comprises a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the data transmission method according to any one of claims 1 to 10.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the computer program is loaded and executed by the processor to implement the data transmission method according to any one of claims 1 to 10.

15. A computer program product, characterized in that The computer program product comprises a computer program, which is stored in a computer-readable storage medium; the computer program is read and executed by a processor of a computer device to implement the data transmission method according to any one of claims 1 to 10.