CN112333087A - Consumption message processing method and related equipment - Google Patents

Consumption message processing method and related equipment Download PDF

Info

Publication number
CN112333087A
CN112333087A CN202011292303.7A CN202011292303A CN112333087A CN 112333087 A CN112333087 A CN 112333087A CN 202011292303 A CN202011292303 A CN 202011292303A CN 112333087 A CN112333087 A CN 112333087A
Authority
CN
China
Prior art keywords
consumption
message
configuration information
service implementation
implementation class
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
CN202011292303.7A
Other languages
Chinese (zh)
Other versions
CN112333087B (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 Consumer Finance Co Ltd
Original Assignee
Ping An Consumer Finance 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 Consumer Finance Co Ltd filed Critical Ping An Consumer Finance Co Ltd
Priority to CN202011292303.7A priority Critical patent/CN112333087B/en
Publication of CN112333087A publication Critical patent/CN112333087A/en
Application granted granted Critical
Publication of CN112333087B publication Critical patent/CN112333087B/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
    • 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
    • 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/046Interoperability with other network applications or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a consumption message processing method and related equipment, wherein the method comprises the following steps: under the condition that a first platform is started, acquiring N pieces of first configuration information from a first database through the first platform, wherein each piece of first configuration information comprises a message theme, a message label and a service implementation class; starting N consumption threads; under the condition that each consumption thread monitors a first consumption message in a consumption label under a consumption topic included by corresponding first configuration information and a first log list does not include an identifier of the first consumption message, the first consumption message is sent to a service implementation class in the first configuration information corresponding to each consumption thread, and the first log list is used for recording the identifier of the consumption message; and processing each first consumption message by adopting each service implementation class. By adopting the embodiment of the application, the repeated processing of the same consumption message can be avoided.

Description

Consumption message processing method and related equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a method for processing a consumption message and a related device.
Background
Asynchronous messages are generally required to be sent and received in a message system, decoupling between different systems is achieved, for example, asynchronous sound logs after orders are created, shopping carts are cleared, notification mails are sent, and the like. However, in practical applications, there is often a complex need for consuming messages as follows: when a message subscriber reads a batch of consumption messages and then finishes processing the consumption messages completely, the message subscriber terminates the processing of the consumption messages, and if the previous consumption messages are read again for processing, the processed messages are processed repeatedly, so that the problem of repeatedly processing the consumption messages is solved urgently.
Disclosure of Invention
The embodiment of the application provides a consumption message processing method and related equipment, which are beneficial to avoiding repeated processing on the same consumption message.
In a first aspect, an embodiment of the present application provides a method for processing a consumption message, where the method includes:
under the condition that a first platform is started, N pieces of first configuration information are obtained from a first database through the first platform, each piece of first configuration information comprises a message theme, a message label and a service implementation class, and N is a positive integer;
starting N consumption threads, wherein the N consumption threads correspond to the N first configuration information one by one;
under the condition that each consumption thread monitors a first consumption message in a consumption label under a consumption topic included by corresponding first configuration information and a first log list does not include an identifier of the first consumption message, the first consumption message is sent to a service implementation class in the first configuration information corresponding to each consumption thread, and the first log list is used for recording the identifier of the consumption message;
and processing each first consumption message by adopting each service implementation class.
In a second aspect, an embodiment of the present application provides a consumption message processing apparatus, including:
an obtaining unit, configured to obtain, by a first platform, N pieces of first configuration information from a first database when the first platform is started, where each piece of the first configuration information includes a message topic, a message tag, and a service implementation class, and N is a positive integer;
the starting unit is used for starting N consumption threads, and the N consumption threads correspond to the N first configuration information one by one;
a sending unit, configured to send, when each consumption thread monitors a first consumption message in a consumption tag under a consumption topic included in corresponding first configuration information of the consumption thread and a first log table does not include an identifier of the first consumption message, the first consumption message to a service implementation class in the first configuration information corresponding to each consumption thread, where the first log table is used to record the identifier of the consumption message;
and the processing unit is used for processing each first consumption message by adopting each service implementation class.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in the method according to the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform some or all of the steps described in the method according to the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps described in the method according to the first aspect of the present application. The computer program product may be a software installation package.
It can be seen that, in this embodiment of the application, when the first platform is started, the electronic device first obtains, through the first platform, N pieces of first configuration information from the first database, where each piece of first configuration information includes a message topic, a message tag, and a service implementation class, then starts N consumption threads, and then sends, when each consumption thread monitors a first consumption message in the consumption tag included in the corresponding first configuration information and the first log table does not include an identifier of the first consumption message, the first consumption message to the service implementation class in the first configuration information corresponding to each consumption thread, and finally processes each first consumption message by using each service implementation class. The electronic equipment is used for processing the first consumption message by adopting the service implementation class under the condition that the first consumption message is monitored and the first log list does not comprise the identifier of the first consumption message, so that the problem of repeatedly processing the same consumption message is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for processing a consumption message according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of another electronic device provided in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a consumption message processing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following are detailed below.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Hereinafter, some terms in the present application are explained to facilitate understanding by those skilled in the art.
Electronic devices may include various handheld devices, vehicle mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem with wireless communication capabilities, as well as various forms of User Equipment (UE), Mobile Stations (MS), terminal Equipment (terminal device), and so forth.
As shown in fig. 1, fig. 1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. The electronic device includes a processor, Memory, signal processor, transceiver, display screen, speaker, communication interface, Random Access Memory (RAM), camera, sensor, and the like. The storage, the signal processor, the display screen, the loudspeaker, the RAM, the camera, the sensor and the communication interface are connected with the processor, and the transceiver is connected with the signal processor.
The Display screen may be a Liquid Crystal Display (LCD), an Organic or inorganic Light-Emitting Diode (OLED), an Active Matrix/Organic Light-Emitting Diode (AMOLED), or the like.
The camera may be a common camera, an infrared camera, or an intelligent camera, and is not limited herein. The camera may be a front camera or a rear camera, and is not limited herein.
Wherein the sensor comprises at least one of: light-sensitive sensors, gyroscopes, infrared proximity sensors, fingerprint sensors, pressure sensors, etc. Among them, the light sensor, also called an ambient light sensor, is used to detect the ambient light brightness. The light sensor may include a light sensitive element and an analog to digital converter. The photosensitive element is used for converting collected optical signals into electric signals, and the analog-to-digital converter is used for converting the electric signals into digital signals. Optionally, the light sensor may further include a signal amplifier, and the signal amplifier may amplify the electrical signal converted by the photosensitive element and output the amplified electrical signal to the analog-to-digital converter. The photosensitive element may include at least one of a photodiode, a phototransistor, a photoresistor, and a silicon photocell.
The processor is a control center of the electronic equipment, various interfaces and lines are used for connecting all parts of the whole electronic equipment, and various functions and processing data of the electronic equipment are executed by operating or executing software programs and/or modules stored in the memory and calling data stored in the memory, so that the electronic equipment is monitored integrally.
The processor may integrate an application processor and a modem processor, wherein the application processor mainly handles operating systems, user interfaces, application programs, and the like, and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor.
The memory is used for storing software programs and/or modules, and the processor executes various functional applications and data processing of the electronic equipment by operating the software programs and/or modules stored in the memory. The memory mainly comprises a program storage area and a data storage area, wherein the program storage area can store an operating system, a software program required by at least one function and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The following describes embodiments of the present application in detail.
As shown in fig. 2, the consumption message processing method provided in the embodiment of the present application is applied to the electronic device, and specifically includes the following steps:
step 201: under the condition that a first platform is started, N pieces of first configuration information are obtained from a first database through the first platform, each piece of first configuration information comprises a message theme, a message label and a service implementation class, and N is a positive integer.
The first platform can be a preset platform, the first platform can also be a channel integration service platform, and can also be other service platforms, and the channel integration service platform can store information uniformly, so that information sharing among different channels and uniform information management are achieved.
The N pieces of first configuration information are all information in the first database.
If the message themes included in the different first configuration information are the same, the message labels are different; if the message topics included in different first configurations are different, the message tags may be the same or different.
Wherein, a message subject can correspond to at least one message label, and the type of each message label is different.
For example, if the subject of the message is loan, the message tag may be personal loan or home loan; if the message subject is a logistics message, the message labels may include a skatecat supermarket logistics, a box horse logistics, and a kyoto logistics.
The service implementation class may be an http implementation class, an https implementation class, an openAPI implementation class, an esgipi implementation class, or the like.
The service implementation classes included in the different first configuration information may be the same or different.
The message subject and the message tag included in the same first configuration information are associated with the service implementation class, that is, for the same first configuration information, the message subject and/or the service implementation class may be determined by the message subject, the message subject and/or the service implementation class may be determined by the message tag, and the message subject and/or the message tag may be determined by the service implementation class.
Step 202: and starting N consumption threads, wherein the N consumption threads correspond to the N first configuration information one by one.
Each consumption thread is used for monitoring consumption messages in the message tags under the message subjects in the corresponding first configuration information.
For example, if the first sub-configuration has 3, then 3 new consuming threads are started, and each piece of first sub-configuration information corresponds to one consuming thread.
For example, if there are 3 first configuration information (configuration information 1, configuration information 2, and configuration information 3), 3 threads (thread 1, thread 2, and thread 3). Wherein, thread 1 corresponds to configuration information 1, thread 2 corresponds to configuration information 2, and thread 3 corresponds to configuration information 3, then thread 1 is used for monitoring the consumption messages in the message tags under the message subjects included in configuration information 1, thread 2 is used for monitoring the consumption messages in the message tags under the message subjects included in configuration information 2, and thread 3 is used for monitoring the consumption messages in the message tags under the message subjects included in configuration information 3.
The consumption message may be an order message, a transaction message, a cancel order message, or the like.
Step 203: and under the condition that each consumption thread monitors a first consumption message in a consumption label under a consumption topic included by the corresponding first configuration information, and a first log table does not include an identifier of the first consumption message, sending the first consumption message to a service implementation class in the first configuration information corresponding to each consumption thread, wherein the first log table is used for recording the identifier of the consumption message.
The first consumption message may include one consumption message or a plurality of consumption messages, and the identification information of each consumption message is different when the first consumption message includes a plurality of consumption messages.
The identifier of the consumption message has uniqueness, and may be preset, determined based on the message subject and the message note where the consumption message is located, or determined based on the time monitored by the consumption thread.
Wherein, the consumption thread and the first consumption message have a one-to-one correspondence relationship.
The identifier of the first consumption message may be recorded in the first log table after the first consumption message is sent to the service implementation class in the corresponding first configuration information, or the identifier of the first consumption message may be recorded in the first log table before the first consumption message is sent to the service implementation class in the corresponding first configuration information.
The identifier of the consumption message recorded in the first log table can be cleared after a preset time period, the duration of the preset time period can be fixed, the preset time periods corresponding to different consumption messages are different, and the time when each consumption message is recorded in the first log table is the starting time of the preset time period corresponding to the consumption message.
Step 204: and processing each first consumption message by adopting each service implementation class.
The service implementation classes and the first consumption messages have a one-to-one correspondence, and the service implementation classes are all used for processing the corresponding first consumption messages.
Optionally, because the message topic, the message tag, and the service implementation class included in the first configuration information have an association relationship, for each service implementation class, first, based on the message topic and the message tag associated with each service implementation class, the second configuration information may be obtained from the second database, and then, based on the second configuration information, each service implementation class is used to process the corresponding first consumption message.
The message theme and/or the message label associated with each service implementation class may be different, and the second configuration information corresponding to different message themes and/or message labels may be the same or different, so that the second configuration information corresponding to each service implementation class may be the same or different.
The service implementation class is only used for processing the corresponding first consumption message, so that the consumption message is prevented from being in a state of waiting for processing, and the efficiency of processing the consumption message is improved.
Optionally, since the second configuration information includes a first preset value, and the first preset value is used to indicate a processing manner of the consumption message, for each service implementation class, when the first preset value included in the second configuration information corresponding to each service implementation class is a first value, first processing the corresponding first consumption message by using each service implementation class to obtain a first consumption record, and then storing the first consumption message in the consumption note under the consumption topic where the first consumption message is located by using each service implementation; or under the condition that the first preset value included in the second configuration information corresponding to each service implementation class is the second value, first obtaining a second consumption record in the consumption label under the consumption theme of the first consumption message corresponding to each service implementation class from the third database, and then performing second processing on the corresponding first consumption message and second consumption record by using each service implementation class to obtain the target consumption information.
Wherein each first consumption message corresponds to a first consumption record.
The second consumption record is all consumption records in the consumption label under the consumption topic of the first consumption message, and the second consumption record comprises at least one consumption record.
The first value and the second value can be represented by numerical values, and the first value is different from the second value.
Because the processing mode of the consumption message is directly determined according to the first value or the second value, the consumption message can be accurately processed.
Optionally, the first processing comprises the steps of: first, a first message generation time, a first consumption status, and a first consumption product type of the first consumption message are determined, and then a first consumption record is generated based on the first message generation time, the first consumption status, and the first consumption product type.
Wherein the consumption state comprises consumption success and consumption failure.
The consumer product type can be a financial product, a clothing product, a medical product, and the like.
Wherein the first consumption record includes a first message generation time, a first consumption status, and a first consumer product type.
Since the first consumption record is generated based on the first message generation time, the first consumption status, and the first consumption product type of the first consumption message, subsequent analysis of the user consumption based on the first consumption message is facilitated.
Optionally, the consumption records in the second consumption record each include a message generation time, a consumption status, and a consumption product type; the second process includes the steps of: the method comprises the steps of firstly determining second message generation time, second consumption state and second consumption product type of a first consumption message, then determining a first consumption success rate of consumption at the second generation time and a second consumption success rate of consumption products of which the types are the second consumption product type based on a second consumption record, the second message generation time, the second consumption state and the second consumption product type, wherein target consumption information comprises at least one of the first consumption success rate and the second consumption success rate.
Optionally, the first consumption success rate may be a ratio of a first number to a second number, the first number being a number of consumption records in which the message generation time is the second generation time and the consumption status is successful in the second consumption record, and the second number being a number of message records in which the message generation time is the second message generation time in the second consumption record.
Alternatively, the second consumption success rate may be a ratio of a third quantity to a fourth quantity, the third quantity being a quantity of consumption records in the second consumption record in which the type of the consumption product is the second consumption product type and the consumption status is successful, and the fourth quantity being a quantity of consumption records in the second consumption record in which the type of the consumption product is the second consumption product type.
The first consumption success rate and/or the second consumption success rate in the target consumption information are/is beneficial to analyzing the consumption behaviors of the user.
It can be seen that, in this embodiment of the application, when the first platform is started, the electronic device first obtains, through the first platform, N pieces of first configuration information from the first database, where each piece of first configuration information includes a message topic, a message tag, and a service implementation class, then starts N consumption threads, and then sends, when each consumption thread monitors a first consumption message in the consumption tag included in the corresponding first configuration information and the first log table does not include an identifier of the first consumption message, the first consumption message to the service implementation class in the first configuration information corresponding to each consumption thread, and finally processes each first consumption message by using each service implementation class. The electronic equipment is used for processing the first consumption message by adopting the service implementation class under the condition that the first consumption message is monitored and the first log list does not comprise the identifier of the first consumption message, so that the problem of repeatedly processing the same consumption message is avoided.
In a possible implementation manner, after obtaining the target consumption information, the method further includes:
generating recommendation information under the condition that the first consumption success rate is greater than a first preset success rate and the second consumption success rate is greater than a second preset success rate, wherein the recommendation information is used for indicating that the products of the second consumption product type are recommended at the second generation time;
and outputting the first consumption success rate, the second consumption success rate and the recommendation information.
Wherein the first preset success rate may be determined based on a consumption success rate in which the consumed time within the first preset period is the second generation time; the second preset success rate may be determined by the success rate that the type of the consumer product is the type of the second consumer product within the second preset time period, the first preset time period may be the same as or different from the second preset time period, and the termination time of the first preset time period and the termination time of the second preset time period are both the current time.
It can be seen that, in the embodiment of the application, recommendation information is output, which is beneficial to improving the satisfaction degree of a customer.
Referring to fig. 3, in accordance with the embodiment shown in fig. 2, fig. 3 is a schematic structural diagram of an electronic device provided in an embodiment of the present application, and as shown in the figure, the electronic device includes a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the following steps:
under the condition that a first platform is started, N pieces of first configuration information are obtained from a first database through the first platform, each piece of first configuration information comprises a message theme, a message label and a service implementation class, and N is a positive integer;
starting N consumption threads, wherein the N consumption threads correspond to the N first configuration information one by one;
under the condition that each consumption thread monitors a first consumption message in a consumption label under a consumption topic included by corresponding first configuration information and a first log list does not include an identifier of the first consumption message, the first consumption message is sent to a service implementation class in the first configuration information corresponding to each consumption thread, and the first log list is used for recording the identifier of the consumption message;
and processing each first consumption message by adopting each service implementation class.
In an implementation manner of the present application, an association relationship exists between a message topic, a message tag, and a service implementation class included in the first configuration information;
in processing each of the first consumption messages with each of the business implementation classes, the program includes instructions further for:
acquiring second configuration information from a second database based on the message theme and the message label associated with each service implementation class;
and processing each first consumption message by adopting each service implementation class based on the second configuration information.
In an implementation manner of the present application, the second configuration information includes a first preset value, where the first preset value is used to indicate a processing manner of the consumption message;
in processing each of the first consumption messages with each of the service implementation classes based on the second configuration information, the program includes instructions further for:
if the first preset value is a first value, performing first processing on each first consumption message by adopting each service implementation class to obtain a first consumption record, and storing the first consumption record in a consumption label under a consumption theme where each first consumption message is located in a third database through each service implementation class;
and if the first preset value is a second value, acquiring a second consumption record in a consumption label under a consumption theme where each first consumption message is located in the third database by adopting each service implementation class, and performing second processing on each first consumption message and each second consumption record by adopting each service implementation class to obtain target consumption information, wherein the second consumption records are all consumption records in the consumption label under the consumption theme where each first consumption message is located.
In an implementation manner of the present application, the first processing includes the following steps:
determining a first message generation time, a first consumption status, and a first consumer product type for each of the first consumption messages;
generating the first consumption record based on the first message generation time, the first consumption status, and the first consumer product type.
In one implementation of the present application, the consumption record includes a message generation time, a consumption status, and a consumption product type, and the consumption status includes a consumption success and a consumption failure;
the first process includes the steps of:
determining a second message generation time, a second consumption status, and a second consumer product type for each of the first consumption messages;
and determining a first consumption success rate of consumption at the second generation time and a second consumption success rate of the consumption product type as the second consumption product type based on the second consumption record, the second message generation time, the second consumption state and the second consumption product type, wherein the target consumption information comprises at least one of the first consumption success rate and the second consumption success rate.
In an implementation manner of the present application, the first consumption success rate is determined based on a first number and a second number, where the first number is the number of consumption records in which the message generation time is the second generation time and the consumption state is successful in the second consumption record, and the second number is the number of consumption records in which the message generation time is the second message generation time in the second consumption record;
the second consumption success rate is determined based on a third number and a fourth number, the third number is the number of consumption records in which the type of the consumption product in the second consumption record is the second consumption product type and the consumption state is successful, and the fourth number is the number of consumption records in which the type of the consumption product in the second consumption record is the second consumption product type.
In an implementation manner of the present application, after performing second processing on each of the first consumption message and the second consumption record by using each of the service implementation classes to obtain target consumption information, the program includes instructions further configured to perform the following steps:
generating recommendation information under the condition that the first consumption success rate is greater than a first preset success rate and the second consumption success rate is greater than a second preset success rate, wherein the recommendation information is used for indicating that the products of the second consumption product type are recommended at the second generation time;
and outputting the first consumption success rate, the second consumption success rate and the recommendation information.
It should be noted that, for the specific implementation process of the present embodiment, reference may be made to the specific implementation process described in the above method embodiment, and a description thereof is omitted here.
Referring to fig. 4, fig. 4 is a consumption message processing apparatus according to an embodiment of the present application, the apparatus including:
an obtaining unit 401, configured to obtain, by a first platform, N pieces of first configuration information from a first database when the first platform is started, where each piece of first configuration information includes a message topic, a message tag, and a service implementation class, and N is a positive integer;
an opening unit 402, configured to open N consumption threads, where the N consumption threads correspond to the N first configuration information one to one;
a sending unit 403, configured to send, when each consumption thread monitors a first consumption message in a consumption tag under a consumption topic included in corresponding first configuration information, and a first log table does not include an identifier of the first consumption message, the first consumption message to a service implementation class in the first configuration information corresponding to each consumption thread, where the first log table is used to record the identifier of the consumption message;
a processing unit 404, configured to process each first consumption message by using each service implementation class.
In an implementation manner of the present application, an association relationship exists between a message topic, a message tag, and a service implementation class included in the first configuration information;
in terms of processing each first consumption message by using each service implementation class, the processing unit 404 is further configured to:
acquiring second configuration information from a second database based on the message theme and the message label associated with each service implementation class;
and processing each first consumption message by adopting each service implementation class based on the second configuration information.
In an implementation manner of the present application, the second configuration information includes a first preset value, where the first preset value is used to indicate a processing manner of the consumption message;
in terms of processing each first consumption message by using each service implementation class based on the second configuration information, the processing unit 404 is further configured to:
if the first preset value is a first value, performing first processing on each first consumption message by adopting each service implementation class to obtain a first consumption record, and storing the first consumption record in a consumption label under a consumption theme where each first consumption message is located in a third database through each service implementation class;
and if the first preset value is a second value, acquiring a second consumption record in a consumption label under a consumption theme where each first consumption message is located in the third database by adopting each service implementation class, and performing second processing on each first consumption message and each second consumption record by adopting each service implementation class to obtain target consumption information, wherein the second consumption records are all consumption records in the consumption label under the consumption theme where each first consumption message is located.
In an implementation manner of the present application, the first processing includes the following steps:
determining a first message generation time, a first consumption status, and a first consumer product type for each of the first consumption messages;
generating the first consumption record based on the first message generation time, the first consumption status, and the first consumer product type.
In one implementation of the present application, the consumption record includes a message generation time, a consumption status, and a consumption product type, and the consumption status includes a consumption success and a consumption failure;
the first process includes the steps of:
determining a second message generation time, a second consumption status, and a second consumer product type for each of the first consumption messages;
and determining a first consumption success rate of consumption at the second generation time and a second consumption success rate of the consumption product type as the second consumption product type based on the second consumption record, the second message generation time, the second consumption state and the second consumption product type, wherein the target consumption information comprises at least one of the first consumption success rate and the second consumption success rate.
In an implementation manner of the present application, the first consumption success rate is determined based on a first number and a second number, where the first number is the number of consumption records in which the message generation time is the second generation time and the consumption state is successful in the second consumption record, and the second number is the number of consumption records in which the message generation time is the second message generation time in the second consumption record;
the second consumption success rate is determined based on a third number and a fourth number, the third number is the number of consumption records in which the type of the consumption product in the second consumption record is the second consumption product type and the consumption state is successful, and the fourth number is the number of consumption records in which the type of the consumption product in the second consumption record is the second consumption product type.
In an implementation manner of the present application, after performing second processing on each of the first consumption message and the second consumption record by using each of the service implementation classes to obtain target consumption information, the processing unit 404 is further configured to:
generating recommendation information under the condition that the first consumption success rate is greater than a first preset success rate and the second consumption success rate is greater than a second preset success rate, wherein the recommendation information is used for indicating that the products of the second consumption product type are recommended at the second generation time;
and outputting the first consumption success rate, the second consumption success rate and the recommendation information.
The obtaining unit 401, the starting unit 402, the sending unit 403, and the processing unit 404 may be implemented by a processor.
Embodiments of the present application also provide a computer storage medium, which stores a computer program, where the computer program is executed by a processor to implement part or all of the steps of any one of the consumption message processing methods as described in the above method embodiments.
Embodiments of the present application also provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to perform some or all of the steps described in the electronic device in the above method. The computer program product may be a software installation package.
The steps of a method or algorithm described in the embodiments of the present application may be implemented in hardware, or may be implemented by a processor executing software instructions. The software instructions may be comprised of corresponding software modules that may be stored in Random Access Memory (RAM), flash Memory, Read Only Memory (ROM), Erasable Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), registers, a hard disk, a removable disk, a compact disc Read Only Memory (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC. Additionally, the ASIC may reside in an access network device, a target network device, or a core network device. Of course, the processor and the storage medium may reside as discrete components in an access network device, a target network device, or a core network device.
Those skilled in the art will appreciate that in one or more of the examples described above, the functionality described in the embodiments of the present application may be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., Digital Video Disk (DVD)), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the embodiments of the present application in further detail, and it should be understood that the above-mentioned embodiments are only specific embodiments of the present application, and are not intended to limit the scope of the embodiments of the present application, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the embodiments of the present application should be included in the scope of the embodiments of the present application.

Claims (10)

1. A method of consuming message processing, the method comprising:
under the condition that a first platform is started, N pieces of first configuration information are obtained from a first database through the first platform, each piece of first configuration information comprises a message theme, a message label and a service implementation class, and N is a positive integer;
starting N consumption threads, wherein the N consumption threads correspond to the N first configuration information one by one;
under the condition that each consumption thread monitors a first consumption message in a consumption label under a consumption topic included by corresponding first configuration information and a first log list does not include an identifier of the first consumption message, the first consumption message is sent to a service implementation class in the first configuration information corresponding to each consumption thread, and the first log list is used for recording the identifier of the consumption message;
and processing each first consumption message by adopting each service implementation class.
2. The method according to claim 1, wherein the first configuration information includes a message subject, a message tag and a service implementation class, which have an association relationship;
the processing each first consumption message by using each service implementation class includes:
acquiring second configuration information from a second database based on the message theme and the message label associated with each service implementation class;
and processing each first consumption message by adopting each service implementation class based on the second configuration information.
3. The method of claim 2, wherein the second configuration information comprises a first preset value, and the first preset value is used for indicating a processing manner of the consumption message;
the processing each first consumption message by using each service implementation class based on the second configuration information includes:
if the first preset value is a first value, performing first processing on each first consumption message by adopting each service implementation class to obtain a first consumption record, and storing the first consumption record in a consumption label under a consumption theme where each first consumption message is located in a third database through each service implementation class;
and if the first preset value is a second value, acquiring a second consumption record in a consumption label under a consumption theme where each first consumption message is located in the third database by adopting each service implementation class, and performing second processing on each first consumption message and each second consumption record by adopting each service implementation class to obtain target consumption information, wherein the second consumption records are all consumption records in the consumption label under the consumption theme where each first consumption message is located.
4. The method according to claim 3, wherein the first processing comprises the steps of:
determining a first message generation time, a first consumption status, and a first consumer product type for each of the first consumption messages;
generating the first consumption record based on the first message generation time, the first consumption status, and the first consumer product type.
5. The method of claim 3, wherein the consumption record comprises a message generation time, a consumption status, and a consumption product type, the consumption status comprising a consumption success and a consumption failure;
the second process includes the steps of:
determining a second message generation time, a second consumption status, and a second consumer product type for each of the first consumption messages;
and determining a first consumption success rate of consumption at the second generation time and a second consumption success rate of the consumption product type as the second consumption product type based on the second consumption record, the second message generation time, the second consumption state and the second consumption product type, wherein the target consumption information comprises at least one of the first consumption success rate and the second consumption success rate.
6. The method of claim 5, wherein the first consumption success rate is determined based on a first number of consumption records in the second consumption record having a message generation time of the second generation time and a consumption status of success, and a second number of consumption records in the second consumption record having a message generation time of the second message generation time;
the second consumption success rate is determined based on a third number and a fourth number, the third number is the number of consumption records in which the type of the consumption product in the second consumption record is the second consumption product type and the consumption state is successful, and the fourth number is the number of consumption records in which the type of the consumption product in the second consumption record is the second consumption product type.
7. The method according to claim 5 or 6, wherein after performing the second processing on each of the first consumption message and the second consumption record by using each of the service implementation classes to obtain target consumption information, the method further comprises:
generating recommendation information under the condition that the first consumption success rate is greater than a first preset success rate and the second consumption success rate is greater than a second preset success rate, wherein the recommendation information is used for indicating that the products of the second consumption product type are recommended at the second generation time;
and outputting the first consumption success rate, the second consumption success rate and the recommendation information.
8. A consumer message processing apparatus, the apparatus comprising:
an obtaining unit, configured to obtain, by a first platform, N pieces of first configuration information from a first database when the first platform is started, where each piece of the first configuration information includes a message topic, a message tag, and a service implementation class, and N is a positive integer;
the starting unit is used for starting N consumption threads, and the N consumption threads correspond to the N first configuration information one by one;
a sending unit, configured to send, when each consumption thread monitors a first consumption message in a consumption tag under a consumption topic included in corresponding first configuration information of the consumption thread and a first log table does not include an identifier of the first consumption message, the first consumption message to a service implementation class in the first configuration information corresponding to each consumption thread, where the first log table is used to record the identifier of the consumption message;
and the processing unit is used for processing each first consumption message by adopting each service implementation class.
9. An electronic device, comprising a processor, memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, wherein the computer program is processed to perform the method according to any of claims 1-7.
CN202011292303.7A 2020-11-18 2020-11-18 Consumption message processing method and related equipment Active CN112333087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011292303.7A CN112333087B (en) 2020-11-18 2020-11-18 Consumption message processing method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011292303.7A CN112333087B (en) 2020-11-18 2020-11-18 Consumption message processing method and related equipment

Publications (2)

Publication Number Publication Date
CN112333087A true CN112333087A (en) 2021-02-05
CN112333087B CN112333087B (en) 2023-03-28

Family

ID=74322539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011292303.7A Active CN112333087B (en) 2020-11-18 2020-11-18 Consumption message processing method and related equipment

Country Status (1)

Country Link
CN (1) CN112333087B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543662A (en) * 2022-11-30 2022-12-30 苏州浪潮智能科技有限公司 Method and related device for issuing kafka message data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170149713A1 (en) * 2015-11-23 2017-05-25 International Business Machines Corporation Managing message threads through use of a consolidated message
CN107945031A (en) * 2017-12-25 2018-04-20 泰康保险集团股份有限公司 Data handling system and unit of risk data creation method is protected again
CN108984325A (en) * 2018-07-20 2018-12-11 北京北信源信息安全技术有限公司 Message queue consuming method and device
CN109582470A (en) * 2017-09-28 2019-04-05 北京国双科技有限公司 A kind of data processing method and data processing equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170149713A1 (en) * 2015-11-23 2017-05-25 International Business Machines Corporation Managing message threads through use of a consolidated message
CN109582470A (en) * 2017-09-28 2019-04-05 北京国双科技有限公司 A kind of data processing method and data processing equipment
CN107945031A (en) * 2017-12-25 2018-04-20 泰康保险集团股份有限公司 Data handling system and unit of risk data creation method is protected again
CN108984325A (en) * 2018-07-20 2018-12-11 北京北信源信息安全技术有限公司 Message queue consuming method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115543662A (en) * 2022-11-30 2022-12-30 苏州浪潮智能科技有限公司 Method and related device for issuing kafka message data
CN115543662B (en) * 2022-11-30 2023-03-21 苏州浪潮智能科技有限公司 Method and related device for issuing kafka message data

Also Published As

Publication number Publication date
CN112333087B (en) 2023-03-28

Similar Documents

Publication Publication Date Title
CN112491998B (en) Message pushing method and related equipment
CN108153647A (en) log processing method, device, terminal device and storage medium
CN112333087B (en) Consumption message processing method and related equipment
CN107861765B (en) Product configuration method, apparatus, and computer-readable storage medium
CN108170585A (en) log processing method, device, terminal device and storage medium
US8682983B2 (en) Systems, methods and computer program products for the delivery of email text messages and audio video attachments to an IPTV display device
CN110881224B (en) Network long connection method, device, equipment and storage medium
CN110912807A (en) Information prompting method and device, electronic equipment and computer readable storage medium
CN113760500A (en) Service processing method, device, server and medium
US20090144378A1 (en) Systems, methods and computer program products for the delivery of email text messages and image attachments to an iptv display device
WO2022078397A1 (en) Communication method and apparatus, device, and storage medium
EP3910911B1 (en) Method for service decision distribution among multiple terminal devices and system
CN115187364A (en) Method and device for monitoring deposit risk under bank distributed scene
CN111427878B (en) Data monitoring alarm method, device, server and storage medium
CN113849638A (en) Information processing method, information processing device, electronic equipment and storage medium
CN112686619B (en) Method and device for reminding order collection
CN107818469A (en) Data processing method, device and computer-readable recording medium
CN114006987A (en) Visual interaction method and device
CN112612517A (en) Data acquisition method and related equipment
CN112764969A (en) Application software exception handling method and related equipment
CN110825396A (en) Exception handling method and related equipment
CN112132657B (en) Message reminding method and related equipment
CN112132657A (en) Message reminding method and related equipment
CN110766498A (en) Method and device for recommending commodities
CN114693313B (en) Identification code-based warehousing equipment detection method and device, electronic equipment and 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
GR01 Patent grant