Data processing method and device
By receiving data packets in the digital networking solution, the agent sends requests, audits and encapsulates them, solving the problems of data auditing, encryption and routing in massive communications, achieving fast and efficient data transmission and security, and meeting the needs of communication in different scenarios. need.
Patent Information
- Application Number
- CN202410736940.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-09-10
AI Technical Summary
In digital networking solutions, it is difficult to simultaneously meet fast and efficient data auditing, encryption, and flexible routing in massive communications. Especially because data packets need to be parsed to meet the forward and reverse routing rules of different scenarios, communication data cannot be effectively processed.
Send a request through the agent that receives the data message, search for audit rules based on the audit identifier, audit the legality of the data message, determine the target address and encapsulation requirements based on the routing identifier, perform data encapsulation and encryption conversion, and ensure the integrity of the data during transmission. Security and routing flexibility.
It realizes fast and efficient data auditing, encryption and flexible routing in massive communications, improves the traceability and security of communications, meets the communication needs of different scenarios, reduces costs and improves user experience.
Smart Images

Figure CN118631518A
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a data processing method and device. Background Art
[0002] In the digital networking solution, the communication between different nodes needs to ensure the recordability and traceability of the intranet data, as well as the encryption of the communication data. At the same time, it also needs to meet the forward and reverse routing rules required by various scenarios. This requires the nodes to parse the data packets during the communication process. Therefore, the communicating parties need to initiate requests for the plain text protocols such as http used in the application, but the communication data needs to be encrypted. Therefore, it is impossible to ensure fast and efficient data auditing, encryption, and flexible routing in massive communications. Summary of the invention
[0003] The purpose of the embodiments of the present disclosure is to provide a data processing method and device, which realizes fast and efficient data auditing, encryption, and flexible routing in massive communications.
[0004] In order to achieve the above-mentioned purpose, the first aspect of the embodiment of the present disclosure provides a data processing method, including: receiving a proxy sending request containing a data message; searching for an audit rule corresponding to the audit identifier according to an audit identifier in the data message, and auditing the legitimacy of the data message according to the audit rule; after determining the legitimacy of the data message, determining the target address and encapsulation requirements of the data message according to the routing identifier in the data message, and encapsulating the data message and the target address according to the encapsulation requirements; encrypting and converting the encapsulated data message, and sending the encrypted and converted data message to the target address.
[0005] In some embodiments of the present disclosure, after receiving the proxy sending request including the data message, the method further includes: storing the data message locally.
[0006] In some embodiments of the present disclosure, the audit identifier includes: a source address, a target address, an application identifier, or a communication protocol.
[0007] In some embodiments of the present disclosure, auditing the legitimacy of the data message according to the audit rules includes: parsing the data message to obtain a text protocol corresponding to the data message; auditing specified content in the text protocol according to the audit rules; when the specified content audit passes, determining the legitimacy of the data message; when the specified content audit fails, determining the illegality of the data message.
[0008] In some embodiments of the present disclosure, auditing the legitimacy of the data message according to the audit rules includes: auditing predetermined content in the data message according to the audit rules; when the audit of the predetermined content passes, determining the legitimacy of the data message; when the audit of the predetermined content fails, determining the illegality of the data message.
[0009] In some embodiments of the present disclosure, auditing the legitimacy of the data message according to the audit rules includes: extracting the source address in the data message, and accumulating the number of data messages sent by the source address; when the number reaches a set threshold, determining the illegality of the data message; when the number does not reach the set threshold, determining the legitimacy of the data message.
[0010] In some embodiments of the present disclosure, auditing the legitimacy of the data message according to the audit rules includes: extracting the target address in the data message, and determining whether the target address exists in a set blacklist; when the target address exists in the set blacklist, determining the illegality of the data message; when the target address does not exist in the set blacklist, determining the legitimacy of the data message.
[0011] In some embodiments of the present disclosure, after auditing the legitimacy of the data message, the method further comprises: after determining the illegality of the data message, intercepting the sending of the data message.
[0012] In some embodiments of the present disclosure, encapsulating the data packet with the target address according to the encapsulation requirement includes: modifying the data packet according to the encapsulation requirement, and encapsulating the modified data packet with the target address.
[0013] According to a second aspect of the present disclosure, a data processing device is provided, the device comprising: a proxy module, used to receive a proxy sending request containing a data message; an audit module, used to search for an audit rule corresponding to an audit identifier in the data message, and audit the legitimacy of the data message according to the audit rule; a routing module, used to determine the target address and encapsulation requirements of the data message according to the routing identifier in the data message after determining the legitimacy of the data message, and encapsulate the data message and the target address according to the encapsulation requirements; an encryption sending module, used to encrypt and convert the encapsulated data message, and send the encrypted and converted data message to the target address.
[0014] Other features and advantages of the embodiments of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present disclosure, but do not constitute a limitation on the embodiments of the present disclosure. In the accompanying drawings:
[0016] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present disclosure;
[0017] Figure 2 It is a schematic diagram of the architecture of a data processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0019] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein.
[0020] Figure 1 FIG. 1 is a flow chart of a data processing method provided by an embodiment of the present disclosure. Figure 1 As shown, the method comprises the following steps:
[0021] Step S110, receiving a proxy sending request including a data message.
[0022] In a complex network environment, when an application needs to send a data message, it needs to first send a proxy send request. After receiving the proxy send request, the data message is stored locally, for example, in a Mysql database, etc., to facilitate recording the data message and ensure the traceability of data communication.
[0023] Step S120: searching for an audit rule corresponding to the audit identifier in the data message according to the audit identifier in the data message, and auditing the legitimacy of the data message according to the audit rule.
[0024] The audit identifier may include: a source address, a target address, an application identifier, or a communication protocol, etc.
[0025] Different audit identifiers correspond to different audit rules. The audit identifiers and the audit rules corresponding to them are pre-stored locally. When the data message is received, the audit rules corresponding to the audit identifiers can be found.
[0026] In one implementation of the disclosed embodiment, the source address in the data message can be extracted, and the number of data messages sent by the source address can be accumulated. When the number reaches a set threshold, the illegality of the data message is determined, and when the number does not reach the set threshold, the legitimacy of the data message is determined. For example, if the same source address continues to send a large number of data messages outward, there may be a malicious data de-database or database collision request, and the data message in this case should be intercepted.
[0027] In another implementation of the embodiment of the present disclosure, the target address in the data message can be extracted, and it can be determined whether the target address exists in a local blacklist. In the embodiment of the present disclosure, a blacklist including illegal target addresses can be pre-set. When the target address exists in the blacklist, the illegality of the data message is determined, and when the target address does not exist in the blacklist, the legality of the data message is determined.
[0028] In addition, the local adaptation protocol can be pre-set, including a standard protocol or a protocol with known rules. After the data message is received locally, if it is identified that the data message matches a certain adaptation protocol set locally, the data message can be parsed and audited. If the data message does not match any of the adaptation protocols set locally, the data message will be audited directly.
[0029] For the parsed data message that matches a certain locally set adaptation protocol, the text protocol corresponding to the data message is obtained, and the corresponding audit rules are determined through the audit identifier in the data message, and then the specified content in the text protocol is audited according to the audit rules. When the audit of the specified content passes, the legality of the data message is determined, and when the audit of the specified content fails, the illegality of the data message is determined. For example, when the audit identifier in the data message is a certain application identifier, the specified content in the header of the audited text protocol is audited according to the corresponding audit rules, such as auditing the token in the header. If the audit fails, it is an illegal outbound request and is intercepted.
[0030] If the data message is not compatible with the locally set protocol, the data message itself is directly audited, and the predetermined content in the data message is audited according to the audit rules corresponding to the audit identifier in the data message. When the audit of the predetermined content passes, the legality of the data message is determined, and when the audit of the predetermined content fails, the illegality of the data message is determined. The predetermined content may include predefined keywords, etc. If there are predefined keywords, it is determined that the audit of the data message fails and the data message is an illegal message.
[0031] In addition, for the direct audit data message itself, the audit rules may also include whether the size of the audit data message meets the requirements, whether the audit data message contains a specified logical keyword, and whether the audit data message hits a logical regular expression.
[0032] The embodiments disclosed herein include but are not limited to the above-mentioned implementation methods. For example, the corresponding audit rules can also be found through the source address and the target address, and the data message can be matched with a local adaptation protocol and then parsed to determine whether the parsed text protocol meets the corresponding rules, etc.
[0033] All illegal data messages determined in the above implementation methods are intercepted and not sent out of the network. The compliance, security, reliability, etc. of the data messages are audited, and necessary analysis and processing are performed on the data messages to facilitate subsequent data routing and encryption processing.
[0034] Step S130, after determining the legitimacy of the data message, determine the target address and encapsulation requirement of the data message according to the routing identifier in the data message, and encapsulate the data message and the target address according to the encapsulation requirement.
[0035] The routing identifier may include characteristics of the source address, characteristics of the destination address, characteristics of the protocol message, service characteristic identifier, a request with a specified identifier, a system identifier and / or a version identifier in the header, and the like.
[0036] The corresponding target address and encapsulation requirements can be determined according to different routing identifiers.
[0037] In one implementation of the embodiment of the present disclosure, the corresponding target address can be found according to a specified feature of the source address, and the data message can be directly encapsulated with the target address.
[0038] In one implementation of the embodiment of the present disclosure, the corresponding target address can be found according to a specified feature of the target address, and the data message can be directly encapsulated with the target address.
[0039] In one implementation of the embodiment of the present disclosure, the corresponding target address can be determined according to the protocol message characteristics in the data message, and the data message and the target address can be directly encapsulated.
[0040] In another implementation of the embodiment of the present disclosure, the data message is modified according to the encapsulation requirement, and the modified data message is encapsulated with the target address.
[0041] For example, the data message and the target address can be encapsulated by flexibly rewriting, encapsulating and / or encrypting according to the business feature identifier corresponding to the partner (for example, the specified business code in the header, the specified token, the specified access party identifier, etc.). For example, according to the business feature identifier in the http header, the corresponding actual target address to be forwarded can be searched in redis so that the business party can flexibly control the forwarding. For example, for some specific business parties, there will be requirements for message format and encryption (for example, requiring data messages to be encrypted with the national secret algorithm SM2, and requiring access business codes, authorization tokens, access party identifiers, etc. to be attached in the header). Plug-ins can be directly written to achieve unified corresponding encapsulation and rewriting to avoid repeated transformation of internal business systems.
[0042] In one implementation of the present disclosure, for a request with a specified identifier (for example, a request with a special identifier URI prefix), the token in the data message can be verified, for example, and the verification code is calculated according to a specified algorithm and placed in the header of the encrypted data message, thereby completing the encapsulation of the data message.
[0043] In one implementation of the embodiment of the present disclosure, the corresponding target address may be determined according to the system identifier and / or version identifier in the data message header, so that the data message and the target address may be encapsulated.
[0044] In the disclosed embodiment, there is another routing method, which intercepts and sends back the request that does not need to be sent to the external network to the internal network routing node. For example, if the target address is a node in the internal network, the data message is directly sent back to the internal network.
[0045] In addition, in the embodiments of the present disclosure, dynamic routing is achieved through the platform Openresty and the programming language lua.
[0046] Based on the audited data messages, according to the preset routing rules, that is, the corresponding target address and encapsulation requirements are determined through the routing identifier, flexible routing of data messages is achieved to ensure the reliability and efficiency of communication between nodes, which can better meet the communication needs in different scenarios and improve communication efficiency.
[0047] Step S140, encrypting and converting the encapsulated data message, and sending the encrypted and converted data message to the target address.
[0048] Among them, in order to avoid the appearance of plain text in the outgoing data, the outgoing data packets are encrypted. Generally, the http type data packets are converted to the encrypted https type, and the grpc type data packets are converted to the encrypted grpcs type, so as to better protect the user's data security and improve the user experience.
[0049] Through the embodiments of the present disclosure, a series of processes such as data message proxy, auditing, routing, encryption, etc. can greatly improve the traceability, security and flexibility of communications. Among them, by auditing and processing data messages, potential security issues can be better discovered and resolved, and the security and reliability of the network can be improved. In addition, the flexible routing mechanism can better meet the communication needs in different scenarios and improve the efficiency of communication. Encryption processing of outbound data can better protect the user's data security and improve the user's experience. In addition, the implementation cost of the embodiments of the present disclosure is low and the versatility is relatively strong.
[0050] Accordingly, Figure 2 Schematic diagram of the architecture of a data processing device provided by an embodiment of the present disclosure. Figure 2 As shown, the device 20 includes: an agent module 21, an audit module 22, a routing module 23 and an encryption sending module 24.
[0051] Among them, the proxy module 21 is used to receive a proxy sending request containing a data message. The audit module 22 is used to find the audit rule corresponding to the audit identifier according to the audit identifier in the data message, and audit the legitimacy of the data message according to the audit rule. The routing module 23 is used to determine the target address and encapsulation requirements of the data message according to the routing identifier in the data message after determining the legitimacy of the data message, and encapsulate the data message and the target address according to the encapsulation requirements. The encryption sending module 24 is used to encrypt the encapsulated data message and send the encrypted data message to the target address.
[0052] Furthermore, the proxy module 21 is also used to store the data message locally.
[0053] Furthermore, the audit module 22 is also used to parse the data message to obtain the text protocol corresponding to the data message; audit the specified content in the text protocol according to the audit rules; when the specified content audit passes, determine the legality of the data message; when the specified content audit fails, determine the illegality of the data message.
[0054] Optionally, the audit module 22 is also used to audit predetermined content in the data message according to the audit rules; when the predetermined content audit passes, determine the legality of the data message; when the predetermined content audit fails, determine the illegality of the data message.
[0055] Optionally, the audit module 22 is also used to extract the source address in the data message and accumulate the number of data messages sent by the source address; when the number reaches a set threshold, the illegality of the data message is determined; when the number does not reach the set threshold, the legality of the data message is determined.
[0056] Optionally, the audit module 22 is also used to extract the target address in the data message and determine whether the target address exists in the set blacklist; when the target address exists in the set blacklist, the illegality of the data message is determined; when the target address does not exist in the set blacklist, the legality of the data message is determined.
[0057] In addition, the audit module 22 is also used to intercept the sending of the data message after determining the illegality of the data message.
[0058] Furthermore, the routing module 23 is further configured to modify the data message according to the encapsulation requirement, and encapsulate the modified data message with the target address.
[0059] The specific working principle and benefits of the data processing device provided in the embodiment of the present disclosure are similar to the specific working principle and benefits of the data processing method provided in the embodiment of the present disclosure, and will not be repeated here.
[0060] Furthermore, another aspect of the embodiments of the present disclosure provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the data processing method described in the above embodiments.
[0061] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as a system or a computer program product. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented 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.
[0062] The present disclosure is described with reference to the flowcharts and / or block diagrams of the systems (devices) and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0063] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0064] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0065] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0066] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0067] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0068] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0069] The above are only embodiments of the present disclosure and are not intended to limit the present disclosure. For those skilled in the art, the present disclosure may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present disclosure shall be included in the scope of the claims of the present disclosure.
Claims
1. A data processing method, It is characterized in that The method comprises: Receive a proxy send request containing a data message; According to the audit identifier in the data message, searching for the audit rule corresponding to the audit identifier, and auditing the legitimacy of the data message according to the audit rule; After determining the legitimacy of the data message, determining the target address and encapsulation requirement of the data message according to the routing identifier in the data message, and encapsulating the data message and the target address according to the encapsulation requirement; The encapsulated data message is encrypted and converted, and the encrypted data message is sent to the target address.
2. The data processing method according to claim 1, It is characterized in that After receiving the proxy sending request including the data message, the method further includes: The data message is stored locally.
3. The data processing method according to claim 1, It is characterized in that The audit identifier includes: a source address, a target address, an application identifier or a communication protocol.
4. The data processing method according to claim 1, It is characterized in that According to the audit rules, auditing the legitimacy of the data message includes: Parsing the data message to obtain a text protocol corresponding to the data message; Auditing the specified contents of the text agreement in accordance with the audit rules; When the designated content audit passes, determining the legitimacy of the data message; When the designated content audit fails, the illegality of the data message is determined.
5. The data processing method according to claim 1, It is characterized in that According to the audit rules, auditing the legitimacy of the data message includes: Auditing predetermined content in the data message according to the audit rule; When the predetermined content audit passes, determining the legitimacy of the data message; When the predetermined content audit fails, the illegality of the data message is determined.
6. The data processing method according to claim 1, It is characterized in that According to the audit rules, auditing the legitimacy of the data message includes: Extracting the source address in the data message, and accumulating the number of data messages sent by the source address; When the number reaches a set threshold, determining the illegality of the data message; When the number does not reach the set threshold, the legitimacy of the data message is determined.
7. The data processing method according to claim 1, It is characterized in that According to the audit rules, auditing the legitimacy of the data message includes: Extracting the target address in the data message, and determining whether the target address exists in a set blacklist; When the target address exists in the set blacklist, determining the illegality of the data message; When the target address does not exist in the set blacklist, the legitimacy of the data message is determined.
8. The data processing method according to claim 1, It is characterized in that After auditing the legitimacy of the data message, the method further includes: After determining that the data message is illegal, the sending of the data message is intercepted.
9. The data processing method according to claim 1, It is characterized in that Encapsulating the data message and the target address according to the encapsulation requirement includes: The data message is modified according to the encapsulation requirement, and the modified data message is encapsulated with the target address.
10. A data processing device, It is characterized in that The device comprises: The proxy module is used to receive a proxy sending request containing a data message; An audit module, used to search for an audit rule corresponding to the audit identifier in the data message according to the audit identifier in the data message, and audit the legitimacy of the data message according to the audit rule; A routing module, configured to determine the legitimacy of the data message, determine the target address and encapsulation requirements of the data message according to the routing identifier in the data message, and encapsulate the data message and the target address according to the encapsulation requirements; The encryption sending module is used to encrypt and convert the encapsulated data message, and send the encrypted and converted data message to the target address.
