Message queue management method, device, equipment and computer-readable storage medium

Through the use of signature information and signature keys, the problems of message tampering and missend in the message queue are solved, ensuring the authenticity of the message and transmission reliability.

CN114143012BActive Publication Date: 2024-12-31SOUNDAI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111421765.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2024-12-31
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

In the application of message queue, there is a risk of message tampering and missend, which makes the authenticity of the message impossible to guarantee.

Method used

By obtaining the message to be sent, determining its signature information and the sender's signature key, using the signature key to sign the signature information, generating the signature of the message, and comparing it during sending and receiving to ensure the authenticity of the message.

Benefits of technology

It effectively guarantees the authenticity of messages and improves the reliability of message transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114143012B_ABST
    Figure CN114143012B_ABST
Patent Text Reader

Abstract

The present application discloses a message queue management method, apparatus, device and computer-readable storage medium, and belongs to the field of computer technology. The method includes: obtaining a first message to be sent; determining the signature information of the first message and the signature key corresponding to the sender of the first message; signing the signature information with the signature key to obtain the signature of the first message; sending the first message, the signature and the signature information to the corresponding message queue. Another method includes: receiving a first message, a signature and signature information, obtaining the signature key of the first message; signing the signature information with the signature key, comparing the obtained signature with the signature of the first message, and determining the authenticity of the first message according to the comparison result. The present application uses the sender and the receiver of the message queue to sign the signature information of the first message with the same signature key, and determines the authenticity of the first message in the message queue according to the comparison result of the signature.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a message queue management method, apparatus, device, and computer-readable storage medium. Background Art

[0002] In the message transmission scenario, message queues are widely used. In the application of message queues, the sender is responsible for sending messages to the message queue, and the receiver receives messages from the message queue.

[0003] In the related art, multiple message queue accounts can be created according to different systems, and the sender uses different accounts to access different virtual machines to send different messages to the message queue. The receiver uses the account corresponding to any virtual machine to receive the message in the message queue.

[0004] In the message queue management method provided by the related art, the message is at risk of being tampered with during the process of the sender sending the message to the message queue and storing the message in the message queue. In addition, during the process of the sender sending the message to the message queue, there is a risk of sending the wrong message queue, resulting in the authenticity of the message cannot be guaranteed. Summary of the invention

[0005] The embodiments of the present application provide a message queue management method, apparatus, device and computer-readable storage medium, which can be used to solve the problems in related technologies. The technical solution is as follows:

[0006] In a first aspect, an embodiment of the present application provides a message queue management method, the method comprising:

[0007] Get the first message to be sent;

[0008] Determine the signature information of the first message and the signature key corresponding to the sender of the first message, where different senders correspond to different signature keys;

[0009] Sign the signature information using the signature key to obtain the signature of the first message;

[0010] The first message, the signature, and the signature information are sent to the corresponding message queue.

[0011] In a possible implementation, the signature information includes at least two types of information, and the signature information is signed using a signature key to obtain a signature of the first message, including:

[0012] Sorting at least two types of information included in the signature information to obtain a sorting result;

[0013] The sorting result is encrypted using the signature key, and the encrypted result is used as the signature of the first message.

[0014] In a possible implementation, the signature information includes APPID (application identification), where the APPID is used to identify a sender of the first message.

[0015] In a possible implementation, the signature information further includes at least one of a timestamp of the first message and a message identifier of the first message, where the message identifier is used to identify the first message and the timestamp is used to identify a sending time of the first message.

[0016] In a second aspect, an embodiment of the present application provides a message queue management method, the method comprising:

[0017] Receiving a first message, a signature of the first message, and signature information from a message queue;

[0018] Obtain the signature key of the first message;

[0019] The signature information is signed using a signature key, the obtained signature is compared with the signature of the first message, and the authenticity of the first message is determined based on the comparison result.

[0020] In a possible implementation, the signature information includes at least two types of information, and the signature information is signed using a signature key, including:

[0021] Sorting at least two types of information included in the signature information to obtain a sorting result;

[0022] The sorting result is encrypted using the signature key, and the encrypted result is used as the obtained signature.

[0023] In a possible implementation, the signature information includes an APPID, where the APPID is used to identify a sender of the first message; and obtaining a signature key of the first message includes:

[0024] The signature key is obtained by searching in the database based on the APPID. The database stores the signature keys corresponding to different senders.

[0025] In a possible implementation, the signature information further includes a timestamp of the first message, where the timestamp is used to identify a sending time of the first message. After receiving the first message, the signature of the first message, and the signature information from the message queue, the following is further included:

[0026] Verify timestamp;

[0027] When the time corresponding to the timestamp is within the allowable time error range, the first message is determined to be a valid message.

[0028] In a possible implementation, the signature information further includes a message identifier of the first message, where the message identifier is used to identify the first message. After receiving the first message, the signature of the first message, and the signature information from the message queue, the following is further included:

[0029] Determining whether the first message has been processed based on the message identifier;

[0030] When it is determined based on the message identifier that the first message has not been processed, a processing operation on the first message is performed.

[0031] In a possible implementation manner, after determining the authenticity of the first message according to the comparison result, the method further includes:

[0032] When it is determined according to the comparison result that the first message is not authentic, the processing of the first message is abandoned.

[0033] In a third aspect, a message queue management device is provided, the device comprising:

[0034] An acquisition module, used for acquiring a first message to be sent;

[0035] A determination module, used to determine the signature information of the first message and a signature key corresponding to the sender of the first message, where different senders correspond to different signature keys;

[0036] A signature module, used to sign the signature information using a signature key to obtain a signature of the first message;

[0037] The sending module is used to send the first message, the signature and the signature information to the corresponding message queue.

[0038] In a possible implementation, the signature information includes at least two types of information, and the signature module is used to sort the at least two types of information included in the signature information to obtain a sorting result; encrypt the sorting result using a signature key, and use the encrypted result as the signature of the first message.

[0039] In a possible implementation, the signature information includes APPID, where the APPID is used to identify the sender of the first message.

[0040] In a possible implementation, the signature information further includes at least one of a timestamp of the first message and a message identifier of the first message, where the message identifier is used to identify the first message and the timestamp is used to identify a sending time of the first message.

[0041] In a fourth aspect, a message queue management device is provided, the device comprising:

[0042] A receiving module, used for receiving a first message, a signature of the first message and signature information from a message queue;

[0043] An acquisition module, used to acquire a signature key of the first message;

[0044] The signature module is used to sign the signature information using the signature key;

[0045] The first determination module is used to compare the obtained signature with the signature of the first message, and determine the authenticity of the first message according to the comparison result.

[0046] In a possible implementation, the signature information includes at least two types of information, and the signature module is used to sort the at least two types of information included in the signature information to obtain a sorting result; use a signature key to encrypt the sorting result, and use the encrypted result as the obtained signature.

[0047] In a possible implementation, the signature information includes an APPID, where the APPID is used to identify the sender of the first message; an acquisition module is used to search in a database based on the APPID to obtain a signature key, and the database stores signature keys corresponding to different senders.

[0048] In a possible implementation, the signature information further includes a timestamp of the first message, where the timestamp is used to identify a sending time of the first message. The device further includes:

[0049] Verification module, used to verify timestamp;

[0050] The second determination module is used to determine that the first message is a valid message when the time corresponding to the timestamp is within an allowable time error range.

[0051] In a possible implementation manner, the signature information further includes a message identifier of the first message, where the message identifier is used to identify the first message, and the apparatus further includes:

[0052] A third determination module, configured to determine whether the first message has been processed based on the message identifier;

[0053] The processing module is used to execute a processing operation on the first message when it is determined based on the message identifier that the first message has not been processed.

[0054] In a possible implementation, the device further includes:

[0055] The processing module is used to abandon the processing of the first message when it is determined according to the comparison result that the first message is not authentic.

[0056] On the other hand, a computer device is provided, comprising a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the computer device implements any of the above-mentioned message queue management methods.

[0057] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor so that a computer implements any of the above-mentioned message queue management methods.

[0058] On the other hand, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any of the above message queue management methods.

[0059] The technical solution provided by the embodiments of the present application brings at least the following beneficial effects:

[0060] In an embodiment of the present application, the sender uses the signature key corresponding to the sender to sign the signature information to obtain the signature of the first message; the receiver also uses the same signature key to perform the same signature operation on the signature information, compares the obtained signature with the signature of the first message, and determines the authenticity of the first message based on the comparison result, so that the authenticity of the message is guaranteed and the reliability of message transmission is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0062] Figure 1 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;

[0063] Figure 2 This is a flow chart of a message queue management method provided by an embodiment of the present application;

[0064] Figure 3 This is a schematic diagram of a message queue management process provided by an embodiment of the present application;

[0065] Figure 4 It is a schematic diagram of a message queue management device provided in an embodiment of the present application;

[0066] Figure 5 It is a schematic diagram of a message queue management device provided in an embodiment of the present application;

[0067] Figure 6 is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0068] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0070] It should be noted that the terms "first", "second", etc. (if any) in the specification and claims of the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0071] This application embodiment provides a message queue management method, please refer to Figure 1 , which shows a schematic diagram of an implementation environment provided by an embodiment of the present application. The implementation environment may include: a first terminal 11, a server 12 and a second terminal 13.

[0072] Among them, the first terminal 11 can apply the method provided in the embodiment of the present application to manage the message queue. The first terminal 11 can sign the signature information to obtain the signature of the first message, and send the signature of the first message, the first message and the signature information to the corresponding message queue. The server 12 can receive the first message, the signature of the first message and the signature information in the message queue, and sign the signature information.

[0073] Alternatively, the first terminal 11 can apply the method provided in the embodiment of the present application to manage the message queue. The first terminal 11 can sign the signature information to obtain the signature of the first message, and send the signature of the first message, the first message and the signature information to the corresponding message queue. The second terminal 13 can receive the first message, the signature of the first message and the signature information in the message queue, and sign the signature information.

[0074] Alternatively, the server 12 can apply the method provided in the embodiment of the present application to manage the message queue, the first terminal 11 can sign the signature information to obtain the signature of the first message, and send the signature of the first message, the first message and the signature information to the corresponding message queue. The second terminal 13 can receive the first message, the signature of the first message and the signature information in the message queue, and sign the signature information.

[0075] Optionally, the first terminal 11 and the second terminal 13 can be any electronic product that can interact with the user through one or more methods such as keyboard, touchpad, touch screen, remote control, voice interaction or handwriting device, such as PC (Personal Computer), mobile phone, smart phone, PDA (Personal Digital Assistant), wearable device, PPC (Pocket PC), tablet computer, smart car machine, smart TV, smart speaker, etc. The server 12 can be a server, or a server cluster composed of multiple servers, or a cloud computing service center. The first terminal 11, the second terminal 13 and the server 12 establish a communication connection through a wired or wireless network.

[0076] Those skilled in the art should understand that the above-mentioned first terminal 11, second terminal 13 and server 12 are only examples, and other existing or future terminals or servers that may appear, if applicable to the present application, should also be included in the scope of protection of the present application and are included here by reference.

[0077] Based on the above Figure 1 In the implementation environment shown, the embodiment of the present application provides a message queue management method, taking the method applied to the interaction between the first terminal 11 and the second terminal 13 as an example. The first terminal 11 can be a sender, and the sender can sign the signature information to obtain the signature of the first message, and send the signature of the first message, the first message and the signature information to the corresponding message queue. The second terminal 13 can be a receiver, and the receiver can receive the first message, the signature of the first message and the signature information in the message queue, and sign the signature information. Figure 2 As shown, the method provided in the embodiment of the present application may include the following steps:

[0078] Step 201: The sender obtains a first message to be sent.

[0079] The embodiment of the present application does not limit the method for obtaining the first message to be sent, nor does it limit the application scenario of the message queue management method. For example, the application scenario of the message queue management method may be an e-commerce scenario, in which the first message may be an order message, a product message, etc. Taking the first message as an order message as an example, in an e-commerce scenario, a user can place an order for any product of a merchant, and the sender can obtain an order message based on the user's order placement operation. The order message may include a user ID (Identification), a product ID of the product in the order, and the like.

[0080] In step 202, the sender determines the signature information of the first message and the signature key corresponding to the sender of the first message, and different senders correspond to different signature keys.

[0081] Optionally, the signature information includes APPID, where APPID is used to identify the sender of the first message.

[0082] The embodiments of the present application do not limit the format and acquisition method of the APPID. For example, the APPID can be allocated based on the application or service, and any sender corresponds to a unique APPID.

[0083] Optionally, the signature information also includes at least one of a timestamp of the first message and a message ID of the first message, where the message ID is used to identify the first message and the timestamp is used to identify a sending time of the first message.

[0084] The embodiments of the present application do not limit the format and acquisition method of the timestamp, nor the format and acquisition method of the message ID. For example, the first message is an order message, and the order time is 19:30 on August 1, 2005. If the signature information determined by a sender includes APPID, timestamp and message ID, APPID is the identifier of the sender, the timestamp can be set to 200508011930 according to the order time, and the message ID can be generated by any message ID generation algorithm. Any first message corresponds to a unique message ID.

[0085] In a possible implementation, the signature key may be configured by the sender before obtaining the first message, and the embodiment of the present application does not limit the format and determination method of the signature key. For example, the signature key may be determined by any encryption algorithm, for example, the signature key may be determined by the MD5 (Message-Digest Algorithm 5) encryption algorithm, and configured by the sender before obtaining the first message. Any sender corresponds to a unique signature key, and the signature key also corresponds to the sender's APPID.

[0086] Step 203: The sender signs the signature information using the signature key to obtain the signature of the first message.

[0087] Optionally, the signature information includes at least two types of information, and the signature information is signed with a signature key to obtain the signature of the first message, including: the sender sorts the at least two types of information included in the signature information to obtain a sorting result; the sender encrypts the sorting result with the signature key, and uses the encrypted result as the signature of the first message.

[0088] The embodiment of the present application does not limit the order of sorting, for example, the order may be a dictionary order. In a possible implementation, the signature information may include APPID, timestamp and message ID. The sender sorts the APPID, timestamp and message ID in a dictionary order to obtain a sorting result.

[0089] In a possible implementation, the signature key is determined by an MD5 encryption algorithm, and the sorting result is encrypted by MD5 using the signature key, and the encryption result is used as the signature of the first message.

[0090] Step 204: The sender sends the first message, the signature, and the signature information to the corresponding message queue.

[0091] The embodiment of the present application does not limit the type of message queue, and can be selected according to the demand for the message queue. For example, if the message queue needs to have high reliability and flexible routing, the first message, signature and signature information can be sent to a RabbitMQ (a message queue).

[0092] Step 205: The receiver receives the first message, the signature of the first message and the signature information from the message queue.

[0093] Optionally, in the case where the signature information also includes the timestamp of the first message, and the timestamp is used to identify the sending time of the first message, after receiving the first message, the signature of the first message and the signature information from the message queue, it also includes: the recipient verifies the timestamp; when the time corresponding to the timestamp is within the allowable time error range, the recipient determines that the first message is a valid message.

[0094] The embodiment of the present application does not limit the allowable time error range. For example, the allowable time error range may be five minutes. In a possible implementation, the signature information also includes a timestamp, and the receiver verifies the timestamp. When the time corresponding to the timestamp is within five minutes, the receiver determines that the first message is a valid message. If the time corresponding to the timestamp is not within five minutes, the receiver determines that the first message is not a valid message and discards the first message.

[0095] The embodiment of the present application determines whether the first message is a valid message by checking the timestamp, thereby ensuring the validity of the message transmission.

[0096] Optionally, the signature information also includes a message identification ID of the first message, and the message ID is used to identify the first message. After receiving the first message, the signature and signature information of the first message from the message queue, it also includes: the recipient determines whether the first message has been processed based on the message ID; when it is determined based on the message ID that the first message has not been processed, the recipient performs processing operations on the first message.

[0097] The embodiment of the present application does not limit the specific method by which the receiver determines whether the first message has been processed based on the message ID. For example, the message ID can be used to determine whether the first message is received by the receiver for the first time, and whether the first message has been processed by the receiver is determined based on the determination result. In a possible implementation, the receiver determines whether the first message has been processed based on the message ID, including: if it is determined based on the message ID that the first message is not received by the receiver for the first time, then it is determined that the first message has been processed, and the first message is discarded, ensuring that the message will not be processed repeatedly, thereby ensuring the effectiveness of message transmission.

[0098] Among them, the embodiment of the present application does not limit the method of judging whether the first message is received by the recipient for the first time based on the message ID, including but not limited to comparing the message ID of the first message with the ID of the received message, if the message ID of the first message does not exist in the ID of the received message, then it is determined that the first message is received for the first time. Optionally, if the message ID of the first message exists in the ID of the received message, then it is determined that the first message is not received for the first time.

[0099] It should be noted that when the signature information includes a timestamp and a message ID, the embodiment of the present application does not limit the order of verifying the timestamp and determining whether the first message has been processed.

[0100] In a possible implementation, the signature information includes a timestamp and a message ID, and the receiver verifies the timestamp. When the time corresponding to the timestamp is within the allowable time error range, the receiver determines that the first message is a valid message. The receiver then determines whether the first message has been processed based on the message ID. When it is determined based on the message ID that the first message has not been processed, the receiver performs a processing operation on the first message. The embodiment of the present application does not limit the processing operation. For example, the processing operation can be the operation of obtaining the signature key of the first message in step 206-step 207, signing the signature information with the signature key, and verifying the authenticity of the first message based on the signature.

[0101] If the time corresponding to the timestamp is not within the allowable time error range or it is determined based on the message ID that the first message has been processed, the first message is discarded.

[0102] The embodiment of the present application determines whether the first message has been processed based on the message ID. When the first message has not been processed, the receiver performs the processing operation on the first message to ensure that the message will not be processed repeatedly, thereby ensuring the effectiveness of message transmission.

[0103] Step 206: The recipient obtains the signature key of the first message.

[0104] Optionally, the signature information includes an application identifier APPID, where the APPID is used to identify the sender of the first message; obtaining the signature key of the first message includes: the recipient searches the database based on the APPID to obtain the signature key, and the database stores signature keys corresponding to different senders.

[0105] The embodiment of the present application does not limit the source and type of the database. For example, in an e-commerce scenario, after a user places an order, the e-commerce platform sends an order message to the merchant, and the database is the database agreed upon by the e-commerce platform and the merchant. The database can store multiple APPIDs corresponding to multiple senders and multiple signature keys corresponding to multiple APPIDs. The recipient searches the database based on the APPID included in the signature information to obtain the signature key corresponding to the APPID.

[0106] In a possible implementation, when the signature information includes at least one of a timestamp and a message ID, after the recipient obtains the signature key of the first message, the timestamp is checked accordingly to determine whether the first message has been processed. For example, if the signature information includes a timestamp, the recipient first obtains the signature key of the first message, signs the signature information with the signature key, determines the authenticity of the first message based on the signature, and then checks the timestamp. If the first message is determined to be authentic based on the signature, the first message is discarded and the timestamp is no longer checked, thereby reducing time costs.

[0107] In a possible implementation, when the signature information includes at least one of a timestamp and a message ID, the timestamp is first verified accordingly to determine whether the first message has been processed, and then the signature key of the first message is obtained. For example, if the signature information includes a timestamp, the receiver first verifies the timestamp, determines the validity of the first message based on the timestamp, and then obtains the signature key of the first message. If the first message is determined to be invalid based on the timestamp, the first message is discarded and the signature key of the first message is no longer obtained, thereby reducing time costs.

[0108] In step 207, the receiver signs the signature information using the signature key, compares the obtained signature with the signature of the first message, and determines the authenticity of the first message based on the comparison result.

[0109] Optionally, the signature information includes at least two types of information, and signing the signature information with a signature key includes: sorting the at least two types of information included in the signature information to obtain a sorting result; encrypting the sorting result with the signature key, and using the encrypted result as the obtained signature.

[0110] In a possible implementation, the order of sorting adopted by the receiving party is the same as the order of sorting adopted by the sending party. The signing key and encryption algorithm adopted by the receiving party are the same as the signing key and encryption algorithm adopted by the sending party.

[0111] Optionally, after the receiver determines the authenticity of the first message according to the comparison result, the method further includes: when it is determined according to the comparison result that the first message is not authentic, abandoning processing of the first message.

[0112] In a possible implementation, the receiver searches the database through the APPID to obtain the signature key, encrypts the sorting result with the signature key, and uses the encryption result as the obtained signature. When the signature obtained by the receiver is inconsistent with the comparison result of the signature of the first message, the receiver determines that the first message is not authentic, and abandons the processing of the first message, thereby improving the reliability of message transmission. When the signature obtained by the receiver is consistent with the comparison result of the signature of the first message, the receiver determines that the first message is authentic, and starts to process the first message.

[0113] In an embodiment of the present application, the sender uses the signature key corresponding to the sender to sign the signature information to obtain the signature of the first message; the receiver also uses the same signature key to perform the same signature operation on the signature information, compares the obtained signature with the signature of the first message, and determines the authenticity of the first message based on the comparison result, so that the authenticity of the message is guaranteed and the reliability of message transmission is improved.

[0114] like Figure 3 As shown, a process diagram of message queue management provided by an embodiment of the present application is as follows:

[0115] 301. The sender obtains a first message, determines the signature information of the first message and the signature key corresponding to the sender of the first message.

[0116] The implementation method of this step can refer to the above steps 201 and 202, which will not be repeated here.

[0117] 302. The sender signs the signature information using the signature key, and finally obtains the first signature.

[0118] The implementation method of this step can refer to the above step 203, which will not be repeated here.

[0119] 303. The sender sends the first message, the signature, and the signature information to the corresponding message queue.

[0120] The implementation method of this step can refer to the above step 204, which will not be repeated here.

[0121] 304. The receiver receives the first message, the signature of the first message and the signature information in the message queue, obtains the signature key of the first message, and signs the signature information based on the signature key of the first message to obtain a second signature.

[0122] The implementation method of this step can refer to the above steps 205 to 207, which will not be repeated here.

[0123] 305, the receiver compares the first signature with the second signature. When the first signature is identical to the second signature, the receiver determines the authenticity of the first message and performs subsequent business operations.

[0124] 306. The receiver compares the first signature with the second signature. When the first signature is different from the second signature, the receiver determines that the first message is not authentic, abandons processing the first message, and ends the process.

[0125] The implementation method of this step can refer to the above step 207, which will not be repeated here.

[0126] See also Figure 4 , an embodiment of the present application provides a message queue management device, the device comprising:

[0127] An acquisition module 401 is used to acquire a first message to be sent;

[0128] A determination module 402 is used to determine the signature information of the first message and the signature key corresponding to the sender of the first message, where different senders correspond to different signature keys;

[0129] The signature module 403 is used to sign the signature information using the signature key to obtain the signature of the first message;

[0130] The sending module 404 is used to send the first message, the signature and the signature information to the corresponding message queue.

[0131] Optionally, the signature information includes at least two types of information, and the signature module 403 is used to: sort the at least two types of information included in the signature information to obtain a sorting result; encrypt the sorting result using a signature key, and use the encrypted result as the signature of the first message.

[0132] Optionally, the signature information includes APPID, where APPID is used to identify the sender of the first message.

[0133] Optionally, the signature information also includes at least one of a timestamp of the first message and a message ID of the first message, where the message ID is used to identify the first message and the timestamp is used to identify a sending time of the first message.

[0134] See also Figure 5 , an embodiment of the present application provides a message queue management device, the device comprising:

[0135] The receiving module 501 is used to receive a first message, a signature of the first message and signature information from a message queue;

[0136] An acquisition module 502 is used to acquire a signature key of the first message;

[0137] Signature module 503, used to sign signature information using a signature key;

[0138] The first determination module 504 is used to compare the obtained signature with the signature of the first message, and determine the authenticity of the first message according to the comparison result.

[0139] Optionally, the signature information includes at least two types of information, and the signature module 503 is used to sort the at least two types of information included in the signature information to obtain a sorting result; use the signature key to encrypt the sorting result, and use the encrypted result as the obtained signature.

[0140] Optionally, the signature information includes APPID, and APPID is used to identify the sender of the first message; the acquisition module 502 is used to search in the database based on APPID to obtain the signature key, and the database stores signature keys corresponding to different senders.

[0141] Optionally, the signature information further includes a timestamp of the first message, where the timestamp is used to identify a sending time of the first message. The device further includes:

[0142] Verification module, used to verify timestamp;

[0143] The second determination module is used to determine that the first message is a valid message when the time corresponding to the timestamp is within an allowable time error range.

[0144] Optionally, the signature information further includes a message ID of the first message, where the message ID is used to identify the first message. The device further includes:

[0145] A third determination module, configured to determine whether the first message has been processed based on the message ID;

[0146] The processing module is used to execute a processing operation on the first message when it is determined based on the message ID that the first message has not been processed.

[0147] Optionally, the device further comprises:

[0148] The processing module is used to abandon the processing of the first message when it is determined according to the comparison result that the first message is not authentic.

[0149] It should be noted that the device provided in the above embodiment only uses the division of the above functional modules as an example to implement its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and their specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0150] Figure 6 It is a structural diagram of a computer device provided in an embodiment of the present application. The computer device may be a server. The server may have relatively large differences due to different configurations or performances. It may include one or more processors (Central Processing Units, CPU) 601 and one or more memories 602, wherein at least one computer program is stored in the one or more memories 602, and the at least one computer program is loaded and executed by the one or more processors 601, so that the server implements the message queue management method provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be repeated here.

[0151] Figure 7 1 is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. The device may be a terminal, such as a smart phone, a tablet computer, an MP3 (Moving Picture Experts Group Audio Layer III) player, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The terminal may also be referred to as a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0152] Typically, the terminal includes: a processor 701 and a memory 702 .

[0153] The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0154] The memory 702 may include one or more computer-readable storage media, which may be non-transitory. The memory 702 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 702 is used to store at least one instruction, which is used to be executed by the processor 701 so that the terminal implements the message queue management method provided in the method embodiment of the present application.

[0155] In some embodiments, the terminal may further optionally include: a peripheral device interface 703 and at least one peripheral device. The processor 701, the memory 702 and the peripheral device interface 703 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 703 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707, a positioning assembly 708 and a power supply 709.

[0156] The peripheral device interface 703 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 701 and the memory 702. In some embodiments, the processor 701, the memory 702, and the peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 701, the memory 702, and the peripheral device interface 703 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.

[0157] The radio frequency circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 704 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 704 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 704 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 704 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.

[0158] The display screen 705 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 705 is a touch display screen, the display screen 705 also has the ability to collect touch signals on the surface or above the surface of the display screen 705. The touch signal can be input to the processor 701 as a control signal for processing. At this time, the display screen 705 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 705 can be one, set on the front panel of the terminal; in other embodiments, the display screen 705 can be at least two, respectively set on different surfaces of the terminal or in a folding design; in other embodiments, the display screen 705 can be a flexible display screen, set on a curved surface or a folding surface of the terminal. Even, the display screen 705 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 705 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0159] The camera assembly 706 is used to capture images or videos. Optionally, the camera assembly 706 includes a front camera and a rear camera. Typically, the front camera is arranged on the front panel of the terminal, and the rear camera is arranged on the back of the terminal. In some embodiments, there are at least two rear cameras, which are any one of a main camera, a depth of field camera, a wide-angle camera, and a telephoto camera, so as to realize the fusion of the main camera and the depth of field camera to realize the background blur function, the fusion of the main camera and the wide-angle camera to realize panoramic shooting and VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera assembly 706 may also include a flash. The flash can be a monochrome temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm light flash and a cold light flash, which can be used for light compensation at different color temperatures.

[0160] The audio circuit 707 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 701 for processing, or input them into the radio frequency circuit 704 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 707 may also include a headphone jack.

[0161] Positioning component 708 is used to locate the current geographical location of the terminal to implement navigation or LBS (Location Based Service). Positioning component 708 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.

[0162] The power supply 709 is used to power various components in the terminal. The power supply 709 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 709 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0163] In some embodiments, the terminal further includes one or more sensors 710 , including but not limited to: an acceleration sensor 711 , a gyroscope sensor 712 , a pressure sensor 713 , a fingerprint sensor 714 , an optical sensor 715 , and a proximity sensor 716 .

[0164] The acceleration sensor 711 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established by the terminal. For example, the acceleration sensor 711 can be used to detect the components of gravity acceleration on the three coordinate axes. The processor 701 can control the display screen 705 to display the user interface in a horizontal view or a vertical view according to the gravity acceleration signal collected by the acceleration sensor 711. The acceleration sensor 711 can also be used for collecting game or user motion data.

[0165] The gyroscope sensor 712 can detect the body direction and rotation angle of the terminal, and the gyroscope sensor 712 can cooperate with the acceleration sensor 711 to collect the user's 3D actions on the terminal. The processor 701 can implement the following functions based on the data collected by the gyroscope sensor 712: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.

[0166] The pressure sensor 713 can be set in the side frame of the terminal and / or the lower layer of the display screen 705. When the pressure sensor 713 is set in the side frame of the terminal, the user's holding signal of the terminal can be detected, and the processor 701 performs left and right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 713. When the pressure sensor 713 is set in the lower layer of the display screen 705, the processor 701 controls the operability controls on the UI interface according to the user's pressure operation on the display screen 705. The operability controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.

[0167] The fingerprint sensor 714 is used to collect the user's fingerprint, and the processor 701 identifies the user's identity based on the fingerprint collected by the fingerprint sensor 714, or the fingerprint sensor 714 identifies the user's identity based on the collected fingerprint. When the user's identity is identified as a trusted identity, the processor 701 authorizes the user to perform relevant sensitive operations, which include unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings. The fingerprint sensor 714 can be set on the front, back or side of the terminal. When a physical button or a manufacturer logo is set on the terminal, the fingerprint sensor 714 can be integrated with the physical button or the manufacturer logo.

[0168] The optical sensor 715 is used to collect the ambient light intensity. In one embodiment, the processor 701 can control the display brightness of the display screen 705 according to the ambient light intensity collected by the optical sensor 715. Specifically, when the ambient light intensity is high, the display brightness of the display screen 705 is increased; when the ambient light intensity is low, the display brightness of the display screen 705 is reduced. In another embodiment, the processor 701 can also dynamically adjust the shooting parameters of the camera assembly 706 according to the ambient light intensity collected by the optical sensor 715.

[0169] The proximity sensor 716, also known as a distance sensor, is usually arranged on the front panel of the terminal. The proximity sensor 716 is used to collect the distance between the user and the front of the terminal. In one embodiment, when the proximity sensor 716 detects that the distance between the user and the front of the terminal is gradually decreasing, the processor 701 controls the display screen 705 to switch from the screen-on state to the screen-off state; when the proximity sensor 716 detects that the distance between the user and the front of the terminal is gradually increasing, the processor 701 controls the display screen 705 to switch from the screen-off state to the screen-on state.

[0170] Those skilled in the art will understand that Figure 7 The structure shown in the figure does not constitute a limitation on the terminal, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.

[0171] In an exemplary embodiment, a computer device is also provided, the computer device comprising a processor and a memory, wherein at least one computer program is stored in the memory. The at least one computer program is loaded and executed by one or more processors, so that the computer device implements any of the above message queue management methods.

[0172] In an exemplary embodiment, a computer-readable storage medium is further provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor of a computer device to enable the computer to implement any of the above-mentioned message queue management methods.

[0173] In one possible implementation, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0174] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes any of the above-mentioned message queue management methods.

[0175] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0176] The above are merely exemplary embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A message queue management method, characterized in that: The method is applicable to e-commerce scenarios, and the method includes: Get the first message to be sent; Determine the signature information of the first message and the signature key corresponding to the sender of the first message, where different senders correspond to different signature keys; Sorting at least two types of information included in the signature information in lexicographic order to obtain a sorting result; encrypting the sorting result using the signature key, and using the encrypted result as the signature of the first message; Sending the first message, the signature, and the signature information to a corresponding message queue, so that a recipient receives the first message, the signature, and the signature information from the message queue; The signature information includes an application identifier APPID, a timestamp of the first message, and a message identifier of the first message, the APPID is used to identify the sender of the first message, the message identifier is used to identify the first message, and the timestamp is used to identify the sending time of the first message; The receiving party is used to verify the timestamp, and determine that the first message is a valid message when the time corresponding to the timestamp is within the allowable time error range; the message identifier of the first message is used to compare with the message identifier of the message received by the receiving party, if the message identifier of the received message contains the message identifier of the first message, it is determined that the first message is not received for the first time; if the message identifier of the received message does not contain the message identifier of the first message, it is determined that the first message is received for the first time; if the first message is not received for the first time, the receiving party determines that the first message has been processed and discards the first message; if the first message is received for the first time, the receiving party determines that the first message has not been processed; the receiving party is used to, when the first message is a valid message and has not been processed, based on the APPI D retrieves the signature key from the database, and uses the signature key to encrypt the information included in the signature information after sorting it in dictionary order, and uses the encryption result as the signature obtained by the receiver, and the receiver compares the obtained signature with the signature of the first message to determine the authenticity of the first message. The sorting order used by the receiver is the same as the sorting order used by the sender, and the database stores signature keys corresponding to different senders; if the signature obtained by the receiver is consistent with the signature comparison result of the first message, the receiver determines that the first message is authentic and starts business processing of the first message; if the signature obtained by the receiver is inconsistent with the signature comparison result of the first message, the receiver determines that the first message is not authentic and abandons processing of the first message.

2. A message queue management method, characterized in that: The method is applicable to e-commerce scenarios, and the method includes: Receive a first message, a signature of the first message, and signature information from a message queue, wherein the signature information includes an application identifier APPID, a timestamp of the first message, and a message identifier of the first message, wherein the APPID is used to identify a sender of the first message, the message identifier is used to identify the first message, and the timestamp is used to identify a sending time of the first message; Checking the timestamp; when the time corresponding to the timestamp is within the allowable time error range, determining that the first message is a valid message; Compare the message identifier of the first message with the message identifier of the received message, and if the message identifier of the received message contains the message identifier of the first message, determine that the first message is not received for the first time; if the message identifier of the received message does not contain the message identifier of the first message, determine that the first message is received for the first time; If the first message is not received for the first time, it is determined that the first message has been processed, and the first message is discarded; if the first message is received for the first time, it is determined that the first message has not been processed, and a database is searched based on the APPID to obtain a signature key, where the database stores signature keys corresponding to different senders; Sorting the information included in the signature information in lexicographic order to obtain a sorting result; encrypting the sorting result using the signature key, taking the encryption result as the obtained signature, comparing the obtained signature with the signature of the first message, and determining the authenticity of the first message according to the comparison result, wherein the sorting order adopted by the receiver is the same as the sorting order adopted by the sender; If the signature obtained by the recipient is consistent with the signature comparison result of the first message, the first message is determined to be authentic and business processing of the first message is started; if the signature obtained by the recipient is inconsistent with the signature comparison result of the first message, the first message is determined to be authentic and processing of the first message is abandoned.

3. A message queue management device, characterized in that: The device is applicable to e-commerce scenarios, and includes: An acquisition module, used for acquiring a first message to be sent; A determination module, used to determine the signature information of the first message and a signature key corresponding to the sender of the first message, where different senders correspond to different signature keys; A signature module, configured to sort the at least two types of information included in the signature information in lexicographic order to obtain a sorting result; encrypt the sorting result using the signature key, and use the encrypted result as the signature of the first message; A sending module, configured to send the first message, the signature, and the signature information to a corresponding message queue, so that a recipient receives the first message, the signature, and the signature information from the message queue; The signature information includes an application identifier APPID, a timestamp of the first message, and a message identifier of the first message, the APPID is used to identify the sender of the first message, the message identifier is used to identify the first message, and the timestamp is used to identify the sending time of the first message; The receiver is used to verify the timestamp, and determine that the first message is a valid message when the time corresponding to the timestamp is within the allowable time error range; the message identifier of the first message is used to compare with the message identifier of the message received by the receiver, if the message identifier of the received message contains the message identifier of the first message, it is determined that the first message is not received for the first time; if the message identifier of the received message does not contain the message identifier of the first message, it is determined that the first message is received for the first time; if the first message is not received for the first time, the receiver determines that the first message has been processed and discards the first message; if the first message is received for the first time, the receiver determines that the first message has not been processed; the receiver is used to, when the first message is a valid message and has not been processed, based on the APPID A signature key is retrieved from a database, and the signature key is used to encrypt a sorting result after the information included in the signature information is sorted in dictionary order, and the encryption result is used as the signature obtained by the receiver, and the receiver compares the obtained signature with the signature of the first message to determine the authenticity of the first message. The sorting order adopted by the receiver is the same as the sorting order adopted by the sender, and the database stores signature keys corresponding to different senders; if the signature obtained by the receiver is consistent with the signature comparison result of the first message, the receiver determines that the first message is authentic and starts business processing of the first message; if the signature obtained by the receiver is inconsistent with the signature comparison result of the first message, the receiver determines that the first message is not authentic and abandons processing of the first message.

4. A message queue management device, characterized in that: The device is applicable to e-commerce scenarios, and includes: a receiving module, configured to receive a first message, a signature of the first message, and signature information from a message queue, wherein the signature information includes an application identifier APPID, a timestamp of the first message, and a message identifier of the first message, wherein the APPID is used to identify a sender of the first message, the timestamp is used to identify a sending time of the first message, and the message identifier is used to identify the first message; A verification module, used for verifying the timestamp; A second determination module, configured to determine that the first message is a valid message when the time corresponding to the timestamp is within an allowable time error range; A third determination module is used to compare the message identifier of the first message with the message identifier of the received message. If the message identifier of the received message contains the message identifier of the first message, it is determined that the first message is not received for the first time; if the message identifier of the received message does not contain the message identifier of the first message, it is determined that the first message is received for the first time; if the first message is not received for the first time, it is determined that the first message has been processed and the first message is discarded; if the first message is received for the first time, it is determined that the first message has not been processed; An acquisition module, configured to retrieve a signature key from a database based on the APPID, wherein the first message has not been processed and the database stores signature keys corresponding to different senders; A signature module, used to sort the information included in the signature information in dictionary order to obtain a sorting result; encrypt the sorting result using the signature key, and use the encrypted result as the obtained signature, and the sorting order used by the receiver is the same as the sorting order used by the sender; A first determination module, configured to compare the obtained signature with the signature of the first message, and determine the authenticity of the first message according to the comparison result; if the signature obtained by the receiver is consistent with the signature comparison result of the first message, the first message is determined to be authentic; if the signature obtained by the receiver is inconsistent with the signature comparison result of the first message, the first message is determined to be authentic; The processing module is used to start business processing of the first message when the first message is authentic; and to give up processing of the first message when the first message is not authentic.

5. A computer device, characterized in that: The computer device includes a processor and a memory, wherein at least one computer program is stored in the memory, and the at least one computer program is loaded and executed by the processor so that the computer device implements the message queue management method as claimed in claim 1 or the message queue management method as claimed in claim 2.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by a processor to enable a computer to implement the message queue management method according to claim 1 or the message queue management method according to claim 2.

7. A computer program product, characterized in that The computer program product includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the message queue management method as claimed in claim 1, or the message queue management method as claimed in claim 2.