CN114221883A - Message testing method, device, server and storage medium - Google Patents

Message testing method, device, server and storage medium Download PDF

Info

Publication number
CN114221883A
CN114221883A CN202111526001.6A CN202111526001A CN114221883A CN 114221883 A CN114221883 A CN 114221883A CN 202111526001 A CN202111526001 A CN 202111526001A CN 114221883 A CN114221883 A CN 114221883A
Authority
CN
China
Prior art keywords
message
queue
target
request
associated information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111526001.6A
Other languages
Chinese (zh)
Other versions
CN114221883B (en
Inventor
朱正刚
王宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An E Wallet Electronic Commerce Co Ltd
Original Assignee
Ping An E Wallet Electronic Commerce Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An E Wallet Electronic Commerce Co Ltd filed Critical Ping An E Wallet Electronic Commerce Co Ltd
Priority to CN202111526001.6A priority Critical patent/CN114221883B/en
Publication of CN114221883A publication Critical patent/CN114221883A/en
Application granted granted Critical
Publication of CN114221883B publication Critical patent/CN114221883B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0817Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/145Network analysis or design involving simulating, designing, planning or modelling of a network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L51/00User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
    • H04L51/04Real-time or near real-time messaging, e.g. instant messaging [IM]
    • H04L51/043Real-time or near real-time messaging, e.g. instant messaging [IM] using or handling presence information

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Environmental & Geological Engineering (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application is applicable to the technical field of artificial intelligence, and provides a message testing method, a device, a server and a storage medium, wherein the method comprises the following steps: receiving a test request sent by a test terminal; selecting associated information corresponding to the target queue name from a pre-stored associated information set, and sending a queue message template in the selected associated information to a test terminal; acquiring a target queue message returned by the test terminal based on the queue message template from the target message queue; and transmitting the target queue message to a message channel corresponding to the message type according to the message type of the target queue message, so as to send the target queue message to a message server corresponding to the message type through the message channel. The method and the device can realize that different platforms do not need to be logged in when the queue messages of different types are tested and sent, and are beneficial to improving the testing efficiency.

Description

Message testing method, device, server and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a message testing method, an apparatus, a server, and a storage medium.
Background
A message queue is a container that holds messages during the transmission of the messages. The main purpose of the message queue is to provide routing and guarantee delivery of the message; if the recipient is not available when the message is sent, the message queue will hold the message until it can be successfully delivered.
In the related art, the message queue is applied frequently in the micro service system architecture. Management and operation of message queues is very dependent on the message platform. When the user needs to test and send queue messages of different types, the queue messages need to be sent by logging in different platforms, the operation is complex, and the testing efficiency is easily reduced.
Disclosure of Invention
In view of this, embodiments of the present application provide a message testing method, an apparatus, a server, and a storage medium, so as to solve the problems in the related art that when a user needs to test and send different types of queue messages, the user needs to log in different platforms to send the queue messages, the operation is complicated, and the testing efficiency is low.
A first aspect of an embodiment of the present application provides a message testing method, including:
receiving a test request sent by a test terminal, wherein the test request comprises a target queue name of a target message queue;
selecting associated information corresponding to a target queue name from a pre-stored associated information set, and sending a queue message template in the selected associated information to a test terminal, wherein the associated information in the associated information set comprises the queue name and the queue message template;
acquiring a target queue message returned by the test terminal based on the queue message template from the target message queue;
and transmitting the target queue message to a message channel corresponding to the message type according to the message type of the target queue message, so as to send the target queue message to a message server corresponding to the message type through the message channel, wherein the message server is used for sending the queue message of the corresponding type to a message receiving party.
Further, if the associated information in the associated information set further includes at least one scene identifier, and each scene identifier corresponds to one queue message template, the test request further includes a target scene identifier for indicating a test scene.
Further, sending the queue message template in the selected association information to the test terminal, including:
and sending the queue message template corresponding to the target scene identifier in the selected associated information to the test terminal.
Further, the method further comprises:
storing the target queue message, the target queue name and the target scene identifier in a target data set in an associated manner;
upon receiving a message update request including a request queue name, a request scene identifier, and new template description information, extracting target data matching the request queue name and the request scene identifier from a target data set, and extracting associated information matching the request queue name from an associated information set;
and according to the new template description information and the queue message template corresponding to the request scene identifier in the extracted association information, performing data cleaning on the queue message in the extracted target data so as to enable the queue message after data cleaning to be matched with the new template described by the new template description information.
Further, according to the new template description information and the queue message template corresponding to the request scene identifier in the extracted association information, performing data cleaning on the queue message in the extracted target data, including:
determining a set of data fields included in a queue message template corresponding to the request scene identifier, recording the set as a first field set, determining a set of data fields included in a new template according to the description information of the new template, and recording the set as a second field set;
and recording the queue message in the extracted target data as a request queue message, and performing data cleaning on the request queue message according to the first field set and the second field set.
Further, performing data washing on the request queue message according to the first field set and the second field set, including at least one of:
reserving cross data fields in the request queue message, wherein the cross data fields belong to a first field set and belong to a second field set;
deleting redundant data fields in the request queue message, wherein the redundant data fields belong to the first field set and do not belong to the second field set;
and supplementing a new data field in the request queue message, wherein the new data field belongs to the second field set and does not belong to the first field set.
Further, the method further comprises:
if the associated information is concentrated and the associated information corresponding to the target queue name does not exist, presenting a preset information input interface to the test terminal, wherein the preset information input interface is used for guiding a user to input the associated information corresponding to the target queue name;
receiving the association information corresponding to the target queue name input by the user on the preset information input interface from the test terminal, and storing the received association information into an association information set.
A second aspect of an embodiment of the present application provides a message testing apparatus, including:
the device comprises a request receiving unit, a test processing unit and a processing unit, wherein the request receiving unit is used for receiving a test request sent by a test terminal, and the test request comprises a target queue name of a target message queue;
the information selecting unit is used for selecting the associated information corresponding to the target queue name from a pre-stored associated information set and sending a queue message template in the selected associated information to the test terminal, wherein the associated information in the associated information set comprises the queue name and the queue message template;
the message acquisition unit is used for acquiring a target queue message returned by the test terminal based on the queue message template from the target message queue;
and the message transmission unit is used for transmitting the target queue message to a message channel corresponding to the message type according to the message type of the target queue message so as to send the target queue message to a message server corresponding to the message type through the message channel, wherein the message server is used for sending the queue message of the corresponding type to a message receiving party.
Further, if the associated information in the associated information set further includes at least one scene identifier, and each scene identifier corresponds to one queue message template, the test request further includes a target scene identifier for indicating a test scene.
Further, the information selecting unit is specifically configured to:
and sending the queue message template corresponding to the target scene identifier in the selected associated information to the test terminal.
Further, the device also comprises an association storage unit, an information extraction unit and an update execution unit.
The association storage unit is used for associating and storing the target queue message, the target queue name and the target scene identifier into a target data set;
an information extraction unit configured to, upon receiving a message update request including a request queue name, a request scene identification, and new template description information, extract target data matching the request queue name and the request scene identification from a target data set, and extract associated information matching the request queue name from an associated information set;
and the updating execution unit is used for performing data cleaning on the queue message in the extracted target data according to the new template description information and the queue message template corresponding to the request scene identifier in the extracted associated information, so that the queue message after data cleaning is matched with the new template described by the new template description information.
Further, the update execution unit is specifically configured to:
determining a set of data fields included in a queue message template corresponding to the request scene identifier, recording the set as a first field set, determining a set of data fields included in a new template according to the description information of the new template, and recording the set as a second field set;
and recording the queue message in the extracted target data as a request queue message, and performing data cleaning on the request queue message according to the first field set and the second field set.
Further, in the update execution unit, performing data washing on the request queue message according to the first field set and the second field set, where the data washing includes at least one of:
reserving cross data fields in the request queue message, wherein the cross data fields belong to a first field set and belong to a second field set;
deleting redundant data fields in the request queue message, wherein the redundant data fields belong to the first field set and do not belong to the second field set;
and supplementing a new data field in the request queue message, wherein the new data field belongs to the second field set and does not belong to the first field set.
Further, the device also comprises an interface presenting unit and an information storage unit.
The interface presentation unit is used for presenting a preset information input interface to the test terminal if the associated information is concentrated and the associated information corresponding to the target queue name does not exist, wherein the preset information input interface is used for guiding a user to input the associated information corresponding to the target queue name;
and the information storage unit is used for receiving the association information which is input on a preset information input interface by a user and corresponds to the target queue name from the test terminal and storing the received association information into the association information set.
A third aspect of embodiments of the present application provides a server, which includes a memory, a processor, and a computer program stored in the memory and executable on the server, and when the processor executes the computer program, the processor implements the steps of the message testing method provided in the first aspect.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps of the message testing method provided in the first aspect.
The message testing method, the message testing device, the server and the storage medium have the following beneficial effects that: by analyzing the message type of the target queue message, transmitting the target queue message to the message channel corresponding to the message type and sending the target queue message to the message server corresponding to the message type through the message channel, the method can realize that different platforms do not need to be logged in when different types of queue messages are tested and sent, is more convenient and faster to operate, and is beneficial to improving the testing efficiency. In addition, when testing is carried out, the associated information corresponding to the target queue name can be found from the associated information set based on the target queue name of the target message queue, so that a queue message template is obtained, and then the obtained queue message template is sent to the test terminal, so that the test terminal can quickly and effectively generate and return queue messages according to the format of the queue message template, and the test efficiency and the accuracy are improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the embodiments or the related technical descriptions will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of an implementation of a message testing method according to an embodiment of the present application;
FIG. 2 is a flow chart of an implementation for flushing queue messages according to an embodiment of the present application;
FIG. 3 is a flow chart of another implementation of a message testing method provided in an embodiment of the present application;
fig. 4 is a block diagram of a message testing apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of a server according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
In the embodiment of the application, the message sending function is tested based on the artificial intelligence technology.
The message testing method can be executed by a server. When the message testing method is executed by the server, the execution subject is the server. In practice, the server is usually a management server, and the management server may manage test process data and may also manage development process data.
It should be noted that the server may include, but is not limited to, a server, a computer, a mobile phone, a tablet, a wearable smart device, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), and a big data and artificial intelligence platform.
Referring to fig. 1, fig. 1 shows a flowchart of an implementation of a message testing method according to an embodiment of the present application, including:
step 101, receiving a test request sent by a test terminal.
Wherein, the test request comprises the target queue name of the target message queue. The target message queue is typically the message queue selected for testing. The execution main body can acquire the message to be tested from the test terminal through the target message queue. The target queue name is generally the name of the target message queue.
Here, the execution agent may receive a test request transmitted from a test terminal through a network.
And 102, selecting the associated information corresponding to the target queue name from the pre-stored associated information set, and sending the queue message template in the selected associated information to the test terminal.
Wherein, the associated information in the associated information set comprises a queue name and a queue message template.
The queue message template is generally used to indicate the composition of the message transmitted by the target message queue. As an example, the structure of the target message queue may be as follows:
{
"orderId":"H202108112227490298792202",
"orderState":"10",
"penaltyAmount":"410000000"
}
in the above example, the target message queue includes three data fields, respectively, "orderId," "orderState," and "pendylammount," wherein the data corresponding to the data field "orderId" may have 25 bits, the data corresponding to the data field "orderState" may have 2 bits, and the data corresponding to the data field "pendylammount" may have 9 bits.
Here, the execution body may adopt the target queue name, find the association information where the target queue name is located from the association information set, and send the queue message template in the found association information to the test terminal. Therefore, the test terminal can quickly and effectively generate and return the queue message according to the format of the queue message template, and the test efficiency and the accuracy are improved.
And 103, acquiring a target queue message returned by the test terminal based on the queue message template from the target message queue.
Here, the test terminal may generate a queue message in a format of the queue message template and transmit the queue message to the target message queue. Thus, the execution agent may obtain the queue message from the target message queue.
And 104, transmitting the target queue message to a message channel corresponding to the message type according to the message type of the target queue message, so as to send the target queue message to a message server corresponding to the message type through the message channel.
The message server is used for sending the queue message of the corresponding type to the message receiver. The message server may be comprised of MQ server, TOPIC server and KAFKA server. The message receiver is usually a predetermined device or server. Wherein, the message type of the target queue message can be one of MQ type, TOPIC type and KAFKA type.
As an example, the target queue message may carry a message type, so that the execution body may obtain the message type of the target queue message while obtaining the target queue message. As another example, the target message queue may correspond to a unique message type, and the execution entity may obtain the message type of the message in the target message queue by using the message type corresponding to the target message queue.
Here, a message channel may be established in advance for each message type, for example, the execution subject may establish a message channel between a message queue of the message type and a corresponding message server based on a type identifier of the message type and a server identifier of the message server for each message type. For example, a message channel between a KAFKA-type message queue and a KAFKA message server may be established for the KAFKA type. In this way, the execution body may transmit the target queue message to a corresponding message channel according to the message type of the target queue message, so as to send the target queue message to a message server corresponding to the message type through the message channel, thereby realizing sending the target queue message to a message recipient through the message server.
According to the method provided by the embodiment, the target queue message is transmitted to the message channel corresponding to the message type by analyzing the message type of the target queue message, and the target queue message is sent to the message server corresponding to the message type through the message channel, so that when different types of queue messages are tested and sent, different platforms do not need to be logged in, the operation is more convenient and faster, and the test efficiency is improved. In addition, when testing is carried out, the associated information corresponding to the target queue name can be found from the associated information set based on the target queue name of the target message queue, so that a queue message template is obtained, and then the obtained queue message template is sent to the test terminal, so that the test terminal can quickly and effectively generate and return queue messages according to the format of the queue message template, and the test efficiency and the accuracy are improved.
In some optional implementation manners of this embodiment, if the associated information in the associated information set further includes at least one scene identifier, and each scene identifier corresponds to one queue message template, the test request further includes a target scene identifier for indicating a test scene.
The test scenario is generally a scenario described by a test case. The target scene id is generally a scene id included in the test request.
Here, each piece of association information may further include a plurality of corresponding pairs of scene identifiers and queue message templates. In this way, the target message queue may be used to transmit messages for a variety of test scenarios.
In the foregoing implementation manner, the sending the queue message template in the selected association information to the test terminal may include: and sending the queue message template corresponding to the target scene identifier in the selected associated information to the test terminal.
Here, when the test request further includes a target scene identifier for indicating a test scene, and each piece of associated information in the associated information set further includes a plurality of corresponding pairs of scene identifiers and queue message templates, the execution main body may send the queue message template corresponding to the target scene identifier in the associated information to the test terminal.
It should be noted that other information may also be included in the association information, for example, queue function description information may also be included. The queue function description information is generally information for describing a function of the target message queue, such as a message type of a queue message that can be transmitted, an affiliated service line, an affiliated system, and the like. When the association information comprises a plurality of messages, the tested queue message can be searched through at least one of the plurality of messages. For example, the queue name may be used to find all queue messages transmitted by a certain message queue. Or the tested queue message corresponding to a certain test scenario in a certain message queue can be searched by adopting the scenario identifier and the queue name.
In some optional implementation manners, when the test request further includes a target scene identifier for indicating a test scene, and each piece of associated information in the associated information set further includes a plurality of corresponding pairs of scene identifiers and queue message templates, the message testing method may further include the following step 201 and 203. Fig. 2 is a flowchart of an implementation for flushing queue messages according to an embodiment of the present disclosure.
Step 201, storing the target queue message, the target queue name and the target scene identifier in a target data set in an associated manner.
Here, the execution agent may associate the object queue message, the object queue name, and the object scene identifier with each other, and store the associated object queue message, the object queue name, and the object scene identifier as one object data into an object data set. For example, name1, case2, and message2 may be associated to obtain a target data: name1-case2-message 2. The name1 is a queue name, the case2 is a scene identifier, and the message2 is a queue message.
It is noted that by default, the target data set is an empty set.
Step 202, when receiving a message update request including a request queue name, a request scene identifier and new template description information, extracting target data matching the request queue name and the request scene identifier from a target data set, and extracting associated information matching the request queue name from an associated information set.
The request queue name is generally a queue name included in the message update request. The request scene id is typically the scene id included in the message update request. The above-mentioned new template description information is generally information for describing a new template.
Here, the execution agent may extract, when receiving the message update request, the target data where the request queue name and the request scene identifier are located from the target data set by using the request queue name and the request scene identifier therein, and then extract, from the association information set, the association information where the request queue name is located by using the request queue name.
For example, if there are 3 target data in the target data set, and the target data set is { name1-case1-message1, name1-case2-message2, name2-case3-message3}, where name1 and name2 are queue names, case1, case2 and case3 are scene identifiers, and message1, message2 and message3 are queue messages. If the request queue name is name1 and the request scenario identifier is case2, the target data extracted from the target data set by the execution subject is: name1-case2-message 2.
Step 203, according to the new template description information and the queue message template corresponding to the request scene identifier in the extracted association information, performing data cleaning on the queue message in the extracted target data, so that the queue message after data cleaning is matched with the new template described by the new template description information.
The data cleansing generally refers to adding, reserving or deleting data fields in queue messages.
Here, the execution body may perform data cleaning on the queue message in the extracted target data by using the new template description information and the queue message template corresponding to the request scene identifier, so that the cleaned queue message is adapted to the new template described by the new template description information.
As an example, if the extracted target data is: name1-case2-message2, then message2 can be data washed. If the message2 has 3 data fields, each field A, B, C, and the new template has 5 data fields, each field A, B, C, D, E, then the message2 may be data cleaned and the message2 may be supplemented with two new fields D and E. It should be noted that, when a data field is supplemented into a queue message, a value of the newly supplemented data field may be null or a preset default value.
It should be noted that, as the service requirement may change along with the development of the service, the content of the message to be transmitted may change, and therefore, the message template corresponding to each message queue needs to change accordingly. The user can change the queue message generated based on the old template into the queue message matched with the new template by sending a message updating request to the execution main body, so that the data utilization rate is improved.
In some optional implementation manners, the above performing data cleansing on the queue message in the extracted target data according to the queue message template corresponding to the request scene identifier in the new template description information and the extracted association information may include the following step one and step two.
Step one, determining a set of data fields included in a queue message template corresponding to a request scene identifier, recording the set as a first field set, determining a set of data fields included in a new template according to new template description information, and recording the set as a second field set.
Here, the execution body may analyze the queue message template corresponding to the request scenario identifier, and directly obtain all data fields included therein, thereby obtaining the first field set. Then, the execution subject may analyze the new template described by the new template description information, so as to obtain all data fields included in the new template, so as to obtain the second field set.
And step two, recording the queue message in the extracted target data as a request queue message, and performing data cleaning on the request queue message according to the first field set and the second field set.
Here, for convenience of description, the execution body may refer to a queue message in the extracted target data as a request queue message. The execution body may compare the first field set and the second field set to determine the data fields in the two sets that have differences, and perform data cleaning on the request queue message based on the data fields that have differences, for example, the new data fields in the second field set may be added to the request queue message.
It should be noted that, the data washing is performed on the request queue message, so that the request queue message after the data washing can be adapted to the new template described by the new template description information.
In the foregoing implementation manner, the performing data washing on the request queue message according to the first field set and the second field set includes at least one of the following three items.
First, the interleaved data field in the request queue message is reserved.
Wherein the cross-data fields belong to a first set of fields and to a second set of fields.
Here, the execution body may reserve a cross data field in the request queue message. The data field in the first set of fields is a data field included in a request queue message. For example, if the first set of fields includes A, B, C three data fields and the second set of fields includes A, B, D, E, F five data fields, the interleaved data fields are A, B, and the execution entity may reserve A, B two data fields of the request queue message.
Second, redundant data fields in the request queue message are deleted.
Wherein the redundant data field belongs to the first set of fields and does not belong to the second set of fields.
Here, the execution body may delete a redundant data field in the request queue message. For example, if the first set of fields includes A, B, C data fields and the second set of fields includes A, B, D, E, F data fields, the redundant data field is C, and the execution entity may delete the data field C in the request queue message.
And the third item, a new data field is added in the request queue message.
Wherein the newly added data field belongs to the second set of fields and does not belong to the first set of fields.
Here, the execution body may supplement the request queue message with a new data field. For example, if the first set of fields includes A, B, C data fields and the second set of fields includes A, B, D, E, F data fields, the new data field is D, E, F, and the execution entity may supplement D, E, F data fields in the request queue message.
In an optional implementation manner of each embodiment of the present application, after performing data cleansing on the queue message in the extracted target data, the method may further include finding associated information matching a request queue name from an associated information set, and switching a queue message template corresponding to the request scene identifier in the found associated information to the new template.
After the queue messages are subjected to data cleaning, the corresponding old queue message template is replaced by the new template, so that the template of the queue messages can be updated in time.
Referring to fig. 3, fig. 3 is a flowchart illustrating an implementation of a message testing method according to an embodiment of the present application. The message testing method provided by the embodiment may include the following steps:
step 301, receiving a test request sent by a test terminal.
Wherein the test request includes a target queue name of the target message queue.
In this embodiment, the specific operation of step 301 is substantially the same as the operation of step 101 in the embodiment shown in fig. 1, and is not described herein again.
Step 302, if the associated information is concentrated and the associated information corresponding to the target queue name does not exist, presenting a preset information input interface to the test terminal.
The preset information input interface is used for guiding a user to input the associated information corresponding to the target queue name.
Here, when the associated information set does not have associated information corresponding to the target queue name, the execution main body may send the preset information input interface to the test terminal, so that the test terminal may present the preset information input interface. The tester can input the associated information aiming at the target message queue based on the content presented by the preset information input interface.
Step 303, receiving the association information corresponding to the target queue name, which is input by the user on the preset information input interface, from the test terminal, and storing the received association information into an association information set.
Wherein the user is usually a tester. Here, the tester may input the association information corresponding to the target queue name on a preset information input interface. Then, the test terminal may transmit the association information to the execution main body. Thus, the execution subject may receive the association information and store the association information in an association information set.
And 304, selecting the associated information corresponding to the target queue name from the associated information set, and sending the queue message template in the selected associated information to the test terminal.
Wherein, the associated information in the associated information set comprises a queue name and a queue message template.
And 305, acquiring a target queue message returned by the test terminal based on the queue message template from the target message queue.
Step 306, according to the message type of the target queue message, transmitting the target queue message to a message channel corresponding to the message type, so as to send the target queue message to a message server corresponding to the message type through the message channel.
The message server is used for sending the queue message of the corresponding type to the message receiver.
In the present embodiment, the specific operations of steps 304-306 are substantially the same as the operations of steps 102-104 in the embodiment shown in fig. 1, and are not repeated herein.
In this embodiment, the user can configure the associated information in the associated information set, which is helpful for implementing unified management of the queue messages for testing based on the associated information set, and is convenient for subsequent checking of the test data.
Referring to fig. 4, fig. 4 is a block diagram illustrating a message testing apparatus 400 according to an embodiment of the present disclosure. The message testing apparatus in this embodiment includes units for performing the steps in the embodiments corresponding to fig. 1-3. Please refer to fig. 1-3 and the related descriptions of the embodiments corresponding to fig. 1-3. For convenience of explanation, only the portions related to the present embodiment are shown. Referring to fig. 4, the message test apparatus 400 includes:
a request receiving unit 401, configured to receive a test request sent by a test terminal, where the test request includes a target queue name of a target message queue;
an information selecting unit 402, configured to select, from a pre-stored association information set, association information corresponding to a target queue name, and send a queue message template in the selected association information to a test terminal, where the association information in the association information set includes the queue name and the queue message template;
a message obtaining unit 403, configured to obtain, from the target message queue, a target queue message returned by the test terminal based on the queue message template;
a message transmitting unit 404, configured to transmit the target queue message to a message channel corresponding to the message type according to the message type of the target queue message, so as to send the target queue message to a message server corresponding to the message type through the message channel, where the message server is configured to send the queue message of the corresponding type to a message recipient.
As an embodiment of the present application, if the associated information in the associated information set further includes at least one scene identifier, and each scene identifier corresponds to one queue message template, the test request further includes a target scene identifier for indicating a test scene.
As an embodiment of the present application, the information selecting unit 402 is specifically configured to:
and sending the queue message template corresponding to the target scene identifier in the selected associated information to the test terminal.
As an embodiment of the present application, the apparatus further includes an association storage unit, an information extraction unit, and an update execution unit (not shown in the figure).
The association storage unit is used for associating and storing the target queue message, the target queue name and the target scene identifier into a target data set;
an information extraction unit configured to, upon receiving a message update request including a request queue name, a request scene identification, and new template description information, extract target data matching the request queue name and the request scene identification from a target data set, and extract associated information matching the request queue name from an associated information set;
and the updating execution unit is used for performing data cleaning on the queue message in the extracted target data according to the new template description information and the queue message template corresponding to the request scene identifier in the extracted associated information, so that the queue message after data cleaning is matched with the new template described by the new template description information.
As an embodiment of the present application, the update execution unit is specifically configured to:
determining a set of data fields included in a queue message template corresponding to the request scene identifier, recording the set as a first field set, determining a set of data fields included in a new template according to the description information of the new template, and recording the set as a second field set;
and recording the queue message in the extracted target data as a request queue message, and performing data cleaning on the request queue message according to the first field set and the second field set.
As an embodiment of the present application, in the update execution unit, performing data cleaning on the request queue message according to the first field set and the second field set, where the data cleaning includes at least one of the following:
reserving cross data fields in the request queue message, wherein the cross data fields belong to a first field set and belong to a second field set;
deleting redundant data fields in the request queue message, wherein the redundant data fields belong to the first field set and do not belong to the second field set;
and supplementing a new data field in the request queue message, wherein the new data field belongs to the second field set and does not belong to the first field set.
As an embodiment of the present application, the apparatus further includes an interface presenting unit and an information storing unit (not shown in the figure).
The interface presentation unit is used for presenting a preset information input interface to the test terminal if the associated information is concentrated and the associated information corresponding to the target queue name does not exist, wherein the preset information input interface is used for guiding a user to input the associated information corresponding to the target queue name;
and the information storage unit is used for receiving the association information which is input on a preset information input interface by a user and corresponds to the target queue name from the test terminal and storing the received association information into the association information set.
According to the device provided by the embodiment, the target queue message is transmitted to the message channel corresponding to the message type by analyzing the message type of the target queue message, and the target queue message is sent to the message server corresponding to the message type through the message channel, so that when different types of queue messages are tested and sent, different platforms do not need to be logged in, the operation is more convenient and faster, and the test efficiency is improved. In addition, when testing is carried out, the associated information corresponding to the target queue name can be found from the associated information set based on the target queue name of the target message queue, so that a queue message template is obtained, and then the obtained queue message template is sent to the test terminal, so that the test terminal can quickly and effectively generate and return queue messages according to the format of the queue message template, and the test efficiency and the accuracy are improved.
It should be understood that, in the structural block diagram of the message testing apparatus shown in fig. 4, each unit is used to execute each step in the embodiment corresponding to fig. 1 to fig. 3, and each step in the embodiment corresponding to fig. 1 to fig. 3 has been explained in detail in the above embodiment, and specific reference is made to the relevant description in the embodiment corresponding to fig. 1 to fig. 3 and fig. 1 to fig. 3, which is not described herein again.
Fig. 5 is a block diagram of a server according to another embodiment of the present application. As shown in fig. 5, the server 500 of this embodiment includes: a processor 501, a memory 502 and a computer program 503, such as a program for a message test method, stored in the memory 502 and executable on the processor 501. The processor 501, when executing the computer program 503, implements the steps in the various embodiments of the message testing methods described above, such as the steps 101 to 104 shown in fig. 1. Alternatively, when the processor 501 executes the computer program 503, the functions of the units in the embodiment corresponding to fig. 4, for example, the functions of the units 401 to 404 shown in fig. 4, are implemented, for which reference is specifically made to the relevant description in the embodiment corresponding to fig. 4, which is not repeated herein.
Illustratively, the computer program 503 may be divided into one or more units, which are stored in the memory 502 and executed by the processor 501 to accomplish the present application. One or more elements may be a series of computer program instruction segments capable of performing certain functions, which are used to describe the execution of computer program 503 in server 500. For example, the computer program 503 may be divided into a request receiving unit, an information selecting unit, a message acquiring unit, and a message transmitting unit, and each unit has the above specific functions.
The server may include, but is not limited to, a processor 501, a memory 502. Those skilled in the art will appreciate that fig. 5 is merely an example of a server 500, and does not constitute a limitation on server 500, and may include more or fewer components than shown, or some components in combination, or different components, e.g., a turntable device may also include input output devices, network access devices, buses, etc.
The Processor 501 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The storage 502 may be an internal storage unit of the server 500, such as a hard disk or a memory of the server 500. The memory 502 may also be an external storage device of the server 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the server 500. Further, memory 502 may also include both internal storage units of server 500 and external storage devices. The memory 502 is used for storing computer programs and other programs and data required by the turntable device. The memory 502 may also be used to temporarily store data that has been output or is to be output.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated module, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be non-volatile or volatile. Based on such understanding, all or part of the flow in the method of the embodiments described above can be realized by a computer program, which can be stored in a computer readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable storage medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable storage media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A method for message testing, the method comprising:
receiving a test request sent by a test terminal, wherein the test request comprises a target queue name of a target message queue;
selecting associated information corresponding to the target queue name from a pre-stored associated information set, and sending a queue message template in the selected associated information to the test terminal, wherein the associated information in the associated information set comprises the queue name and the queue message template;
acquiring a target queue message returned by the test terminal based on the queue message template from the target message queue;
and transmitting the target queue message to a message channel corresponding to the message type according to the message type of the target queue message, so as to send the target queue message to a message server corresponding to the message type through the message channel, wherein the message server is used for sending the queue message of the corresponding type to a message receiving party.
2. The message testing method according to claim 1, wherein if the associated information in the associated information set further includes at least one scene identifier, and each scene identifier corresponds to a queue message template, the test request further includes a target scene identifier for indicating a test scene.
3. The message testing method according to claim 2, wherein the sending the queue message template in the selected association information to the testing terminal includes:
and sending the queue message template corresponding to the target scene identifier in the selected associated information to the test terminal.
4. The message testing method of claim 2, wherein the method further comprises:
storing the target queue message, the target queue name and the target scene identifier in a target data set in a correlated manner;
upon receiving a message update request including a request queue name, a request scene identification, and new template description information, extracting target data matching the request queue name and the request scene identification from the target data set, and extracting association information matching the request queue name from the association information set;
and according to the new template description information and the queue message template corresponding to the request scene identifier in the extracted associated information, performing data cleaning on the queue message in the extracted target data, so that the queue message after data cleaning is matched with the new template described by the new template description information.
5. The message testing method according to claim 4, wherein the performing data washing on the queue message in the extracted target data according to the queue message template corresponding to the request scenario identifier in the new template description information and the extracted association information includes:
determining a set of data fields included in a queue message template corresponding to the request scene identifier, recording the set as a first field set, determining a set of data fields included in the new template according to the description information of the new template, and recording the set as a second field set;
recording the queue message in the extracted target data as a request queue message, and performing data cleaning on the request queue message according to the first field set and the second field set.
6. The message testing method of claim 5, wherein the data flushing of the request queue message according to the first set of fields and the second set of fields comprises at least one of:
reserving a cross-data field in the request queue message, wherein the cross-data field belongs to the first set of fields and belongs to the second set of fields;
deleting redundant data fields in the request queue message, wherein the redundant data fields belong to the first set of fields and do not belong to the second set of fields;
and supplementing a newly added data field in the request queue message, wherein the newly added data field belongs to the second field set and does not belong to the first field set.
7. The message testing method according to any of claims 1-6, characterized in that the method further comprises:
if the associated information is concentrated and the associated information corresponding to the target queue name does not exist, presenting a preset information input interface to the test terminal, wherein the preset information input interface is used for guiding a user to input the associated information corresponding to the target queue name;
receiving the associated information corresponding to the target queue name input by the user on the preset information input interface from the test terminal, and storing the received associated information into the associated information set.
8. A message testing apparatus, characterized in that the apparatus comprises:
a request receiving unit, configured to receive a test request sent by a test terminal, where the test request includes a target queue name of a target message queue;
the information selecting unit is used for selecting the associated information corresponding to the target queue name from a pre-stored associated information set and sending a queue message template in the selected associated information to the test terminal, wherein the associated information in the associated information set comprises the queue name and the queue message template;
the message obtaining unit is used for obtaining the target queue message returned by the test terminal based on the queue message template from the target message queue;
and the message transmission unit is used for transmitting the target queue message to a message channel corresponding to the message type according to the message type of the target queue message so as to send the target queue message to a message server corresponding to the message type through the message channel, wherein the message server is used for sending the queue message of the corresponding type to a message receiving party.
9. A server comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the steps of the method according to any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202111526001.6A 2021-12-14 2021-12-14 Message testing method, device, server and storage medium Active CN114221883B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111526001.6A CN114221883B (en) 2021-12-14 2021-12-14 Message testing method, device, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111526001.6A CN114221883B (en) 2021-12-14 2021-12-14 Message testing method, device, server and storage medium

Publications (2)

Publication Number Publication Date
CN114221883A true CN114221883A (en) 2022-03-22
CN114221883B CN114221883B (en) 2024-06-21

Family

ID=80701727

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111526001.6A Active CN114221883B (en) 2021-12-14 2021-12-14 Message testing method, device, server and storage medium

Country Status (1)

Country Link
CN (1) CN114221883B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979982A (en) * 2022-04-13 2022-08-30 中移互联网有限公司 Message issuing method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371892A (en) * 2020-03-05 2020-07-03 中国银行股份有限公司 High-concurrency distributed message pushing system and method
CN112689005A (en) * 2020-12-21 2021-04-20 青岛海尔科技有限公司 Message sending method and device, storage medium and electronic device
CN113220782A (en) * 2021-04-30 2021-08-06 土巴兔集团股份有限公司 Method, device, equipment and medium for generating multivariate test data source

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111371892A (en) * 2020-03-05 2020-07-03 中国银行股份有限公司 High-concurrency distributed message pushing system and method
CN112689005A (en) * 2020-12-21 2021-04-20 青岛海尔科技有限公司 Message sending method and device, storage medium and electronic device
CN113220782A (en) * 2021-04-30 2021-08-06 土巴兔集团股份有限公司 Method, device, equipment and medium for generating multivariate test data source

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979982A (en) * 2022-04-13 2022-08-30 中移互联网有限公司 Message issuing method and device, electronic equipment and storage medium
CN114979982B (en) * 2022-04-13 2023-08-15 中移互联网有限公司 Message issuing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114221883B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
US20190163524A1 (en) Method and apparatus for processing task in smart device
CN110569298B (en) Data docking and visualization method and system
CN109600375B (en) Message tracking method and device, electronic equipment and storage medium
CN107729928B (en) Information acquisition method and device
CN113268336B (en) Service acquisition method, device, equipment and readable medium
CN109582655B (en) Method and device for positioning system log and computer readable storage medium
CN112615753B (en) Link abnormity tracking method, first node, second node and link
CN110377440B (en) Information processing method and device
CN114785685A (en) Software differential upgrading method and device, electronic equipment and readable storage medium
CN110990350B (en) Log analysis method and device
CN114221883B (en) Message testing method, device, server and storage medium
CN111078573A (en) Test message generation method and device
CN111338716A (en) Data processing method and device based on rule engine and terminal equipment
CN111641554B (en) Message processing method and device and computer readable storage medium
CN113780847A (en) Intelligent community information processing method based on Internet of things and server
CN111124541A (en) Configuration file generation method, device, equipment and medium
CN115328506A (en) Application package generation method, loading method, device, medium and equipment
CN114205325A (en) Message sending method, device, server and storage medium
CN114186046A (en) Information processing method, information processing apparatus, server, and storage medium
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN113919310A (en) Short message content determination method and device, electronic equipment and storage medium
CN112948195A (en) Interface testing method and device, electronic equipment and storage medium
CN109086145B (en) Data generation method and device and computer storage medium
CN111831530A (en) Test method and device
CN113704320B (en) Data processing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant