CN110674004A - Queue message recording method, system, electronic equipment and storage medium - Google Patents

Queue message recording method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN110674004A
CN110674004A CN201910803881.3A CN201910803881A CN110674004A CN 110674004 A CN110674004 A CN 110674004A CN 201910803881 A CN201910803881 A CN 201910803881A CN 110674004 A CN110674004 A CN 110674004A
Authority
CN
China
Prior art keywords
queue
message
information
consumer
mark
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.)
Pending
Application number
CN201910803881.3A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910803881.3A priority Critical patent/CN110674004A/en
Publication of CN110674004A publication Critical patent/CN110674004A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to a queue message recording method, a queue message recording system, electronic equipment and a storage medium, wherein the recording method comprises the following steps: before the message enters the queue, acquiring source information of the message and queue information of the queue of the message to be cached, adding the source information and the queue information into the message, and adding a mark to the message; and when the message is sent to the consumer from the queue, acquiring consumer information corresponding to the consumer, and analyzing to obtain source information, queue information and a mark in the message. The method and the device for monitoring the message transmission among the queues have the advantages that the source information and the queue information of the message are obtained before the message enters the queue, the mark, the source message and the queue information are added to the message, the obtained consumer information and the mark, the source message and the queue information obtained through analysis are stored when the message is transmitted to the next consumer, the producer and the queue of the message can be obtained from the stored information, and the message transmitted among the queues can be tracked and monitored through the transmission path of the consumer.

Description

Queue message recording method, system, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a queue message recording method, a queue message recording system, an electronic device, and a storage medium.
Background
Data includes structured, semi-structured, and unstructured data, with unstructured data becoming an increasingly dominant part of the data. Survey reports by IDC show: 80% of the data in a business is unstructured and the data grows exponentially by 60% each year. The big data is a representation or a characteristic of the internet which is developed to the present stage, and does not need to be worried or worried about the big data, under the setback of a technical innovation large screen represented by cloud computing, the data which is originally hard to collect and use is easy to utilize, and the big data can gradually create more value for human beings through continuous innovation of various industries.
The existing commonly used monitoring system basically monitors a data interface, the monitoring of the queue is also centralized on the operation and maintenance of the queue, the production and consumption conditions of the queue can be monitored only by alarming according to operation and maintenance backlog or low consumption speed and the like, and then the log investigation is carried out, but one queue can have a plurality of production ends, a plurality of consumption ends carry out production and consumption simultaneously, the source and the trend of the message are difficult to see during the investigation, and even the data of which source is not known during the writing and the storage, so that the inconvenience is brought to the investigation.
Disclosure of Invention
In order to solve the problems in the prior art, at least one embodiment of the present invention provides a queue message recording method, a queue message recording system, an electronic device, and a storage medium.
In a first aspect, an embodiment of the present invention provides a queue message recording method, where the recording method includes:
before a message enters a queue, a producer acquires source information of the message and queue information of the queue in which the message is to be cached, adds the source information and the queue information to the message, and adds a mark to the message;
the producer stores the source information, the queue information and the mark;
when the message is sent to a consumer from the queue, the consumer obtains consumer information corresponding to the consumer, and analyzes the consumer information to obtain the source information, the queue information and the mark in the message;
the consumer stores the consumer information, source information, queue information, and indicia.
In a second aspect, an embodiment of the present invention provides a queue message recording method, which is applied to a producer, and the recording method includes:
acquiring a message to be sent to a queue;
acquiring producer information of the message and queue information of the queue in which the message is to be cached;
and adding the producer information and the queue information into the message, and adding a mark to the message.
With reference to the second aspect, in a first embodiment of the second aspect, the tagging the message includes:
checking whether a flag is present in the message;
if the message does not have the mark, generating a unique mark, and adding the mark to the message;
or if the mark exists in the message, the message is not processed.
With reference to the second aspect, in a second embodiment of the second aspect, the recording method further includes:
and carrying out persistent storage on the producer information, the queue information and the mark.
In a third aspect, an embodiment of the present invention provides a queue message recording method, which is applied to a consumer, and the recording method includes:
obtaining a message sent from a queue to the consumer;
acquiring consumer information corresponding to the consumer;
analyzing the message to obtain source information, queue information and a mark;
storing the consumer information, the source information, the queue information, and the tag.
With reference to the third aspect, in a first embodiment of the third aspect, the storing the consumer information, the source information, the queue information, and the tag includes:
the consumer information, source information, queue information, and indicia are persistently stored.
With reference to the third aspect, in a second embodiment of the third aspect, the recording method further includes:
acquiring source information of the message, queue information of a passing queue and consumer information according to the mark;
and generating a production consumption link according to the source information, the queue information and the consumer information.
With reference to the third aspect or the first and second embodiments of the third aspect, in a third embodiment of the third aspect, the source information includes: producer information and queue information for each queue that transmitted the message.
In a fourth aspect, an embodiment of the present invention provides a queue message recording system, where the tracking system includes: a producer and a consumer;
the producer includes:
a first obtaining unit, configured to obtain source information of a message and queue information of a queue in which the message is to be cached before the message enters the queue;
a marking unit, configured to add the source information and the queue information to the message, and mark the message;
the first storage unit is used for storing the source information, the queue information and the mark;
the consumer includes:
the second acquisition unit is used for acquiring consumer information corresponding to a consumer when a message is sent to the consumer from the queue;
the analysis unit is used for analyzing and obtaining the source information, the queue information and the mark in the message;
and the second storage unit is used for storing the consumer information, the source information, the queue information and the mark.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the queue message recording method in any embodiment of the first aspect, the second aspect or the third aspect when executing the program stored in the memory.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement the queue message recording method according to any one of the first aspect, the second aspect, or the third aspect.
Compared with the prior art, the technical scheme of the invention has the following advantages: according to the method and the device for monitoring the message transmission, the source information and the queue information of the message are obtained before the message enters the queue, the mark, the source message and the queue information are added to the message, the obtained consumer information and the mark, the source message and the queue information obtained through analysis are stored when the message is transmitted to the next consumer, the producer, the queue and the transmission path of the consumer of the message can be obtained from the stored information, and the tracking and monitoring of the message transmitted among the queues are achieved.
Drawings
Fig. 1 is a schematic diagram of a terminal according to various embodiments of the present invention;
fig. 2 is a schematic flowchart of a queue message recording method according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a queue message recording method according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating a method for recording queue messages according to another embodiment of the present invention;
fig. 5 is a flowchart illustrating a queue message recording method according to another embodiment of the present invention;
fig. 6 is a third schematic flowchart of a queue message recording method according to another embodiment of the present invention;
FIG. 7 is a diagram illustrating a queue message tracking device according to another embodiment of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to yet another embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As shown in fig. 1, a hardware structure diagram of a terminal according to an embodiment of the present invention for implementing various embodiments of the present invention includes a queue configuration parameter input unit 110, a queue model generation unit 120, a processor 1110, a memory 1130, and a communication bus 1140, where electronic components complete communication with each other through the communication bus 1140, where the terminal may be a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and a fixed terminal such as a digital TV, a desktop computer, and the like.
As shown in fig. 2, an embodiment of the present invention provides a queue message recording method, where the recording method includes:
s11, before the message enters the queue, the producer obtains the source information of the message and the queue information of the queue in which the message is to be cached, adds the source information and the queue information to the message, and adds a mark to the message.
The mark can be generated by a method such as a UUID or a snowflow algorithm, the UUID is an abbreviation of a universal Unique Identifier (universal Unique Identifier), and is a standard for software construction, and the purpose of the mark is to enable all elements in a distributed system to have Unique identification information without specifying the identification information through a central control terminal. In this way, everyone can create a UUID that does not conflict with others. The snowflow algorithm is a Twitter open source distributed ID generation algorithm, and the result is a long type ID. The core idea is as follows: 41 bits are used as the number of milliseconds, 10 bits as the ID of the machine (5 bits are the data center, 5 bits of machine ID), 12 bits as the number of streamlines within a millisecond (meaning that each node can generate 4096 IDs per millisecond).
A queue is a special linear table, which is special in that it allows only delete operations at the front of the table, and insert operations at the back of the table, as with a stack, a linear table with restricted operations. The end performing the insert operation is called the tail of the queue, and the end performing the delete operation is called the head of the queue. The data elements of the queue are also referred to as queue elements. Inserting a queue element into a queue is called enqueuing, and removing a queue element from a queue is called dequeuing. Since queues allow only insertion at one end and deletion at the other end, only the elements that enter the queue earliest can be deleted from the queue first, so queues are also known as first-in-first-out (FIFO-first-out) linear tables.
In this embodiment, the data transmission process is that a producer generates a message, the message may be a control instruction or a data parameter, the message is transmitted to a consumer through the queue, and the consumer performs corresponding operations according to the message, where the message transmission process may be that a wireless transmission device transmits between wireless terminals, or that the message enters the queue to be queued for transmission, for example, the control instruction needs to enter the queue before being transmitted to the consumer, so as to ensure that all the control instructions are executed in sequence, thereby avoiding the influence of instruction arrival time confusion on the consumer due to different data transmission efficiencies, where the producer and the consumer may be objects instantiated by a software program, or a control method, and details are not repeated in this step.
In this embodiment, before a message is transmitted to a queue, source information of the message and queue information of the queue are obtained, for example, the source information may be information of an object that transmits the message to the queue, the object may be a producer or another queue, the source of the message is confirmed before the message enters the queue, so that the message is convenient to trace back, and the source information may include a name of an object that transmits the message to the queue or a name of a service, and may further include parameter information such as specific transmission time, data amount, and the like. The source information and the queue information are added into the message, the queue information is added into the message, the queue passed by the message can be confirmed in the message source tracing process, and meanwhile, a mark is added on the message for identifying the message.
S12, the producer stores the source information, the queue information and the mark.
In this embodiment, the producer information, queue information, and the flag may be persisted, which is a mechanism to transition program data between a persistent state and a transient state. Colloquially, instantaneous data, such as data in a memory, cannot be permanently stored; persistence is persistent data, such as persisting into a database, which can be persisted for long.
S13, when the message is sent to the consumer from the queue, the consumer obtains the consumer information corresponding to the consumer, and analyzes to obtain the source information, the queue information and the mark in the message.
In this embodiment, the consumer may be an instantiated object, other queue, or service method for processing a message, and when the message is sent to the consumer, corresponding consumer information is obtained, and source information queue information and a tag in the message are obtained.
In this embodiment, the consumer includes: and when the message is transmitted from the queue to the next queue, the source information of the message and the queue message of the queue need to be continuously acquired, so that the message is tracked and monitored when the message is transmitted between the queue and the queue.
S14, the consumer stores the consumer information, the source information, the queue information and the mark.
When a user needs to check the links of the messages, the production consumption links among the queues can be seen through the consumer information, the source information, the queue information and the marks, each message can be recorded to the producer and the consumer to form a complete link, and the tracking and monitoring of the messages transmitted among the queues are realized.
In this embodiment, the consumer information, source information, queue information, and the indicia may be persisted, which is a mechanism for transitioning program data between a persistent state and a transient state. Colloquially, instantaneous data, such as data in a memory, cannot be permanently stored; persistence is persistent data, such as persisting into a database, which can be persisted for long.
In this embodiment, data may be persisted in a persisted log.
In this embodiment, the message recording method further includes: and acquiring producer information of the message, queue information of the passing queue and final consumer information of the consumer according to the mark, and generating a production consumption link according to the producer information, all the queue information and the consumer information. And generating a consumption link through the stored consumer information, source information, queue information and mark, and realizing the tracking and monitoring of the message source and the link.
In this embodiment, each step in the present solution may be repeatedly performed, for example, when a message is transferred from one queue to another queue, step S12 and step S13 both meet the condition of triggering, and since the consumer is the other queue, step S12 is similar to step S13, and only the relevant information needs to be stored, in this solution, the step of tracing back the message is not limited to the above three steps, and may also be changed according to the number of queues in the message link, which is specifically stated, and is not described again in this embodiment.
As shown in fig. 3, an embodiment of the present invention provides a queue message recording method, and referring to fig. 3, the recording method includes the following steps:
and S21, acquiring the message to be sent to the queue.
S22, obtaining producer information of the message and queue information of the queue in which the message is to be cached.
In this embodiment, the data transmission process is that a producer generates a message, the message may be a control instruction or a data parameter, the message is transmitted to a consumer through the queue, and the consumer performs corresponding operations according to the message, where the message transmission process may be that a wireless transmission device transmits between wireless terminals, or that the message enters the queue to be queued for transmission, for example, the control instruction needs to enter the queue before being transmitted to the consumer, so as to ensure that all the control instructions are executed in sequence, thereby avoiding the influence of instruction arrival time confusion on the consumer due to different data transmission efficiencies, where the producer and the consumer may be objects instantiated by a software program, or a control method, and details are not repeated in this step.
In this embodiment, before a message is transmitted to a queue, source information of the message and queue information of the queue are obtained, for example, the source information may be information of an object that transmits the message to the queue, the object may be a producer or another queue, the source of the message is confirmed before the message enters the queue, so that the message is convenient to trace back, and the source information may include a name of an object that transmits the message to the queue or a name of a service, and may further include parameter information such as specific transmission time, data amount, and the like.
And S23, adding the producer information and the queue information into the message, and adding a mark to the message.
In this embodiment, the source information and the queue information are added to the message, and the queue information is added to the message, so that the queue through which the message passes can be confirmed in the message source tracing process, and meanwhile, a mark is added to the message for identifying the message.
As shown in fig. 4, the method for adding a mark to a message includes the following steps:
s31, checking whether the message has a mark.
In this embodiment, it is determined whether a flag exists in the message, and if the flag exists in the message, it indicates that the message has been transmitted to the queue before, and if the flag does not exist in the message, it indicates that the message has not been transmitted to the queue before.
And S32a, if the mark does not exist in the message, generating a unique mark, and adding the mark to the message.
S32b, or if there is a flag in the message, no processing is performed.
In this embodiment, if the message has not been transmitted to the queue before, a unique tag is generated, and the tag is added to the message, so that only one tag is provided after each message enters the queue or during transmission between the queues, and it is ensured that a transmission link of the message can be effectively acquired.
As shown in fig. 5, an embodiment of the present invention provides a queue message recording method, where the recording method includes the following steps:
and S41, acquiring a queue creating parameter.
In this embodiment, a queue may be encapsulated by using an abstract class in a factory model, so as to implement configuration, production, or monitoring of the queue, transmit a queue creation parameter into the abstract class, instantiate a queue object as a queue, and configure a corresponding method for processing a message for the queue.
In this embodiment, the queue creation parameter includes: the name of the queue, the storage time interval of the data in the queue, and other parameters.
And S42, judging whether a reusable queue corresponding to the queue creating parameter exists in the queue list or not based on the queue creating parameter.
In this embodiment, whether a corresponding reusable queue exists in the queue list is determined according to the queue creation parameter, and if the reusable queue exists, the queue does not need to be created again, and the reusable queue is directly obtained from the queue list as the queue, so that the code can be reused, and the work efficiency is improved.
In this embodiment, reusability (reusability) is also called reuse, which means reuse. At present, the reuse rate of general software is not high, especially in China. The benefits of multiplexing can result in higher production efficiency and consequent cost reduction, higher software quality (errors can be corrected faster), and proper use of multiplexing can improve system maintainability.
S43a, if a reusable queue corresponding to the queue creating parameter exists, acquiring the reusable queue from the queue list as the queue;
s43b, or if there is no reusable queue corresponding to the queue creating parameter, generating the reusable queue based on the queue creating parameter as the queue, and storing the reusable queue in the queue list.
In this embodiment, whether to generate a reusable queue according to the queue creation parameter is determined according to whether a reusable queue exists in the queue list.
As shown in fig. 6, an embodiment of the present invention provides a queue message recording method. Referring to fig. 6, the recording method includes the steps of:
s51, obtaining the message sent from the queue to the consumer.
And S52, acquiring consumer information corresponding to the consumer.
In this embodiment, the consumer may be a service in the program, and the consumer information corresponding to the consumer may be a service name of the service.
S53, analyzing the message to obtain the source information, the queue information and the mark.
In this embodiment, the source information recorded in the message, the queue information of the queue through which the message passes, and the mark added to the message are obtained by analyzing the message sent from the queue to the consumer.
S54, storing the consumer information, the source information, the queue information and the mark.
In this embodiment, the consumer information, source information, queue information, and the indicia may be persisted, which is a mechanism for transitioning program data between a persistent state and a transient state. Colloquially, instantaneous data, such as data in a memory, cannot be permanently stored; persistence is persistent data, such as persisting into a database, which can be persisted for long.
In the embodiment, the source information of the message, the queue information of the queue passing through and the consumer information are obtained according to the mark; and generating a production consumption link according to the source information, the queue information and the consumer information.
And acquiring the source information, the queue information and the consumer information of the message from the persistent log or the memory through marking, and obtaining a link passed by the message based on the source information, the queue information and the consumer information.
In this embodiment, the source information includes: producer information and queue information for each queue that transmitted the message.
As shown in fig. 7, an embodiment of the present invention provides a queue message tracking system, where the tracking system includes: producer, consumer;
the producer includes: a first acquisition unit 11, a marking unit 12 and a first storage unit 13.
In this embodiment, the first obtaining unit 11 is configured to obtain source information of a message and queue information of the queue where the message is to be cached before the message enters the queue.
In this embodiment, the marking unit 12 is configured to add the source information and the queue information to the message, and add a mark to the message.
In this embodiment, the first storage unit 13 is used for storing the source information, the queue information and the tag.
The consumer includes: a second acquisition unit 14, a parsing unit 15 and a second storage unit 16.
In this embodiment, the second obtaining unit 14 is configured to obtain the consumer information corresponding to the consumer when the message is sent from the queue to the consumer.
In this embodiment, the parsing unit 15 is configured to parse the source information, the queue information, and the tag in the obtained message.
In this embodiment, the second storage unit 16 is configured to store the consumer information, the source information, the queue information, and the tag.
In this embodiment, the first storage unit 13 is configured to persistently store the producer information, the queue information, and the flag.
In this embodiment, the second storage unit 16 is configured to persistently store the consumer information, the source information, the queue information, and the tag.
In this embodiment, the second obtaining unit 14 may be configured to obtain queue information of another queue when a message is sent from the queue to the other queue, and parse the source information, the queue information, and the tag in the message.
In this embodiment, the tracking system further includes: a fifth acquisition unit and a link generation unit.
In this embodiment, the fifth obtaining unit is configured to obtain, according to the flag, producer information of the message, queue information of a queue that passes through, and consumer information of a final consumer.
In this embodiment, the link generating unit is configured to generate a production consumption link according to the producer information, all queue information, and consumer information.
In conjunction with the queue message tracking system shown in fig. 7, in a specific embodiment, the marking unit 12 is specifically configured to check whether a mark exists in the message; if the message does not have the mark, generating a unique mark, and adding the mark to the message; or if the mark exists in the message, the message is not processed.
With reference to the queue message tracking system shown in fig. 7, in a specific embodiment, the queue generating unit specifically includes: the device comprises a third acquisition unit, a first judgment unit, a fourth acquisition unit and a generation unit.
In this embodiment, the third obtaining unit is configured to obtain the queue creation parameter.
In this embodiment, the first determining unit is configured to determine, based on the queue creation parameter, whether a reusable queue corresponding to the queue creation parameter exists in a queue list.
In this embodiment, the fourth obtaining unit is configured to, if there is a reusable queue corresponding to the queue creating parameter, obtain the reusable queue from the queue list as the queue.
In this embodiment, the generating unit is configured to, if there is no reusable queue corresponding to the queue creating parameter, generate the reusable queue based on the queue creating parameter, as the queue, and store the reusable queue in the queue list.
As shown in fig. 8, an embodiment of the present invention provides an electronic device, which includes a processor 1110, a communication interface 1120, a memory 1130, and a communication bus 1140, wherein the processor 1110, the communication interface 1120, and the memory 1130 complete communication with each other through the communication bus 1140;
a memory 1130 for storing computer programs;
the processor 1110, when executing the program stored in the memory 1130, implements the following steps:
before a message enters a queue, a producer acquires source information of the message and queue information of the queue in which the message is to be cached, adds the source information and the queue information to the message, and adds a mark to the message;
the producer stores the source information, the queue information and the mark;
when the message is sent to a consumer from the queue, the consumer obtains consumer information corresponding to the consumer, and analyzes the consumer information to obtain the source information, the queue information and the mark in the message;
the consumer stores the consumer information, source information, queue information, and indicia.
In the electronic device provided in the embodiment of the present invention, the processor 1110 records source information of a message, passed queue information, and consumer information before the message enters a queue and when the message is sent to a next consumer by executing a program stored in the memory 1130, when a user needs to check a link of the message, a production consumption link between queues can be seen through the consumer information, the source information, the queue information, and a tag, and each message can record a producer and a consumer to form a complete link, thereby tracking and monitoring the message transmitted between queues.
The communication bus 1140 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The communication interface 1120 is used for communication between the electronic device and other devices.
The memory 1130 may include a Random Access Memory (RAM) 1130, and may also include a non-volatile memory 1130, such as at least one disk memory 1130. Optionally, the memory 1130 may also be at least one memory device located remotely from the processor 1110.
The processor 1110 may be a general-purpose processor 1110, and includes a Central Processing Unit (CPU) 1110, a Network Processor (NP) 1110, and the like; the device may also be a digital signal processor 1110 (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
Embodiments of the present invention provide a computer-readable storage medium, which stores one or more programs, and the one or more programs are executable by one or more processors 1110 to implement the message recording method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized 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. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. 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 in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (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., DVD), or a semiconductor medium (e.g., solid state disk (ssd)), among others.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will 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; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (11)

1. A queue message recording method, the recording method comprising:
before a message enters a queue, a producer acquires source information of the message and queue information of the queue in which the message is to be cached, adds the source information and the queue information to the message, and adds a mark to the message;
the producer stores the source information, the queue information and the mark;
when the message is sent to a consumer from the queue, the consumer obtains consumer information corresponding to the consumer, and analyzes the consumer information to obtain the source information, the queue information and the mark in the message;
the consumer stores the consumer information, source information, queue information, and indicia.
2. A queue message recording method applied to a producer, the recording method comprising:
acquiring a message to be sent to a queue;
acquiring producer information of the message and queue information of the queue in which the message is to be cached;
and adding the producer information and the queue information into the message, and adding a mark to the message.
3. The recording method according to claim 2, wherein said tagging the message comprises:
checking whether a flag is present in the message;
if the message does not have the mark, generating a unique mark, and adding the mark to the message;
or if the mark exists in the message, the message is not processed.
4. The recording method according to claim 2, characterized in that the recording method further comprises:
and carrying out persistent storage on the producer information, the queue information and the mark.
5. A queue message recording method applied to a consumer, the recording method comprising:
obtaining a message sent from a queue to the consumer;
acquiring consumer information corresponding to the consumer;
analyzing the message to obtain source information, queue information and a mark;
storing the consumer information, the source information, the queue information, and the tag.
6. The recording method according to claim 5, wherein the storing the consumer information, the source information, the queue information, and the flag comprises:
the consumer information, source information, queue information, and indicia are persistently stored.
7. The recording method according to claim 5, further comprising:
acquiring source information of the message, queue information of a passing queue and consumer information according to the mark;
and generating a production consumption link according to the source information, the queue information and the consumer information.
8. The recording method according to any one of claims 5 to 7, wherein the source information includes: producer information and queue information for each queue that transmitted the message.
9. A queue message recording system, wherein the tracking system comprises: a producer and a consumer;
the producer includes:
a first obtaining unit, configured to obtain source information of a message and queue information of a queue in which the message is to be cached before the message enters the queue;
a marking unit, configured to add the source information and the queue information to the message, and mark the message;
the first storage unit is used for storing the source information, the queue information and the mark;
the consumer includes:
the second acquisition unit is used for acquiring consumer information corresponding to a consumer when a message is sent to the consumer from the queue;
the analysis unit is used for analyzing and obtaining the source information, the queue information and the mark in the message;
and the second storage unit is used for storing the consumer information, the source information, the queue information and the mark.
10. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the queue message recording method according to any one of claims 1, 2 to 4, or 5 to 8 when executing a program stored in a memory.
11. A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the queue message recording method of any one of claims 1, 2-4, or 5-8.
CN201910803881.3A 2019-08-28 2019-08-28 Queue message recording method, system, electronic equipment and storage medium Pending CN110674004A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910803881.3A CN110674004A (en) 2019-08-28 2019-08-28 Queue message recording method, system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910803881.3A CN110674004A (en) 2019-08-28 2019-08-28 Queue message recording method, system, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110674004A true CN110674004A (en) 2020-01-10

Family

ID=69076389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910803881.3A Pending CN110674004A (en) 2019-08-28 2019-08-28 Queue message recording method, system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110674004A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160117243A1 (en) * 2014-10-28 2016-04-28 International Business Machines Corporation Optimization of non-volatile memory in message queuing
CN107070782A (en) * 2017-05-02 2017-08-18 山东浪潮通软信息科技有限公司 A kind of Interface integration method, server and the system expansible based on message queue
CN107317742A (en) * 2016-04-27 2017-11-03 北京京东尚科信息技术有限公司 A kind of message treatment method and system
CN108984325A (en) * 2018-07-20 2018-12-11 北京北信源信息安全技术有限公司 Message queue consuming method and device
CN109995801A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of method for message transmission and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160117243A1 (en) * 2014-10-28 2016-04-28 International Business Machines Corporation Optimization of non-volatile memory in message queuing
CN107317742A (en) * 2016-04-27 2017-11-03 北京京东尚科信息技术有限公司 A kind of message treatment method and system
CN107070782A (en) * 2017-05-02 2017-08-18 山东浪潮通软信息科技有限公司 A kind of Interface integration method, server and the system expansible based on message queue
CN109995801A (en) * 2017-12-29 2019-07-09 北京京东尚科信息技术有限公司 A kind of method for message transmission and device
CN108984325A (en) * 2018-07-20 2018-12-11 北京北信源信息安全技术有限公司 Message queue consuming method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘晓建等: "一种用于并行系统的非阻塞消息队列机制", 《计算机工程与科学》 *

Similar Documents

Publication Publication Date Title
CN111339186B (en) Workflow engine data synchronization method, device, medium and electronic equipment
WO2019127844A1 (en) Method and device for generating electronic report, computer equipment, and storage medium
CN110908967B (en) Method, device, equipment and computer readable medium for storing log
US11150896B2 (en) Automated generation of service definitions for message queue application clients
CN113987074A (en) Distributed service full-link monitoring method and device, electronic equipment and storage medium
CN111190888A (en) Method and device for managing graph database cluster
CN109818787A (en) Service exception detection method, device and storage medium
CN110019001A (en) Promote method, system and the monitoring module of message-oriented middleware message trace ability
CN110688828A (en) File processing method and device, file processing system and computer equipment
CN110347674A (en) A kind of index creation method, device and equipment based on service identification
US20160283069A1 (en) Visual Representation of an Email Chain
CN110059064A (en) Journal file processing method, device and computer readable storage medium
CN111522854B (en) Data labeling method and device, storage medium and computer equipment
CN110442439B (en) Task process processing method and device and computer equipment
CN110377891B (en) Method, device and equipment for generating event analysis article and computer readable storage medium
CN109271238A (en) Support the task scheduling apparatus and method of a variety of programming languages
CN110674004A (en) Queue message recording method, system, electronic equipment and storage medium
CN109600250B (en) Service system fault notification method, device, electronic device and storage medium
CN108628909B (en) Information pushing method and device
CN113852610B (en) Message processing method, device, computer equipment and storage medium
CN113743842B (en) Multi-source data difference alarm method and device
CN112799903A (en) Method and device for evaluating health state of business system
WO2019136914A1 (en) Method for automatically recording field change, application server and computer-readable storage medium
CN110796137A (en) Method and device for identifying image
CN112579553B (en) Method and apparatus for recording information

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