Data processing methods, apparatus, storage media and computer equipment
By identifying message scenarios and selecting appropriate encryption strategies during data transmission, key data items are encrypted, which solves the limitations of network isolation schemes and the problem of unified encryption rules, thereby improving data security, transaction efficiency, and system performance.
Patent Information
- Application Number
- CN202410568865.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-05-09
AI Technical Summary
In existing technologies, data transmission schemes based on network isolation have limitations and high costs, and uniform encryption rules lead to low transaction efficiency and reduced confidentiality.
By identifying the data items in the message to be sent, the scene recognition model is used to determine the scene in which the message is located, and the corresponding encryption strategy is selected to encrypt the key data items, including anti-replay, anti-tampering and anti-repudiation strategies.
It improves data security, enhances transaction efficiency and system performance, reduces redundant encryption, and improves user experience.
Smart Images

Figure CN118316718B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and specifically relates to a data processing method, a data processing device, a machine-readable storage medium, and a computer device. Background Technology
[0002] In the context of the internet, the requirements for secure data transmission are becoming increasingly stringent, especially in certain specific scenarios where the confidentiality of data is paramount. To achieve secure transmission of critical data, existing technologies have proposed solutions based on network isolation. These methods are typically implemented based on physical location, such as establishing dedicated networks in specific areas. However, this approach has limitations, high costs, and clearly does not meet the current requirements for mobile internet access. In addition, existing technologies have also proposed solutions based on encryption algorithms to perform unified encryption on data.
[0003] For example, to ensure secure transmission of transaction data, existing credit products employ the same encryption rule for various transaction data. This rule combines the SM2, SM3, and SM4 algorithms from the Chinese national cryptographic algorithm, and it encrypts and decrypts the entire transaction message as a whole. The encryption process can be briefly described as follows: The transaction message is encrypted using the SM3 algorithm to obtain a digest; the digest is digitally signed using the SM2 algorithm's private key; a key is generated using the SM4 algorithm; the generated SM4 key is used to encrypt the entire transaction message; the SM4 key is then encrypted using the SM2 algorithm; and the encrypted transaction message and digital signature are sent to the recipient. The decryption process corresponding to this rule can be briefly described as follows: Receive the encrypted transaction message and digital signature; decrypt the received SM4 key using the SM2 algorithm to obtain the SM4 key; decrypt the encrypted transaction message using the SM4 key to obtain the decrypted transaction message; decrypt the digital signature using the SM2 algorithm public key to ensure that the transaction message was sent by the requester; encrypt the decrypted transaction message using the SM3 algorithm to obtain the digest; compare the digest content with the content of the decrypted signature verification to prevent the message from being tampered with during transmission. If all the above verifications pass, the decryption is complete, and the decrypted transaction message is sent to the backend for business processing.
[0004] Using the same set of encryption rules for all data interaction scenarios can easily lead to the following two types of drawbacks:
[0005] 1) As the scenarios and data encryption requirements become more and more diverse, more and more encryption rules will be added, which will turn a very short message into a huge ciphertext after encryption, affecting transaction efficiency, reducing system performance, and thus causing a poor user experience.
[0006] 2) A unified encryption rule is adopted. Once the encryption rule is broken, the attacker can cause damage to the system at will and move freely in different scenarios. For example, in the encryption rule based on the national cryptographic algorithm mentioned above, the attacker can decrypt the message after obtaining the public key of the SM2 algorithm. It can be seen that with the widespread application of encryption rules, the confidentiality of transaction messages has been reduced.
[0007] In summary, in order to balance the needs of data confidentiality, transaction efficiency, and system performance, establishing differentiated encryption rules for different transaction scenarios is a technical challenge that urgently needs to be overcome. Summary of the Invention
[0008] The purpose of this application is to provide a data processing method, data processing device, storage medium, and computer equipment to overcome at least one of the deficiencies in the prior art, namely, the construction of dedicated network to ensure data confidentiality and the adoption of unified encryption rules in different scenarios.
[0009] To achieve the above objectives, the first aspect of this application provides a data processing method applied to a first data node in a network, the method comprising:
[0010] Identify data items in the message to be sent;
[0011] The identified data items are input into a preset scene recognition model to identify the scene in which the message to be sent is located;
[0012] The encryption strategy corresponding to the scenario in which the message to be sent is located is selected to encrypt the message to be sent, thereby obtaining an encrypted message, which is used to send to the second data node in the network;
[0013] The scene recognition model is used to generate a score based on the cumulative score of data items in each scene, and to determine the scene in which the message to be sent is located based on the score.
[0014] In this embodiment of the application, the step of generating a score based on the cumulative score of data items in each scenario, and determining the scenario in which the message to be sent belongs based on the score, includes:
[0015] Calculate the cumulative score of each data item in each scenario;
[0016] The maximum accumulated score is used as the score for the message to be sent;
[0017] The scenario corresponding to the accumulated score, which serves as the assigned score, is determined as the scenario in which the message to be sent is located.
[0018] In this embodiment of the application, the calculation of the cumulative score of data items in each scenario includes:
[0019] For each scenario, calculate the first score value of each data item in that scenario, and sum all the first score values in that scenario to obtain the cumulative score result for that scenario;
[0020] The first score is the product of the base score and weight of the corresponding data item in that scenario.
[0021] In this embodiment of the application, when the message to be sent is the first i messages to be sent of the first data node, the weight is a preset initial weight, i≥N, where N represents the first preset value;
[0022] When the message to be sent is not one of the first i messages to be sent from the first data node, the weight is the updated weight;
[0023] The updated weight is the product of the first ratio and the second ratio;
[0024] The first ratio is the ratio of the number of times a data item appears in the corresponding scenario to the total number of times the data item appears in all scenarios;
[0025] The second ratio is the ratio of the number of successful transactions in the corresponding scenario to the total number of successful transactions. When the first data node receives the response message of the second data node to the encrypted message, it is recorded as a successful transaction.
[0026] In this embodiment of the application, when selecting the encryption strategy corresponding to the scenario where the message to be sent is located to encrypt the message to be sent, only the values of the key data items in the message to be sent are encrypted.
[0027] In this embodiment of the application, the method further includes: determining whether the initial weighted score value of the data item in the scenario where the message to be sent is located is greater than a second preset value; if so, then the data item is determined to be a critical data item, otherwise it is a non-critical data item;
[0028] The initial weighted score value is the product of the basic score value of the data item in the scenario where the message to be sent is located and the first ratio.
[0029] In this application embodiment, the scenarios include user login scenarios and financial transaction scenarios.
[0030] In this embodiment of the application, the encryption strategy includes a first encryption strategy to prevent replay, a second encryption strategy to prevent tampering and repudiation, and a third encryption strategy to prevent repudiation.
[0031] In this embodiment of the application, the method further includes:
[0032] Receive the response message from the second data node to the encrypted message;
[0033] Identify the data items in the response message;
[0034] The identified data items are input into a preset scene recognition model to identify the scene in which the response message is located;
[0035] Select the decryption strategy corresponding to the scenario in which the response message is located to decrypt the response message.
[0036] A second aspect of this application provides a data processing apparatus disposed within a first data node in a network, the apparatus comprising:
[0037] The data item identification module is used to identify data items in the message to be sent;
[0038] The scene recognition module is used to input the recognized data items into a preset scene recognition model to identify the scene in which the message to be sent is located;
[0039] The encryption module is used to select an encryption strategy corresponding to the scenario in which the message to be sent is located, and encrypt the message to be sent to obtain an encrypted message, which is used to send to the second data node in the network;
[0040] The scene recognition model is used to generate a score based on the cumulative score of data items in each scene, and to determine the scene in which the message to be sent is located based on the score.
[0041] A third aspect of this application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the data processing method described in the first aspect of this application.
[0042] A fourth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the data processing method described in the first aspect of this application.
[0043] The fifth aspect of this application provides a computer program product, including a computer program that, when executed by a processor, implements the data processing method described in the first aspect of this application.
[0044] Through the above technical solution, before encrypting the message, the scenario in which the message is located is identified, and then the encryption strategy corresponding to the scenario is selected to encrypt the message. The diversity of message encryption methods improves the overall data security of the system. While taking into account data security, the adoption of different encryption methods avoids the redundancy phenomenon presented by using complex encryption for non-critical fields such as some public information in the message, thereby improving transaction efficiency, system performance and user experience.
[0045] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0046] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:
[0047] Figure 1 The diagram illustrates an application example of the data processing method according to an embodiment of this application.
[0048] Figure 2 This illustration schematically shows a flowchart of a data processing method according to an embodiment of this application;
[0049] Figure 3 The illustration shows another flowchart of a data processing method according to an embodiment of this application;
[0050] Figure 4 This schematic diagram illustrates the composition of a data processing apparatus according to an embodiment of the present application;
[0051] Figure 5 The diagram illustrates an application example of a data processing apparatus according to an embodiment of this application.
[0052] Figure 6 Schematic illustration Figure 5 A flowchart illustrating a data processing method in the application example shown;
[0053] Figure 7 The diagram illustrates the internal structure of a computer device according to an embodiment of this application. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0055] It should be noted that if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0056] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0057] Method Implementation Examples
[0058] The data processing method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, the first data node 102 and the second data node 104 communicate through a computer network. The first data node 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, etc., and the second data node 104 can be a server, which can be implemented through a standalone server or a server cluster consisting of multiple servers.
[0059] See Figure 2 In this embodiment, a data processing method is provided, and this embodiment applies the method to the above-mentioned... Figure 1 Taking the first data node 102 as an example, the following steps are included:
[0060] Step S1: Identify the data items in the message to be sent.
[0061] It is important to understand that a message consists of multiple data items. For example, the data items in an e-commerce transaction message are mainly the order number and order details, while the data items in a contract transaction message are mainly the contract number and amount.
[0062] Step S2: Input the data items in the identified message to be sent into the preset scene recognition model to identify the scene where the message to be sent is located. The scene recognition model is used to generate an assigned score based on the cumulative score of the data items in each scene, and to determine the scene where the message to be sent is located based on the assigned score.
[0063] For example, a scene recognition model consists of a score conversion unit and a scene determination unit. The score conversion unit takes the data items in the message to be sent as input and the score conversion result (assigned score) as output. The scene determination unit takes the assigned score as input and the scene number as output. To realize the score conversion processing from data items in the message to be sent to assigned scores, a basic scoring table can be pre-constructed. The basic scoring table gives the basic score value of each data item in each scene. The cumulative score of the data item in each scene can be obtained from the basic scoring table. The basic score value can be dynamically adjusted by gradually accumulating the results according to the number of messages. The basic scoring table is shown in Table 1.
[0064] Table 1
[0065] Scene 1 Scene 2 … Data item 1 0 0.6 … Data item 2 0.1 0.2 … … … … …
[0066] S3. Select the encryption strategy corresponding to the scenario to encrypt the message to be sent, and obtain the encrypted message. The encrypted message is used to send to the second data node in the network.
[0067] In credit products, the scenarios in which messages are sent typically include user login scenarios, financial transaction scenarios involving e-commerce, and financial transaction scenarios involving contracts.
[0068] For user login scenarios, the encryption strategy can employ a primary encryption strategy to prevent replay attacks. For example, this primary encryption strategy could be "timestamp + nonce + symmetric encryption + asymmetric encryption." Symmetric encryption refers to using symmetric encryption algorithms such as AES, DES, 3DES, SM1, and SM4, while asymmetric encryption refers to using asymmetric encryption algorithms such as SM2. Preventing replay attacks refers to preventing replay attacks, where an attacker sends a packet that the target host has already received to deceive the system. Preventing replay attacks is primarily used in scenarios such as identity authentication.
[0069] For financial transactions involving contracts, a secondary encryption strategy can be adopted, combining tamper-proof and non-repudiation measures. For example, this secondary encryption strategy could be "one-way encryption + asymmetric encryption combined with digital signature + symmetric encryption." One-way encryption refers to encrypting data using a one-way encryption algorithm, ensuring the encrypted data cannot be decrypted; this is commonly used for password encryption or message digest generation. Tamper-proof measures prevent the system's data and programs from being illegally modified or destroyed. Non-repudiation measures prevent the message sender from denying the fact that they sent the information; messages involved in electronic payments, electronic invoices, and electronic contracts all require non-repudiation strategies.
[0070] For financial transaction scenarios involving e-commerce, a non-repudiation third encryption strategy can be adopted. For example, the third encryption strategy can be "asymmetric encryption combined with digital signature".
[0071] See Figure 3 In one specific embodiment, the data processing method provided in this application further includes:
[0072] Step S4: Receive the response message from the second data node to the encrypted message.
[0073] Step S5: Identify the data items in the response message. It's important to understand that the principle behind data item identification in this step is the same as in step S1.
[0074] Step S6 involves inputting the data items from the response message into a preset scene recognition model to identify the scene in which the response message is located. It's important to understand that the principle behind scene recognition based on the scene recognition model in this step is the same as in step S2.
[0075] Step S7: Select the decryption strategy corresponding to the scenario to decrypt the response message. It is understood that a response message for a specific scenario is encrypted using the encryption strategy corresponding to that scenario. Upon receiving the response message, it needs to be decrypted using the decryption strategy corresponding to that scenario. This application does not elaborate on the individual decryption strategies that correspond one-to-one with each encryption strategy.
[0076] It needs to be understood that, although Figure 2 and Figure 3 The steps are shown sequentially as indicated by the arrows, but they are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order in which these steps are performed; they can be executed in other orders. Figure 2 and Figure 3 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0077] In one specific embodiment, a score is generated based on the cumulative score of data items in each scenario, and the scenario in which the message to be sent is located is determined based on the score, including:
[0078] Calculate the cumulative score of each data item in each scenario;
[0079] The maximum accumulated score is used as the score for the message to be sent;
[0080] The scenario corresponding to the accumulated score, which serves as the scoring value, is determined as the scenario in which the message to be sent will be located.
[0081] By assigning scores to the data items corresponding to the message to be sent, the mapping from data items to scores is completed. By comparing the sum of scores in each scenario, the scenario corresponding to the largest sum of scores is determined as the scenario where the message to be sent is located, thus completing the mapping from scores to scenarios and enabling fast and accurate identification of the scenario where the message is located.
[0082] As an improved implementation method, when calculating the cumulative score of data items in each scenario, the basic score values in the basic scoring table shown in Table 1 are weighted. Accordingly, a specific implementation process for calculating the cumulative score of data items in each scenario is as follows:
[0083] For each scenario, calculate the first score value of each data item in that scenario, and sum all the first scores in that scenario to obtain the cumulative score result for that scenario. The first score value is the product of the base score value and the weight of the corresponding data item in that scenario.
[0084] It's important to understand that weights, as a quantitative allocation of the importance of different aspects of the evaluated object, are used to identify the context in which a message is located. As the number of message transactions accumulates, it becomes apparent that the probability of data items appearing in different scenarios varies. For example, in financial transaction scenarios involving contracts, the amount field has a high probability of appearing, while the order number field has a low probability. Based on this principle, weights can be set for each data item in its corresponding scenario, making the cumulative score for each scenario more reasonable. When multiple data items of a message to be sent indicate that the message should belong to a specific scenario, the cumulative score obtained through score conversion increases due to weighting, making it easier to determine the maximum cumulative score and thus more likely to identify the scenario in which the message belongs. Therefore, the accuracy of scenario identification is improved through weighting.
[0085] In one specific embodiment, the weights are set as follows:
[0086] When the message to be sent is the first i messages to be sent by the first data node, the weight is the preset initial weight, which can be set based on experience, where i≤N, and N represents the first preset value. When the number of successful transactions between the first data node and the second data node reaches the first preset value, the probability of occurrence of each data item in different scenarios can be obtained by statistically analyzing the record information of these messages. Therefore, when the first preset value is not reached, the first score value is calculated based on the initial weight given during system initialization.
[0087] After the first data node sends the encrypted message to the second data node, the second data node responds to the encrypted message. The first data node records the successful transaction after receiving the response message sent by the second data node.
[0088] When the message to be sent is not one of the first i messages to be sent from the first data node, the weight is the updated weight, which is the product of the first ratio and the second ratio. When calculating the first score of a data item in a certain scenario, the first ratio is the ratio of the number of times the data item appears in the scenario to the total number of times the data item appears in all scenarios, and the second ratio is the ratio of the number of successful transactions in the scenario to the total number of successful transactions.
[0089] For example, the weights can be automatically updated by periodically checking the record information of successful transactions on the first data node, and the updated weights can be used when converting scores.
[0090] In the above technical solution, the first ratio represents the statistical probability value of a data item appearing in a certain scenario, and the second ratio represents the proportion of successful transactions in a certain scenario. The basic score value is weighted for the first time by the first ratio to obtain the initial weighted score value, which is the product of the basic score value and the first ratio. The accumulated result of the initial weighted score values of each data item in the scenario is weighted for the second time by the second ratio (also known as offset processing). Compared with the unweighted score transformation or the score transformation with only one weighting, the accuracy of scenario recognition is improved by the two weighted score transformations.
[0091] In one specific embodiment, when selecting an encryption strategy corresponding to the scenario in which the message to be sent is located, only the values of key data items in the message are encrypted, while non-key data items are left unencrypted. Whether a data item is key can be determined by quantifying the impact of unencrypted data items on message confidentiality. By encrypting only the values of key data items, lightweight message encryption is achieved, eliminating the need to encrypt unnecessary fields, further improving message transaction efficiency, overall system performance, and user experience.
[0092] Based on the proposed method for scene recognition using two weighted score transformations in the above specific embodiments, a method for determining key data items is presented in one specific embodiment, as follows:
[0093] Determine whether the initial weighted score of the data item in the context of the message to be sent is greater than the second preset value; if so, determine that the data item is a critical data item, otherwise it is a non-critical data item.
[0094] The initial weighted score of a data item in a given scenario is positively correlated with its probability of occurrence in that scenario. The greater the probability of a data item occurring in a given scenario, the more important the data item is to maintaining message confidentiality, and the greater the initial weighted score obtained from the score conversion. Based on this principle, the importance of data items is quantified and then filtered, which improves the accuracy of selecting key data items and provides support for the implementation of lightweight message encryption.
[0095] Based on the basic scoring table shown in Table 1, for scenarios such as user login, financial transactions involving contracts, and financial transactions involving e-commerce, the preferred second preset value is 0.6. It should be understood that 0.6 is a preset base value, which can be dynamically adjusted and updated as the number of message transactions gradually increases.
[0096] Device Examples
[0097] See Figure 4 This application provides a data processing device 400, including a data item recognition module 410, a scene recognition module 420, and an encryption module 430 connected in sequence, wherein:
[0098] Data item identification module 410 is used to identify data items in the message to be sent;
[0099] The scene recognition module 420 is used to input the recognized data items into a preset scene recognition model to identify the scene where the message to be sent is located;
[0100] The encryption module 430 is used to select the encryption strategy corresponding to the scenario where the message to be sent is located, encrypt the message to be sent, and obtain an encrypted message, which is used to send to the second data node in the network.
[0101] The scene recognition model is used to generate a score based on the cumulative score of data items in each scene, and to determine the scene in which the message to be sent is located based on the score.
[0102] In one specific embodiment, a score is generated based on the cumulative score of data items in each scenario, and the scenario in which the message to be sent is located is determined based on the score, including:
[0103] Calculate the cumulative score of each data item in each scenario;
[0104] The maximum accumulated score is used as the score for the message to be sent;
[0105] The scenario corresponding to the accumulated score, which serves as the scoring value, is determined as the scenario in which the message to be sent will be located.
[0106] In one specific embodiment, the calculation of the cumulative score of data items in each scenario includes:
[0107] For each scenario, calculate the first score value of each data item in that scenario, and sum all the first score values in that scenario to obtain the cumulative score result for that scenario;
[0108] The first score is the product of the base score and weight of the corresponding data item in that scenario.
[0109] In one specific embodiment, when the message to be sent is the first i messages to be sent of the first data node, the weight adopts a preset initial weight, i≥N, where N represents the first preset value;
[0110] When the message to be sent is not one of the first i messages to be sent from the first data node, the weight is the updated weight.
[0111] The updated weight is the product of the first ratio and the second ratio;
[0112] The first ratio is the ratio of the number of times a data item appears in the corresponding scenario to the total number of times that data item appears in all scenarios;
[0113] The second ratio is the ratio of the number of successful transactions in the corresponding scenario to the total number of successful transactions. When the first data node receives the response message of the second data node to the encrypted message, it is recorded as a successful transaction.
[0114] In one specific embodiment, when selecting an encryption strategy corresponding to the scenario in which the message to be sent is located to encrypt the message, only the values of key data items in the message to be sent are encrypted.
[0115] In one specific embodiment, the data processing device 400 provided in this application further includes a key data item determination module (not shown in the figure). The key data item determination module is used to determine whether the initial weighted score value of the data item in the scenario where the message to be sent is located is greater than a second preset value. If so, the data item is determined to be a key data item; otherwise, it is a non-key data item. The initial weighted score value is the product of the basic score value of the data item in the scenario where the message to be sent is located and the first ratio.
[0116] In one specific embodiment, the scenarios include user login scenarios and financial transaction scenarios.
[0117] In one specific embodiment, the encryption strategy includes a first encryption strategy to prevent replay, a second encryption strategy to prevent tampering and repudiation, and a third encryption strategy to prevent repudiation.
[0118] In one specific embodiment, the data processing apparatus 400 provided in this application further includes a receiving module (not shown in the figure), a first identification module (not shown in the figure), and a decryption module (not shown in the figure), wherein:
[0119] The receiving module is used to receive the response message from the second data node to the encrypted message;
[0120] The first identification module is used to identify data items in the response message;
[0121] The aforementioned scene recognition module 420 is also used to input the data items in the recognized response message into a preset scene recognition model to identify the scene in which the response message is located;
[0122] The decryption module is used to select the decryption strategy corresponding to the scenario in which the response message is located to decrypt the response message.
[0123] Figure 5 The diagram illustrates an application example of the data processing device 400. This data processing device 400 is used for scene recognition, encryption, and decryption of messages. It consists of a data item recognition module 410, a scene recognition module 420, an encryption module 430, a key data item determination module, a receiving module, a first recognition module, and a decryption module; therefore, it can also be called an encryption / decryption device. In this application example, the channel side includes PC terminals, mini-programs, and external clients, while the server side includes an API gateway, microservice A, microservice B, and microservice C, etc. The encryption / decryption device is applied to the channel side, API gateway, and server side.
[0124] Assume the PC terminal has joined a computer network and is about to communicate with microservice A via message communication. The message communication process is as follows:
[0125] Step SS1: The PC terminal initiates a request.
[0126] In step SS2, the encryption / decryption device on the back of the PC terminal parses the content of the request message, identifies the data items, inputs each identified data item into a preset scene recognition model, determines the scene in which the current request message is located, selects the encryption strategy corresponding to that scene to encrypt the request message, obtains an encrypted message, and then sends the encrypted message to the network. The scene recognition model uses initial weights to convert scores when identifying the scene in which the request message is located.
[0127] The scoring value is obtained through the scene recognition function, which can be expressed by Equation 1:
[0128]
[0129] In Equation 1, f(x) represents the scene recognition function, which is used to identify the maximum value of the accumulated score. This represents the cumulative score of the data item in the request message for scenario number 1, where w1 represents the second ratio corresponding to scenario number 1, and H... 1jThe initial weighted score value of the j-th data item in scenario number 1 is given by , n represents the number of data items corresponding to the message to be sent, m represents the number of scenarios, and so on. The meaning of other parameters in Equation 1 can be understood, but they will not be explained one by one in this embodiment.
[0130] The initial weighted score of a certain data item can be expressed by Equation 2:
[0131] H k = k * k (Formula 2);
[0132] In Equation 2, H k This represents the initial weighted score of the data item in scenario k, a. k This represents the base score of the data item in scenario k, b k This represents the ratio of the number of times the data item appears in scenario k to the total number of times the data item appears in all scenarios, i.e., the first ratio.
[0133] The first ratio corresponding to a certain data item in scenario f can be represented by Equation 3:
[0134]
[0135] In equation three, b f This represents the first ratio of the data item in scenario f, t f This indicates the number of times the data item appears in scenario f, where m represents the number of scenarios;
[0136] The second ratio corresponding to scenario f can be expressed by Equation 4:
[0137]
[0138] In Equation 4, w f s represents the second ratio corresponding to scenario f. f Let f represent the number of successful transactions in scenario f, and g represent the total number of successful transactions.
[0139] In step SS3, the encryption / decryption device in front of microservice A identifies the corresponding scenario and selects the appropriate decryption strategy to decrypt the encrypted message sent by the PC terminal.
[0140] Step SS4: Process the service business logic and generate the original response message.
[0141] In step SS5, after the encryption / decryption device in front of microservice A obtains the original response message, it identifies the corresponding scenario and selects the encryption strategy corresponding to the scenario to encrypt the original response message, thus obtaining the encrypted response message.
[0142] In step SS6, the encryption / decryption device on the back of the PC terminal receives the encrypted response message, identifies the corresponding scenario, and selects the decryption strategy corresponding to the scenario to decrypt the encrypted response message.
[0143] In step SS7, after receiving the encrypted response message, the encryption / decryption device on the PC terminal stores the relevant information in the database. For example, a table is created in the database, recording the number of times each data item in each message sent by the PC terminal appears in each scenario, the total number of times it appears in all scenarios, the first ratio, as well as the number of successful transactions in each scenario, the total number of successful transactions in all scenarios, and the second ratio.
[0144] The table includes fields such as: the number of times the data item appears in scenario f (t). f f = 1, 2, ..., m; the total number of times the data item appears in all scenarios. First ratio b f The number of successful transactions s in scenario f f f = 1, 2, ..., m; the total number of successful transactions in all scenarios, g; the second ratio w. f .
[0145] In step SS8, the encryption and decryption device in front of the PC terminal periodically checks the recorded information in the database and automatically updates the first ratio and the second ratio for scenario recognition when the PC terminal sends subsequent messages.
[0146] When the scenarios include user login scenarios, financial transaction scenarios involving contracts, and financial transaction scenarios involving e-commerce, the above message communication process is as follows: Figure 6 As shown.
[0147] In one embodiment, the data processing apparatus 400 provided in this application can be implemented as a computer program, and the computer program can be implemented in such a way as... Figure 7 It runs on the computer device shown. The memory of the computer device can store the various program modules that make up the data processing device 400, for example, Figure 4 The data item recognition module 410, scene recognition module 420, and encryption module 430 are shown. The computer program composed of these modules enables the processor to execute the steps in the data processing method of the above-described method embodiment.
[0148] Figure 7 The computer device shown can be used as follows Figure 4 The data item recognition module 410 in the data processing device 400 shown executes step S1, the scene recognition module 420 executes step S2, and the encryption module 430 executes step S3.
[0149] On the other hand, embodiments of this application also provide a storage medium storing a program thereon, which, when executed by a processor, implements any of the data processing methods described in the above method embodiments.
[0150] In another aspect, embodiments of this application also provide a processor for running a program, wherein the program executes any of the data processing methods described in the above method embodiments.
[0151] In another aspect, embodiments of this application also provide a computer device, which may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05, and a memory (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A06. The network interface A02 is used for communication with external terminals via a network connection. When the computer program is executed by the processor A01, it implements a data processing method as described in the above embodiment. The display screen A04 can be a liquid crystal display (LCD) or an e-ink display. The input device A05 can be a touch layer covering the display screen, a button, trackball, or touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0152] It should be understood that the structure shown in the figure is only a block diagram of a part of the structure related to the present application and does not constitute a limitation on the computer device on which the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0153] In another aspect, embodiments of this application also provide a computer program product, which, when executed on a processor, is suitable for executing a program with the following method steps: identifying data items in a message to be sent; inputting the data items into a preset scene recognition model to identify the scene in which the message to be sent is located; selecting an encryption strategy corresponding to the scene to encrypt the message to be sent to obtain an encrypted message, which is used to send to a second data node in the network; the scene recognition model is used to generate a score value based on the cumulative score of the data items in each scene, and to determine the scene in which the message to be sent is located based on the score value.
[0154] In one embodiment, a score is generated based on the cumulative score of data items in each scenario, and the scenario of the message to be sent is determined based on the score. This includes: calculating the cumulative score of data items in each scenario; using the largest cumulative score as the score of the message to be sent; and determining the scenario corresponding to the cumulative score used as the score as the score as the scenario of the message to be sent.
[0155] In one embodiment, calculating the cumulative score of data items in each scenario includes: for each scenario, calculating the first score value of each data item in that scenario, and summing all the first score values in that scenario to obtain the cumulative score of that scenario; the first score value is the product of the base score value of the corresponding data item in that scenario and the weight.
[0156] In one embodiment, when the message to be sent is one of the first i messages to be sent by the first data node, the weight adopts a preset initial weight, i≥N, where N represents the first preset value; when the message to be sent is not one of the first i messages to be sent by the first data node, the weight adopts an updated weight; the updated weight is the product of the first ratio and the second ratio; the first ratio is the ratio of the number of times the data item appears in the corresponding scenario to the total number of times the data item appears in all scenarios; the second ratio is the ratio of the number of successful transactions in the corresponding scenario to the total number of successful transactions, and the first data node receives the response message of the second data node to the encrypted message as a successful transaction.
[0157] In one embodiment, when selecting the encryption strategy corresponding to the scenario to encrypt the message to be sent, only the values of the key data items in the message to be sent are encrypted.
[0158] In one embodiment, the method steps further include: determining whether the initial weighted score value of the data item in the scenario where the message to be sent is located is greater than a second preset value; if so, determining that the data item is a critical data item; otherwise, determining that it is a non-critical data item; the initial weighted score value is the product of the basic score value of the data item in the scenario where the message to be sent is located and a first ratio.
[0159] In one embodiment, the scenarios include user login scenarios and financial transaction scenarios.
[0160] In one embodiment, the encryption strategy includes a first encryption strategy to prevent replay, a second encryption strategy to prevent tampering and repudiation, and a third encryption strategy to prevent repudiation.
[0161] In one embodiment, the method steps further include: receiving a response message from a second data node to an encrypted message; identifying data items in the response message; inputting the data items into a preset scene recognition model to identify the scene in which the response message is located; and selecting a decryption strategy corresponding to the scene to decrypt the response message.
[0162] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0163] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0164] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0166] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.
[0167] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0168] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A data processing method applied to a first data node in a network, characterized in that, The method comprises: identifying data items in the to-be-sent message; inputting the identified data items into a preset scene recognition model to identify the scene where the to-be-sent message is located; selecting an encryption strategy corresponding to the scene where the to-be-sent message is located to encrypt the to-be-sent message to obtain an encrypted message, the encrypted message being used to be sent to a second data node in a network; The scene recognition model is configured to generate a score value according to a score accumulation result of the data item in each scene, and determine the scene where the to-be-sent message is located according to the score value. Specifically, the score accumulation result is a sum of products of the basic score value of the data item in the corresponding scene and the weight, the weight is a preset initial weight when the to-be-sent message is the first i to-be-sent messages of the first data node, N represents a first preset value, and the weight is an updated weight when the to-be-sent message is not the first i to-be-sent messages of the first data node, and the updated weight is a product of a first ratio and a second ratio. wherein the first ratio is a ratio of a number of times that a data item appears in a corresponding scene to a total number of times that the data item appears in all scenes; the second ratio is a ratio of a number of successful transactions in the corresponding scene to a total number of successful transactions; and a response message of the second data node to the encrypted message received by the first data node is recorded as one successful transaction.
2. The data processing method according to claim 1, characterized in that, The generation of the score value according to the score accumulation result of the data item in each scene and the determination of the scene where the to-be-sent message is located according to the score value comprise: calculating the score accumulation result of the data item in each scene; taking the maximum score accumulation result as the score value of the to-be-sent message; determining the scene corresponding to the score accumulation result as the scene where the to-be-sent message is located.
3. The data processing method of claim 1, wherein, When the encryption strategy corresponding to the scene where the to-be-sent message is located is selected to encrypt the to-be-sent message, only the value of a key data item in the to-be-sent message is encrypted; wherein the key data item is determined through the following process: judging whether an initial weighted score value of a data item in the scene where the to-be-sent message is located is greater than a second preset value, if yes, the data item is determined as a key data item, otherwise, the data item is determined as a non-key data item, the initial weighted score value being a product of a basic score value of the data item in the scene where the to-be-sent message is located and the first ratio.
4. The data processing method of claim 1, wherein, The scene comprises a user login scene and a financial transaction scene.
5. The data processing method of claim 1, wherein, The encryption strategy comprises a first encryption strategy for anti-replay, a second encryption strategy for anti-tampering and anti-repudiation, and a third encryption strategy for anti-repudiation.
6. The data processing method of claim 1, wherein, The method further comprises: receiving a response message of the second data node to the encrypted message; identifying data items in the response message; inputting the identified data items into a preset scene recognition model to identify the scene where the response message is located; selecting a decryption strategy corresponding to the scene where the response message is located to decrypt the response message.
7. A data processing apparatus arranged in a first data node in a network, characterized by The apparatus comprises: a data item identification module configured to identify data items in the to-be-sent message; a scene identification module configured to input the identified data items into a preset scene recognition model to identify the scene where the to-be-sent message is located; an encryption module configured to select an encryption strategy corresponding to the scene where the to-be-sent message is located to encrypt the to-be-sent message to obtain an encrypted message, the encrypted message being used to be sent to a second data node in a network; The scene recognition model is configured to generate a score value according to a score accumulation result of the data item in each scene, and determine the scene where the to-be-sent message is located according to the score value. Specifically, the score accumulation result is a sum of products of the basic score value of the data item in the corresponding scene and the weight, the weight is a preset initial weight when the to-be-sent message is the first i to-be-sent messages of the first data node, N represents a first preset value, and the weight is an updated weight when the to-be-sent message is not the first i to-be-sent messages of the first data node, and the updated weight is a product of a first ratio and a second ratio. wherein the first ratio is a ratio of a number of times that a data item appears in a corresponding scene to a total number of times that the data item appears in all scenes; the second ratio is a ratio of a number of successful transactions in the corresponding scene to a total number of successful transactions; and a response message of the second data node to the encrypted message received by the first data node is recorded as one successful transaction.
8. A computer device, comprising: The apparatus comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data processing method of any one of claims 1 to 6 when executing the program.
9. A machine-readable storage medium having stored thereon instructions, the instructions being executable by a machine to cause the machine to perform operations comprising: The instructions, when executed by a processor, cause the processor to be configured to perform the data processing method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the data processing method of any one of claims 1 to 6.
Citation Information
Patent Citations
Data encryption and decryption method based on national cryptographic algorithm and related equipment
CN114884697A
Tracking of sensitive data
US20220070189A1