Search

CN-116166517-B - Order message processing method, device, equipment and medium

CN116166517BCN 116166517 BCN116166517 BCN 116166517BCN-116166517-B

Abstract

The application discloses a method, a device, equipment and a medium for processing order information, and relates to the field of testing, wherein the method comprises the steps of determining a random date and a random character string corresponding to the order information by using a preset pressure testing tool; the order information is an MQ information sent by a producer in a preset information subscription tool, a time variable value corresponding to the order information is determined based on a random date, a random number corresponding to the order information is determined based on a random character string, the time variable value and the random number are stored in an information body in the order information as variables, the order information is sent to a consumer, so that the consumer can consume the order information and then fall the order information into a target table in a target database, the target database is determined based on the time variable value, and the target table in the target database is determined based on the random number. The application can ensure high concurrency of the order message sources and realize accurate warehouse falling of orders in the follow-up process.

Inventors

  • XIE RUDONG
  • FANG JIAN
  • HU XINGJIANG
  • WANG FAN

Assignees

  • 杭州右文网络科技有限公司

Dates

Publication Date
20260512
Application Date
20230220

Claims (8)

  1. 1. An order message processing method, comprising: Determining a random date and a random character string corresponding to an order message by using a preset pressure test tool, wherein the order message is an MQ message sent by a producer in a preset message subscription tool; Determining a time variable value corresponding to the order message based on the random date, and determining a random number corresponding to the order message based on the random character string; Storing the time variable value and the random number as variables in a message body in the order message, and sending the order message to a consumer so that the consumer can consume the order message and then drop the order message into a target table in a target database, wherein the target database is determined based on the time variable value, and the target table in the target database is determined based on the random number; Wherein the determining the random number corresponding to the order message based on the random string includes: determining a remainder result of the random character string by utilizing Ha Xiqu remainder algorithm, and determining the remainder result as a random number corresponding to the order message; wherein the determining, based on the random date, a time variable value corresponding to the order message includes: and determining a time variable value corresponding to the order message according to a preset rule for determining the random date of the order message based on the month to which the order placing time in the order message belongs by using the random date.
  2. 2. The method for processing order message according to claim 1, wherein said determining a random date and a random string corresponding to the order message by using a preset pressure test tool, said subscribing to the MQ message sent by the producer in the tool, comprises: and determining a random date and a random character string corresponding to the order message by utilizing jemter, wherein the order message is an MQ message sent by a producer in kafka.
  3. 3. The method for processing the order message according to claim 2, wherein before determining the random date and the random character string corresponding to the order message by using the preset pressure testing tool, the method further comprises: And packaging the custom kafka address, the message theme and the sending data in the message into a Jar packet by using a preset development tool, and introducing the Jar packet into a preset pressure test tool.
  4. 4. The method for processing an order message according to claim 1, wherein before determining the random date and the random character string corresponding to the order message by using the preset pressure test tool, the method further comprises: defining a kafka producer object and adding configuration information to the producer object; a producer object is created and a send method is invoked to send an order message using the producer object.
  5. 5. The order message processing method as set forth in claim 1, wherein the determining, by using a preset pressure test tool, a random date and a random character string corresponding to the order message includes: and determining a random date and a random character string corresponding to the order message by using a preset random generation method in a preset pressure test tool.
  6. 6. An order message processing apparatus, comprising: The message processing module is used for determining a random date and a random character string corresponding to the order message by utilizing a preset pressure testing tool, wherein the order message is preset with the MQ message sent by a producer in the message subscribing tool; The data determining module is used for determining a time variable value corresponding to the order message based on the random date and determining a random number corresponding to the order message based on the random character string; the message sending module is used for storing the time variable value and the random number as variables into a message body in the order message and sending the order message to a consumer so that the consumer can drop the order message into a target table in a target database after consuming the order message, wherein the target database is determined based on the time variable value, and the target table in the target database is determined based on the random number; wherein the data determining module comprises: The algorithm application unit is used for determining a remainder result of the random character string by utilizing a hash remainder algorithm and determining the remainder result as a random number corresponding to the order message; wherein the data determining module comprises: And the rule application unit is used for determining a time variable value corresponding to the order message according to a preset rule for determining the random date of the order message by utilizing the random date according to the month which is based on the order placing time in the order message.
  7. 7. An electronic device comprising a processor and a memory, wherein the processor implements the order message processing method of any of claims 1 to 5 when executing a computer program stored in the memory.
  8. 8. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the order message processing method of any of claims 1 to 5.

Description

Order message processing method, device, equipment and medium Technical Field The present invention relates to the field of testing, and in particular, to a method, apparatus, device, and medium for processing an order message. Background In the order test process, a tester often needs a large amount of order data, but the configuration information of the Message Queue (MQ) is required to be manually sent, so that the high concurrency quantity cannot be quickly achieved, and secondly, the tester is difficult to know the place of the order after the current MQ Message is sent when the order is placed, and the data checking cost is increased in the follow-up data checking process. Therefore, how to improve the message sending efficiency and how to realize accurate order placement in the order testing process is a problem to be solved in the field. Disclosure of Invention Accordingly, the present invention is directed to a method, apparatus, device and medium for processing order messages, which can ensure high concurrency of order message sources and realize accurate inventory of orders in the follow-up process. The specific scheme is as follows: in a first aspect, the application discloses an order message processing method, which comprises the following steps: Determining a random date and a random character string corresponding to an order message by using a preset pressure test tool, wherein the order message is an MQ message sent by a producer in a preset message subscription tool; Determining a time variable value corresponding to the order message based on the random date, and determining a random number corresponding to the order message based on the random character string; Storing the time variable value and the random number as variables in a message body in the order message, and sending the order message to a consumer so that the consumer can drop the order message into a target table in a target database after consuming the order message, wherein the target database is determined based on the time variable value, and the target table in the target database is determined based on the random number. Optionally, the method comprises the steps of determining a random date and a random character string corresponding to the order message by using a preset pressure testing tool, wherein the order message presets the MQ message sent by a producer in the message subscribing tool and comprises the following steps: and determining a random date and a random character string corresponding to the order message by utilizing jemter, wherein the order message is an MQ message sent by a producer in kafka. Optionally, before determining the random date and the random character string corresponding to the order message by using the preset pressure testing tool, the method further includes: And packaging the custom kafka address, the message theme and the sending data in the message into a Jar packet by using a preset development tool, and introducing the Jar packet into a preset pressure test tool. Optionally, before determining the random date and the random character string corresponding to the order message by using the preset pressure testing tool, the method further includes: defining a kafka producer object and adding configuration information to the producer object; a producer object is created and a send method is invoked to send an order message using the producer object. Optionally, the determining, by using a preset pressure testing tool, the random date and the random character string corresponding to the order message includes: and determining a random date and a random character string corresponding to the order message by using a preset random generation method in a preset pressure test tool. Optionally, the determining, based on the random string, a random number corresponding to the order message includes: and determining a remainder result of the random character string by utilizing Ha Xiqu remainder algorithm, and determining the remainder result as a random number corresponding to the order message. Optionally, the determining, based on the random date, a time variable value corresponding to the order message includes: and determining a time variable value corresponding to the order message according to a preset rule for determining the random date of the order message based on the month to which the order placing time in the order message belongs by using the random date. In a second aspect, the present application discloses an order message processing apparatus, including: The message processing module is used for determining a random date and a random character string corresponding to the order message by utilizing a preset pressure testing tool, wherein the order message is preset with the MQ message sent by a producer in the message subscribing tool; The data determining module is used for determining a time variable value corresponding to the order message based on the random date and det