Request transmission method and device, equipment and medium
By using verification marks and encryption algorithms in request transmission, the legality of request parameters is ensured, the problem of data tampering in public network data interaction is solved, and the security of service processing is improved.
Patent Information
- Application Number
- CN202411261965.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-10
Smart Images

Figure CN119109577A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication transmission technology, and in particular to a request transmission method, device, equipment and medium. Background Art
[0002] At present, in the actual business processing process, many business scenarios require data interaction with third-party systems. In the process of the above data interaction, it is inevitable that there is a way to connect to the public network, and data attackers are becoming more and more familiar with the encryption algorithms currently used in the market, which leads to a greatly increased success rate for data attackers to tamper with data in the public network. In this case, the data recipient may directly regard the tampered data as reasonable data for business processing without knowing it, but this is likely to have a negative impact on the security of business processing, thereby causing immeasurable losses. Summary of the invention
[0003] In view of this, the purpose of the present invention is to provide a request transmission method, device, equipment and medium, which can enable the request receiver to determine whether the request parameters in the request have been tampered with after receiving the request sent by the request sender, and can avoid directly using unchecked request parameters for business processing, thereby improving the security of request business processing. The specific scheme is as follows:
[0004] In a first aspect, the present application provides a request transmission method, which is applied to a request sender, comprising:
[0005] Obtaining actual request parameters and recording current time information, and generating a first verification identifier based on the current time information;
[0006] Encapsulating the actual request parameter, the current time information, and the first verification identifier into a request to be transmitted, and encrypting the request to be transmitted to obtain an encrypted ciphertext;
[0007] The encrypted ciphertext is transmitted to the request recipient so that the request recipient decrypts the encrypted ciphertext to obtain the decrypted time information and the decrypted request parameters, and generates a second verification identifier based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, performs corresponding request business processing based on the decrypted request parameters.
[0008] Optionally, the generating a first verification identifier based on the current time information includes:
[0009] Obtaining a target time calculation formula corresponding to the target identity of the request sender from a configuration file; wherein the configuration file is a file for recording the corresponding relationship between the identity and the time calculation formula;
[0010] The first verification identifier is generated by using the target time calculation formula and based on the current time information.
[0011] Optionally, encapsulating the actual request parameter, the current time information, and the first verification identifier into a request to be transmitted includes:
[0012] Determine a request header based on the target identity and the current time information;
[0013] The actual request parameter and the first verification identifier are concatenated to obtain concatenated parameters, and the request header and the concatenated parameters are encapsulated as the request to be transmitted.
[0014] Optionally, transmitting the encrypted ciphertext to a request receiving party so that the request receiving party decrypts the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generating a second verification identifier based on the decrypted time information includes:
[0015] The encrypted ciphertext is transmitted to the request recipient so that the request recipient decrypts the encrypted ciphertext to obtain the decrypted time information, the decrypted request parameters and the target identity, and obtains the target time calculation formula corresponding to the target identity from the configuration file to generate the second verification identifier using the target time calculation formula and based on the decrypted time information.
[0016] Optionally, the request transmission method further includes:
[0017] If any time calculation formula in the configuration file has reached the corresponding validity period, the time calculation formula in the configuration file is updated; wherein different time calculation formulas in the configuration file correspond to different validity periods.
[0018] In a second aspect, the present application provides a request transmission method, applied to a request receiving party, comprising:
[0019] Obtain the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained by the request sender after encrypting the request to be transmitted, the request to be transmitted is the request obtained by encapsulating the actual request parameters, the current time information, and the first verification identifier, the first verification identifier is the verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters;
[0020] Decrypting the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generating a second verification identifier based on the decrypted time information;
[0021] The request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier is encrypted to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, corresponding request business processing is performed based on the decrypted request parameters.
[0022] In a third aspect, the present application provides a request transmission device, which is applied to a request sender, including:
[0023] A verification mark generation module, used to obtain actual request parameters and record current time information, and generate a first verification mark based on the current time information;
[0024] A request encryption module, used for encapsulating the actual request parameters, the current time information, and the first verification identifier into a request to be transmitted, and encrypting the request to be transmitted to obtain an encrypted ciphertext;
[0025] A ciphertext transmission module is used to transmit the encrypted ciphertext to the request recipient so that the request recipient can decrypt the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generate a second verification identifier based on the decrypted time information, and then encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
[0026] In a fourth aspect, the present application provides a request transmission device, applied to a request receiving party, comprising:
[0027] A ciphertext acquisition module is used to acquire the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained by the request sender after encrypting the request to be transmitted, the request to be transmitted is the request obtained by encapsulating the actual request parameters, the current time information, and the first verification identifier, the first verification identifier is the verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters;
[0028] A verification mark generation module, used to decrypt the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generate a second verification mark based on the decrypted time information;
[0029] A request business processing module is used to encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
[0030] In a fifth aspect, the present application provides an electronic device, including:
[0031] Memory, used to store computer programs;
[0032] The processor is used to execute the computer program to implement the aforementioned request transmission method.
[0033] In a sixth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned request transmission method when executed by a processor.
[0034] In the present application, the request sender obtains the actual request parameters and records the current time information, and generates a first verification identifier based on the current time information; encapsulates the actual request parameters, the current time information, and the first verification identifier as a request to be transmitted, and encrypts the request to be transmitted to obtain an encrypted ciphertext; transmits the encrypted ciphertext to the request receiver, so that the request receiver decrypts the encrypted ciphertext to obtain the decrypted time information and the decrypted request parameters, and generates a second verification identifier based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters, and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, performs corresponding request business processing based on the decrypted request parameters. It can be seen that in the process of request transmission of this application, the request sender needs to encrypt the request to be transmitted that encapsulates the actual request parameters, current time information and the first verification mark, and transmit the encrypted ciphertext to the request receiver, so that the request receiver decrypts the encrypted ciphertext and obtains the decrypted time information and the decrypted request parameters from it, thereby determining the second verification mark based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters, and the second verification mark to obtain the ciphertext to be compared, and judges whether the encrypted ciphertext is consistent with the ciphertext to be compared, so as to use the correct request parameters to perform the corresponding request business processing when they are consistent. In this way, this scheme judges the consistency of the encrypted ciphertext and the ciphertext to be compared by the request receiver, so that before using the request parameters sent by the request sender to perform the request business processing, the request parameters sent by the request sender are first checked to determine whether the request parameters sent by the request sender have been tampered with, and at the same time, it can avoid directly using unchecked request parameters for business processing, thereby improving the security of request business processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0036] Figure 1 A flow chart of a request transmission method disclosed in this application;
[0037] Figure 2 A schematic diagram of a specific request transmission method disclosed in this application;
[0038] Figure 3A flowchart of another specific request transmission method disclosed in this application;
[0039] Figure 4 A structural flow chart of a request transmission device disclosed in this application;
[0040] Figure 5 This is a structural flow chart of another request transmission device disclosed in this application;
[0041] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] At present, in the actual business processing process, many business scenarios need to interact with third-party systems for data. In the process of the above data interaction, it is inevitable that there is a way to connect to the public network, and data attackers are more and more familiar with the encryption algorithms currently used in the market, which leads to a greatly increased success rate of data attackers tampering with data in the public network. In this case, the data recipient may directly regard the tampered data as reasonable data for business processing without knowing it, but this is likely to have a negative impact on the security of business processing, thereby causing immeasurable losses. To this end, the present application provides a request transmission method that can avoid directly using unchecked request parameters for business processing and improve the security of request business processing.
[0044] See also Figure 1 As shown, an embodiment of the present invention discloses a request transmission method, which is applied to a request sender, comprising:
[0045] Step S11, obtaining actual request parameters and recording current time information, and generating a first verification identifier based on the current time information.
[0046] In this embodiment, before the request sender sends a request to the request receiver, it is necessary to first obtain the actual request parameters, record the current time information when the actual request parameters are obtained, and generate a first verification identifier based on the current time information. The verification identifier is a unique identifier and can be a number or a string.
[0047] Specifically, generating a first verification identifier based on the current time information may include: pre-acquiring a target time calculation formula corresponding to the target identity identifier of the request sender from a configuration file, thereby substituting the current time information into the target time calculation formula to generate a corresponding first verification identifier. The configuration file is a file used to record the correspondence between the identity identifier and the time calculation formula; the target identity identifier is a unique identifier corresponding to the request sender, and different request senders correspond to different identity identifiers. The request sender can be understood as a client, and the request receiver can be understood as a server.
[0048] It is worth mentioning that before using the above request for business processing, for the same request business, different time calculation formulas can be set in the configuration file for different request senders and request receivers, so that different request senders obtain different time calculation formulas from the above configuration file to calculate the current time information, thereby calculating the time information through differentiation to maximize the security of request business processing. That is, different request senders can use different time calculation formulas to calculate different verification identifiers based on time information.
[0049] Step S12: encapsulate the actual request parameters, the current time information, and the first verification identifier into a request to be transmitted, and encrypt the request to be transmitted to obtain an encrypted ciphertext.
[0050] In this embodiment, after calculating the current time information using the time calculation formula to obtain the first verification identifier, the actual request parameters, the current time information and the first verification identifier need to be encapsulated as a request to be transmitted, so that the request sender can encrypt the request to be transmitted and send it to the request receiver. Specifically, encapsulating the actual request parameters, the current time information and the first verification identifier as a request to be transmitted can include: determining the request header based on the target identity identifier and the current time information of the request sender, that is, the request header includes the target identity identifier and the current time information, wherein the request header is located at the head of the request to be transmitted; then the actual request parameters and the first verification identifier need to be spliced to obtain the spliced parameters, and then the request header and the spliced parameters are encapsulated as the request to be transmitted.
[0051] It is worth mentioning that after the request sender completes the encapsulation of the request header and the splicing parameters to obtain the request to be transmitted, it is necessary to use a preset encryption algorithm to encrypt the request to be transmitted to improve the security of the request to be transmitted during the transmission process. That is, in the process of data connection between the request sender and the request receiver, the embodiment of the present application adds a preset encryption algorithm agreed upon by both parties in advance to enhance the security of the encrypted request.
[0052] In a specific implementation, the preset encryption algorithm agreed upon by the above-mentioned two parties in advance may adopt a symmetric encryption algorithm, for example, the Advanced Encryption Standard algorithm (AES), or an asymmetric encryption algorithm, for example, the RSA algorithm (Rivest-Shamir-Adleman, an asymmetric encryption algorithm), the Elgamal algorithm (an asymmetric encryption algorithm), ECC (Elliptic Curve Cryptography, an elliptic curve encryption algorithm), etc., which are not specifically limited here.
[0053] Among them, the key used in the preset encryption algorithm is generated by negotiation between the request receiving party and the request sending party. After the two parties have negotiated the key, try to avoid directly transmitting the key on the network, otherwise it is easy to cause the key to be illegally obtained during the transmission process, thereby causing data leakage and causing immeasurable losses. In this regard, before transmitting the key, the embodiment of the present invention can encrypt the key before transmitting it. For example, an asymmetric encryption algorithm can be used to encrypt the key, and then transmit it to the request receiving party through the network.
[0054] Step S13, transmitting the encrypted ciphertext to the request recipient, so that the request recipient decrypts the encrypted ciphertext to obtain the decrypted time information and the decrypted request parameters, and generates a second verification identifier based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, performs corresponding request business processing based on the decrypted request parameters.
[0055] In this embodiment, after the request sender transmits the encrypted ciphertext to the request receiver, the request receiver needs to use the key to decrypt the encrypted ciphertext, and then obtain the decrypted time information and the decrypted request parameters from the decrypted ciphertext, and then calculate the second verification mark based on the decrypted time information. Furthermore, after the request receiver obtains the second verification mark, it needs to encapsulate the decrypted time information, the decrypted request parameters and the second verification mark into a request to be encrypted, and then encrypt the request to be encrypted using a preset encryption algorithm to obtain the ciphertext to be compared; it should be noted that the preset encryption algorithm used by the request receiver is the same as the preset encryption algorithm used by the request sender. Then, the request receiving party determines whether the ciphertext to be compared is consistent with the encrypted ciphertext sent by the request sender. If the ciphertext to be compared and the encrypted ciphertext are consistent, it is considered that the request sent by the request sender has not been tampered with during the transmission process, and the request receiving party can use the request parameters in the request for normal business processing; if the ciphertext to be compared and the encrypted ciphertext are not consistent, it is considered that the request sent by the request sender has been illegally obtained and tampered with during the transmission process, and the request can be discarded, and an alarm message is returned to the request sender. Among them, the ciphertext to be compared and the encrypted ciphertext may be a string of codes or strings.
[0056] Among them, for the second verification identifier, the encrypted ciphertext can be decrypted by the requesting party after receiving the encrypted ciphertext to obtain the decrypted time information, the decrypted request parameter and the target identity identifier, and the target time calculation formula corresponding to the target identity identifier is obtained from several time calculation formulas pre-stored in the configuration file, so as to generate the second verification identifier based on the decrypted time information using the target time calculation formula. It is worth mentioning that the time calculation formula used by the requesting party to generate the second verification identifier is the same as the time calculation formula used by the requesting party to generate the first verification identifier.
[0057] To further enhance the security of business processing, each time calculation formula included in the above configuration file is configured with a corresponding validity period, that is, different time calculation formulas in the configuration file correspond to different validity periods. When the validity period of any time calculation formula in the configuration file expires, the expired time calculation formula must be updated.
[0058] It can be seen that in the process of request transmission of this application, the request sender needs to encrypt the request to be transmitted that encapsulates the actual request parameters, current time information and the first verification mark, and transmit the encrypted ciphertext to the request receiver, so that the request receiver decrypts the encrypted ciphertext and obtains the decrypted time information and the decrypted request parameters from it, thereby determining the second verification mark based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters, and the second verification mark to obtain the ciphertext to be compared, and judges whether the encrypted ciphertext is consistent with the ciphertext to be compared, so as to use the correct request parameters to perform the corresponding request business processing when they are consistent. In this way, this scheme judges the consistency of the encrypted ciphertext and the ciphertext to be compared by the request receiver, so that before using the request parameters sent by the request sender to perform the request business processing, the request parameters sent by the request sender are first checked to determine whether the request parameters sent by the request sender have been tampered with, and at the same time, it can avoid directly using unchecked request parameters for business processing, thereby improving the security of request business processing.
[0059] See also Figure 2 As shown, an embodiment of the present invention discloses a request transmission method, including:
[0060] In this embodiment, before the request sender and the request receiver exchange data, the request receiver needs to make a legality judgment on the request from the request sender. The specific process of making a legality judgment on the above request is as follows:
[0061] First, the request sender needs to obtain the actual request parameters and record the current time information when obtaining the actual request parameters. Then, the target time calculation formula corresponding to the target identity of the request sender is determined from several time calculation formulas stored in the configuration file agreed upon in advance by the request sender and the request receiver.
[0062] Subsequently, the request sender uses the above target time calculation formula to calculate the above current time information, thereby obtaining a first verification identifier, and outputs the first verification identifier, and then splices the above output first verification identifier with the actual request parameters to obtain splicing parameters; subsequently, it is necessary to determine the request header based on the target identity identifier and the current time information, and encapsulate the request header and the splicing parameters into a request to be transmitted, and then perform AES encryption on the request to be transmitted. In a specific implementation, the request sender can extract a key from a configuration file agreed in advance, so as to use the key to encrypt the request to be transmitted, so as to generate an encrypted string, that is, an encrypted ciphertext, and send the encrypted ciphertext to the request receiver.
[0063] Furthermore, when the request sender sends the encrypted ciphertext to the request receiver, it is necessary to determine whether the encrypted ciphertext is successfully sent to the request receiver. Specifically, if the request receiver successfully receives the encrypted ciphertext, the encrypted ciphertext can be decrypted for subsequent operations; if the request receiver fails to successfully receive the encrypted ciphertext, subsequent operations are prohibited from being triggered, and a prompt message indicating that the sending failed is returned to the request sender.
[0064] After the request recipient successfully receives the encrypted ciphertext, the request recipient can use the key obtained from the configuration file to decrypt the encrypted ciphertext to obtain the decrypted plaintext, wherein the decrypted plaintext includes the decrypted time information, the decrypted request parameters, and the target identity. Then, the target time calculation formula corresponding to the target identity identifier is obtained from the configuration file, and the decrypted time information is calculated using the target time calculation formula to obtain a second verification identifier; then, the decrypted request parameter in the decrypted plaintext is concatenated with the second verification identifier, and the concatenated result and the decrypted time information are encapsulated into the request to obtain the request to be encrypted; then, the AES algorithm can be used to encrypt the request to be encrypted to obtain the ciphertext to be compared; finally, the request recipient needs to determine whether the encrypted ciphertext is consistent with the ciphertext to be compared. If the encrypted ciphertext is inconsistent with the ciphertext to be compared, the request sent by the request sender is considered to be an illegal request, that is, the request has been illegally tampered with during the transmission process; if the encrypted ciphertext is consistent with the ciphertext to be compared, the request sent by the request sender is considered to be a legal request, and the request recipient can use the legal request to perform normal business processing.
[0065] It should be noted that the request sender and the request receiver can obtain the time calculation formula corresponding to the identity identifier from the configuration file based on the same identity identifier, so that the request sender and the request receiver can perform subsequent operations according to the configuration file, such as obtaining the time calculation formula from the above configuration file. In addition, the format of the above configuration file can be JSON (JavaScript Object Notation, a lightweight data exchange format) file format, and any file format that can save configuration information is applicable to this embodiment, for example, INI (Initialization, a file extension) file format, XML (eXtensible Markup Language, an extensible markup language) file format, etc., which are not specifically limited here.
[0066] In the present application, during the process of request transmission, the request sender needs to encrypt the request to be transmitted which encapsulates the actual request parameters, the current time information and the first verification mark, and transmit the encrypted ciphertext to the request receiver, so that the request receiver decrypts the encrypted ciphertext and obtains the decrypted time information and the decrypted request parameters from it, thereby determining the second verification mark based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification mark to obtain the ciphertext to be compared, and judges whether the encrypted ciphertext is consistent with the ciphertext to be compared, so as to use the correct request parameters to perform the corresponding request business processing when they are consistent. In this way, the present scheme judges the consistency of the encrypted ciphertext and the ciphertext to be compared by the request receiver, so that before using the request parameters sent by the request sender to perform the request business processing, the request parameters sent by the request sender are first checked to determine whether the request parameters sent by the request sender have been tampered with, and at the same time, it can avoid directly using the unchecked request parameters for business processing, thereby improving the security of the request business processing.
[0067] See also Figure 3 As shown, an embodiment of the present invention discloses a request transmission method, which is applied to a request receiving party, including:
[0068] Step S21, obtain the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained by the request sender after encrypting the request to be transmitted, the request to be transmitted is the request obtained by encapsulating the actual request parameters, current time information, and a first verification identifier, the first verification identifier is a verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters.
[0069] Step S22: decrypt the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generate a second verification identifier based on the decrypted time information.
[0070] Step S23: Encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
[0071] Among them, the specific implementation process of the above steps S21 to S23 can refer to the corresponding content in the previous embodiment, and will not be repeated here.
[0072] In the present application, during the process of request transmission, the request receiver needs to obtain the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained after the request sender encrypts the request to be transmitted, and the request to be transmitted is the request obtained by encapsulating the actual request parameters, the current time information, and the first verification identifier, the first verification identifier is the verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters; the encrypted ciphertext is decrypted to obtain the decrypted time information and the decrypted request parameters, and a second verification identifier is generated based on the decrypted time information; the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier is encrypted to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, the corresponding request business processing is performed based on the decrypted request parameters. In this way, this scheme makes a consistency judgment on the encrypted ciphertext and the ciphertext to be compared by the request recipient, so as to check the request parameters sent by the request sender before using them to process the request business, so as to determine whether the request parameters sent by the request sender have been tampered with. At the same time, it can avoid directly using unchecked request parameters for business processing, thereby improving the security of request business processing.
[0073] See also Figure 4 As shown, the present application also provides a request transmission device, which is applied to a request sender, including:
[0074] A verification mark generation module 11 is used to obtain actual request parameters and record current time information, and generate a first verification mark based on the current time information;
[0075] A request encryption module 12, used to encapsulate the actual request parameters, the current time information, and the first verification identifier into a request to be transmitted, and encrypt the request to be transmitted to obtain an encrypted ciphertext;
[0076] The ciphertext transmission module 13 is used to transmit the encrypted ciphertext to the request recipient so that the request recipient can decrypt the encrypted ciphertext to obtain the decrypted time information and the decrypted request parameters, and generate a second verification identifier based on the decrypted time information, and then encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
[0077] It can be seen that in the process of request transmission of this application, the request sender needs to encrypt the request to be transmitted that encapsulates the actual request parameters, current time information and the first verification mark, and transmit the encrypted ciphertext to the request receiver, so that the request receiver decrypts the encrypted ciphertext and obtains the decrypted time information and the decrypted request parameters from it, thereby determining the second verification mark based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters, and the second verification mark to obtain the ciphertext to be compared, and judges whether the encrypted ciphertext is consistent with the ciphertext to be compared, so as to use the correct request parameters to perform the corresponding request business processing when they are consistent. In this way, this scheme judges the consistency of the encrypted ciphertext and the ciphertext to be compared by the request receiver, so that before using the request parameters sent by the request sender to perform the request business processing, the request parameters sent by the request sender are first checked to determine whether the request parameters sent by the request sender have been tampered with, and at the same time, it can avoid directly using unchecked request parameters for business processing, thereby improving the security of request business processing.
[0078] In some specific implementations, the verification mark generation module 11 may specifically include:
[0079] A calculation formula acquisition unit, used to acquire a target time calculation formula corresponding to the target identity of the request sender from a configuration file; wherein the configuration file is a file used to record the corresponding relationship between the identity and the time calculation formula;
[0080] A verification mark generating unit is used to generate the first verification mark based on the current time information using the target time calculation formula.
[0081] In some specific implementations, the request encryption module 12 may specifically include:
[0082] A request header determining unit, configured to determine a request header based on the target identity and the current time information;
[0083] A parameter splicing unit is used to splice the actual request parameter and the first verification identifier to obtain a spliced parameter, and encapsulate the request header and the spliced parameter into the request to be transmitted.
[0084] In some specific implementations, the ciphertext transmission module 13 may specifically include:
[0085] A ciphertext transmission unit is used to transmit the encrypted ciphertext to the request receiving party so that the request receiving party can decrypt the encrypted ciphertext to obtain the decrypted time information, the decrypted request parameters and the target identity, and obtain the target time calculation formula corresponding to the target identity from the configuration file to generate the second verification identifier based on the decrypted time information using the target time calculation formula.
[0086] In some specific implementations, the request transmission device may further include:
[0087] A formula updating unit is used to update any time calculation formula in the configuration file if the corresponding validity period of use has been reached; wherein different time calculation formulas in the configuration file correspond to different validity periods of use.
[0088] See also Figure 5 As shown, the present application also provides a request transmission device, which is applied to a request receiving party, including:
[0089] The ciphertext acquisition module 21 is used to acquire the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained by the request sender after encrypting the request to be transmitted, the request to be transmitted is the request obtained by encapsulating the actual request parameters, the current time information, and the first verification identifier, the first verification identifier is the verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters;
[0090] A verification mark generation module 22, used to decrypt the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generate a second verification mark based on the decrypted time information;
[0091] The request business processing module 23 is used to encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
[0092] It can be seen that in the process of request transmission of this application, the request sender needs to encrypt the request to be transmitted that encapsulates the actual request parameters, current time information and the first verification mark, and transmit the encrypted ciphertext to the request receiver, so that the request receiver decrypts the encrypted ciphertext and obtains the decrypted time information and the decrypted request parameters from it, thereby determining the second verification mark based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters, and the second verification mark to obtain the ciphertext to be compared, and judges whether the encrypted ciphertext is consistent with the ciphertext to be compared, so as to use the correct request parameters to perform the corresponding request business processing when they are consistent. In this way, this scheme judges the consistency of the encrypted ciphertext and the ciphertext to be compared by the request receiver, so that before using the request parameters sent by the request sender to perform the request business processing, the request parameters sent by the request sender are first checked to determine whether the request parameters sent by the request sender have been tampered with, and at the same time, it can avoid directly using unchecked request parameters for business processing, thereby improving the security of request business processing.
[0093] Furthermore, the present application also discloses an electronic device. Figure 6 It is a structural diagram of an electronic device 30 according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device 30 may specifically include: at least one processor 31, at least one memory 32, a power supply 33, a communication interface 34, an input and output interface 35 and a communication bus 36. Among them, the memory 32 is used to store a computer program, and the computer program is loaded and executed by the processor 31 to implement the relevant steps in the request transmission method disclosed in any of the aforementioned embodiments. In addition, the electronic device 30 in this embodiment may specifically be an electronic computer.
[0094] In this embodiment, the power supply 33 is used to provide working voltage for each hardware device on the electronic device 30; the communication interface 34 can create a data transmission channel between the electronic device 30 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 35 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0095] In addition, the memory 32, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 321, a computer program 322, etc., and the storage method can be temporary storage or permanent storage.
[0096] The operating system 321 is used to manage and control the hardware devices and computer programs 322 on the electronic device 30, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the request transmission method performed by the electronic device 30 disclosed in any of the aforementioned embodiments, the computer program 322 can further include a computer program that can be used to complete other specific tasks.
[0097] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed request transmission method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0098] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0099] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0100] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0101] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0102] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A request transmission method, characterized in that: Applicable to the request sender, including: Obtaining actual request parameters and recording current time information, and generating a first verification identifier based on the current time information; Encapsulating the actual request parameter, the current time information, and the first verification identifier into a request to be transmitted, and encrypting the request to be transmitted to obtain an encrypted ciphertext; The encrypted ciphertext is transmitted to the request recipient so that the request recipient decrypts the encrypted ciphertext to obtain the decrypted time information and the decrypted request parameters, and generates a second verification identifier based on the decrypted time information, and then encrypts the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, performs corresponding request business processing based on the decrypted request parameters.
2. The request transmission method according to claim 1, characterized in that: The generating a first verification mark based on the current time information includes: Obtaining a target time calculation formula corresponding to the target identity of the request sender from a configuration file; wherein the configuration file is a file for recording the corresponding relationship between the identity and the time calculation formula; The first verification identifier is generated by using the target time calculation formula and based on the current time information.
3. The request transmission method according to claim 2, characterized in that: The step of encapsulating the actual request parameter, the current time information, and the first verification identifier into a request to be transmitted includes: Determine a request header based on the target identity and the current time information; The actual request parameter and the first verification identifier are concatenated to obtain concatenated parameters, and the request header and the concatenated parameters are encapsulated as the request to be transmitted.
4. The request transmission method according to claim 3, characterized in that: The transmitting the encrypted ciphertext to the request receiving party so that the request receiving party decrypts the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generating a second verification identifier based on the decrypted time information, includes: The encrypted ciphertext is transmitted to the request recipient so that the request recipient decrypts the encrypted ciphertext to obtain the decrypted time information, the decrypted request parameters and the target identity, and obtains the target time calculation formula corresponding to the target identity from the configuration file to generate the second verification identifier using the target time calculation formula and based on the decrypted time information.
5. The request transmission method according to claim 2, characterized in that: Also includes: If any time calculation formula in the configuration file has reached the corresponding validity period, the time calculation formula in the configuration file is updated; wherein different time calculation formulas in the configuration file correspond to different validity periods.
6. A request transmission method, characterized in that: Applies to the request recipient, including: Obtain the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained by the request sender after encrypting the request to be transmitted, the request to be transmitted is the request obtained by encapsulating the actual request parameters, the current time information, and the first verification identifier, the first verification identifier is the verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters; Decrypting the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generating a second verification identifier based on the decrypted time information; The request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier is encrypted to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, corresponding request business processing is performed based on the decrypted request parameters.
7. A request transmission device, characterized in that: Applicable to the request sender, including: A verification mark generation module, used to obtain actual request parameters and record current time information, and generate a first verification mark based on the current time information; A request encryption module, used for encapsulating the actual request parameters, the current time information, and the first verification identifier into a request to be transmitted, and encrypting the request to be transmitted to obtain an encrypted ciphertext; A ciphertext transmission module is used to transmit the encrypted ciphertext to the request recipient so that the request recipient can decrypt the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generate a second verification identifier based on the decrypted time information, and then encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
8. A request transmission device, characterized in that: Applies to the request recipient, including: A ciphertext acquisition module is used to acquire the encrypted ciphertext transmitted by the request sender; the encrypted ciphertext is the ciphertext obtained by the request sender after encrypting the request to be transmitted, the request to be transmitted is the request obtained by encapsulating the actual request parameters, the current time information, and the first verification identifier, the first verification identifier is the verification identifier generated based on the current time information, and the current time information is the time information recorded when the request sender obtains the actual request parameters; A verification mark generation module, used to decrypt the encrypted ciphertext to obtain decrypted time information and decrypted request parameters, and generate a second verification mark based on the decrypted time information; A request business processing module is used to encrypt the request encapsulated based on the decrypted time information, the decrypted request parameters and the second verification identifier to obtain the ciphertext to be compared, and when the ciphertext to be compared is consistent with the encrypted ciphertext, perform corresponding request business processing based on the decrypted request parameters.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the request transmission method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, the steps of the request transmission method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Control method and system of LED display screen with protection function
CN119383406A
A control method and system for LED display screen with protection function
CN119383406B
