Parameter transmission method and device based on JSON, equipment and storage medium

By initializing the API interface in web applications to obtain dynamic encryption parameters and encrypting the input parameters of the JSON interface, the problem of easy cracking of secret keys in JavaScript code is solved, and higher security and flexibility are achieved.

CN119473660APending Publication Date: 2025-02-18GUANGDONG ESHORE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411637470.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

When the prior art protects web applications security, the characteristics of JavaScript code lead to the secret key being exposed in plain text, which is easy to be reverse compiled and cracked, and has low security.

Method used

Dynamic encryption parameters are obtained by initializing the API interface, and the input parameters of the JSON interface are first encrypted to obtain the encrypted packet. The encrypted packet is transmitted to the backend for decryption verification. After successful, the output parameters are determined through the backend response and the second encryption process is returned.

Benefits of technology

Encryption is performed using dynamic encryption parameters to prevent back-compilation and cracking of encryption parameters and improve security; at the same time, targeted encryption processing is performed based on different interface types, adapting to different business scenarios, increasing flexibility and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473660A_ABST
    Figure CN119473660A_ABST
Patent Text Reader

Abstract

The invention provides a JSON-based parameter transmission method, device and equipment and a storage medium, and the method comprises the steps: obtaining a dynamic encryption parameter through an initialization API interface, obtaining an input parameter through a JSON interface, determining the interface type of the JSON interface, and according to the interface type and the dynamic encryption parameter, transmitting the dynamic encryption parameter to the JSON interface; the method comprises the steps of performing first encryption processing on an input parameter to obtain an encrypted message, transmitting the encrypted message to a rear end, performing decryption verification on the encrypted message to obtain a decryption verification result, determining an output parameter in response to the input parameter through the rear end when the decryption verification result represents that decryption succeeds, performing second encryption processing on the output parameter, and returning the output parameter. The dynamic encryption parameters are used for encryption, so that the condition of cracking the encryption parameters by reverse compiling is prevented, and the security is improved; and encryption processing is targeted based on different interface types to adapt to different service scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a JSON-based parameter transmission method, apparatus, device, and storage medium. Background Art

[0002] In today's technological environment, many web applications and website development rely on web technology. Online contacts automatically download and run JavaScript scripting language through the browser. This language is a directly interpreted scripting language, and its code is presented in plain text. In addition, the information communication between the front-end and the back-end can only be based on the API interface and implemented in the JSON plain text data format, so it is very easy to be stolen.

[0003] At present, the security of web applications is usually protected by code obfuscation and encryption of API interface interactions, random name replacement of local variables and local functions in the code, and removal of whitespace to reduce the readability of the code; at the same time, front-end and back-end personnel agree on secret keys to decrypt input and output parameters. However, due to the characteristics of JavaScript code, the secret keys are basically exposed to the public network in plain text, and the encryption rules are clearly visible in the code. Therefore, professional technicians can read the front-end source code key and reverse compile to crack the secret key and other encryption parameters, but the security is still low. Summary of the invention

[0004] The embodiments of the present application provide a JSON-based parameter transmission method, apparatus, device, and storage medium to solve at least one problem existing in the related art. The technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for parameter transmission based on JSON, including:

[0006] Get dynamic encryption parameters through the initialization API interface and get input parameters through the JSON interface;

[0007] Determine the interface type of the JSON interface, and perform a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message;

[0008] Transmitting the encrypted message to the backend, decrypting and verifying the encrypted message, and obtaining a decryption and verification result;

[0009] When the decryption verification result indicates that the decryption is successful, the backend determines the output parameter in response to the input parameter, and performs a second encryption process on the output parameter before returning it.

[0010] In one embodiment, the dynamic encryption parameters include a ticket and a dynamic key parameter; and obtaining the dynamic encryption parameters through the initialization API interface includes:

[0011] The front end sends an initialization request to the API interface;

[0012] The back end responds to the initialization request and sends a ticket to the front end so that the front end generates dynamic key parameters required for encryption.

[0013] In one implementation, performing a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message includes:

[0014] Determining target parameters from the input parameters according to the interface type;

[0015] According to the dynamic key parameter, a first encryption process is performed on the target parameter and the ticket to obtain an encrypted message.

[0016] In one implementation, determining the target parameter from the input parameter according to the interface type includes:

[0017] When the interface type is a full-input encrypted type interface, determining the input parameter as a target parameter;

[0018] When the interface type is a partially-entered encrypted type interface, irregular parameters in the input parameters are determined as target parameters.

[0019] In one implementation, performing a first encryption process on the target parameter and the ticket according to the dynamic key parameter to obtain an encrypted message includes:

[0020] Using the dynamic key parameter, perform AES encryption on the target parameter and the ticket to obtain an AES encryption result;

[0021] The AES encryption result is encrypted twice by an asymmetric encryption algorithm to obtain an encrypted message; wherein the header of the encrypted message includes the dynamic key parameter.

[0022] In one implementation, the decrypting and verifying the encrypted message to obtain a decryption and verification result includes:

[0023] Decrypting the encrypted message, and when the ticket is successfully decrypted, determining the function type of the JSON interface;

[0024] Determine the usage status of the ticket, and determine the decryption verification result according to the function type and the usage status.

[0025] In one implementation, determining the decryption verification result according to the function type and the usage status includes:

[0026] When the function type is a query type, if the usage time in the usage status is less than or equal to a time threshold, determining a decryption verification result indicating successful decryption;

[0027] When the function type is a handling type, if the number of uses in the use status is less than or equal to a number threshold, a decryption verification result indicating successful decryption is determined.

[0028] In a second aspect, an embodiment of the present application provides a JSON-based parameter transmission device, including:

[0029] The acquisition module is used to obtain dynamic encryption parameters through the initialization API interface and obtain input parameters through the JSON interface;

[0030] An encryption module, used to determine the interface type of the JSON interface, and perform a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message;

[0031] A decryption module is used to transmit the encrypted message to the back end, decrypt and verify the encrypted message, and obtain a decryption verification result;

[0032] The output module is used to determine the output parameter in response to the input parameter through the back end when the decryption verification result indicates that the decryption is successful, and return the output parameter after performing a second encryption process on the output parameter.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.

[0034] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.

[0035] The beneficial effects of the above technical solution include at least:

[0036] By initializing the API interface to obtain dynamic encryption parameters and obtaining input parameters through the JSON interface, the interface type of the JSON interface is determined, and according to the interface type and the dynamic encryption parameters, the input parameters are subjected to a first encryption process to obtain an encrypted message, the encrypted message is transmitted to the back end, and the encrypted message is decrypted and verified to obtain a decryption verification result. When the decryption verification result indicates that the decryption is successful, the output parameters are determined by the back end in response to the input parameters, and the output parameters are subjected to a second encryption process and returned. Encryption using dynamic encryption parameters is beneficial to preventing the occurrence of reverse compilation and cracking of encryption parameters, thereby improving security. At the same time, targeted encryption processing based on different interface types can adapt to different business scenarios, thereby increasing flexibility and scalability.

[0037] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.

[0039] Figure 1 This is a schematic diagram of the steps of a parameter transmission method based on JSON according to an embodiment of the present application;

[0040] Figure 2 This is a flow chart of a parameter transmission method based on JSON according to an embodiment of the present application;

[0041] Figure 3 This is a structural block diagram of a JSON-based parameter transmission device according to an embodiment of the present application;

[0042] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0043] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.

[0044] Glossary:

[0045] JSON (JavaScript Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript (the js specification developed by the European Computer Manufacturers Association) and uses a text format that is completely independent of programming languages ​​to store and represent data. The concise and clear hierarchical structure makes JSON an ideal data exchange language that is easy for people to read and write, as well as easy for machines to parse and generate, and effectively improves network transmission efficiency.

[0046] AES encryption algorithm (Advanced Encryption Standard): is a symmetric encryption algorithm, also known as the Advanced Encryption Standard. The AES encryption algorithm uses 128-bit, 192-bit or 256-bit keys to encrypt and decrypt data. It has the advantages of high strength, high speed and easy implementation.

[0047] RSA algorithm: It is an asymmetric encryption algorithm. Unlike the symmetric encryption algorithm, the RSA algorithm has two different keys, one is the public key and the other is the private key. The public key can be made public and used to encrypt information; the private key is kept secret by the owner and is used to decrypt information encrypted with the public key.

[0048] Reference Figure 1 , a flow chart of a parameter transmission method based on JSON according to an embodiment of the present application is shown. The parameter transmission method based on JSON may at least include steps S100-S400:

[0049] S100, obtaining dynamic encryption parameters through an initialization API interface and obtaining input parameters through a JSON interface.

[0050] S200. Determine the interface type of the JSON interface, and perform a first encryption process on the input parameters according to the interface type and dynamic encryption parameters to obtain an encrypted message.

[0051] S300: Transmit the encrypted message to the backend, perform decryption verification on the encrypted message, and obtain a decryption verification result.

[0052] S400: When the decryption verification result indicates that the decryption is successful, the backend determines the output parameter in response to the input parameter, and performs a second encryption process on the output parameter before returning it.

[0053] The JSON-based parameter transmission method of the embodiment of the present application can be executed by a front-end and a back-end, and the front-end and the back-end can be a computer, a mobile phone, a tablet, a cloud server, etc.

[0054] The technical solution of the embodiment of the present application obtains dynamic encryption parameters through an initialization API interface and obtains input parameters through a JSON interface, determines the interface type of the JSON interface, performs a first encryption processing on the input parameters according to the interface type and the dynamic encryption parameters, obtains an encrypted message, transmits the encrypted message to a back-end, decrypts and verifies the encrypted message, obtains a decryption verification result, and when the decryption verification result indicates that the decryption is successful, determines the output parameters through the back-end in response to the input parameters, performs a second encryption processing on the output parameters and returns them, and uses dynamic encryption parameters for encryption, which is beneficial to preventing the occurrence of reverse compilation and cracking of encryption parameters, thereby improving security; at the same time, targeted encryption processing based on different interface types can adapt to different business scenarios, thereby increasing flexibility and scalability.

[0055] like Figure 2 As shown, in one embodiment, the dynamic encryption parameters include a ticket and a dynamic key parameter. In step S100, the dynamic encryption parameters are obtained by initializing the API interface. Specifically:

[0056] The front end sends an initialization request to the API interface, and the back end responds to the initialization request based on BASE64 and sends a token to the front end. After receiving it, the front end decrypts it through BASE64 to generate the dynamic key parameters required for encryption, providing a basis for the subsequent encryption process.

[0057] It should be noted that the dynamic encryption parameters are obtained based on the initialization request. Each initialization request generates a valid dynamic encryption parameter. The dynamic encryption parameter will become invalid after being used once. Therefore, the dynamic encryption parameter is "dynamic" rather than persistent and valid. Therefore, the dynamic key parameter is also "dynamic". The dynamic encryption parameter is unpredictable. This single-use method can effectively prevent malicious users from repeatedly requesting the interface and reduce security risks. At the same time, it can effectively ensure the security of parameters during Internet transmission, and effectively prevent information leakage caused by input and output parameter data being captured or cracked, as well as other types of Internet security issues.

[0058] In one implementation, a user may access a request JSON interface through a front-end, and obtain input parameters (i.e., input parameters) related to the request through the JSON interface.

[0059] In one embodiment, the interface types of the JSON interface include, but are not limited to, full-input encrypted type interfaces, partial-input encrypted type interfaces, and unencrypted type interfaces. Full-input encrypted type interfaces are interfaces where all input parameters need to be encrypted, and the input parameters (input parameters) are usually controllable, such as input parameters such as numbers, area codes, and time; partial-input encrypted type interfaces: usually have irregular input parameters such as notes, source channels, image file streams, image base64, etc.; unencrypted type interfaces are usually auxiliary interfaces for input parameters without sensitive data and are not encrypted.

[0060] In one implementation, in step S200, the input parameter is first encrypted according to the interface type and the dynamic encryption parameter to obtain an encrypted message, including steps S210-S220:

[0061] S210: Determine target parameters from input parameters according to the interface type.

[0062] Optionally, when the interface type is a full-input encrypted interface, the input parameter is determined as the target parameter; when the interface type is a partial-input encrypted interface, the irregular parameter in the input parameter is determined as the target parameter. For example, the irregular parameter can be a remark, source channel, image file stream, image base64, and other parameters.

[0063] S220: Perform a first encryption process on the target parameter and the ticket according to the dynamic key parameter to obtain an encrypted message.

[0064] Optionally, steps S2201-S2202 are included:

[0065] S2201, using dynamic key parameters, perform AES encryption on the target parameters and the ticket to obtain an AES encryption result;

[0066] Optionally, after the front end obtains the ticket and determines the target parameters, the front end uses the dynamic key parameters to perform AES encryption on the target parameters and the ticket to obtain an AES encryption result. Exemplarily, the dynamic key parameters may include the key offset (IV) and key (key) of AES, and the target parameters and the ticket are AES encrypted by the key offset (IV) and key (key) of AES, thereby obtaining an AES encryption result. Among them, the AES encryption algorithm has the advantages of high strength, high speed and easy implementation, and can effectively protect the confidentiality of data.

[0067] S2202. Perform secondary encryption on the AES encryption result using an asymmetric encryption algorithm to obtain an encrypted message.

[0068] Then, the AES encryption result is re-encrypted using an asymmetric encryption algorithm such as the public key of RAS to obtain an encrypted message. The header of the encrypted message includes dynamic key parameters, which are sent to the backend together with the encrypted message. The asymmetric nature of the RSA algorithm ensures the security of the key. The public key is used for encryption and the private key is used for decryption, which increases the difficulty of cracking.

[0069] In one implementation, the encrypted message is transmitted to the backend, and the encrypted message is decrypted and verified in step S300 to obtain a decryption verification result, including steps S310-S320:

[0070] S310: Decrypt the encrypted message, and when the ticket is successfully obtained through decryption, determine the function type of the JSON interface.

[0071] Optionally, after receiving the double-encrypted encrypted message, the backend uses the private key to decrypt the encrypted message containing the input parameters (input parameters), and if the decryption is successful and the ticket is obtained, the function type of the JSON interface is determined. The function type includes but is not limited to the query type and the handling type.

[0072] Optionally, if the decryption fails, the backend automatically analyzes the reason for the decryption failure and returns it to the frontend for the user to understand and end the process.

[0073] S320: Determine the usage status of the ticket, and determine the decryption verification result according to the function type and the usage status.

[0074] Optionally, the usage status of the ticket is determined, where the usage status includes the usage time and the number of times the ticket is used. S320 includes steps S3201-S3202:

[0075] S3201: When the function type is a query type, if the usage time in the usage status is less than or equal to the time threshold, determine a decryption verification result indicating successful decryption.

[0076] It should be noted that for the query class, the expiration time is set, because querying a piece of data may require requesting multiple interfaces. If the initialization interface is repeatedly requested, resources will be wasted. Therefore, the expiration time is specified. For example, the time threshold is 2 minutes, and it will expire after 2 minutes. Within the expiration time, the front end can use the previously obtained dynamic key parameters for encryption, without requesting the initialization interface again, avoiding frequent requests for the initialization interface and wasting resources, and can also improve efficiency.

[0077] For example, the time threshold is 2 minutes, and other embodiments may be adjusted based on actual conditions. Therefore, when the function type is a query type, if the usage time in the usage status is less than or equal to 2 minutes, the ticket is considered valid, and a decryption verification result indicating successful decryption is determined; otherwise, the ticket is determined to be invalid, and a decryption verification result indicating a failed decryption is determined.

[0078] S3202. When the function type is a processing type, if the number of times used in the usage status is less than or equal to the number threshold, a decryption verification result indicating successful decryption is determined, that is, the decryption fails.

[0079] Exemplarily, the number threshold is 1 time. When the function type is processing type, if the number of uses in the usage status is less than or equal to 1 time, the ticket is considered valid, and a decryption verification result representing a successful decryption is determined; otherwise, the ticket is determined to be invalid, and a decryption verification result representing a decryption failure is determined, that is, the decryption fails.

[0080] In one embodiment, in step S400, when the decryption verification result indicates that the decryption is successful, since the input parameters will be obtained after decryption, the normal JSON request logic is executed at this time, the output parameters are determined by the backend in response to the input parameters, and the output parameters are subjected to a second encryption process and returned to the JSON interface, the front end receives the output parameters after the second encryption process and decrypts them, and the output parameters are obtained if the decryption is successful, and finally the front end executes the normal logic of the front end page based on the output parameters, such as displaying the query results or the processing results corresponding to the query class or the processing class. It should be noted that the second encryption process can be AES encryption, and the process ends if the decryption fails.

[0081] The method of the embodiment of the present application introduces the judgment of the validity of the bill, which is conducive to ensuring the integrity and authenticity of the data; at the same time, the present solution does not need to change the original architecture of the interface access. Both the front-end and the back-end can write a general solution and put it into practice, reducing development resources and time costs, and can easily implement the upgrade of the encryption and decryption functions; personalized solutions can be formulated according to different interface characteristics, such as processing and query types, etc., which are highly flexible and can better adapt to the needs of various business scenarios; the use of a dynamic encryption scheme greatly improves the security of the interface, avoids users maliciously using the same input parameter to repeatedly request submission of the interface, thereby effectively reducing resource consumption, and after the input and output parameters are dynamically encrypted, even if the data is obtained by the crawler, the crawler cannot interpret the data content because it does not have the key and offset required for decryption, effectively ensuring the security and confidentiality of the data.

[0082] Reference Figure 3 , shows a structural block diagram of a JSON-based parameter transmission device according to an embodiment of the present application, and the device may include:

[0083] The acquisition module is used to obtain dynamic encryption parameters through the initialization API interface and obtain input parameters through the JSON interface;

[0084] The encryption module is used to determine the interface type of the JSON interface, and perform a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message;

[0085] The decryption module is used to transmit the encrypted message to the backend, decrypt and verify the encrypted message, and obtain the decryption verification result;

[0086] The output module is used to determine the output parameters in response to the input parameters through the back end when the decryption verification result indicates that the decryption is successful, and return the output parameters after performing a second encryption process.

[0087] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.

[0088] Reference Figure 4 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the JSON-based parameter transmission method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.

[0089] In one embodiment, the electronic device also includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and complete mutual communication. 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 ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0090] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.

[0091] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the JSON-based parameter transmission method provided in the above embodiment.

[0092] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.

[0093] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.

[0094] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.

[0095] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).

[0096] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.

[0097] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0098] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0099] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.

[0100] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0101] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.

[0102] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.

[0103] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A parameter transmission method based on JSON, characterized in that: include: Get dynamic encryption parameters through the initialization API interface and get input parameters through the JSON interface; Determine the interface type of the JSON interface, and perform a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message; Transmitting the encrypted message to the backend, decrypting and verifying the encrypted message, and obtaining a decryption and verification result; When the decryption verification result indicates that the decryption is successful, the backend determines the output parameter in response to the input parameter, and performs a second encryption process on the output parameter before returning it.

2. The JSON-based parameter transmission method according to claim 1, characterized in that: The dynamic encryption parameters include a ticket and a dynamic key parameter; The obtaining of dynamic encryption parameters by initializing the API interface includes: The front end sends an initialization request to the API interface; The back end responds to the initialization request and sends a ticket to the front end so that the front end generates dynamic key parameters required for encryption.

3. The JSON-based parameter transmission method according to claim 2, characterized in that: The performing a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message comprises: Determining target parameters from the input parameters according to the interface type; According to the dynamic key parameter, a first encryption process is performed on the target parameter and the ticket to obtain an encrypted message.

4. The JSON-based parameter transmission method according to claim 3, characterized in that: Determining the target parameter from the input parameter according to the interface type includes: When the interface type is a full-input encrypted type interface, determining the input parameter as a target parameter; When the interface type is a partially-entered encrypted type interface, irregular parameters in the input parameters are determined as target parameters.

5. The JSON-based parameter transmission method according to claim 3, characterized in that: The step of performing a first encryption process on the target parameter and the ticket according to the dynamic key parameter to obtain an encrypted message comprises: Using the dynamic key parameter, perform AES encryption on the target parameter and the ticket to obtain an AES encryption result; The AES encryption result is encrypted twice by an asymmetric encryption algorithm to obtain an encrypted message; wherein the header of the encrypted message includes the dynamic key parameter.

6. The JSON-based parameter transmission method according to any one of claims 2 to 5, characterized in that: The decryption verification of the encrypted message to obtain a decryption verification result includes: Decrypting the encrypted message, and when the ticket is successfully decrypted, determining the function type of the JSON interface; Determine the usage status of the ticket, and determine the decryption verification result according to the function type and the usage status.

7. The JSON-based parameter transmission method according to claim 6, characterized in that: Determining the decryption verification result according to the function type and the usage status includes: When the function type is a query type, if the usage time in the usage status is less than or equal to a time threshold, determining a decryption verification result indicating successful decryption; When the function type is a handling type, if the number of uses in the use status is less than or equal to a number threshold, a decryption verification result indicating successful decryption is determined.

8. A parameter transmission device based on JSON, characterized in that: include: The acquisition module is used to obtain dynamic encryption parameters through the initialization API interface and obtain input parameters through the JSON interface; An encryption module, used to determine the interface type of the JSON interface, and perform a first encryption process on the input parameter according to the interface type and the dynamic encryption parameter to obtain an encrypted message; A decryption module is used to transmit the encrypted message to the back end, decrypt and verify the encrypted message, and obtain a decryption verification result; The output module is used to determine the output parameter in response to the input parameter through the back end when the decryption verification result indicates that the decryption is successful, and return the output parameter after performing a second encryption process on the output parameter.

9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.