Message queue response method and system in one-way network environment
By verifying and parsing the received request task in a one-way network environment, the response address is dynamically generated, which solves the problem that the sender cannot receive the correct response routing address, and achieves accurate feedback of the response address and efficient operation of the system. .
Patent Information
- Application Number
- CN202411468014.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-21
- Publication Date
- 2025-01-21
AI Technical Summary
In a one-way network environment, the sender's application cannot receive the correct response routing address sent by the receiver, resulting in the loss and missed response address.
By verifying and parsing the message content in the received request task in the receiver, the target identification of the sender is generated, and the network identification of the sender is obtained through reverse operation, the response address is dynamically generated, and the response address is generated from the pre-constructed The mapping relationship between the response address and the network identifier is obtained from the mapping table, and finally the response data and write-back response address are encapsulated and transmitted to the sender.
This ensures that the response address can be accurately fed back to the sender, avoiding the loss and misdelivery of the response address, and improving the system's response efficiency and accuracy.
Smart Images

Figure CN119341813A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communication technology, and in particular to a message queue response method and system in a one-way network environment. Background Art
[0002] In some high-security network environments, such as financial institutions or government agencies, unidirectional networks are often used to isolate network areas and ensure the security of data transmission. Specifically, when a sending application sends a message to a receiving message queue registry, the limitations of the unidirectional network prevent the receiving application from feeding back the correct response routing address, resulting in the sending application being unable to receive a timely response.
[0003] Therefore, there is an urgent need to solve the problem that the sender's application cannot receive the correct response routing address sent by the receiver due to the limitations of the one-way network. Summary of the Invention
[0004] Based on the above-mentioned deficiencies of the prior art, the present application provides a message queue response method and system in a one-way network environment to solve the problem that the sender's application cannot receive the correct response routing address sent by the receiver.
[0005] In order to achieve the above objectives, this application provides the following technical solutions:
[0006] In a first aspect, the present application provides a message queue response method in a one-way network environment, which is applied to a receiving party and includes:
[0007] When receiving a request task sent by the sender, verify the message content in the request task;
[0008] If the message content in the request task passes the verification, the message content is parsed to obtain the business information corresponding to the message content; wherein the business information at least includes the message information and the sender network identifier;
[0009] generating a target identifier of the sender based on the message information and the sender network identifier;
[0010] Performing a reverse operation on the target identifier to obtain the network identifier of the sender;
[0011] Based on the network identifier, a response address is generated, and a mapping relationship between the response address and the network identifier is obtained from a pre-built mapping table;
[0012] Based on the mapping relationship, a write-back response address is generated, and response data corresponding to the request task is obtained from a database;
[0013] The response data and the write-back response address are encapsulated to obtain a response message body, and the response message body is transmitted to the sender.
[0014] Optionally, in the message queue response method in the unidirectional network environment, the verifying the message content in the request task includes:
[0015] Checking whether the message content in the request task meets the integrity requirements and whether the message content has not been tampered with;
[0016] If the message content in the request task meets the integrity requirements and the message content has not been tampered with, then it is determined that the message content in the request task has passed the verification;
[0017] If the message content in the request task does not meet the integrity requirement and the message content has been tampered with, it is determined that the message content in the request task has failed the verification.
[0018] Optionally, in the message queue response method in the unidirectional network environment, generating the sender's target identifier based on the message information and the sender's network identifier includes:
[0019] Obtaining a current timestamp and generating a sequence number based on the current timestamp;
[0020] Calculating a hash value of the message information;
[0021] The current timestamp, the sequence number, the hash value, and the sender network identifier are concatenated to obtain the sender's target identifier.
[0022] Optionally, in the message queue response method in the unidirectional network environment, performing a reverse operation on the target identifier to obtain the network identifier of the sender includes:
[0023] Obtaining a coding rule for the target identifier;
[0024] According to the encoding rule, the sender network identifier is identified from the target identifier, and the sender network identifier is converted into the sender's network identifier.
[0025] Optionally, in the message queue response method in the unidirectional network environment, the verifying the message content in the request task further includes:
[0026] If the message content in the request task fails to pass the verification, a prompt message is fed back to the sender.
[0027] A second aspect of the present application provides a message queue response method in a one-way network environment, which is applied to a sender, comprising:
[0028] When receiving a request task for processing a business from a user, the request task is sent to the recipient, who verifies and parses the message content in the request task to obtain the business information corresponding to the message content, and determines the response message body based on the business information and the request task;
[0029] Receiving a response message body sent by the recipient, and parsing the response message body to obtain a write-back response address and response data;
[0030] The response data is routed to the task request service corresponding to the write-back response address, and the task request service obtains data information of the processing business based on the response data.
[0031] A third aspect of the present application provides a message queue response system in a one-way network environment, applied to a receiving side, comprising:
[0032] A verification unit, configured to verify the message content in the request task when receiving the request task sent by the sender;
[0033] A content parsing unit, configured to parse the message content if the message content in the request task passes verification, and obtain business information corresponding to the message content; wherein the business information includes at least message information and a sender network identifier;
[0034] an identifier generating unit, configured to generate a target identifier of the sender based on the message information and the sender network identifier;
[0035] a reverse operation unit, configured to perform a reverse operation on the target identifier to obtain the network identifier of the sender;
[0036] a relationship acquisition unit, configured to generate a response address based on the network identifier, and acquire a mapping relationship between the response address and the network identifier from a pre-built mapping table;
[0037] A data acquisition unit, configured to generate a write-back response address based on the mapping relationship, and acquire response data corresponding to the request task from a database;
[0038] An encapsulation unit is used to encapsulate the response data and the write-back response address to obtain a response message body, and transmit the response message body to the sender.
[0039] Optionally, in the message queue response system in the above-mentioned unidirectional network environment, the verification unit includes:
[0040] A detection unit, configured to detect whether the message content in the request task meets the integrity requirements and whether the message content has not been tampered with;
[0041] a first determining unit, configured to determine that the message content in the request task passes verification if the message content in the request task meets the integrity requirement and the message content has not been tampered with;
[0042] The second determining unit is configured to determine that the message content in the request task fails to pass the verification if the message content in the request task does not meet the integrity requirement and the message content has been tampered with.
[0043] Optionally, in the message queue response system in the above-mentioned unidirectional network environment, the identifier generation unit includes:
[0044] an acquiring unit, configured to acquire a current timestamp and generate a sequence number based on the current timestamp;
[0045] A calculation unit, configured to calculate a hash value of the message information;
[0046] The concatenation unit is configured to concatenate the current timestamp, the sequence number, the hash value, and the sender network identifier to obtain a target identifier of the sender.
[0047] Optionally, in the message queue response system in the above-mentioned unidirectional network environment, the reverse operation unit includes:
[0048] A rule acquisition unit, configured to acquire a coding rule for the target identifier;
[0049] The conversion unit is configured to identify the sender network identifier from the target identifier according to the encoding rule, and convert the sender network identifier into the sender's network identifier.
[0050] Optionally, the message queue response system in the above-mentioned one-way network environment further includes:
[0051] A feedback unit is used to feed back prompt information to the sender if the message content in the request task fails to pass the verification.
[0052] A fourth aspect of the present application provides a message queue response system in a one-way network environment, applied to a sender, comprising:
[0053] a sending unit configured to, upon receiving a request task for processing a service sent by a user, send the request task to a recipient, wherein the recipient verifies and parses the message content in the request task, obtains the service information corresponding to the message content, and determines a response message body based on the service information and the request task;
[0054] a parsing unit, configured to receive a response message body sent by the recipient, and parse the response message body to obtain a write-back response address and response data;
[0055] The routing unit is configured to route the response data to the task request service corresponding to the write-back response address, and the task request service obtains data information of the processing business based on the response data.
[0056] The present application provides a message queue response method for a one-way network environment. When a request task sent by a sender is received, the message content in the request task is verified. If the message content in the request task passes the verification, the message content is parsed to obtain business information corresponding to the message content, wherein the business information includes at least message information and the sender's network identifier. Then, based on the message information and the sender's network identifier, the sender's target identifier is generated. Then, a reverse operation is performed on the target identifier to obtain the sender's network identifier. Then, based on the network identifier, a response address is generated. The mapping relationship between the response address and the network identifier is obtained from a pre-built mapping table. Then, based on the mapping relationship, a write-back response address is generated. The response data corresponding to the request task is obtained from a database. Finally, the response data and the write-back response address are encapsulated to obtain a response message body, and the response message body is transmitted to the sender. Thus, by parsing the network identifier in the message content and dynamically generating the corresponding response address, it is possible to ensure that the response address can be accurately fed back to the sender, thereby avoiding the loss or misdelivery of the response address. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.
[0058] Figure 1 A schematic diagram of the overall structure of a message queue response system provided in an embodiment of the present application;
[0059] Figure 2 A flowchart of a message queue response method in a one-way network environment provided by an embodiment of the present application;
[0060] Figure 3 A flowchart of a method for verifying message content provided in an embodiment of the present application;
[0061] Figure 4 A flowchart of a method for generating a target identifier provided in an embodiment of the present application;
[0062] Figure 5 A flowchart of a method for obtaining a network identifier provided in an embodiment of the present application;
[0063] Figure 6 A flowchart of another message queue response method in a one-way network environment provided by an embodiment of the present application;
[0064] Figure 7 A flowchart of a message queue response method in a one-way network environment provided by another embodiment of the present application;
[0065] Figure 8 A schematic diagram of the structure of a message queue response system in a one-way network environment provided by another embodiment of the present application;
[0066] Figure 9 A structural diagram of a message queue response system in another one-way network environment provided by another embodiment of the present application. DETAILED DESCRIPTION
[0067] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0068] In this application, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0069] An embodiment of the present application provides a message queue response method in a one-way network environment, which is applied to a message queue response system to solve the problem that the sender's application cannot receive the correct response routing address sent by the receiver.
[0070] It should be noted that the one-way network environment system is composed of a message sending module, a message processing module, a network identification module, a response generation module, a message return module and a message routing module.
[0071] Alternatively, as Figure 1 As shown, an embodiment of the present application provides a message queue response system, including a message sending module, a message processing module, a network identification module, a response generation module, a message return module and a message routing module.
[0072] Specifically, the message sending module is deployed in the application program in the sender's application area and is used to send messages to the receiver's data center.
[0073] Message processing module: deployed in the message queue registration center of the receiver's data center, used to receive and process messages.
[0074] Network identification module: deployed in the receiver's data center to identify the source of the message.
[0075] Response generation module: deployed in the recipient's data center, used to generate the corresponding response address.
[0076] Message return module: deployed in the receiver's data center, used to send the response message body back to the sender's application area through a one-way network.
[0077] Message routing module: deployed in the sender application area, used to route the response message to the corresponding application according to the response address.
[0078] Therefore, based on the above-mentioned message queue response system, the embodiment of the present application provides a message queue response method in a one-way network environment, which is applied to the receiving party, such as Figure 2 As shown, the specific steps include:
[0079] S201. When receiving a request task sent by a sender, verify the message content in the request task.
[0080] It should be noted that when the sender's application receives a service request, it needs to obtain a response address from the receiver in order to correctly process the service according to the response address. Therefore, the sender can optionally send a request task through the interface provided by the receiver, so that the receiver can process the request task accordingly.
[0081] It should also be noted that after the receiver receives the request task sent by the sender, in order to ensure the integrity, accuracy and security of the message content in the request task, it is necessary to verify the message content in the request task.
[0082] The receiver refers to the North Bridge data center, and the sender refers to the South Bridge application area.
[0083] Optionally, in another embodiment of the present application, a specific implementation of step S201 is as follows: Figure 3 As shown, the following steps are included:
[0084] S301: Check whether the message content in the request task meets the integrity requirements and whether the message content has not been tampered with.
[0085] It is understandable that in order to ensure the integrity, accuracy, and security of the message content in the request task, it is necessary to verify whether the message content has been tampered with or damaged during transmission, and to confirm that the message content conforms to the expected format or standard, to avoid problems caused by data errors, and to prevent malicious attacks or unauthorized operations, protecting the system from security threats. Therefore, if the message content in the request task meets the integrity requirements and the message content has not been tampered with, it means that the message content in the request task is reliable, and therefore step S302 is executed. If the message content in the request task does not meet the integrity requirements and the message content has been tampered with, it means that the message content in the request task is not reliable, and therefore step S303 is executed.
[0086] Optionally, when the message content in the request task meets the integrity requirements but the message content has been tampered with, or when the message content in the request task does not meet the integrity requirements but the message content has not been tampered with, it can be said that the message content in the request task is not reliable, so step S303 is executed.
[0087] S302: Determine whether the message content in the request task passes verification.
[0088] When the message content in the request task meets the integrity requirements and the message content has not been tampered with, the recipient can perform subsequent operations based on the message content, so step S203 can be executed.
[0089] S303: Determine whether the message content in the requested task fails verification.
[0090] Optionally, when the message content in the request task does not meet the integrity requirements and the message content has been tampered with, the recipient can refuse to process the request task to avoid potential security risks or erroneous operations, and can also record relevant information of tampering detection in the log for subsequent auditing and analysis to help track the source and nature of the problem.
[0091] S202: Determine whether the message content in the request task passes verification.
[0092] Specifically, if the message content in the request task passes the verification, step S203 is executed.
[0093] Optionally, in another embodiment of the present application, after executing step S202, the following steps are further included:
[0094] If the message content in the request task fails to pass the verification, a prompt message will be fed back to the sender.
[0095] It is understandable that the prompt information is used to inform the sender that there is a problem with the message content and to suggest resending a valid request task.
[0096] S203: Parse the message content to obtain business information corresponding to the message content.
[0097] Specifically, to enable the recipient to effectively and accurately process the data in the message content and provide correct results, when the message content in the request task passes verification, it can be parsed using JSONSCHEMA to obtain the corresponding business information of the message content. The business information includes at least the message information and the sender's network identifier (such as the network ID or source IP address).
[0098] Optionally, the embodiment of the present application is not limited to the parsing method of JSONSCHEMA, but can also be other parsing methods, which can be specifically set according to needs.
[0099] S204: Generate a target identifier of the sender based on the message information and the sender's network identifier.
[0100] It is understandable that in order to ensure that each sender has a unique identifier in the receiver, thereby facilitating tracking and identification, it is necessary to generate the sender's target identifier (NID) based on the message information and the sender's network identifier.
[0101] Optionally, in another embodiment of the present application, a specific implementation of step S204 is as follows: Figure 4 As shown, the following steps are included:
[0102] S401. Obtain a current timestamp and generate a sequence number based on the current timestamp.
[0103] It should be noted that in the embodiments of the present application, the sender's unique ID (abbreviated as NID) is generated using the Snowflake Algorithm. The Snowflake Algorithm is a distributed unique ID generation algorithm. Therefore, it is necessary to first obtain the current timestamp (usually millisecond level) in the receiver's system, and then generate a unique sequence number (usually a self-incrementing number) within the same timestamp to prevent duplicate IDs from being generated within the same millisecond.
[0104] S402: Calculate the hash value of the message information.
[0105] It can be understood that in order to integrate the message information into the snowflake algorithm and generate the sender's target identifier, it is necessary to extract useful information from the message, such as a field of the message, a hash value or other unique identifier. Therefore, in the embodiment of the present application, the hash value of the message information is calculated and integrated into the snowflake algorithm.
[0106] S403: Concatenate the current timestamp, sequence number, hash value, and sender network identifier to obtain the sender's target identifier.
[0107] It is understandable that in the snowflake algorithm, a machine ID is required to uniquely identify the machine or node that generates the ID. This machine ID is usually a fixed-length number that is combined with the serial number and hash value to ensure that the generated ID is unique in a distributed environment. Therefore, in this embodiment of the present application, the sender's network identifier is used as the machine ID in the snowflake algorithm. Therefore, the data for generating the sender's target identifier is already prepared. At this time, it is only necessary to combine and splice the serial number, hash value, and sender's network identifier to obtain the sender's target identifier.
[0108] For example, if the timestamp is 1609459200000, the sender network identifier is 1, the sequence number is 123, and the hash value is 2, then the generated target identifier can be 1609459200000-1-123-2.
[0109] S205: Perform a reverse operation on the target identifier to obtain the network identifier of the sender.
[0110] It is understandable that after obtaining the sender's target identifier, the target identifier needs to be parsed using a reverse algorithm to obtain the sender's true network identifier, and then the network identifier parsed using the reverse algorithm can be used to determine the source network environment of the message content. This can accurately identify the network environments of different senders and generate the correct response address.
[0111] Optionally, in another embodiment of the present application, a specific implementation of step S205 is as follows: Figure 5 As shown, the following steps are included:
[0112] S501: Obtain the encoding rule of the target identifier.
[0113] It is understandable that in order to perform reverse calculation on the target identifier and obtain the sender's network identifier, it is necessary to know the encoding rules of the target identifier so that the sender's network identifier can be reversely calculated and parsed. Therefore, it is necessary to obtain the encoding rules of the target identifier from the system records in advance.
[0114] S502: Identify the sender's network identifier from the target identifier according to the encoding rule, and convert the sender's network identifier into the sender's network identifier.
[0115] Specifically, after obtaining the encoding rules of the target identifier, it is first necessary to analyze the target identifier, and then determine the format and structure of the target identifier. For example, it may be a string, a sequence of numbers, or binary data. Secondly, understand the encoding method of the target identifier (such as Base64, Hex, URL encoding, etc.) according to the encoding rules. Then, if the target identifier is encoded, it needs to be decoded into its original format first. For example, if the target identifier is encoded using Base64, it is decoded using a Base64 decoder, and the decoded data may contain multiple fields or information blocks. Then, according to the encoding rules, the data structure is parsed to identify the sender's network identifier. This may include: identifying the starting position and length of the field, such as using a specific delimiter or marker to locate the sender's network identifier, and finally converting the sender's network identifier into the sender's network identifier. This can include:
[0116] Character mapping: If the sender network identifier is encoded in a specific character set, perform character mapping.
[0117] Data conversion: If you need to convert the recognized identity into a specific format or structure, you can use the corresponding data conversion method (such as hexadecimal to ASCII, bit mask, etc.).
[0118] Handling special formats: If the sender's network identifier has specific format requirements, such as network address, ID number, etc., you must also ensure that the conversion result meets these format requirements.
[0119] Optionally, if the target identifier is not encoded, the data structure is directly parsed according to the encoding rule to identify the sender network identifier, and finally the sender network identifier is converted into the sender's network identifier.
[0120] S206: Generate a response address based on the network identifier, and obtain a mapping relationship between the response address and the network identifier from a pre-built mapping table.
[0121] Specifically, the receiver first identifies the data structure of the network identifier based on the obtained network identifier, and then extracts the IP address and port number according to the encoding rules of the network identifier. Then, the receiver generates a corresponding response address based on the extracted IP address and port number, which includes the IP address and port number.
[0122] In addition, after the response address is generated, it is also necessary to obtain the mapping relationship between the response address and the network identifier from a pre-built mapping table so as to subsequently generate an information write-back response address based on the mapping relationship.
[0123] S207: Generate a write-back response address based on the mapping relationship, and obtain response data corresponding to the request task from the database.
[0124] Specifically, after obtaining the mapping relationship between the acquisition response address and the network identifier, a write-back response address may be generated by using a programming language (such as Python).
[0125] It should be noted that after generating the write-back response address, the receiver also needs to obtain the response data corresponding to the request task from its own database so that the sender can process the user's business based on the response data. Therefore, the response data can include data identification code, status code, message body and description information.
[0126] Specifically, the identifier is MID or NID. Status code is a numeric code indicating the result of the request, such as 200 (Success) or 404 (Not Found) in the HTTP protocol. Body is the actual response data, which can be in JSON, XML, or other formats. Message is a brief description of the response, such as "Success" or "Resource Not Found."
[0127] S208: Encapsulate the response data and the write-back response address to obtain a response message body, and transmit the response message body to the sender.
[0128] It can be understood that after obtaining the response data and the write-back response address, in order to ensure the security of the data, the response data and the write-back response address need to be encapsulated according to the message format, so as to obtain a response message body in the message format. Finally, the receiver sends the response message body to the sender through a unidirectional network.
[0129] The present application provides a message queue response method for a one-way network environment. When a request task sent by a sender is received, the message content in the request task is verified. If the message content in the request task passes the verification, the message content is parsed to obtain business information corresponding to the message content, wherein the business information includes at least message information and the sender's network identifier. Then, based on the message information and the sender's network identifier, the sender's target identifier is generated. Then, a reverse operation is performed on the target identifier to obtain the sender's network identifier. Then, based on the network identifier, a response address is generated. The mapping relationship between the response address and the network identifier is obtained from a pre-built mapping table. Then, based on the mapping relationship, a write-back response address is generated. The response data corresponding to the request task is obtained from a database. Finally, the response data and the write-back response address are encapsulated to obtain a response message body, and the response message body is transmitted to the sender. Thus, by parsing the network identifier in the message content and dynamically generating the corresponding response address, it is possible to ensure that the response address can be accurately fed back to the sender, thereby avoiding the loss or misdelivery of the response address.
[0130] The embodiment of the present application provides another message queue response method in a one-way network environment, which is applied to the sender, such as Figure 6 As shown, the specific steps include:
[0131] S601. When a request task for processing a business sent by a user is received, the request task is sent to the recipient. The recipient verifies and parses the message content in the request task, obtains the business information corresponding to the message content, and determines the response message body based on the business information and the request task.
[0132] It should be noted that when the sender receives a request task for processing business sent by the user, the sender's application will initiate a request task to the receiver's message queue registration center, where each request task is accompanied by a unique message ID (MID for short). The MID is mainly used by the sender to process its own business, and the receiver will also return the MID.
[0133] The specific recipient verifies and parses the message content in the request task, obtains the business information corresponding to the message content, and determines the response message body based on the business information and the request task. The specific implementation method can refer to the implementation method of steps S201 to S208, which will not be repeated here.
[0134] S602: Receive the response message body sent by the recipient, and parse the response message body to obtain the write-back response address and response data.
[0135] Specifically, after the receiver performs a series of operations based on the requested task, it will generate the write-back response address and response data requested by the sender, that is, the response message body. Then the sender will receive the response message body sent by the receiver, parse the response message body generated by the receiver through the routing system, and obtain the write-back response address in the message body, which is used to determine whether the sender initiated the task request service.
[0136] S603: Routing the response data to the task request service corresponding to the write-back response address, and the task request service obtaining data information of the processing business based on the response data.
[0137] It can be understood that the sender routes the response data to the corresponding task request service based on the resolved response address, allowing the task request service to promptly obtain the user's business data information and perform corresponding processing. "Routing" is an important concept in computer networks and communications, involving the path selection and forwarding process for data packets transmitted from one node to another.
[0138] The present application provides a message queue response method for a one-way network environment. The method is applied to the sender. When a request task for processing a business is received from a user, the request task is sent to the receiver. The receiver verifies and parses the message content in the request task to obtain the business information corresponding to the message content. Based on the business information and the request task, the receiver determines the response message body. The receiver then receives the response message body sent by the receiver and parses the response message body to obtain the write-back response address and response data. Finally, the response data is routed to the task request service corresponding to the write-back response address. The task request service obtains the data information for processing the business based on the response data. This provides an effective message identification and response routing mechanism. The sender's application can promptly receive the processing results fed back by the receiver, effectively improving user experience and system performance.
[0139] Another embodiment of the present application provides a message queue response method for a one-way network environment, such as Figure 7 As shown, the specific steps include:
[0140] S701: When a sender receives a request task for processing a service from a user, the sender sends the request task to a receiver.
[0141] It should be noted that the specific implementation of step S701 can refer to step S601 accordingly, and will not be repeated here.
[0142] S702: When the receiver receives the request task sent by the sender, it verifies the message content in the request task.
[0143] It should be noted that the specific implementation of step S702 can refer to step S201 accordingly, and will not be repeated here.
[0144] S703: Determine whether the message content in the request task passes verification.
[0145] Specifically, if the message content in the request task passes the verification, step S704 is executed.
[0146] Optionally, if the message content in the request task fails to pass the verification, a prompt message is fed back to the sender.
[0147] S704: If the recipient determines that the message content in the request task passes the verification, the recipient parses the message content to obtain the business information corresponding to the message content.
[0148] The service information at least includes message information and sender network identifier.
[0149] It should be noted that the specific implementation of step S704 can refer to step S203 accordingly, and will not be repeated here.
[0150] S705: The receiver generates a target identifier of the sender based on the message information and the sender's network identifier.
[0151] It should be noted that the specific implementation of step S705 can refer to step S204 accordingly, and will not be repeated here.
[0152] S706: The receiver performs a reverse operation on the target identifier to obtain the network identifier of the sender.
[0153] It should be noted that the specific implementation of step S706 can refer to step S205 accordingly, and will not be repeated here.
[0154] S707: The receiver generates a response address based on the network identifier, and obtains a mapping relationship between the response address and the network identifier from a pre-built mapping table.
[0155] It should be noted that the specific implementation of step S707 can refer to step S206 accordingly, and will not be repeated here.
[0156] S708: The receiver generates a write-back response address based on the mapping relationship, and obtains response data corresponding to the request task from the database.
[0157] It should be noted that the specific implementation of step S708 can refer to step S207 accordingly, and will not be repeated here.
[0158] S709: The receiver encapsulates the response data and the write-back response address to obtain a response message body, and transmits the response message body to the sender.
[0159] It should be noted that the specific implementation of step S709 can refer to step S208 accordingly, and will not be repeated here.
[0160] S710: The sender receives the response message body sent by the receiver, and parses the response message body to obtain the write-back response address and response data.
[0161] It should be noted that the specific implementation of step S710 can refer to step S602 accordingly, and will not be repeated here.
[0162] S711 , the sender routes the response data to the task request service corresponding to the write-back response address, and the task request service obtains data information of the processing business based on the response data.
[0163] It should be noted that the specific implementation of step S711 can refer to step S603 accordingly, and will not be repeated here.
[0164] Another embodiment of the present application provides a message queue response system for a one-way network environment, which is applied to a receiving party, such as Figure 8 As shown, it includes the following units:
[0165] The verification unit 801 is configured to verify the message content in the request task when receiving the request task sent by the sender.
[0166] The content parsing unit 802 is configured to parse the message content if the message content in the request task passes the verification, and obtain the service information corresponding to the message content, wherein the service information at least includes the message information and the sender network identifier.
[0167] The identifier generating unit 803 is configured to generate a target identifier of the sender based on the message information and the sender's network identifier.
[0168] The reverse operation unit 804 is configured to perform a reverse operation on the target identifier to obtain the network identifier of the sender.
[0169] The relationship acquisition unit 805 is configured to generate a response address based on the network identifier, and acquire a mapping relationship between the response address and the network identifier from a pre-built mapping table.
[0170] The data acquisition unit 806 is used to generate a write-back response address based on the mapping relationship and acquire response data corresponding to the request task from the database.
[0171] The encapsulation unit 807 is configured to encapsulate the response data and the write-back response address to obtain a response message body, and transmit the response message body to the sender.
[0172] It should be noted that the specific working process of the above-mentioned units in the embodiment of the present application can refer to steps S201 to S208 in the above-mentioned method embodiment, and will not be repeated here.
[0173] Optionally, in a message queue response system in a one-way network environment provided by another embodiment of the present application, the verification unit 801 includes:
[0174] The detection unit is used to detect whether the message content in the request task meets the integrity requirements and whether the message content has not been tampered with.
[0175] The first determining unit is configured to determine that the message content in the request task passes the verification if the message content in the request task meets the integrity requirement and the message content has not been tampered with.
[0176] The second determining unit is configured to determine that the message content in the request task fails verification if the message content in the request task does not meet the integrity requirement and the message content has been tampered with.
[0177] Optionally, in a message queue response system in a one-way network environment provided by another embodiment of the present application, the identifier generation unit 803 includes:
[0178] The acquisition unit is used to obtain the current timestamp and generate a sequence number based on the current timestamp.
[0179] A calculation unit is used to calculate the hash value of the message information.
[0180] The splicing unit is used to splice the current timestamp, sequence number, hash value and sender network identifier to obtain the sender's target identifier.
[0181] Optionally, in a message queue response system in a unidirectional network environment provided by another embodiment of the present application, the reverse operation unit 804 includes:
[0182] The rule acquisition unit is used to acquire the encoding rule of the target identifier.
[0183] The conversion unit is used to identify the sender network identifier from the target identifier according to the encoding rule, and convert the sender network identifier into the sender's network identifier.
[0184] Optionally, another embodiment of the present application provides a message queue response system in a one-way network environment, further comprising:
[0185] The feedback unit is used to feedback prompt information to the sender if the message content in the request task fails to pass the verification.
[0186] Another embodiment of the present application provides another message queue response system in a one-way network environment, which is applied to the sender, such as Figure 9 As shown, it includes the following units:
[0187] The sending unit 901 is used to send the request task to the recipient when it receives a request task for processing a business sent by the user. The recipient verifies and parses the message content in the request task, obtains the business information corresponding to the message content, and determines the response message body based on the business information and the request task.
[0188] The parsing unit 902 is configured to receive a response message body sent by the recipient, and parse the response message body to obtain a write-back response address and response data.
[0189] The routing unit 903 is used to route the response data to the task request service corresponding to the write-back response address, and the task request service obtains data information of the processing business based on the response data.
[0190] It should be noted that the specific working process of the above-mentioned units in the embodiment of the present application can refer to steps S601 to S603 in the above-mentioned method embodiment, and will not be repeated here.
[0191] It should also be noted that the message queue response system for a one-way network environment provided by the embodiment of the present application has the technical effects of any of the above embodiments, and the embodiment of the present application will not be described in detail here.
[0192] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0193] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A message queue response method in a one-way network environment, characterized in that: Applied to the receiving side, including: When receiving a request task sent by a sender, verifying the message content in the request task; If the message content in the request task passes the verification, the message content is parsed to obtain the business information corresponding to the message content; wherein the business information at least includes the message information and the sender network identifier; Generate a target identifier of the sender based on the message information and the sender network identifier; Performing a reverse operation on the target identifier to obtain the network identifier of the sender; Based on the network identifier, a response address is generated, and a mapping relationship between the response address and the network identifier is obtained from a pre-built mapping table; Based on the mapping relationship, a write-back response address is generated, and response data corresponding to the request task is obtained from a database; The response data and the write-back response address are encapsulated to obtain a response message body, and the response message body is transmitted to the sender.
2. The method according to claim 1, characterized in that: The verifying the message content in the request task includes: Check whether the message content in the request task meets the integrity requirements and whether the message content has not been tampered with; If the message content in the request task meets the integrity requirement and the message content has not been tampered with, it is determined that the message content in the request task passes the verification; If the message content in the request task does not meet the integrity requirement and the message content has been tampered with, it is determined that the message content in the request task has failed the verification.
3. The method according to claim 1, characterized in that The generating the target identifier of the sender based on the message information and the sender network identifier includes: Obtaining a current timestamp, and generating a sequence number based on the current timestamp; Calculate the hash value of the message information; The current timestamp, the sequence number, the hash value and the sender network identifier are concatenated to obtain the sender's target identifier.
4. The method according to claim 1, characterized in that The performing a reverse operation on the target identifier to obtain the network identifier of the sender includes: Obtaining a coding rule for the target identifier; According to the encoding rule, the sender network identifier is identified from the target identifier, and the sender network identifier is converted into the sender's network identifier.
5. The method according to claim 1, characterized in that The verifying the message content in the request task also includes: If the message content in the request task fails to pass the verification, a prompt message is fed back to the sender.
6. A message queue response method in a one-way network environment, characterized in that: Applicable to the sender, including: When receiving a request task for processing a business sent by a user, the request task is sent to a recipient, and the recipient verifies and parses the message content in the request task to obtain the business information corresponding to the message content, and determines the response message body based on the business information and the request task; Receiving a response message body sent by the recipient, and parsing the response message body to obtain a write-back response address and response data; The response data is routed to the task request service corresponding to the write-back response address, and the task request service obtains data information of the processing business based on the response data.
7. A message queue response system in a one-way network environment, characterized in that: Applied to the receiving side, including: A verification unit, configured to verify the message content in the request task when receiving the request task sent by the sender; A content parsing unit, configured to parse the message content if the message content in the request task passes the verification, and obtain the business information corresponding to the message content; wherein the business information at least includes the message information and the sender network identifier; An identifier generating unit, configured to generate a target identifier of the sender based on the message information and the sender network identifier; A reverse operation unit, used to perform a reverse operation on the target identifier to obtain the network identifier of the sender; A relationship acquisition unit, configured to generate a response address based on the network identifier, and acquire a mapping relationship between the response address and the network identifier from a pre-built mapping table; A data acquisition unit, used to generate a write-back response address based on the mapping relationship, and acquire response data corresponding to the request task from a database; An encapsulation unit is used to encapsulate the response data and the write-back response address to obtain a response message body, and transmit the response message body to the sender.
8. The system according to claim 7, characterized in that The verification unit comprises: A detection unit, used to detect whether the message content in the request task meets the integrity requirements and whether the message content has not been tampered with; A first determining unit, configured to determine that the message content in the request task passes the verification if the message content in the request task meets the integrity requirement and the message content has not been tampered with; The second determining unit is used to determine that the message content in the request task fails to pass the verification if the message content in the request task does not meet the integrity requirement and the message content has been tampered with.
9. The system according to claim 7, characterized in that The identification generating unit comprises: An acquisition unit, used to acquire a current timestamp and generate a sequence number based on the current timestamp; A calculation unit, used to calculate the hash value of the message information; The concatenation unit is used to concatenate the current timestamp, the sequence number, the hash value and the sender network identifier to obtain the sender's target identifier.
10. A message queue response system in a one-way network environment, characterized in that: Applicable to the sender, including: A sending unit, configured to, when receiving a request task for processing a service sent by a user, send the request task to a receiving party, and the receiving party verifies and parses the message content in the request task, obtains the service information corresponding to the message content, and determines a response message body based on the service information and the request task; A parsing unit, configured to receive a response message body sent by the receiving party, and parse the response message body to obtain a write-back response address and response data; A routing unit is used to route the response data to the task request service corresponding to the write-back response address, and the task request service obtains data information of the processing business based on the response data.