Message verification method, device, computer equipment, storage medium and program product

By obtaining the message template of the virtual machine and extracting verification information for comparison, the problem of inability to effectively verify multiple HTTP messages in the prior art is solved, and efficient and widely applicable checksum attack recognition for HTTP messages is achieved.

CN115955330BActive Publication Date: 2025-08-12PURPLE MOUNTAIN LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211519023.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2025-08-12
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

There is a lack of effective verification methods suitable for multiple types of HTTP messages in the prior art, and it is impossible to effectively identify and defend against unknown security threats such as virus Trojans and vulnerable backdoors.

Method used

By obtaining the message template of the message to be checked sent by the virtual machine, extracting the verification information based on the template, and comparing it with the verification information of other messages, determining the verification result, avoiding decoding the message, and suitable for all types of HTTP messages.

Benefits of technology

It realizes wide applicability verification for different types of HTTP messages, improves the efficiency and accuracy of message verification, and can promptly identify abnormal messages and prevent attack behavior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115955330B_ABST
    Figure CN115955330B_ABST
Patent Text Reader

Abstract

This application relates to a message verification method, apparatus, computer device, storage medium, and program product. The method includes: in response to messages to be verified sent by multiple virtual machines, obtaining a message template for each message to be verified; wherein different messages to be verified have different message templates; extracting verification information from each message to be verified based on the message template; and verifying each message to be verified based on the verification information in each message to be verified, thereby obtaining a verification result for each message to be verified. This method is applicable to verifying all types of HTTP messages.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network security technology, and in particular to a message verification method, apparatus, computer equipment, storage medium, and program product. Background Art

[0002] With the continuous development of internet technology, network security issues are becoming increasingly serious. For example, various unknown security threats such as viruses, Trojans, vulnerabilities, and backdoors exist. Active defense using mimicry can combat attacks brought about by these unknown threats.

[0003] Taking Hyper Text Transfer Protocol (HTTP) messages as an example, in related technologies, after receiving an HTTP message, the HTTP message is decoded by an arbiter, and then the decoded HTTP message is verified to determine whether there is any abnormal information in the HTTP message, thereby determining whether there may be an attack.

[0004] However, there is an urgent need in the related art for a message verification method that can be applied to various types of HTTP messages. Summary of the Invention

[0005] Based on this, it is necessary to provide a message verification method, device, computer equipment, storage medium and program product that can be applied to all types of HTTP messages to address the above technical problems.

[0006] In a first aspect, the present application provides a message verification method, the method comprising:

[0007] In response to the messages to be verified sent by the multiple virtual machines, obtaining a message template for each message to be verified; wherein different messages to be verified have different message templates;

[0008] Extracting verification information from each message to be verified according to the message template of each message to be verified;

[0009] Based on the verification information in each message to be verified, each message to be verified is verified to obtain a verification result for each message to be verified.

[0010] In one embodiment, each message to be verified is verified based on the verification information in each message to be verified to obtain a verification result of each message to be verified, including:

[0011] For any message to be verified, the verification information in the message to be verified is compared with the verification information in other messages to be verified;

[0012] If the verification information in the message to be verified is the same as the verification information in other messages to be verified, then the verification result of the message to be verified is determined to be normal;

[0013] If the verification information in the message to be verified is different from any verification information in the other information to be verified, it is determined that the verification result of the message to be verified is abnormal.

[0014] In one embodiment, the method further comprises:

[0015] According to the verification results of each message to be verified, determine the target message whose verification result is normal from each message to be verified;

[0016] Send a target message to the client or third-party server, instructing the client or third-party server to process the target message.

[0017] In one embodiment, the message to be verified includes a message request instruction sent by each virtual machine or a response message returned by each virtual machine based on the message request instruction sent by the client.

[0018] In one embodiment, if the message to be verified is a response message, the process of generating the message to be verified includes:

[0019] Receive message request instructions sent by the client;

[0020] Forwarding the message request instruction to each virtual machine, instructing each virtual machine to process the message request instruction;

[0021] Receive response messages returned by each virtual machine.

[0022] In one embodiment, forwarding the message request instruction to each virtual machine includes:

[0023] The message request instruction is copied, and a reverse proxy corresponding to the copied message request instruction is created; the total number of the copied message request instructions and the number of reverse proxies are the same as the number of the multiple virtual machines;

[0024] Each copied message request instruction is forwarded to each virtual machine through the reverse proxy; each virtual machine corresponds to one message request instruction.

[0025] In one embodiment, obtaining a message template corresponding to each message to be verified includes:

[0026] Obtain identification information in the message request instruction sent by the client;

[0027] Matching the identification information with multiple identification information in the message template library. If the identification information successfully matches any identification information in the message template library, the message template corresponding to the identification information is determined as the message template of the message request instruction; each message template is stored in the message template library in a prefix tree manner;

[0028] A reflection operation is performed on each response message according to the message template of the message request instruction to obtain a message template corresponding to each response message.

[0029] In one embodiment, before verifying the verification information in each message to be verified, the method further includes:

[0030] Determine whether the number of response messages returned by each virtual machine is the same as the number of the multiple virtual machines;

[0031] If yes, then performing the step of verifying each response message based on the verification information in each response message to obtain a verification result for each response message;

[0032] If not, the waiting response time of the multiple virtual machines that have not returned the response message is obtained, and when the waiting response time exceeds the preset time, a message request failure instruction is sent to the client.

[0033] In a second aspect, the present application further provides a message verification device, which includes:

[0034] an acquisition module, responsive to the messages to be verified sent by the plurality of virtual machines, for acquiring a message template for each message to be verified; wherein different messages to be verified have different message templates;

[0035] A processing module, configured to extract verification information from each message to be verified according to a message template of each message to be verified;

[0036] The verification module is used to verify each message to be verified based on the verification information in each message to be verified, and obtain a verification result of each message to be verified.

[0037] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the content of any one of the message verification methods in the first aspect is implemented.

[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the content of any one of the message verification methods in the first aspect.

[0039] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the content of any one of the message verification methods in the first aspect.

[0040] The above-mentioned message verification method, apparatus, computer device, storage medium and program product, in response to the messages to be verified sent by multiple virtual machines, obtains the message template of each message to be verified, extracts the corresponding information according to the message template of each message to be verified, and verifies each message to be verified based on the verification information in each message to be verified, and obtains the verification result of each message to be verified. Among them, different messages to be verified have different message templates, and different messages to be verified sent by virtual machines have different message templates for corresponding messages to be verified.

[0041] Similarly, different message templates can be used to extract verification information from different types of messages to be verified, thereby verifying the verification information of different types of messages, avoiding the need to decode the message.

[0042] It can be applied to the verification of all types of HTTP messages and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is an application environment diagram of a message verification method in one embodiment;

[0044] Figure 2 This is an application environment diagram of a message verification method in one embodiment;

[0045] Figure 3 This is an application environment diagram of a message verification method in one embodiment;

[0046] Figure 4 1 is a flow chart of a message verification method according to an embodiment;

[0047] Figure 5 1 is a flow chart of a message verification method according to an embodiment;

[0048] Figure 6 1 is a flow chart of a message verification method according to an embodiment;

[0049] Figure 7 1 is a flow chart of a message verification method according to an embodiment;

[0050] Figure 8 1 is a flow chart of a message verification method according to an embodiment;

[0051] Figure 9 1 is a flow chart of a message verification method according to an embodiment;

[0052] Figure 10 1 is a flow chart of a message verification method according to an embodiment;

[0053] Figure 11 1 is a flow chart of a message verification method according to an embodiment;

[0054] Figure 12 1 is a flow chart of a message verification method according to an embodiment;

[0055] Figure 13 A schematic diagram of a one-receive-multiple-transmit configuration in one embodiment;

[0056] Figure 14 A schematic diagram of a one-transmit-multiple-receive system in one embodiment;

[0057] Figure 15 A structural block diagram of a message verification device in one embodiment;

[0058] Figure 16 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] The message verification method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, multiple virtual machines 102 communicate with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Multiple virtual machines 102 send messages to be verified to the server 104, and the server 104 verifies the messages to be verified according to the message template of the messages to be verified to obtain the verification results. Among them, multiple virtual machines 102 can be installed on various personal computers or laptops. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.

[0061] It is understandable that multiple virtual machines 102 can serve as both clients and servers. Figure 2As shown, when multiple virtual machines 102 act as clients, the multiple virtual machines 102 and the third-party server 106 communicate with the server 104 respectively. The multiple virtual machines 102 send message request instructions to the server 104, and the server 104 forwards the normal request instructions in the message request instructions to the third-party server 106. The third-party server 106 returns a response instruction corresponding to the message request instruction to the server 104 based on the message request instruction, and the server 104 forwards the response instruction to the multiple virtual machines 102.

[0062] like Figure 3 As shown, when multiple virtual machines 102 act as server terminals, the multiple virtual machines 102 and the client 108 communicate with the server 104. The client 108 sends a message request instruction to the server 104, and the server 104 forwards the message request instruction to the multiple virtual machines 102. The multiple virtual machines 102 return response messages to the server 104 according to the message request instruction, and the server 104 returns the normal message in the response instruction to the client 108.

[0063] In one embodiment, Figure 4 As shown, a message verification method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0064] S201 : In response to messages to be verified sent by multiple virtual machines, obtain a message template for each message to be verified; wherein different messages to be verified have different message templates.

[0065] All messages are sent according to the selected message template configuration, facilitating message content maintenance. Message templates can be of various types, and different messages to be verified require different message templates. Because virtual machines can function as both clients and servers, the messages to be verified sent by multiple virtual machines can be either message requests sent by each virtual machine or response messages returned by each virtual machine based on a message request sent by a client.

[0066] The server can provide an interactive interface with the project (OpenStack) managed by the cloud platform. By configuring OpenStack information and virtual machine (Virtual Machine) information, multiple virtual machines can be created on OpenStack, and the server can manage the entire life cycle of multiple virtual machines.

[0067] In this embodiment, the message template includes identification information of different messages. When determining the message templates of multiple messages to be verified, the identification information in the message request instruction can be matched with the identification information in the message template to determine the message template of the message to be verified from the multiple message templates. Multiple virtual machines simultaneously send multiple messages to be verified to the server. When the multiple messages to be verified are message request instructions, the message templates of each message to be verified can be determined directly based on the identification information of the message to be verified and the identification information in the message template. When the multiple messages to be verified are response messages, the corresponding message request instructions can be determined based on the multiple messages to be verified, and the identification information of the message request instructions corresponding to the multiple messages to be verified can be matched with the identification information in the message template to determine the message template of each message to be verified.

[0068] S202: Extract verification information from each message to be verified according to the message template of each message to be verified.

[0069] The message template stores each piece of information to be verified in the form of keywords (Key) and (Value). Key is the Uniform Resource Identifier (URI) of the message, and Value is a structure containing the following key information: user identification (UeIdentify), unique identifier (UniqueId), location information of the identifier (UniqueId Location), and check (CheckIe). User identification indicates whether the URI of the message has a unique identifier. The unique identifier indicates whether the message body corresponding to the URI has a unique identifier. The location information of the identifier indicates the location information of the UniqueId if it exists. Check indicates determining a correct message from multiple messages.

[0070] In this embodiment, each message to be verified contains multiple verification information, and the message template of each message to be verified includes the verification information of each verification message. The server can extract the verification information in each message to be verified from the message template of each message to be verified based on the message template of each message to be verified.

[0071] S203: Verify each message to be verified based on the verification information in each message to be verified, and obtain a verification result of each message to be verified.

[0072] Among them, the verification results of each information to be verified include normal or abnormal. If all the verification information in the message to be verified is normal, the verification result of the information to be verified is normal; if any verification information in the message to be verified is abnormal, the verification result of the information to be verified is abnormal.

[0073] Optionally, the server may compare the verification information in each message to be verified with the verification information in the standard verification message, and determine the verification result of each message to be verified based on the comparison result.

[0074] The server can compare the verification information in any message to be verified with the verification information 5 of other messages to be verified, and determine the verification results of each message to be verified based on the comparison results. This embodiment does not limit the way to verify each message to be verified.

[0075] In the above message verification method, in response to the messages to be verified sent by multiple virtual machines, the message template of each message to be verified is obtained, and the corresponding message template of each message to be verified is extracted based on the message template of each message to be verified.

[0076] Verify the verification information in the message, verify each message to be verified, and obtain the verification result of each message to be verified. Among them, different messages to be verified have different message templates, and the messages to be verified sent by the virtual machine are different.

[0077] The message templates of the corresponding messages to be verified are different. Through different message templates, the verification information in different types of messages to be verified can be extracted, so that the verification information of different types of messages can be verified, avoiding the decoding operation of the message. It can be applied to the verification of all types of HTTP messages and has a wide range of applications.

[0078] 5 Based on the above embodiment, this embodiment is Figure 4 The specific content of step S203 of "based on the verification information in each message to be verified, verifying each message to be verified to obtain the verification result of each message to be verified" is introduced and explained. Figure 5 As shown, the above step S203 may include the following contents:

[0079] S301 : For any message to be verified, compare verification information in the message to be verified with verification information in other messages to be verified.

[0080] In this embodiment, when the virtual machine is not attacked, the messages to be verified sent by each virtual machine should be the same, and the verification result of the messages to be verified is normal; when a virtual machine may be attacked or has been attacked, the messages to be verified sent by the virtual machine are different from the messages to be verified sent by other virtual machines, and the verification result of the messages to be verified is abnormal. Therefore, each message to be verified can be

[0081] The verification information in the message is compared with the verification information in other messages to be verified, and the verification result of the message to be verified can be determined according to the comparison result.

[0082] S302: If the verification information in the message to be verified is the same as the verification information in other messages to be verified, it is determined that the verification result of the message to be verified is normal.

[0083] In this embodiment, if the verification information in any message to be verified is the same as the verification information of other messages to be verified, the verification results of each message to be verified are determined to be normal, that is, the possibility of the virtual machine being attacked is low. For example, when the number of virtual machines is 3, the number of messages to be verified is also 3, and each message to be verified includes 4 verification information. For any message to be verified, if each verification information is the same as the verification information of other messages to be verified, the verification result of the message to be verified is verification passed.

[0084] S303: If the verification information in the message to be verified is different from any verification information in other information to be verified, it is determined that the verification result of the message to be verified is abnormal.

[0085] In this embodiment, if any verification message in a message to be verified differs from the verification information of other messages to be verified, the verification result of the verification message is considered failed, indicating that the virtual machine to which the verification message belongs may be attacked. For example, assuming that the number of virtual machines is 3, the number of messages to be verified is also 3, and each message to be verified includes 4 pieces of verification information, if the second piece of verification information in the first message to be verified differs from the other pieces of verification information, the verification result of the first message to be verified is determined to be failed.

[0086] In the above-described message verification method, for any message to be verified, regardless of the content of the message itself, the verification information in the message to be verified is compared with the verification information in other messages to be verified, thereby avoiding the need to decode the message to be verified into a specific message structure. This method is applicable to the verification of all types of HTTP messages. If the verification information in the message to be verified is the same as the verification information in the other messages to be verified, the verification result of the message to be verified is determined to be normal. If the verification information in the message to be verified is different from the verification information in any of the other messages to be verified, the verification result of the message to be verified is determined to be abnormal. By determining whether the verification result is normal based on the comparison results of the verification messages, the speed and efficiency of message verification can be increased.

[0087] Based on the above embodiment, this embodiment describes how to determine the specific content of the target message according to the target verification result. Figure 6 As shown, the above steps may also include the following:

[0088] S401, according to the verification results of the messages to be verified, determining a target message whose verification result is normal from the messages to be verified.

[0089] In this embodiment, when the verification results of all the messages to be verified are normal, any one of the messages to be verified can be used as a normal target message. When the verification results of the messages to be verified are partially abnormal and partially normal, any one of the messages to be verified with normal verification results can be used as a normal target message. When the verification results of all the messages to be verified are all abnormal, normal verification information is determined from each message to be verified, all the verification information is combined to obtain a normal message to be verified, and this normal message to be verified is determined as a normal target message.

[0090] S402: Send a target message to the client or the third-party server, instructing the client or the third-party server to process the target message.

[0091] In this embodiment, when each message to be verified is a response message, a normal response message is determined from the response messages and the normal response message is sent to the client. When each message to be verified is a message request instruction, the server selects a normal message request instruction from multiple message request instructions and sends the normal message request instruction to the third-party server. The third-party server can then return a response message corresponding to the normal message request instruction to the server. The server then copies the response message and sends the copied response message to each virtual machine.

[0092] In the above-mentioned message verification method, based on the verification results of each message to be verified, the target message whose verification result is normal can be accurately determined from each message to be verified, and the target message can be sent to the client or the third-party server, instructing the client or the third-party server to process the target message. Through the message verification process, it is possible to avoid sending abnormal messages to the client or the third-party server, and the accuracy of the target message can be guaranteed.

[0093] On the basis of the above embodiment, if the message to be verified is a response message, this embodiment introduces the specific content of the process of generating the message to be verified, such as Figure 7 As shown, the above process of generating the message to be verified may include the following:

[0094] S501: Receive a message request instruction sent by a client.

[0095] In this embodiment, a message request instruction is used to instruct the processing of a message request instruction. The message request instruction may carry identification information, which may be letters, numbers, or underscores. Different message request instructions correspond to different identification information. When a user triggers a message query request on the client, the server can receive the message request instruction sent by the client.

[0096] S502: Forward the message request instruction to each virtual machine, and instruct each virtual machine to process the message request instruction.

[0097] Optionally, after receiving the message request instruction sent by the client, the server can obtain the address information of the message request instruction and send the address information of the message request instruction to multiple virtual machines simultaneously. Alternatively, the server can copy the message request instruction according to the number of virtual machines and forward the copied message request instruction to multiple virtual machines. After receiving the message request instruction, the virtual machine processes the message request instruction. The address information of the message request instruction can be an Internet Protocol Address (IP) or a Media Access Control Address (MAC).

[0098] S503: Receive response messages returned by each virtual machine.

[0099] In this embodiment, after the server sends a message request instruction to multiple virtual machines, it can receive response messages corresponding to the message request instructions returned by multiple virtual machines. If the response messages returned by multiple virtual machines are the same, it is determined that the multiple virtual machines have not been attacked; if the response messages returned by one or several of the multiple virtual machines are different from other response messages, it is determined that the one or several virtual machines may be attacked.

[0100] Furthermore, if it is determined that a virtual machine may be attacked, the virtual machine is destroyed and a new virtual machine is selected from the virtual machine pool to run, thereby ensuring the number of running virtual machines.

[0101] In the above-mentioned message verification method, after receiving the message request instruction sent by the client, the message request instruction is forwarded to each virtual machine, that is, the message request instruction received by each virtual machine is the same. The message request instruction is used to instruct each virtual machine to process the message request instruction and receive the response message returned by each virtual machine. By sending the same message request instruction to the virtual machine, a more accurate message to be verified is obtained.

[0102] Based on the above embodiment, this embodiment is to Figure 7 The specific content of "forwarding the message request instruction to each virtual machine" in step S502 is introduced and explained. Figure 8 As shown, the above step S502 may include the following contents:

[0103] S601, copying a message request instruction and creating a reverse proxy corresponding to the copied message request instruction; the total number of the copied message request instructions and the number of reverse proxies are the same as the number of the multiple virtual machines.

[0104] In this embodiment, after the server receives a message request instruction sent by the client, it can create a job corresponding to the message request instruction, select a thread in the parallel scheduling thread to process the message request instruction, create the same number of reverse proxies as the virtual machines, one reverse proxy corresponds to one virtual machine, and copy the message request instruction, and set the copied message request instruction in each reverse proxy in turn.

[0105] S602 , forwarding each copied message request instruction to each virtual machine through a reverse proxy; each virtual machine corresponds to one message request instruction.

[0106] In this embodiment, the server can forward the copied message request instructions to each virtual machine through multiple reverse proxies. The message request instructions received by each virtual machine are the same, and the tasks performed in each virtual machine are also the same. When the virtual machine is not attacked, the response messages returned by each virtual machine are the same.

[0107] In the above-mentioned message verification method, the message request instruction is copied and a reverse proxy corresponding to the copied message request instruction is created. The total number of copied message request instructions and the number of reverse proxies are the same as the number of multiple virtual machines. The copied message request instruction is then forwarded to each virtual machine through each reverse proxy. Each virtual machine corresponds to a message request instruction to ensure that each virtual machine receives the same message request instruction.

[0108] Based on the above embodiment, this embodiment is to Figure 4 The specific content of "obtaining the message template corresponding to each message to be verified" in step S201 is introduced and explained. Figure 9 As shown, the above step S201 may include the following contents:

[0109] S701: Obtain identification information in a message request instruction sent by a client.

[0110] In this embodiment, after receiving the message request instruction sent by the client, the server may parse the message request instruction to obtain identification information in the message request instruction. The identification information of the message request instruction may be set at the beginning or the end of the message request instruction. This embodiment does not limit the location of the identification information in the message request instruction.

[0111] S702, match the identification information with multiple identification information in the message template library. If the identification information successfully matches any identification information in the message template library, the message template corresponding to the identification information is determined as the message template of the message request instruction; each message template is stored in the message template library in the form of a prefix tree.

[0112] In this embodiment, the server can match the identification information in the message request instruction with each identification information in the message template library through a prefix tree. If the identification information in the message request instruction successfully matches any identification information in the message template library, the message template corresponding to the successfully matched identification information is determined as the message template of the message request instruction.

[0113] S703: Perform a reflection operation on each response message according to the message template of the message request instruction to obtain a message template corresponding to each response message.

[0114] In this embodiment, the server can extract the verification message from any response message based on the message template of the message request instruction, and then reflect the verification message in the response message into the message template of the message request instruction to obtain the message template corresponding to the response message. Following this method, the same reflection operation is performed on the remaining response messages to obtain the message templates corresponding to each response message.

[0115] In the above-mentioned message verification method, by obtaining the identification information in the message request instruction sent by the client, the identification information is matched with multiple identification information in the message template library. If the identification information successfully matches any identification information in the message template library, the message template corresponding to the identification information is determined as the message template of the message request instruction, wherein each message template is stored in the message template library in the form of a prefix tree. According to the identification information, the message template corresponding to the message request instruction can be quickly obtained in the form of a prefix tree, so that each response message is reflected according to the message template of the message request instruction, and the message template corresponding to each response message can be quickly obtained.

[0116] Based on the above embodiment, this embodiment introduces and explains the specific content of the number of response messages returned by each virtual machine. Figure 10 As shown, the number of response messages returned to each virtual machine may include the following:

[0117] S801: Determine whether the number of response messages returned by each virtual machine is the same as the number of the multiple virtual machines.

[0118] In this embodiment, the server can determine the number of virtual machines during the process of copying the message request instruction. After forwarding the copied message request instruction to each virtual machine respectively, the number of response messages returned by each virtual machine can be obtained through a counter to determine whether the number of response messages is the same as the number of virtual machines.

[0119] S802: If yes, then perform a step of verifying each response message based on the verification information in each response message to obtain a verification result for each response message.

[0120] In this embodiment, if the number of response messages is the same as the number of virtual machines, that is, the server can compare the verification information in the message to be verified with the verification messages in other messages to be verified. If the verification information in the message to be verified is the same as the verification messages in other messages to be verified, then the verification result of the message to be verified is determined to be normal; if the verification information in the message to be verified is different from any of the verification information in the other messages to be verified, then the verification result in the message to be verified is determined to be abnormal.

[0121] S803: If not, obtain the response waiting time of multiple virtual machines that have not returned response messages, and send a message request failure instruction to the client when the response waiting time exceeds a preset time.

[0122] In this embodiment, if the number of response messages is different from the number of virtual machines, that is, the number of response messages is less than the number of virtual machines, then continue waiting. If the waiting time for the response is longer than the preset time and the number of response messages is still less than the number of virtual machines, it is determined that a certain virtual machine may have an abnormality and cannot return a response message. The server sends a message request failure instruction to the client.

[0123] In the above-mentioned message verification method, it is determined whether the number of response messages returned by each virtual machine is the same as the number of multiple virtual machines. If so, the step of verifying each response message based on the verification information in each response message is executed to obtain the verification result of each response message. If not, the waiting response time of the multiple virtual machines that have not returned the response message is obtained, and when the waiting response time exceeds the preset time, a message request failure instruction is sent to the client. Through the number and time of the response messages returned, it can be determined whether all virtual machines have responded to the message request instruction, so that it can be accurately determined whether each virtual machine is operating normally.

[0124] In one embodiment, Figure 11 As shown, an embodiment of a message verification method is also provided, which includes the following steps:

[0125] S901, in response to messages to be verified sent by multiple virtual machines, obtaining a message template for each message to be verified;

[0126] S902, extracting verification information from each message to be verified according to the message template of each message to be verified;

[0127] S903, for any message to be verified, comparing the verification information in the message to be verified with the verification information in other messages to be verified;

[0128] S904, if the verification information in the message to be verified is the same as the verification information in the other messages to be verified, then determining that the verification result of the message to be verified is normal;

[0129] S905, if the verification information in the message to be verified is different from any of the verification information in the other messages to be verified, then determining that the verification result in the message to be verified is abnormal;

[0130] S906, based on the verification results of the messages to be verified, determining a target message whose verification result is normal from the messages to be verified;

[0131] S907: Send the target message to the client or the third-party server, instructing the client or the third-party server to process the target message.

[0132] Figure 12 A flowchart showing the message verification method is shown in Figure 12 In the server, there are a mimic controller and a cloud scheduling module. The cloud scheduling module can create multiple virtual machines through projects managed by the cloud platform, and can also destroy, schedule and monitor the status of multiple virtual machines. Each virtual machine runs the service of a heterogeneous executor, and the mimic control module can obtain the information of the heterogeneous executor through the cloud scheduling module. Among them, when the cloud scheduling module is started, it creates a virtual machine in OpenStack through configuration. The parameters of the virtual machine in the configuration include: the name of the virtual machine (Name), the instance type identification number of the virtual machine (FlavorRef), the image identification number of the virtual machine (ImagRef), the domain where the virtual machine runs (AvailabilityZone), the network instance identification number (Networks), the network name (netName), and the port (Port) on which the executor service in the virtual machine listens.

[0133] The server can monitor the operating status of virtual machines through the cloud scheduling module to determine whether the virtual machines are vulnerable to attack. Alternatively, the server can verify the messages returned by multiple virtual machines through the mimic control module to determine whether multiple virtual machines are vulnerable to attack. If a virtual machine is potentially vulnerable, a new virtual machine is selected from the virtual machine resource pool for update, and the potentially vulnerable virtual machine is disconnected.

[0134] Figure 13A diagram showing one receive and multiple send. When the server receives a message request instruction from the client, it creates a job, selects a thread from the parallel scheduling module to process it, and sends the processing results to each virtual machine through multiple reverse proxies. After each virtual machine returns a response message, it returns a response message through the reverse proxy, and the server sends the response message to the client. Figure 14 A diagram showing a one-send-to-multiple-receive scenario. When a server receives multiple message request instructions from multiple virtual machines, it creates multiple tasks to process the multiple message request instructions, determines a normal message request instruction, and sends it to a third-party server through a proxy. The third-party server returns a response message based on the message request instruction, and the server sends the response instruction to multiple virtual machines respectively.

[0135] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0136] Based on the same inventive concept, embodiments of the present application also provide a message verification device for implementing the message verification method involved above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more message verification device embodiments provided below can be referred to the limitations of the message verification method above and will not be repeated here.

[0137] In one embodiment, Figure 15 As shown, a message verification device is provided, comprising: an acquisition module 11, a processing module 12 and a verification module 13, wherein:

[0138] an acquisition module, responsive to the messages to be verified sent by the plurality of virtual machines, for acquiring a message template for each message to be verified; wherein different messages to be verified have different message templates;

[0139] Optionally, the message to be verified includes a message request instruction sent by each virtual machine or a response message returned by each virtual machine based on the message request instruction sent by the client;

[0140] A processing module, configured to extract verification information from each message to be verified according to a message template of each message to be verified;

[0141] The verification module is used to verify each message to be verified based on the verification information in each message to be verified, and obtain a verification result of each message to be verified.

[0142] In one embodiment, the verification module includes: a comparison unit, a first determination unit, and a second determination unit, wherein:

[0143] A comparison unit, for comparing the verification information in any message to be verified with the verification information in other messages to be verified;

[0144] a first determining unit, configured to determine that a verification result of the message to be verified is normal if the verification information in the message to be verified is the same as the verification information in other messages to be verified;

[0145] The second determining unit is configured to determine that the verification result of the message to be verified is abnormal if the verification information in the message to be verified is different from any verification information in other information to be verified.

[0146] In one embodiment, the message verification device further includes: a determination module and a first sending module, wherein:

[0147] A determination module, configured to determine a target message whose verification result is normal from among the messages to be verified, based on the verification results of the messages to be verified;

[0148] The first sending module is used to send a target message to the client or the third-party server, and instruct the client or the third-party server to process the target message.

[0149] In one embodiment, the message verification device further includes: a first receiving module, a forwarding module, and a second receiving module, wherein:

[0150] A first receiving module is used to receive a message request instruction sent by a client;

[0151] A forwarding module, configured to forward the message request instruction to each virtual machine and instruct each virtual machine to process the message request instruction;

[0152] The second receiving module is used to receive the response message returned by each virtual machine.

[0153] In one embodiment, the forwarding module includes: a replication unit and a forwarding unit, wherein:

[0154] a replication unit, configured to replicate the message request instruction; the total number of the replicated message request instructions being the same as the number of the plurality of virtual machines;

[0155] The forwarding unit is used to forward the copied message request instruction to each virtual machine respectively; each virtual machine corresponds to one message request instruction.

[0156] In one embodiment, the acquisition module includes: an acquisition unit, a third determination module, and a fourth determination module, wherein:

[0157] An acquiring unit, configured to acquire identification information in a message request instruction sent by a client;

[0158] A third determining module is used to determine a message template with the same identification information as that in the message template library as a message template of the message request instruction;

[0159] The fourth determining module is configured to perform a reflection operation on each response message according to the message template of the message request instruction to obtain a message template corresponding to each response message.

[0160] In one embodiment, the message verification device further includes: a judgment module and a second sending module, wherein:

[0161] A judging module, configured to judge whether the number of response messages returned by each virtual machine is the same as the number of the multiple virtual machines;

[0162] The verification module is further configured to, when the number of response messages returned by each virtual machine is the same as the number of the plurality of virtual machines, execute a step of verifying each response message based on verification information in each response message to obtain a verification result for each response message;

[0163] The second sending module is used to obtain the waiting response time of multiple virtual machines that have not returned response messages when the number of response messages returned by each virtual machine is different from the number of multiple virtual machines, and send a message request failure instruction to the client when the waiting response time exceeds the preset time.

[0164] Each module in the above-mentioned message verification device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0165] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 16As shown. The computer device includes a processor, a memory, and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data during the message verification process. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a message verification method.

[0166] Those skilled in the art will understand that Figure 16 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of 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 a different component arrangement.

[0167] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the content of any embodiment of the above-mentioned message verification method is implemented.

[0168] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the content of any embodiment of the above-mentioned message verification method is implemented.

[0169] In one embodiment, a computer program product is provided, including a computer program, which implements the content of any embodiment of the above-mentioned message verification method when executed by a processor.

[0170] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0171] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.

[0172] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0173] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A message verification method, characterized in that: The method comprises: In response to messages to be verified sent by multiple virtual machines, obtaining a message template for each of the messages to be verified; wherein different messages to be verified have different message templates, the virtual machine is a client or a server, and the message to be verified includes a message request instruction sent by each virtual machine or a response message returned by each virtual machine based on the message request instruction sent by the client; extracting verification information from each of the messages to be verified from the message templates of the messages to be verified according to the message templates of the messages to be verified; Based on the verification information in each of the messages to be verified, each of the messages to be verified is verified to obtain a verification result of each of the messages to be verified.

2. The method according to claim 1, characterized in that The verifying each of the messages to be verified based on the verification information in each of the messages to be verified to obtain a verification result of each of the messages to be verified includes: For any message to be verified, comparing the verification information in the message to be verified with the verification information in other messages to be verified; If the verification information in the message to be verified is the same as the verification information in the other messages to be verified, determining that the verification result of the message to be verified is normal; If the verification information in the message to be verified is different from any verification information in the other messages to be verified, it is determined that the verification result of the message to be verified is abnormal.

3. The method according to claim 2, characterized in that The method further comprises: Determining, based on the verification results of the messages to be verified, a target message whose verification results are normal from the messages to be verified; The target message is sent to the client or the third-party server, and the client or the third-party server is instructed to process the target message.

4. The method according to any one of claim 1, characterized in that If the message to be verified is a response message, the process of generating the message to be verified includes: Receive message request instructions sent by the client; forwarding the message request instruction to each of the virtual machines, and instructing each of the virtual machines to process the message request instruction; Receive a response message returned by each virtual machine.

5. The method according to claim 4, characterized in that The forwarding the message request instruction to each of the virtual machines includes: Copying the message request instruction and creating a reverse proxy corresponding to the copied message request instruction; the total number of the copied message request instructions and the number of the reverse proxies are the same as the number of the multiple virtual machines; Each of the copied message request instructions is forwarded to each of the virtual machines respectively through the reverse proxy; each virtual machine corresponds to one message request instruction.

6. The method according to claim 4, characterized in that The obtaining of the message template corresponding to each of the messages to be verified includes: Obtaining identification information in the message request instruction sent by the client; Matching the identification information with multiple identification information in a message template library; if the identification information successfully matches any of the identification information in the message template library, determining the message template corresponding to the identification information as the message template of the message request instruction; each of the message templates is stored in the message template library in a prefix tree manner; A reflection operation is performed on each of the response messages according to the message template of the message request instruction to obtain a message template corresponding to each of the response messages.

7. The method according to claim 4, characterized in that Before verifying the verification information in each of the messages to be verified, the method further includes: Determining whether the number of response messages returned by each of the virtual machines is the same as the number of the multiple virtual machines; If yes, performing the step of verifying each response message based on the verification information in each response message to obtain a verification result for each response message; If not, the waiting response time of the multiple virtual machines that have not returned the response message is obtained, and when the waiting response time exceeds the preset time, a message request failure instruction is sent to the client.

8. A message verification device, characterized in that: The device comprises: an acquisition module, responsive to messages to be verified sent by multiple virtual machines, configured to acquire a message template for each message to be verified; wherein different messages to be verified have different message templates, the virtual machine being a client or a server, and the message to be verified comprising a message request instruction sent by each virtual machine or a response message returned by each virtual machine based on the message request instruction sent by the client; a processing module, configured to extract verification information from each message to be verified from the message template of each message to be verified according to the message template of each message to be verified; The verification module is used to verify each of the messages to be verified based on the verification information in each of the messages to be verified, and obtain a verification result of each of the messages to be verified.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Message checking method and device, computer equipment and storage medium

    CN109474578A

  • Short message verification method and device, equipment and storage medium

    CN114390457A