Data transmission method and apparatus, server, terminal device, and storage medium
By assigning a unique key to the target user on the server side and performing double encryption, the problem of poor portability and high cost of existing encrypted transmission methods in mobile terminal environments is solved, and secure data packet transmission is achieved in various operating systems and terminal environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2026-03-20
AI Technical Summary
Existing encrypted transmission methods are poorly portable and costly in mobile terminal environments, and cannot be applied to most mobile terminals.
The server assigns a unique key to the target user, performs double encryption on the encrypted data packet based on the target key, and sends the encrypted data packet to the target terminal. This method uses symmetric and asymmetric encryption algorithms to improve the security and applicability of data packet transmission.
It enables secure data packet transmission across multiple operating systems and terminal environments, reducing costs and improving data packet security and portability.
Smart Images

Figure CN119011191B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data transmission, and in particular to a data transmission method and device, a server, a terminal device and a storage medium. BACKGROUND
[0002] In the development process of an application program, in order to protect the security of the application program, a developer usually adopts a specific encryption method to encrypt and protect the core algorithm module of the application program. The above core algorithm module is transmitted to a user terminal through an encrypted transmission method only when the user terminal needs it.
[0003] A related encrypted transmission method is a transmission method based on a dongle encryption algorithm. This method needs to encrypt and package the core algorithm module through a dongle, and then store it in the secure storage area of the dongle. During the running of the application program, the dongle is used for decryption and transmission to the user terminal.
[0004] However, the above method can only be implemented on a specific operating system or platform, has poor portability, is high in cost, and cannot be applied to most mobile terminal environments. SUMMARY
[0005] The present application provides a data transmission method and device, a server, a terminal device and a storage medium, to solve the problems of poor portability, high cost and inapplicability to most mobile terminal environments in related technologies.
[0006] In a first aspect, the present application provides a data transmission method applied to a server, wherein the server is in communication connection with at least one terminal device;
[0007] The above data transmission method comprises:
[0008] allocating a corresponding secret key to each target user; wherein the target user indicates a user who logs in a first application;
[0009] In response to receiving a download request sent by the target terminal, obtaining request information carried by the download request; wherein the download request indicates a request for obtaining a target data packet in the first application; the target terminal indicates a terminal device of the target user in the at least one terminal device; the request information carries a target identity of the target user and a target data packet identifier of the target data packet;
[0010] determining a target secret key according to the target identity, and encrypting a first data packet according to a second encryption algorithm to obtain an encrypted target data packet; wherein the first data packet indicates a target data packet encrypted based on a first encryption algorithm;
[0011] sending the encrypted target data packet to the target terminal.
[0012] In a possible design, the server stores at least one pre-encryption data packet in the first application, where the pre-encryption data packet indicates a data packet encrypted based on the first encryption algorithm, and the pre-encryption data packet includes the first data packet; and data packet identifiers of every two data packets are different.
[0013] The target key is determined according to the target identity, and the first data packet is encrypted according to the second encryption algorithm to obtain an encrypted target data packet, including:
[0014] The target identity carried in the download request is determined.
[0015] A target key having a mapping relationship with the target identity is determined.
[0016] A pre-encryption data packet matching the target data packet identifier is determined as the first data packet.
[0017] The first data packet is encrypted based on the target key according to the second encryption algorithm to obtain the encrypted target data packet.
[0018] In a possible design, the server includes a mapping relationship table, where the mapping relationship table stores a plurality of identity identifiers and keys respectively having a mapping relationship with each of the identity identifiers.
[0019] Correspondingly, the target key having a mapping relationship with the target identity is determined, including:
[0020] An identity identifier matching the target identity is determined in the mapping relationship table.
[0021] A key having a mapping relationship with the identity identifier matching the target identity is determined as the target key.
[0022] In a possible design, the target user is allocated a corresponding key, including:
[0023] In response to receiving a login request sent by the terminal device, login information carried in the login request is determined, where the login information includes an identity identifier of a user and a login password.
[0024] The user is subjected to login verification according to the login request.
[0025] When the login verification of the user is passed, the user is determined as a target user.
[0026] allocate a corresponding key to the target user, establish a mapping relationship between the key and the target user, and obtain a mapping relationship table; the mapping relationship table is used to store an identity of each target user and a key having a mapping relationship with each identity;
[0027] send the key and a first key to the target terminal; the first key is a key determined based on the first encryption algorithm.
[0028] In a possible design, the second encryption algorithm indicates an asymmetric encryption algorithm.
[0029] The allocating of the corresponding key to the target user and the establishing of the mapping relationship between the key and the target user to obtain the mapping relationship table include:
[0030] allocate a corresponding key to the target terminal based on the identity carried in the login request according to the second encryption algorithm; the key includes a public key and a private key.
[0031] establish a mapping relationship between the identity of the target user and the public key and the private key, and store the mapping relationship in a mapping relationship table.
[0032] In a possible design, after the login verification of the user according to the login request, the method further includes:
[0033] when the login verification of the user fails, generate a login failure prompt information and send the login failure prompt information to the terminal device.
[0034] In a second aspect, the application provides a data transmission method applied to a terminal device, the terminal device being in communication connection with a server.
[0035] The method includes:
[0036] in response to a login operation for a first application, send a login request to the server, and receive login information returned by the server;
[0037] when the first application is logged in, in response to a user operation, generate a download request corresponding to the user operation, and send the download request to the server; the download request carries a target identity of the user and a target data packet identifier of a target data packet.
[0038] in response to receiving the encrypted target data packet sent by the server, determine a target key and a first key based on the target identity.
[0039] The encrypted target data packet is decrypted using the target key and the first key to obtain the target data packet; the target key has a mapping relationship with the target identity identifier.
[0040] In one possible design, the step of decrypting the encrypted target data packet based on the target key and the first key to obtain the target data packet includes:
[0041] According to the second encryption algorithm, the encrypted target data packet is decrypted based on the target key to obtain the first data packet; wherein, the second encryption algorithm indicates an asymmetric encryption algorithm, and the target key indicates a private key that has a mapping relationship with the target identity; the first data packet is the target data packet encrypted based on the first encryption algorithm;
[0042] Based on the first key, the first data packet is decrypted according to the first encryption algorithm to obtain the target data packet; wherein, the first encryption algorithm indicates a symmetric encryption algorithm.
[0043] In one possible design, the terminal device includes a display screen;
[0044] After decrypting the first data packet based on the first key and the first encryption algorithm to obtain the target data packet, the method further includes:
[0045] The operation result is displayed on the screen; the operation result is the result of the terminal device responding to the user operation based on the target data packet.
[0046] In one possible design, the response to a login operation for the first application, sending a login request to the server and receiving login information returned by the server, includes:
[0047] In response to a login operation for the first application, a login request is generated and sent to the server; wherein the login information includes the target identity identifier and the login password;
[0048] Receive login information returned by the server;
[0049] Wherein, when the login information indicates that the login verification is successful, the login information includes the target key and the first key;
[0050] Alternatively, when the login information indicates that login verification has failed, the login information may include a login failure message.
[0051] In one possible design, after decrypting the encrypted target data packet according to the target key and the first key to obtain the target data packet, the method further includes:
[0052] in response to an exit operation for the first application, deleting the target data package.
[0053] In a third aspect, the present application provides a data transmission device, applied to a server, the server being in communication connection with at least one terminal device;
[0054] The device comprises a key configuration module configured to allocate a corresponding key to each target user; wherein the target user indicates a user logged into a first application.
[0055] The device comprises a key configuration module configured to allocate a corresponding key to each target user; wherein the target user indicates a user logged into a first application.
[0056] The device comprises a key configuration module configured to allocate a corresponding key to each target user; wherein the target user indicates a user logged into a first application.
[0057] The device comprises a key configuration module configured to allocate a corresponding key to each target user; wherein the target user indicates a user logged into a first application.
[0058] In a fourth aspect, the present application provides a data transmission device, applied to a terminal device, the terminal device being in communication connection with a server.
[0059] The device comprises a second sending module configured to, in response to a login operation for a first application, send a login request to the server, and receive login information returned by the server.
[0060] The device comprises a second sending module configured to, in response to a login operation for a first application, send a login request to the server, and receive login information returned by the server.
[0061] The device comprises a second sending module configured to, in response to a login operation for a first application, send a login request to the server, and receive login information returned by the server.
[0062] The device comprises a second sending module configured to, in response to a login operation for a first application, send a login request to the server, and receive login information returned by the server.
[0063] In a fifth aspect, an embodiment of the present application provides a server, comprising at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the data transmission method according to the first aspect and various possible designs in the first aspect.
[0064] In a sixth aspect, an embodiment of the present application provides a terminal device, comprising at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the data transmission method according to the second aspect and various possible designs in the second aspect.
[0065] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, when the processor executes the computer-executable instructions, the data transmission method according to various possible designs in the first aspect or the second aspect is implemented.
[0066] In an eighth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, when the processor executes the computer program, the data transmission method according to various possible designs in the first aspect or the second aspect is implemented.
[0067] The data transmission method, device, server, terminal device and storage medium provided by the present application, by the server, a unique key is allocated to a target terminal logging in a first application, in response to receiving a download request for obtaining a target data packet sent by the target terminal, a unique target key corresponding to the target terminal is determined according to the request information, the first data packet encrypted based on a first encryption algorithm is double-encrypted based on the target key, and the encrypted target data packet is sent to the target terminal. That is, the server can encrypt the target data packet according to the target key corresponding to the target terminal for the target terminal, so that the encrypted target data packet can only be decrypted by the target terminal, the security of the target data packet in the transmission process is improved, and the transmission mode of the target data packet is suitable for most operating systems, terminal environments, has strong portability and low cost. BRIEF DESCRIPTION OF DRAWINGS
[0068] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.
[0069] Figure 1 An application scenario diagram suitable for the encryption transmission method of the embodiments of the present application;
[0070] Figure 2The flow of the data transmission method suitable for the embodiment one of the present application Figure 1 ;
[0071] Figure 3 The flow chart of the data packet pre-processing provided by the embodiment one of the present application
[0072] Figure 4 The flow of the data transmission method provided by the embodiment one of the present application Figure 2 ;
[0073] Figure 5 The flow of the data transmission method provided by the embodiment one of the present application Figure 3 ;
[0074] Figure 6 The flow of another data transmission method provided by the embodiment two of the present application Figure 1 ;
[0075] Figure 7 The flow of another data transmission method provided by the embodiment two of the present application Figure 2 ;
[0076] Figure 8 The flow of another data transmission method provided by the embodiment two of the present application Figure 3 ;
[0077] Figure 9 The structural schematic diagram of the data transmission device provided by the embodiment three of the present application
[0078] Figure 10 The structural schematic diagram of another data transmission device provided by the embodiment four of the present application
[0079] Figure 11 The structural schematic diagram of the electronic device provided by the embodiment five of the present application.
[0080] The specific embodiments of the present application have been shown in the above-mentioned drawings, and will be described in more detail hereinafter. These drawings and the following description are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application for those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0081] The exemplary embodiments will be described in detail herein below with reference to the drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0082] The collection, storage, use, processing, transmission, provision and disclosure of the financial data or user data and other information involved in the technical solutions of the present application comply with relevant laws and regulations and do not violate public order and good customs.
[0083] It should be noted that in the embodiments of the present application, some existing industry solutions such as certain software, components, models, etc. may be mentioned, which should be considered as exemplary, and the purpose is only to illustrate the feasibility of the implementation of the technical solutions of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0084] Term explanation:
[0085] Dongle: a kind of encryption product combining software and hardware. It has a non-volatile storage space of dozens or hundreds of bytes for reading and writing, which can be used to store encrypted data packets.
[0086] Platform: refers to system architecture.
[0087] In the development process of the application program, the protection of the core algorithm module in the application program is a key link to maintain the normal operation of the application program. However, the related encryption transmission method has the problems of poor portability, high cost, and cannot be applied to most mobile terminal environments.
[0088] Referring to Figure 1 , in order to solve the above problems, the embodiments of the present application propose a data transmission system 1, the above data transmission system 1 includes a server 101 and at least one terminal device (only two are shown in Figure 1 , including terminal device 1021 and terminal device 1022). The server 101 is in communication connection with each terminal device. Among them, the server 101 stores at least one pre-encrypted data packet encrypted based on a first encryption algorithm (only two are shown in Figure 1 , including 1011 and 1012).
[0089] The server 101 can assign a corresponding key to each target user who logs in the first application, and in response to receiving the target terminal of the target user ( Figure 1Taking the terminal device 1021 as an example, it should be understood that the dashed line in the figure represents the communication connection between the devices, and the solid line represents the data transmission between the devices. In response to the received download request, the server 101 acquires the request information carried in the download request, determines the target key corresponding to the target user according to the request information, and performs secondary encryption on the target data packet encrypted by the first encryption algorithm based on the target key, and sends the encrypted target data packet to the target terminal 1021. In response to the operation of logging in the first application, the target terminal 1021 sends a login request to the server 101 and receives the target key and the first key returned by the server 101. In the case of logging in the first application, the target terminal 1021 generates a corresponding download request in response to a user operation and sends it to the server 101. In response to receiving the encrypted target data packet sent by the server 101, the encrypted target data packet is double-decrypted according to the target key and the first key, and the target data packet is obtained.
[0090] By storing, secondary encrypting and retransmitting the target data packet encrypted once by the server, the method is applicable to most operating systems, platforms and mobile terminal environments, has strong portability and low cost. Moreover, the server performs secondary encryption on the target data packet encrypted once according to the target key corresponding to the target user and having uniqueness, and retransmits the target data packet to the target terminal, so that the encrypted target data packet can only be decrypted by the target terminal of the target user, thereby improving the security of the target data packet in the transmission process.
[0091] The terminal device can include a smart phone, a tablet computer, a notebook computer or a desktop computer, and the specific type of the terminal device is not specially limited in the embodiments of the present application.
[0092] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described again in some embodiments. The embodiments of the present application will be described below with reference to the drawings.
[0093] Embodiment one
[0094] Based on Figure 1 As shown in the data transmission system, the embodiments of the present application also provide a data transmission method applied in a server. Figure 2 A flowchart of a data transmission method provided in the embodiments of the present application.
[0095] As Figure 2 The data transmission method comprises:
[0096] S101, a corresponding key is allocated to each target user; wherein the target user indicates a user who logs in the first application.
[0097] Specifically, the server communicates with at least one terminal device, and the server can receive a login request for a first application sent by a user through a terminal device, verify the user based on the login request to determine whether the terminal device of the user is a trusted terminal device. The user who passes the login verification is a target user, and the terminal device of the target user is a target terminal. A corresponding key is allocated to each target user who passes the verification, so that each target user has a unique key. The first application indicates an application program to which the data transmission method proposed in the embodiments of the present application can be applied.
[0098] For example, the first application can indicate an application program generated by using a java program language, an object-oriented program language (C++ language), or a procedure-oriented program language (C language).
[0099] It can be understood that the number of keys allocated by the server is consistent with the number of target users who pass the login verification, and each target user has a one-to-one mapping relationship with the corresponding key.
[0100] For example, the server communicates with five terminal devices, and the five terminal devices include target terminals of three target users who pass the login verification. The server allocates corresponding keys to the three target users who pass the login verification, that is, the keys of each target user who passes the login verification are different from each other and have uniqueness.
[0101] For example, the five terminal devices connected with the server are terminal A, terminal B, terminal C, terminal D, and terminal E. The users of terminal A, terminal B, and terminal E pass the login verification. The key allocated to the target user of terminal A is M001, the key allocated to the target user of terminal B is M002, and the key allocated to the target user of terminal E is M003.
[0102] S102, in response to receiving the download request sent by the target terminal, obtaining the request information carried by the download request; wherein the download request indicates a request for obtaining a target data packet in the first application; the target terminal indicates a terminal device of a target user in the at least one terminal device; and the request information carries a target identity of the target user and a target data packet identifier of the target data packet.
[0103] Specifically, in response to receiving a download request sent by a user logging in a first application through a target terminal, the download request is parsed to obtain request information carried by the download request. The download request indicates a request for obtaining a target data packet in the first application, and the request information carries a target identity of the target user and a target data packet identifier of the target data packet. That is, by parsing the download request, it can be determined that the target user requests to download the target data packet and the identity of the target user.
[0104] In S103, a target key is determined according to the target identity, and the first data packet is encrypted according to a second encryption algorithm to obtain an encrypted target data packet. The first data packet indicates the target data packet encrypted based on a first encryption algorithm.
[0105] Specifically, the server stores a first data packet obtained by performing first re-encryption on a target data packet based on a first encryption algorithm. The first encryption algorithm can indicate a symmetric encryption algorithm, including but not limited to a national encryption algorithm (such as SM1 algorithm, SM4 algorithm), AES algorithm, etc. The second encryption algorithm can indicate a symmetric encryption algorithm (which can be the same as the first encryption algorithm, or can be different from the first encryption algorithm), or can indicate an asymmetric encryption algorithm, such as RSA algorithm, DSA algorithm, etc.
[0106] Specifically, according to the target identity carried in the request information, the target key corresponding to the target user can be determined. For example, in the case of a symmetric encryption algorithm indicated by the second encryption algorithm, a general key, and for example, in the case of an asymmetric encryption algorithm indicated by the second encryption algorithm, a public key corresponding to the target user. According to the second encryption algorithm, the first data packet is secondly re-encrypted based on the target key to obtain the encrypted target data packet.
[0107] In some possible implementations, the server stores at least one pre-encrypted data packet in the first application, the pre-encrypted data packet indicates a data packet encrypted based on the first encryption algorithm, and the pre-encrypted data packet includes the first data packet; the data packet identifiers of every two data packets are different.
[0108] It can be understood that each application program can include data packets corresponding to one or more core algorithm modules, and also include data packets of non-core algorithm modules.
[0109] This embodiment mainly describes the data transmission mode of the data packet corresponding to the core algorithm module that needs to be protected. Based on this, the server can store at least one pre-encrypted data packet in the first application. The pre-encrypted data packet indicates a data packet encrypted based on the first encryption algorithm, and the pre-encrypted data packet includes the first data packet; the data packet identifiers of every two data packets are different.
[0110] Specifically, at least one data packet in the first application can be encrypted based on a general key (which can also be referred to as a first key) according to the first encryption algorithm to obtain at least one pre-encrypted data packet in the first application, and the at least one pre-encrypted data packet is stored in the server.
[0111] The server storing the at least one pre-encrypted data packet in the first application includes: encrypting a target data packet of the first application by the general key according to the first encryption algorithm to obtain the first data packet.
[0112] It can be understood that the data packet encrypted based on the first encryption algorithm can also be decrypted based on the general key.
[0113] For example, the target data packet can be obtained by decrypting the first data packet by the general key according to the first encryption algorithm.
[0114] As an example but not limitation, the data packet can indicate a data packet after being processed by a shell, code obfuscation.
[0115] The following will be described in combination with Figure 3 The preprocessing process of the data packet is described.
[0116] Referring to Figure 3 During the development of the first application, the first application development device sends the data packet of the non-core algorithm module (hereinafter referred to as the main program data packet) to the terminal device after being processed by obfuscation, compilation, packaging, and shell reinforcement, so as to facilitate the terminal device to install.
[0117] The data packet of the core algorithm module (hereinafter referred to as the core program data packet) is processed by obfuscation, compilation, packaging, and the first encryption algorithm to obtain a pre-encrypted data packet, and the pre-encrypted data packet is stored in the server.
[0118] In this way, when the target user logs in to the first application, the target user can run the main program data packet of the application program based on the main program data packet through the user terminal (which can also be referred to as the target terminal), and when receiving a user operation on the core program data packet, the target terminal sends a download request to the server to obtain the core program data packet returned by the server.
[0119] Based on this, when the server receives the download request sent by the terminal device, the target data packet requested by the target user to download can be determined according to the request information.
[0120] S104, sending the encrypted target data packet to the target terminal.
[0121] Specifically, after the target data packet is secondly encrypted, the encrypted target data packet is sent to the target terminal, so as to facilitate the target terminal to process the encrypted target data packet.
[0122] The embodiment of the present application can improve the data security in the data transmission process, and does not depend on other hardware facilities, reduces the cost, and is applicable to various platforms, system architectures and various terminal environments, and has strong portability.
[0123] Figure 4 A flowchart of step S103 in the data transmission method provided by the embodiment of the present application is shown in FIG. 3. Figure 4 As shown in FIG. 3, step S103 includes the following steps.
[0124] S1031, determining the target identity carried by the download request.
[0125] Specifically, the download request is parsed to determine the request information carried by the download request, and the target identity contained in the request information is obtained.
[0126] S1032, determining the target key having a mapping relationship with the target identity.
[0127] Specifically, in the case that the target user is assigned a corresponding key after the login verification is passed, the key corresponding to the target identity of the target user is determined as the target key after the target identity carried in the download request is determined, so as to perform the second re-encryption on the target data packet based on the target key.
[0128] S1033, determining the pre-encrypted data packet matching the target data packet identifier as the first data packet.
[0129] Specifically, at least one data packet encrypted based on the first encryption algorithm (i.e., the pre-encrypted data packet) is pre-stored, and the data packet identifiers of every two data packets are different, so that the corresponding data packet encrypted based on the first encryption algorithm can be matched from the at least one pre-encrypted data packet as the first data packet according to the target data packet identifier.
[0130] For example, three pre-encrypted data packets encrypted by the AES algorithm are pre-stored, and the identifiers of the pre-encrypted data packets are S001, S002 and S003 respectively. When the target data packet identifier carried in the request information is S003, the pre-stored pre-encrypted data packet with the identifier S003 is taken as the first data packet.
[0131] S1034, encrypting the first data packet based on the target key according to the second encryption algorithm to obtain the encrypted target data packet.
[0132] Specifically, the target key is matched with the target identity, the first data packet is secondly re-encrypted based on the target key, and the encrypted target data packet is obtained, so that the encrypted data packet can be decrypted only by the target terminal of the target user.
[0133] In this way, in the process of transmitting the encrypted target data packet, only the target user can decrypt it through the target terminal, avoiding data leakage and improving the security of the target data packet in the transmission process.
[0134] In some possible implementation manners, the server comprises a mapping relationship table, and the mapping relationship table stores a plurality of identities and keys respectively having a mapping relationship with each of the identities.
[0135] Specifically, the server further comprises a mapping relationship table, wherein the mapping relationship table stores a plurality of target user identities and keys respectively having a mapping relationship with each of the target user identities.
[0136] It can be understood that the target user can indicate a user who logs in the first application.
[0137] In this way, in response to a download request sent by any user who logs in the first application through the target terminal, the server can determine the key having a mapping relationship with the target identity in the mapping relationship table according to the target identity carried in the download request, and the target key.
[0138] It should be noted that the server only allocates the corresponding key to the target user who logs in the first application. Based on this, when receiving a download request sent by a user who does not log in the first application through a terminal device, the corresponding key cannot be matched from the mapping relationship table, the target data packet cannot be secondly re-encrypted, and the encrypted target data packet cannot be sent to the terminal device of the user who does not log in the first application, further improving the security of data in the transmission process.
[0139] In some possible implementation manners, step S1032 comprises:
[0140] determining an identity matched with the target identity in the mapping relationship table;
[0141] determining the key having a mapping relationship with the identity matched with the target identity as the target key.
[0142] Specifically, after determining the target identity included in the request information, a lookup can be performed in the mapping relationship table to determine the identity matching the target identity. Then, based on the mapping relationship table, the key having a mapping relationship with the identity matching the target identity is found out as the target key.
[0143] Taking a symmetric encryption algorithm as an example of the second encryption algorithm, as shown in Table 1, the mapping relationship table can include the identities of three users and the keys corresponding to each user identity:
[0144] Table 1 Mapping relationship table
[0145] Identity Key ID00X M001 ID00Y M002 ID00Z M003
[0146] Referring to Table 1, the mapping relationship table stored by the server includes: target user A with an identity ID00X and the key M001 having a mapping relationship with target user A. Target user B with an identity ID00Y and the key M002 having a mapping relationship with target user B. Target user E with an identity ID00Z and the key M003 having a mapping relationship with target user E.
[0147] When the target identity carried in the request information is ID00X, it can be determined that the identity matching the target identity ID00X is the identity of target user A. Correspondingly, the identity matching the target identity ID00X is the key M001 having a mapping relationship with target user A, that is, the target key.
[0148] Figure 5 A flowchart of step S101 in a data transmission method provided by an embodiment of the present application is shown in FIG. 1. Figure 5 As shown in FIG. 1, step S101 includes the following steps, including:
[0149] S1011, in response to receiving a login request sent by the terminal device, determining login information carried by the login request; wherein the login information includes the identity of the user and the login password.
[0150] Specifically, for each terminal device in communication with the server, in response to receiving a login request sent by the terminal device, the login information carried by the login request can be determined, and the login information includes but is not limited to the identity of the user using the terminal device and the login password.
[0151] Exemplarily, the three terminal devices in communication connection with the server are terminal A' of target user A, terminal B' of target user B, and terminal C' of target user B. For terminal A', if the login request 1 sent by terminal A' is received, it is determined that the login information carried by the login request 1 includes the identity of target user A and the login password. For terminal B', if the login request 2 sent by terminal B' includes the identity of target user B and the login password, it is determined that the login information carried by the login request 2. For terminal C', if the login request 3 sent by terminal C' is received, it is determined that the login information carried by the login request 3 includes the identity of target user C and the login password.
[0152] S1012, performing login verification on the user according to the login request.
[0153] Specifically, the user is verified according to the login information carried by the login request. If the login verification is passed, the user is determined to be a target user, and the terminal device of the target user is a trusted target terminal. The corresponding key can be allocated to the target user.
[0154] It can be understood that if the login verification of any one or more users fails, the terminal of the user is not trusted, and the corresponding key cannot be allocated to the user whose login verification fails, and the encrypted target data packet cannot be sent to the terminal device of the user whose login verification fails.
[0155] S1013, determining that the user is a target user when the login verification of the user is passed.
[0156] S1014, allocating a corresponding key to the target user, establishing a mapping relationship between the key and the target user, and obtaining a mapping relationship table; wherein the mapping relationship table is used to store the identity of each target user and the key having a mapping relationship with each identity.
[0157] Specifically, when the login verification of the user is passed, the user is determined to be a target user, and the terminal device of the target user is a target terminal. The encrypted target data packet can be sent to the target terminal of the target user. The corresponding key is allocated to the target user, and the mapping relationship between the identity of the target user and the key corresponding to the target user is established, and a mapping relationship table is obtained.
[0158] It can be understood that in at least one terminal device in communication connection with the server, there is at least one target terminal of at least one target user. Correspondingly, the mapping relationship table stores the identity of at least one target user and the mapping relationship between the key corresponding to each target user.
[0159] In some possible implementation manners, the step S1013 comprises:
[0160] In a case that the target identity carried by the login request matches the pre-stored identity in the login verification table, a pre-stored login password matched with the pre-stored identity is determined as a password to be verified. In a case that the login password carried by the login request matches the password to be verified, it is determined that the login verification of the user is passed, and the target terminal is logged in. The pre-stored identity indicates the identity of a user registered in advance, and the pre-stored login password indicates a password corresponding to the pre-stored identity. The server stores a login verification table including at least one pre-stored identity and a pre-stored login password corresponding to each pre-stored identity, and uses the login verification table to verify the identity of a user applying for login to the first application.
[0161] S1015, sending the key and a first key to the target terminal; wherein the first key is a key determined based on the first encryption algorithm.
[0162] Specifically, a target key having a mapping relationship with the target user is sent to the target terminal of the target user. Meanwhile, a general key (also referred to as a first key) associated with the first encryption algorithm and used for first re-encryption of the target data packet is sent to the target terminal of the target user.
[0163] In some possible implementation manners, step S1014 includes:
[0164] Based on the identity carried by the login request, a corresponding key is allocated to the target terminal according to the second encryption algorithm; wherein the key includes a public key and a private key;
[0165] A mapping relationship between the identity of the target user and the public key and the private key is established and stored in a mapping relationship table.
[0166] Specifically, in a case that the second encryption algorithm indicates asymmetric encryption, a unique key including a public key and a private key is allocated to the target terminal based on a key generation rule according to the identity carried by the login request. A mapping relationship between the identity carried by the login request and the key (including the public key and the private key) is established and stored in a mapping relationship table.
[0167] It can be understood that in the mapping relationship table, one identity is mapped with one public key and one key.
[0168] The public key is used for encrypting the data packet, and the private key is used for sending to the target terminal of the target user corresponding to the identity.
[0169] Specifically, the key generation rule can be specifically set according to actual requirements.
[0170] For example, the key generation rule can be a random generation rule or an ascending order generation rule, etc.
[0171] For example, the key consists of X bits, where X is 8. Based on the ascending order generation rule, the corresponding key assigned to the first target terminal logging into the first application could be: M0000001.
[0172] In some possible implementations, step S101 further includes:
[0173] When the user's login verification fails, a login failure message is generated and sent to the terminal device.
[0174] Specifically, if either or both of the following conditions are not met: the target identity carried in the login request matches the pre-stored identity, or the login password carried in the login request matches the password to be verified, the user's login verification is determined to have failed, and a login failure message is sent to the user's terminal device. The message informs the user that login verification failed and they cannot log in to the application.
[0175] This application embodiment uses an asymmetric encryption algorithm to assign a corresponding key to the target user logging into the first application, achieving a one-to-one mapping between the target user's identity and the key. Based on this, data leakage caused by abnormal data transmission (such as data packet transmission errors, incorrect transmission objects, etc.) can be avoided, thereby improving data security during data transmission.
[0176] Example 2
[0177] based on Figure 1 In addition to the data transmission system shown, this application embodiment also provides another data transmission method, which is applied to a terminal device. Figure 6 This is a flowchart illustrating a data transmission method provided in an embodiment of this application. Figure 6 As shown, the data transmission method includes:
[0178] S201. In response to a login operation for the first application, a login request is sent to the server, and login information is received from the server.
[0179] Specifically, in response to a login operation for the first application, the system determines the login information corresponding to the operation, including the user's identity identifier, generates a login request corresponding to the login operation, sends it to the server, and receives the login information returned by the server.
[0180] S202, in the case of logging into the first application, in response to a user operation, a download request corresponding to the user operation is generated and sent to the server; wherein the download request carries the target identity of the user and the target data packet identifier of the target data packet.
[0181] Specifically, in the case that the user logs into the first application through the current terminal device, in response to the operation of the user to the first application, a download request corresponding to the user operation is generated, the download request is used to obtain the target data packet corresponding to the user operation, and the download request carries the target identity of the user logging into the first application and the target data packet identifier of the target data packet. In this way, the download request is sent to the server, so as to facilitate the server to transmit the target data packet back based on the target identity of the user.
[0182] S203, in response to receiving the encrypted target data packet sent by the server, determining the target key and the first key based on the target identity.
[0183] Specifically, in response to receiving the encrypted target data packet sent by the server, the target key having a mapping relationship with the target identity of the target user is determined, and the first key is determined.
[0184] It can be understood that the target key is a target key having a mapping relationship with the target identity, which can be obtained from the server in advance and stored in the storage space of the current terminal device. The first encryption algorithm indicates a symmetric encryption algorithm, and correspondingly, the first key is a general key of the first encryption algorithm, which can be obtained from the server in advance and stored in the storage space (including a local storage space such as a database, or other external storage devices connected to the terminal device and can be trusted) of the current terminal device. The request for obtaining the first key can also be sent to the server when sending the download request to the server.
[0185] S204, according to the target key and the first key, the encrypted target data packet is decrypted to obtain the target data packet; the target key has a mapping relationship with the target identity.
[0186] Specifically, according to the second encryption algorithm based on the target key, according to the first encryption algorithm based on the first key, the encrypted target data packet is double-decrypted to obtain the target data packet, and the data transmission process is completed.
[0187] Based on the one-to-one mapping relationship between the target key and the target identity of the current user, only the terminal device of the current user can realize the decryption of the encrypted target data packet, reducing the data leakage.
[0188] Figure 7A flowchart of step S204 in another data transmission method provided by the embodiments of the present application is shown in FIG. 4. As shown in FIG. 4, step S204 includes the following steps, including: Figure 7
[0189] S2041, decrypting the encrypted target data packet based on the target key according to a second encryption algorithm, to obtain a first data packet; wherein the second encryption algorithm indicates an asymmetric encryption algorithm, and the target key indicates a private key having a mapping relationship with the target identity identifier; and the first data packet is the target data packet encrypted based on a first encryption algorithm.
[0190] S2042, decrypting the first data packet based on the first key according to the first encryption algorithm, to obtain the target data packet; wherein the first encryption algorithm indicates a symmetric encryption algorithm.
[0191] Specifically, the second encryption algorithm can indicate a symmetric encryption algorithm, or the second encryption algorithm can also indicate an asymmetric encryption algorithm, such as RSA algorithm, DSA algorithm, etc. Correspondingly, when the second encryption algorithm indicates a symmetric encryption algorithm, the target key indicates a general key having a mapping relationship with the target identity identifier. When the second encryption algorithm indicates an asymmetric encryption algorithm, the target key indicates a private key having a mapping relationship with the target identity identifier. The encrypted data packet is obtained by encryption based on a public key having a mapping relationship with the target identity identifier.
[0192] Specifically, the encrypted target data packet is decrypted based on the target key according to the second encryption algorithm, to obtain the first data packet. The first data packet indicates the target data packet after the first re-encryption based on the first encryption algorithm. The first data packet is secondly decrypted based on the first key according to the first encryption algorithm, to obtain the target data packet.
[0193] In some possible implementation manners, the terminal device includes a display screen.
[0194] Correspondingly, after step S2042, the method further includes:
[0195] displaying an operation result by using the display screen; the operation result is a result of a response of the terminal device to the user operation based on the target data packet.
[0196] Specifically, when the target data packet is obtained, the terminal device responds to the user operation based on the target data packet, to obtain a corresponding operation result, and displays the operation result by using the display screen.
[0197] For example, the first application is an image enhancement application, the user operation is an image processing operation, and the corresponding target data packet indicates an image processing data packet. When the image processing data packet is decrypted, the terminal device enhances the image corresponding to the user operation based on the image processing data packet, obtains the enhancement result, and displays it on the screen.
[0198] Figure 8 A flowchart of step S201 in another data transmission method provided in an embodiment of this application. For example... Figure 8 As shown, step S201 includes the following steps:
[0199] S2011. In response to a login operation for the first application, a login request is generated and sent to the server; wherein, the login information includes the target identity identifier and the login password;
[0200] S2012, Receive the login information returned by the server;
[0201] Wherein, when the login information indicates that the login verification is successful, the login information includes the target key and the first key;
[0202] Alternatively, when the login information indicates that login verification has failed, the login information may include a login failure message.
[0203] When the terminal device successfully logs in, the login information includes the target key and the first key; when the terminal device fails to log in, the login information includes a login failure message.
[0204] Specifically, in response to a user's login operation for the first application, a login request is generated based on the user's target identity and login password, and sent to the server so that the server can verify the user's login.
[0205] Specifically, when user login verification is successful, the login information returned by the server includes: a first key and a target key that is mapped to the user's target identity. When user login verification fails, the login information returned by the server includes a login failure message.
[0206] In some other possible implementations, in response to receiving an encrypted target data packet sent by the server, the encrypted target data packet is decrypted according to the target key. If a non-target data packet is obtained, an error message is generated and displayed on the screen. The error message is used to indicate that the download has failed.
[0207] It can be understood that the above download failure scenarios include: the encrypted target data packet sent by the server is incorrect, or the encrypted target data packet sent by the server is not encrypted using the public key having a mapping relationship with the target identity of the user, and the like.
[0208] By way of example and not limitation, after step S204, the data transmission method further includes: storing the target data packet in a storage space of the current terminal device.
[0209] In some possible implementation, after step S204, the data transmission method further includes:
[0210] In response to an exit operation for the first application, the target data packet is deleted.
[0211] Specifically, in response to an exit operation for the first application by the user, the target data packet is deleted to avoid data leakage.
[0212] Embodiment Three
[0213] Figure 9 A structural schematic diagram of a data transmission apparatus 100 provided by an embodiment of the present application is provided, and the data transmission apparatus 100 is applied to a server. As shown in the structural schematic diagram of the data transmission apparatus 100, the data transmission apparatus 100 includes: Figure 9
[0214] A key configuration module 101 is configured to allocate a corresponding key to each target user; wherein the target user indicates a user who logs in a first application;
[0215] An acquisition module 102 is configured to acquire request information carried in a download request in response to receiving the download request sent by a target terminal; wherein the download request indicates a request for acquiring a target data packet in the first application; the target terminal indicates a terminal device of the target user in the at least one terminal device; and the request information carries a target identity of the target user and a target data packet identifier of the target data packet;
[0216] An encryption module 103 is configured to determine a target key according to the target identity, and encrypt a first data packet according to a second encryption algorithm to obtain an encrypted target data packet; wherein the first data packet indicates the target data packet encrypted based on a first encryption algorithm;
[0217] A first sending module 104 is configured to send the encrypted target data packet to the target terminal.
[0218] In some embodiments, the server stores at least one pre-encryption data packet in the first application, the pre-encryption data packet indicates a data packet encrypted based on the first encryption algorithm, and the pre-encryption data packet includes the first data packet; the data packet identifiers of every two data packets are different;
[0219] The encryption module 103 comprises:
[0220] An identity determination unit configured to determine a target identity carried by the download request;
[0221] A target key determination unit configured to determine a target key having a mapping relationship with the target identity;
[0222] A data matching unit configured to determine a pre-encryption data packet matching the target data packet identifier as a first data packet;
[0223] An encryption unit configured to encrypt the first data packet based on the target key according to the second encryption algorithm to obtain the encrypted target data packet.
[0224] In some embodiments, the server comprises a mapping relationship table, and the mapping relationship table stores a plurality of identities and keys respectively having a mapping relationship with each of the identities;
[0225] Correspondingly, the target key determination unit comprises:
[0226] An identity matching subunit configured to determine an identity matching the target identity in the mapping relationship table;
[0227] A target key determination subunit configured to determine a key having a mapping relationship with the identity matching the target identity as a target key.
[0228] In some embodiments, the key configuration module comprises:
[0229] A login information determination unit configured to determine login information carried by a login request sent by the terminal device in response to receiving the login request; the login information comprises an identity of a user and a login password;
[0230] A login verification unit configured to perform login verification on the user according to the login request;
[0231] A target user determination unit configured to determine the user as a target user when the login verification on the user is passed;
[0232] a mapping unit configured to allocate a corresponding key to the target user, establish a mapping relationship between the key and the target user, and obtain a mapping relationship table; wherein the mapping relationship table is configured to store an identity of each target user and a key having a mapping relationship with each identity;
[0233] a sending unit configured to send the key and a first key to the target terminal; wherein the first key is a key determined based on the first encryption algorithm.
[0234] In some embodiments, the second encryption algorithm indicates an asymmetric encryption algorithm.
[0235] The mapping unit comprises:
[0236] a key allocation subunit configured to allocate a corresponding key to the target terminal based on an identity carried by the login request according to the second encryption algorithm; wherein the key comprises a public key and a private key.
[0237] a mapping subunit configured to establish a mapping relationship between the identity of the target user and the public key and the private key, and store the mapping relationship in a mapping relationship table.
[0238] In some embodiments, the key configuration module further comprises:
[0239] a prompting unit configured to generate a login failure prompt information and send the information to the terminal device when the login verification of the user fails.
[0240] Embodiments of the present application allocate a unique key to a target terminal logging into a first application through a server, in response to receiving a download request for obtaining a target data packet sent by the target terminal, determine a unique target key corresponding to the target terminal according to the request information, double-encrypt a first data packet that has been encrypted based on a first encryption algorithm based on the target key, and send the encrypted target data packet to the target terminal. This makes the encrypted target data packet only able to be decrypted by the target terminal, improves the security of the target data packet in the transmission process, and the transmission mode of the target data packet is applicable to most operating systems and terminal environments, has strong portability and low cost.
[0241] Embodiment Four
[0242] Figure 10 A structural schematic diagram of a data transmission device 200 provided by embodiments of the present application is shown in FIG. 1. As shown in FIG. 1, the data transmission device 200 comprises: Figure 10 a key allocation unit configured to allocate a corresponding key to the target user based on an identity carried by the login request according to the second encryption algorithm; wherein the key comprises a public key and a private key.
[0243] The second sending module 201 is configured to send a login request to the server in response to a login operation for the first application, and receive login information returned by the server.
[0244] The third sending module 202 is configured to, in response to a user operation, generate a download request corresponding to the user operation and send the download request to the server in a case where the first application is logged in, wherein the download request carries a target identity of the user and a target data packet identifier of a target data packet.
[0245] The key determination module 203 is configured to determine a target key and a first key based on the target identity in response to receiving the encrypted target data packet sent by the server.
[0246] The decryption module 204 is configured to decrypt the encrypted target data packet based on the target key and the first key to obtain a target data packet, wherein the target key has a mapping relationship with the target identity.
[0247] In some embodiments, the decryption module comprises:
[0248] The first decryption unit is configured to decrypt the encrypted target data packet based on the target key according to a second encryption algorithm to obtain a first data packet, wherein the second encryption algorithm indicates an asymmetric encryption algorithm, the target key indicates a private key having a mapping relationship with the target identity, and the first data packet is a target data packet encrypted based on a first encryption algorithm.
[0249] The second decryption unit is configured to decrypt the first data packet based on the first key according to the first encryption algorithm to obtain a target data packet, wherein the first encryption algorithm indicates a symmetric encryption algorithm.
[0250] In some embodiments, the terminal device comprises a display screen.
[0251] The decryption module further comprises:
[0252] The display unit is configured to display an operation result by using the display screen, wherein the operation result is a result of a response of the terminal device to the user operation based on the target data packet.
[0253] In some embodiments, the second sending module comprises:
[0254] The login request generation is configured to generate a login request and send the login request to the server in response to a login operation for the first application, wherein the login information comprises the target identity and a login password.
[0255] The login information receiving unit is configured to receive login information returned by the server.
[0256] Wherein, when the login information indicates that the login verification is successful, the login information includes the target key and the first key;
[0257] Alternatively, when the login information indicates that login verification has failed, the login information may include a login failure message.
[0258] In some embodiments, the apparatus further includes:
[0259] The deletion module is used to delete the target data packet in response to an exit operation for the first application.
[0260] This application embodiment sends a download request to a server and obtains the corresponding encrypted target data packet. Based on a target key that maps to the user's target identity and a first key, the encrypted target data packet is double-decrypted to obtain the corresponding target data packet. This ensures that the encrypted target data packet can only be decrypted using a key that maps to the user's identity, improving the security of the target data packet during transmission. Furthermore, the transmission method of the target data packet is applicable to most operating systems and terminal environments, offering strong portability and low cost.
[0261] The data transmission device provided in this application embodiment can be used to execute the technical solution of the data transmission method in the above embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0262] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. For example, the decryption module 204 can be a separate processing element, or it can be integrated into a chip in the above device. Alternatively, it can be stored as program code in the memory of the above device, and its function can be called and executed by a processing element of the device. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.
[0263] Example 5
[0264] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.Figure 11 As shown, the electronic device can include a transceiver 111, a processor 112, and a memory 113.
[0265] The processor 112 executes computer-executed instructions stored in the memory, so that the processor 112 executes the solutions in the above embodiments. The processor 112 can be a general-purpose processor, including a central processing unit CPU, a network processor NP, etc.; and can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0266] The memory 113 is connected with the processor 112 through a system bus and completes mutual communication, and the memory 113 is used for storing computer program instructions.
[0267] The transceiver 111 can be used to obtain a to-be-run task and configuration information of the to-be-run task.
[0268] The system bus can be a peripheral component interconnect PCI bus or an extended industry standard architecture EISA bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries and read-only libraries). The memory can include a random access memory RAM, and can also include a non-volatile memory.
[0269] The electronic device provided by the embodiments of the present application can instruct the above server to execute the technical solution of the data transmission method in the first embodiment; or can also instruct the above terminal device to execute the technical solution of the data transmission method in the second embodiment.
[0270] The embodiments of the present application further provide a chip for executing the technical solution of the data transmission method in the first embodiment or the second embodiment.
[0271] The embodiments of the present application further provide a computer readable storage medium, which stores computer instructions, and when the computer instructions are executed on a computer, the computer executes the technical solution of the data transmission method in the first embodiment or the second embodiment.
[0272] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the data transmission method in Embodiment 1 or Embodiment 2 described above.
[0273] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0274] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.
[0275] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.
[0276] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.
[0277] It should be appreciated that the above processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the application can be directly embodied as hardware processor execution, or executed by a combination of hardware and software modules in the processor.
[0278] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0279] The bus can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.
[0280] The above storage medium can be realized by any type of volatile or non-volatile storage device or their combination, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0281] An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a host device.
[0282] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes to perform the steps of the above-mentioned method embodiments; and the foregoing storage medium includes various storage media that can store program codes, such as ROM, RAM, magnetic disk or optical disk.
[0283] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A data transmission method, characterized in that, The application is used in a server, which is communicatively connected to at least one terminal device; the server stores at least one pre-encrypted data packet in a first application, the pre-encrypted data packet indicating a data packet encrypted based on a first encryption algorithm, the pre-encrypted data packet including the first data packet; each two data packets have different data packet identifiers; The data transmission method includes: Assign a corresponding key to each target user, establish a mapping relationship between the key and the target user, and obtain a mapping relationship table; wherein, the mapping relationship table is used to store the identity identifier of each target user and the key that has a mapping relationship with each identity identifier; wherein, the target user refers to the user who logs into the first application; In response to receiving a download request sent by a target terminal, request information carried in the download request is obtained; wherein, the download request indicates a request for obtaining a target data packet in a first application; the target terminal indicates the terminal device of the target user among the at least one terminal device; the request information carries the target identity identifier of the target user and the target data packet identifier of the target data packet; The key that has a mapping relationship with the target identity is determined in the mapping relationship table and is called the target key. The pre-encrypted data packet that matches the target data packet identifier is determined and is called the first data packet. According to the second encryption algorithm, the first data packet is encrypted based on the target key to obtain an encrypted target data packet; wherein, the first data packet indicates the target data packet encrypted based on the first encryption algorithm; The encrypted target data packet is sent to the target terminal.
2. The method according to claim 1, characterized in that, Before assigning a corresponding key to each target user, the process also includes: In response to receiving a login request from the terminal device, the system determines the login information carried in the login request; wherein the login information includes the user's identity identifier and login password; The user is logged in based on the login request; When the user's login verification is successful, the user is identified as the target user; After establishing the mapping relationship between the key and the target user and obtaining the mapping relationship table, the method further includes: sending the key and the first key to the target terminal; wherein the first key is a key determined based on the first encryption algorithm.
3. The method according to claim 2, characterized in that, The second encryption algorithm indicates an asymmetric encryption algorithm; The step of assigning a corresponding key to the target user, establishing a mapping relationship between the key and the target user, and obtaining a mapping relationship table includes: Based on the identity identifier carried in the login request, a corresponding key is assigned to the target terminal according to the second encryption algorithm; wherein, the key includes a public key and a private key; Establish a mapping relationship between the target user's identity identifier and the public key and the private key, and store it in a mapping relationship table.
4. The method according to claim 2, characterized in that, After verifying the user's login based on the login request, the method further includes: When the user's login verification fails, a login failure message is generated and sent to the terminal device.
5. A data transmission method, characterized in that, It is used in terminal devices, which are connected to a server in communication. The data transmission method includes: In response to a login operation for the first application, a login request is sent to the server, and login information is received from the server. When logged into the first application, in response to the user's operation, a download request corresponding to the user's operation is generated and sent to the server; wherein, the download request carries the user's target identity identifier and the target data packet identifier of the target data packet; In response to receiving an encrypted target data packet sent by the server, a target key and a first key are determined based on the target identity identifier, wherein the encrypted target data packet is determined based on the data transmission method according to any one of claims 1-4; The encrypted target data packet is decrypted using the target key and the first key to obtain the target data packet; the target key has a mapping relationship with the target identity identifier.
6. The method according to claim 5, characterized in that, The step of decrypting the encrypted target data packet according to the target key and the first key to obtain the target data packet includes: According to the second encryption algorithm, the encrypted target data packet is decrypted based on the target key to obtain the first data packet; wherein, the second encryption algorithm indicates an asymmetric encryption algorithm, and the target key indicates a private key that has a mapping relationship with the target identity; the first data packet is the target data packet encrypted based on the first encryption algorithm; Based on the first key, the first data packet is decrypted according to the first encryption algorithm to obtain the target data packet; wherein, the first encryption algorithm indicates a symmetric encryption algorithm.
7. The method according to claim 6, characterized in that, The terminal device includes a display screen; After decrypting the first data packet based on the first key and the first encryption algorithm to obtain the target data packet, the method further includes: The operation result is displayed on the screen; the operation result is the result of the terminal device responding to the user operation based on the target data packet.
8. The method according to any one of claims 5 to 7, characterized in that, The response to a login operation for the first application includes sending a login request to the server and receiving login information returned by the server, including: In response to a login operation for the first application, a login request is generated and sent to the server; wherein the login information includes the target identity identifier and the login password; Receive login information returned by the server; Wherein, when the login information indicates that the login verification is successful, the login information includes the target key and the first key; Alternatively, when the login information indicates that login verification has failed, the login information may include a login failure message.
9. The method according to any one of claims 5 to 7, characterized in that, After decrypting the encrypted target data packet according to the target key and the first key to obtain the target data packet, the method further includes: In response to the exit operation for the first application, the target data packet is deleted.
10. A data transmission device, characterized in that, The application is used in a server, which is communicatively connected to at least one terminal device; the server stores at least one pre-encrypted data packet in a first application, the pre-encrypted data packet indicating a data packet encrypted based on a first encryption algorithm, the pre-encrypted data packet including the first data packet; each two data packets have different data packet identifiers; The device includes: A key configuration module is used to assign a corresponding key to each target user, establish a mapping relationship between the key and the target user, and obtain a mapping relationship table; wherein, the mapping relationship table is used to store the identity identifier of each target user and the key that has a mapping relationship with each identity identifier; wherein, the target user indicates the user who logs into the first application; The acquisition module is configured to, in response to receiving a download request sent by a target terminal, acquire request information carried in the download request; wherein, the download request indicates a request for acquiring a target data packet in a first application; the target terminal indicates the terminal device of the target user among the at least one terminal device; and the request information carries the target identity identifier of the target user and the target data packet identifier of the target data packet; The encryption module is used to determine the key that has a mapping relationship with the target identity in the mapping relationship table, which is the target key, and to determine the pre-encrypted data packet that matches the target data packet identifier, which is the first data packet; According to the second encryption algorithm, the first data packet is encrypted based on the target key to obtain an encrypted target data packet; wherein, the first data packet indicates the target data packet encrypted based on the first encryption algorithm; The first sending module is used to send the encrypted target data packet to the target terminal.
11. A data transmission device, characterized in that, It is used in terminal devices, which are connected to a server in communication. The device includes: The second sending module is used to send a login request to the server and receive login information returned by the server in response to a login operation for the first application. The third sending module is used to, in response to a user operation when the first application is logged in, generate a download request corresponding to the user operation and send it to the server; wherein the download request carries the user's target identity identifier and the target data packet identifier of the target data packet; A key determination module is configured to determine a target key and a first key based on the target identity identifier in response to receiving an encrypted target data packet sent by the server, wherein the encrypted target data packet is determined based on the data transmission method according to any one of claims 1-4; The decryption module is used to decrypt the encrypted target data packet according to the target key and the first key to obtain the target data packet; the target key has a mapping relationship with the target identity identifier.
12. A server, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-4.
13. A terminal device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 5-9.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-4 or 5-9.
15. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-4 or 5-9.
Citation Information
Patent Citations
Business data processing method and device, equipment and medium
CN113591138A
Data transmission method, device and equipment and computer storage medium
CN114844688A
Secure transmission method of identification data
CN117527419A