Data transmission method and device, related equipment and computer program product
By introducing custom tags into the client page template and encrypting the target data in the data transmission request, the problem of sensitive information being easily attacked during transmission in Internet services is solved, and high security and completeness in the data transmission process is achieved sex.
Patent Information
- Application Number
- CN202411765929.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-02-18
AI Technical Summary
In Internet services, sensitive information is transmitted through the network under an unencrypted state and is susceptible to hacking and unauthorized third parties intercepting, resulting in information leakage or tampering.
By introducing custom tags into the client page template, these tags are triggered when a data transmission request is monitored, and the tag attributes are identified through the tag processor to decide whether the data needs to be encrypted. If needed, the encrypted file is loaded, the target data is encrypted, and sent to the server.
It improves the security and integrity of data during transmission, prevents data from being intercepted and tampered, and effectively prevents the leakage of sensitive information and potential cyber attacks.
Smart Images

Figure CN119484143A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and more specifically, to a data transmission method, apparatus, related equipment and computer program product. Background Art
[0002] In the digital age, data security has become a common challenge faced by all industries. With the rapid development of Internet business, a large amount of sensitive information such as personal privacy and business secrets are transmitted over the network in an unencrypted state, which is vulnerable to hacker attacks and unauthorized third-party interception, resulting in information leakage or tampering. Users can directly view the request parameters and return values of interface calls in the browser. This situation may allow attackers to launch attacks by calling the interface, thereby exposing data to risks. Summary of the invention
[0003] In view of the above problems, this application is proposed to provide a data transmission method, apparatus, related equipment and computer program product to improve the security of data during transmission. The specific solution is as follows:
[0004] In a first aspect, a data transmission method is provided, comprising:
[0005] When a data transmission request of a client page is detected, a custom tag in a page template is triggered. After the custom tag is triggered, a tag attribute of the custom tag is identified by a tag processor. The page template is used to generate a client page.
[0006] Determine whether the tag attribute indicates that the data needs to be encrypted, and if so, load the configured encryption file, and use the encryption file to obtain the target data carried in the data transmission request;
[0007] The target data is encrypted to obtain encrypted data, and the encrypted data is sent to the server.
[0008] In a possible design, in another implementation of the first aspect of the embodiment of the present application, the method further includes:
[0009] The feedback data sent by the server is received, and the feedback data is rendered to the client page by using a template engine, wherein the template engine is used to generate the client page by using the feedback data and a page template.
[0010] In a possible design, in another implementation of the first aspect of the embodiment of the present application, before the data transmission request of the client page is monitored, the method further includes:
[0011] Introduce the template engine starter dependency package, modify the basic configuration file, and set the template engine parameters;
[0012] Create a custom tag registration class, where the custom tag registration class is used to determine the name and tag attributes of the custom tag;
[0013] Create a tag processor class, the tag processor class is used to identify the name and tag attributes of the custom tag and add events to the client page, and the tag processor class corresponds to the custom tag registration class one by one.
[0014] In a possible design, in another implementation manner of the first aspect of the embodiments of the present application, the target data is encrypted to obtain the encrypted data, including:
[0015] The target data is divided into a plurality of groups of 128 bits in size, each group is divided into four 32-bit data blocks, and an initial key is generated using a preset algorithm;
[0016] Combining the data block with the initial key, performing 32 rounds of encryption operations, and then performing a reverse transformation to obtain a ciphertext, wherein the encryption operation includes any one or more of XOR, S-box transformation, mixing and shifting;
[0017] Encrypting the initial key to obtain a key;
[0018] The ciphertext and the key are used as encrypted data.
[0019] In a possible design, in another implementation of the first aspect of the embodiments of the present application, determining whether the tag attribute indicates that encryption processing of the data is required includes:
[0020] It is determined whether the tag attribute value in the tag attribute indicates that encryption processing needs to be performed on the data.
[0021] In one possible design, in another implementation of the first aspect of the embodiment of the present application, the data transmission request includes any one of a general request, an Ajax request, and a WebSocket request.
[0022] In a second aspect, a message processing device is provided, including:
[0023] A tag triggering unit, used for triggering a custom tag in a page template when a data transmission request of a client page is detected, and after the custom tag is triggered, identifying a tag attribute of the custom tag through a tag processor, and the page template is used for generating a client page;
[0024] A data encryption unit, used to determine whether the tag attribute indicates that the data needs to be encrypted, and if so, load a configured encryption file and use the encryption file to obtain the target data carried in the data transmission request;
[0025] The data sending unit is used to encrypt the target data to obtain encrypted data, and send the encrypted data to the server.
[0026] In a third aspect, an electronic device is provided, comprising: a memory and a processor;
[0027] The memory is used to store programs;
[0028] The processor is used to execute the program to implement each step of the data transmission method described in any one of the first aspects of the present application.
[0029] In a fourth aspect, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the various steps of the data transmission method described in any one of the first aspects of the present application are implemented.
[0030] In a fifth aspect, a computer program product is provided, including a computer program, which, when executed by a processor, implements the various steps of the data transmission method described in any one of the first aspects of the present application.
[0031] By means of the above technical scheme, the data transmission method of the present application, when monitoring the data transmission request of the client page, will trigger the custom tags in the page template, and identify the attributes of these tags through the tag processor to determine whether the data needs to be encrypted. If the tag attribute indicates that encryption is required, the system will automatically load the configured encryption file and use the file to obtain the target data carried in the data transmission request. The tag attributes of the custom tag can be configured and adjusted as needed, which can flexibly respond to different security requirements, and is also easy to expand and maintain. By integrating custom tags in the client page template, the encryption process can be automatically triggered when a data transmission request occurs, solving the problem of data acquisition difficulties. The target data is then encrypted, and the encrypted data is generated and sent to the server. This method improves the confidentiality and integrity of the data, not only preventing the data from being intercepted and tampered with during transmission, but also effectively preventing the leakage of sensitive information and potential network attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0033] Figure 1 A schematic diagram of a data transmission method flow chart provided in an embodiment of the present application;
[0034] Figure 2 A schematic diagram of a workflow of a template engine provided in an embodiment of the present application;
[0035] Figure 3 A schematic diagram of a flow chart of an encryption method provided in an embodiment of the present application;
[0036] Figure 4 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;
[0037] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] Before introducing this application, the English terms involved in this article are explained first:
[0039] Ajax request: A technology that can update part of a web page without reloading the entire page. It initiates asynchronous requests through JavaScript, obtains data from the server, and dynamically displays the data on the page.
[0040] WebSocket request: A network communication protocol that provides the ability to perform full-duplex communication on a single TCP connection. It allows the server to actively send messages to the client without the client constantly polling the server.
[0041] JavaScript file: Also known as JS file, it is a script file with a .js extension that contains code written in JavaScript and is used to enhance the interactivity and dynamic functionality of web pages on the client side. These files make web page design neater, avoid HTML document clutter through external references, and support modular programming for easy code maintenance and reuse.
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] The present application provides a data transmission method. When the client initiates a data transmission request, the custom tags in the page template are triggered, and the tag processor then identifies the attributes of these tags to determine whether the transmitted data needs to be encrypted. If the tag attributes indicate that encryption is required, the system will load a pre-configured encryption file, and use the encryption rules and keys in the file to encrypt the target data in the data transmission request to generate encrypted data. Finally, the encrypted data is securely sent to the server, ensuring the security and integrity of the data during transmission, and effectively preventing the leakage of sensitive information and potential network attacks.
[0044] The present application solution can be implemented based on a terminal with data processing capabilities, which can be a mobile phone, computer, server, etc.
[0045] Next, see Figure 1 , a flow chart of a data transmission method provided by the present application, the data transmission method of the present application can be implemented by a data transmission system deployed on a terminal, as described below, specifically including the following steps:
[0046] Step S100: When a data transmission request of a client page is monitored, a custom tag in a page template is triggered. After the custom tag is triggered, a tag attribute of the custom tag is identified by a tag processor.
[0047] Specifically, when a client user initiates a data transfer request in the client, such as clicking a link, submitting a form, or initiating a request, the custom tags in the page template will be triggered. These custom tags are pre-designed and embedded in the page template to execute specific logic when specific events occur. Once these custom tags are triggered, the tag processor will intervene. Its role is to identify the properties of these custom tags, which define the behavior and function of the tags. In this process, the tag processor will check the name and properties of the tag, and then perform corresponding operations based on these properties.
[0048] Step S110, determining whether the tag attribute indicates that the data needs to be encrypted, if so, executing step S120.
[0049] Specifically, when a data transmission request of a client page is detected, a custom tag in the page template will be triggered. This custom tag has a specific attribute, which is used to identify whether the data to be transmitted needs to be encrypted. If the attribute is set to indicate that encryption is required, the configured encryption file is loaded and the target data carried in the data transmission request is obtained using the encryption file.
[0050] In this way, the custom tag and tag processor not only respond to the client's data transmission request, but also encrypt the data as needed, enhancing the security of data transmission. This process is automated and transparent to the user, and does not require any additional operation by the user.
[0051] Step S120: Load the configured encrypted file, and use the encrypted file to obtain the target data carried in the data transmission request.
[0052] Specifically, once the system determines that the data needs to be encrypted, it will execute the operation of loading the configured encryption file. The system will load the pre-configured encryption file, which can be a JS file. When the encryption file is successfully loaded, the system will use the encryption file to obtain the target data carried in the data transmission request initiated by the client. This data can be information entered by the user, content submitted by the form, or content sent through a request. Obtaining the data transmitted by the user through a pre-configured encryption file solves the problem of difficulty in data acquisition, and also ensures the security of the data during transmission, preventing the data from being intercepted or tampered with when it is transmitted between the client and the server.
[0053] Step S130: encrypt the target data to obtain encrypted data, and send the encrypted data to the server.
[0054] Specifically, when the data transmission request of the client page is monitored and the system determines that the data needs to be encrypted, the encryption process will be started. The system will encrypt the target data such as the information entered by the user, the content submitted by the form, or the content sent by the request to obtain encrypted data. Subsequently, the encrypted data will be sent to the server through a secure network channel to ensure that the security and privacy of the data are protected during the transmission process, and prevent the data from being intercepted or tampered by unauthorized third parties during the transmission process.
[0055] The data transmission method of the present application, when monitoring the data transmission request of the client page, will trigger the custom tags in the page template, and identify the attributes of these tags through the tag processor to determine whether the data needs to be encrypted. If the tag attribute indicates that encryption is required, the system will automatically load the configured encryption file and use the file to obtain the target data carried in the data transmission request. The tag attributes of the custom tag can be configured and adjusted as needed, which can flexibly respond to different security requirements, and is also easy to expand and maintain. By integrating custom tags in the client page template, the encryption process can be automatically triggered when a data transmission request occurs, solving the problem of data acquisition difficulties. The target data is then encrypted, and the encrypted data is generated and sent to the server. This method improves the confidentiality and integrity of the data, not only preventing the data from being intercepted and tampered with during transmission, but also effectively preventing the leakage of sensitive information and potential network attacks.
[0056] Further, in some embodiments of the present application, after the system sends the encrypted data to the server, the feedback data transmitted by the server is obtained, and the feedback data can be processed by the template engine, see Figure 2 , Figure 2 A schematic diagram of the workflow of a template engine provided in an embodiment of the present application. The following is an introduction to this part:
[0057] Optionally, once the server has finished processing the encrypted data sent by the client, it will generate feedback data and send it back to the client, at which point the template engine will be used to process the feedback data. The template engine plays an important role in dynamically rendering the data to the client page.
[0058] like Figure 2 As shown in the figure, the template engine uses predefined page templates that contain custom tags and placeholders for dynamically filling data. When the feedback data arrives at the client, the template engine will identify the custom tags and placeholders in these page templates and fill these locations with the corresponding content in the feedback data. For example, if the feedback data contains user information or transaction results, the template engine will accurately place this information in the corresponding position of the page template. By utilizing the template engine to parse and apply the feedback data, it combines the data with the page template to generate the final client page.
[0059] This embodiment uses the template engine to analyze and apply the feedback data, combines the feedback data with the page template, and generates the final client page, so that the result processed by the server is displayed on the client page, while maintaining the dynamic and interactive nature of the page. The use of the template engine improves the efficiency of page generation and makes the development and maintenance of the client page simpler and more flexible. In this way, the real-time, security and accuracy of the data are ensured.
[0060] Further, in some embodiments of the present application, in order to realize the monitoring and processing of the data transmission request of the client page, a series of preliminary preparations may be performed before this, and this part is introduced below:
[0061] Optionally, in the backend development framework of the system, you first need to introduce the template engine starter dependency package, which is required to start and configure the template engine. This dependency package contains all the libraries and resources required for the template engine to run. Next, you need to modify the basic configuration file to set the parameters of the template engine. This can include specifying the storage path of the template file, whether to enable caching to improve performance, and the encoding format of the template, etc., to ensure that the template engine can correctly parse and render the page template.
[0062] In order to extend the functionality of the template engine and use custom tags, you need to create a custom tag registration class. The purpose of this class is to define the name and tag attributes of new custom tags, which will be used to perform specific functions in the template, such as data encryption or dynamic content insertion. Corresponding to each custom tag registration class is a tag processor class. The tag processor class is responsible for identifying the name and attributes of the custom tag, and adding corresponding event processing logic to the client page based on these attributes. These events can include operations such as data acquisition, encryption, and sending. The tag processor class ensures that the correct processing flow can be triggered when these events occur.
[0063] In this embodiment, the template engine is configured and extended to support data processing and event processing logic of custom tags. In this way, when data transmission requests from client pages are detected, the template engine is ready to process these requests and perform encryption and data transmission related operations through custom tags and processors. Thus, the entire process is automated and transparent to users, improving the security and user experience of the Web system.
[0064] Further, in some embodiments of the present application, the data may be encrypted using an encryption method specific to the present application, see Figure 3 , Figure 3 The following is a flow chart of an encryption method provided in an embodiment of the present application. The encryption method is introduced as follows:
[0065] First, the target data is divided into multiple groups of 128 bits in size. Each 128-bit data group is further divided into four 32-bit data blocks. This subdivision helps to perform more detailed operations on the data during the encryption process. At the same time, an initial key is generated using a preset algorithm. This key is the key in the encryption process. It will be used in combination with the data block and play a role in the entire encryption process. Each 32-bit data block is combined with the initial key. The data combined with the data block and the initial key is encrypted for 32 rounds. Each round can include operations such as XOR, S-box transformation, mixing and shifting. The combination of these operations increases the complexity and security of encryption. Then, after completing 32 rounds of encryption operations, the data is reversed. This step is to reorganize the data after multiple encryptions to generate the final ciphertext. To further improve security, the initial key itself also needs to be encrypted. The initial key can be encrypted using a preset algorithm to generate a random number to obtain the final key. This key will be used in the decryption process to restore the original data. Finally, the ciphertext and the key are used together as encrypted data. In this way, only the recipient with the correct key can decrypt the ciphertext and obtain the original target data.
[0066] After receiving the encrypted data, the server needs to decrypt it first. The same key is used for encryption and decryption. When decrypting, it only needs to reverse the order of the keys used for polling encryption. After obtaining the data, the server processes the data and then returns the processing results as feedback data.
[0067] This encryption method of the present embodiment provides more detailed encryption operations for the data and enhances security by dividing the target data into 128-bit groups and further subdividing them into four 32-bit data blocks. The initial key generated by the preset algorithm is combined with each data block to ensure the dynamic and unpredictable nature of the encryption. By performing 32 rounds of encryption operations, including XOR, S-box transformation, mixing and shifting, the complexity of the encryption is further increased, making it extremely difficult to crack. After completing these operations, the data will undergo a reverse transformation, which not only reorganizes the encrypted data, but also generates the final ciphertext, further ensuring the security of the data. In addition, the initial key itself also needs to be encrypted to ensure the security of the key and prevent the risk of key leakage. Ultimately, the encrypted data includes ciphertext and key, and only the recipient with the correct key can decrypt the ciphertext and restore the original data. This method not only improves the security of data transmission, but also ensures the integrity and compliance of the data, and is particularly suitable for financial transactions and sensitive information transmission with extremely high security requirements. Its flexibility and scalability also enable the encryption method to adapt to changing security threats and technological advances.
[0068] Further, in some embodiments of the present application, the determination of whether data needs to be encrypted can be made using the tag attribute value in the custom tag. The system will check the tag attribute value in the custom tag to determine whether the associated data needs to be encrypted. If the tag attribute value contains a specific identifier, it can be a Boolean value or a specific keyword. The system will determine the logic represented by the tag attribute value. For example, if the tag attribute value is true, it means that the associated data needs to be encrypted, and the system will trigger the encryption process; if the tag attribute value is false, it means that the associated data does not need to be encrypted, and the data will be transmitted according to the normal process.
[0069] In this embodiment, the decision of whether to encrypt is made by the tag attribute value, which provides a high degree of flexibility, so that the same tag can have different behaviors in different situations, allowing developers to easily set encryption rules for different data or different scenarios according to specific needs. By checking the attribute value of the custom tag to determine whether the data needs to be encrypted, the system is allowed to automatically trigger the encryption process based on the Boolean value or keyword in the tag, thereby improving efficiency and security. This setting is transparent to users, reduces human errors, simplifies maintenance, and can quickly adapt to different encryption needs while ensuring that data transmission meets compliance requirements.
[0070] Further, in some embodiments of the present application, data transmission requests cover a variety of data interaction methods that may occur in a Web system. Specifically, these requests include: general requests, Ajax requests, and WebSocket requests. These data transmission requests form the basis for data interaction between the client and the server in the Web system. In this embodiment, no matter which type of request is made, the system can ensure the security of data during transmission through custom template engine tags and improved encryption algorithms. This means that whether the user clicks on a link, submits a form, performs asynchronous data interaction, or maintains a real-time connection through WebSocket, the data involved in all these operations can be effectively encrypted and protected.
[0071] The data transmission device provided in the embodiment of the present application is described below. The data transmission device described below and the data transmission method described above can be referenced to each other.
[0072] See also Figure 4 , Figure 4 A schematic diagram of the structure of a data transmission device disclosed in an embodiment of the present application.
[0073] like Figure 4 As shown, the device may include:
[0074] The tag triggering unit 11 is used to trigger the custom tag in the page template when a data transmission request of the client page is monitored. After the custom tag is triggered, the tag attribute of the custom tag is identified by the tag processor. The page template is used to generate the client page;
[0075] A data encryption unit 12 is used to determine whether the tag attribute indicates that the data needs to be encrypted. If so, load the configured encryption file and use the encryption file to obtain the target data carried in the data transmission request;
[0076] The data sending unit 13 is used to encrypt the target data to obtain encrypted data, and send the encrypted data to the server.
[0077] Optionally, a data transmission device in an embodiment of the present application further includes:
[0078] The feedback data processing unit is used to receive the feedback data sent by the server, and render the feedback data to the client page using a template engine, wherein the template engine is used to generate the client page using the feedback data and the page template.
[0079] In a possible implementation, a data transmission device in an embodiment of the present application further includes:
[0080] The template engine configuration unit is used to introduce the template engine starter dependency package, modify the basic configuration file, and set the parameters of the template engine before the tag trigger unit 11 processes;
[0081] A tag registration class creation unit, used to create a custom tag registration class before the tag trigger unit 11 processes, wherein the custom tag registration class is used to determine the name and tag attributes of the custom tag;
[0082] The tag processor class creation unit is used to create a tag processor class before the tag trigger unit 11 processes. The tag processor class is used to identify the name and tag attributes of the custom tag and add events to the client page. The tag processor class corresponds one-to-one to the custom tag registration class.
[0083] In a possible implementation, the data encryption unit 12 encrypts the target data to obtain the encrypted data, including:
[0084] The target data is divided into a plurality of groups of 128 bits in size, each group is divided into four 32-bit data blocks, and an initial key is generated using a preset algorithm;
[0085] Combining the data block with the initial key, performing 32 rounds of encryption operations, and then performing a reverse transformation to obtain a ciphertext, wherein the encryption operation includes any one or more of XOR, S-box transformation, mixing and shifting;
[0086] Encrypting the initial key to obtain a key;
[0087] The ciphertext and the key are used as encrypted data.
[0088] In a possible implementation, the data encryption unit 12 determines whether the tag attribute represents a process in which encryption processing of the data is required, including:
[0089] It is determined whether the tag attribute value in the tag attribute indicates that encryption processing needs to be performed on the data.
[0090] In a possible implementation, the data transmission request includes any one of a general request, an Ajax request, and a WebSocket request.
[0091] The present application also provides an electronic device in an embodiment. Figure 5 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present application. The electronic device in the embodiment of the present application may include but is not limited to fixed terminals such as mobile phones, tablet computers, wearable devices, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0092] like Figure 5 As shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 to a random access memory (RAM) 603 to implement the data transmission method of the aforementioned embodiment of the present application. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0093] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a memory card, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0094] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the data transmission method of the aforementioned embodiment of the present application.
[0095] The present application also provides a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the present application is generated in whole or in part.
[0096] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.
[0097] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0098] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0099] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
Claims
1. A data transmission method, characterized in that: include: When a data transmission request of a client page is detected, a custom tag in a page template is triggered. After the custom tag is triggered, a tag attribute of the custom tag is identified by a tag processor. The page template is used to generate a client page. Determine whether the tag attribute indicates that the data needs to be encrypted, and if so, load the configured encryption file, and use the encryption file to obtain the target data carried in the data transmission request; The target data is encrypted to obtain encrypted data, and the encrypted data is sent to the server.
2. The method according to claim 1, characterized in that Also includes: The feedback data sent by the server is received, and the feedback data is rendered to the client page by using a template engine, wherein the template engine is used to generate the client page by using the feedback data and a page template.
3. The method according to claim 1, characterized in that Before the data transmission request of the client page is monitored, the method further includes: Introduce the template engine starter dependency package, modify the basic configuration file, and set the template engine parameters; Create a custom tag registration class, where the custom tag registration class is used to determine the name and tag attributes of the custom tag; Create a tag processor class, the tag processor class is used to identify the name and tag attributes of the custom tag and add events to the client page, and the tag processor class corresponds to the custom tag registration class one by one.
4. The method according to claim 1, characterized in that: The target data is encrypted to obtain the encrypted data, comprising: The target data is divided into a plurality of groups of 128 bits in size, each group is divided into four 32-bit data blocks, and an initial key is generated using a preset algorithm; The data block is combined with the initial key, and 32 rounds of encryption operations are performed, followed by a reverse transformation to obtain a ciphertext, wherein the encryption operation includes any one or more of XOR, S-box transformation, mixing and shifting; Encrypting the initial key to obtain a key; The ciphertext and the key are used as encrypted data.
5. The method according to claim 1, characterized in that Determining whether the tag attribute indicates that encryption processing of the data is required includes: It is determined whether the tag attribute value in the tag attribute indicates that encryption processing needs to be performed on the data.
6. The method according to claim 1, characterized in that The data transmission request includes any one of a general request, an Ajax request and a WebSocket request.
7. A data transmission device, characterized in that: include: A tag triggering unit, used for triggering a custom tag in a page template when a data transmission request of a client page is detected, and after the custom tag is triggered, identifying a tag attribute of the custom tag through a tag processor, and the page template is used for generating a client page; A data encryption unit, used to determine whether the tag attribute indicates that the data needs to be encrypted, and if so, load a configured encryption file and use the encryption file to obtain the target data carried in the data transmission request; The data sending unit is used to encrypt the target data to obtain encrypted data, and send the encrypted data to the server.
8. An electronic device, characterized in that: include: Memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step in the data transmission method according to any one of claims 1 to 6.
9. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step in the data transmission method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, each step in the data transmission method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Implementation method of a lightweight block cipher algorithm Wheel
CN109768854A
Webpage data transmission system, method and device, medium and equipment
CN112632585A
Webpage data processing system, method and device, medium and equipment
CN112737791A
bit slice technology-based dynamic S-box block cipher encryption and decryption method
CN113691364A
Data interaction management method and device, terminal equipment and storage medium
CN116996287A