CN110659142A - Message queue processing method and device, electronic equipment and storage medium - Google Patents

Message queue processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110659142A
CN110659142A CN201910713837.3A CN201910713837A CN110659142A CN 110659142 A CN110659142 A CN 110659142A CN 201910713837 A CN201910713837 A CN 201910713837A CN 110659142 A CN110659142 A CN 110659142A
Authority
CN
China
Prior art keywords
message queue
started
connection process
new short
monitoring process
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
CN201910713837.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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910713837.3A priority Critical patent/CN110659142A/en
Priority to PCT/CN2019/117686 priority patent/WO2021022710A1/en
Publication of CN110659142A publication Critical patent/CN110659142A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues

Abstract

The invention provides a message queue processing method and device, electronic equipment and a storage medium, and relates to the technical field of communication. The message queue processing method comprises the following steps: acquiring a preset mark, and judging whether a monitoring process needs to be started at a block link point or not according to the preset mark; if the monitoring process is judged to need to be started at the block chain node, acquiring operation information corresponding to the message queue in the block chain node through the monitoring process; judging whether a new short connection process needs to be started or not according to the operation information; and if the new short connection process is determined to be needed to be started, starting the new short connection process to process the message queue according to the started long connection process and the new short connection process. The technical scheme of the embodiment of the invention not only can improve the processing efficiency of the message queue of the blockchain node, but also can save the operation resource of the blockchain node and improve the operation efficiency.

Description

Message queue processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a message queue processing method, a message queue processing apparatus, an electronic device, and a computer-readable storage medium.
Background
With the rapid development of technology, the blockchain technology is more and more emphasized. The block chain technology (distributed ledger technology) is a decentralized distributed database technology and has the characteristics of openness, transparency, no tampering, trustiness and the like.
Currently, when processing a message queue, a blockchain node usually opens a long connection process for processing, and when detecting that a message to be processed appears in the message queue, processes the message. When a large number of messages enter the message queue at the same time, the messages in the message queue can be processed one by one through the long connection process, but the processing method can cause accumulation of the messages and reduce the processing efficiency.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
Embodiments of the present invention provide a message queue processing method, a message queue processing apparatus, an electronic device, and a computer-readable storage medium, so as to overcome, at least to a certain extent, a problem that a long connection process or a large number of short connection processes in a message queue of a block chain node in the prior art reduces processing efficiency.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the embodiments of the present invention, there is provided a message queue processing method, including: acquiring a preset mark, and judging whether a monitoring process needs to be started at a block link point or not according to the preset mark; if the monitoring process is judged to need to be started at the block chain node, acquiring operation information corresponding to the message queue in the block chain node through the monitoring process; judging whether a new short connection process needs to be started or not according to the operation information; and if the fact that a new short connection process needs to be started is determined, starting the new short connection process to process the message queue according to the started long connection process and the new short connection process.
In some example embodiments of the present invention, based on the foregoing solution, if it is determined that the monitoring process needs to be started at the blockchain node, acquiring, by the monitoring process, operation information corresponding to a message queue in the blockchain node further includes: and if the monitoring process is judged not to be started at the block chain node, directly executing a long connection process to process the message queue according to the long connection process.
In some example embodiments of the present invention, based on the foregoing solution, the acquiring, by the monitoring process, job information corresponding to a message queue includes: acquiring a query interface corresponding to the message queue based on the monitoring process; and acquiring the job information corresponding to the message queue according to the query interface.
In some example embodiments of the present invention, based on the foregoing solution, the job information includes a depth of a message queue, and the determining whether a new short connection process needs to be started according to the job information includes: judging whether the depth of the message queue exceeds a new short connection process starting threshold value or not based on the monitoring process; and if the depth of the message queue does not exceed the starting threshold of the new short connection process, ending the monitoring process.
In some example embodiments of the present invention, based on the foregoing solution, the job information further includes a number status of all current connection processes of the message queue, and the determining whether a new short connection process needs to be started according to the job information includes: based on the monitoring process, if the depth of the message queue exceeds the new short connection process starting threshold, continuously judging whether the number state of all current connection processes of the message queue exceeds a total number of operation threshold; and when the number states of all the current connection processes of the message queue are determined to exceed the total number threshold of the jobs, ending the monitoring process.
In some example embodiments of the present invention, based on the foregoing solution, the operation information further includes an operation processor utilization rate of the client corresponding to the block link point, and the determining whether to start a new short connection process according to the operation information includes: based on the monitoring process, if the number states of all the current connection processes of the message queue are determined not to exceed the total operation number threshold, whether the utilization rate of the operation processor of the client corresponding to the block link point exceeds the utilization rate threshold of the operation processor is continuously judged; and if the utilization rate of the operation processor of the client corresponding to the block link point is determined to exceed the threshold of the utilization rate of the operation processor, ending the monitoring process. And if the utilization rate of the operation processor of the client corresponding to the block link point is determined not to exceed the utilization rate threshold of the operation processor, starting a new short connection process.
In some example embodiments of the present invention, based on the foregoing, the method further comprises: judging whether the states of all the current connection processes of the message queue are in a locking state or a message waiting state; and if the current states of all the connection processes of the message queue are determined to be in a lock state or a message waiting state, sending warning information to the message queue so that the queue messages can send notification information to the outside.
According to a second aspect of the embodiments of the present invention, there is provided a message queue processing apparatus, including: the system comprises a mark judging unit, a block link point monitoring unit and a monitoring unit, wherein the mark judging unit is used for acquiring a preset mark and judging whether a monitoring process needs to be started at the block link point or not according to the preset mark; an operation information obtaining unit, configured to obtain, if it is determined that the monitoring process needs to be started at the block link node, operation information corresponding to a message queue in the block link node through the monitoring process; the judging unit is used for judging whether a new short connection process needs to be started or not according to the operation information; and the starting unit is used for starting a new short connection process to process the message queue according to the started long connection process and the new short connection process if the new short connection process is determined to be required to be started.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: a processor; and a memory having computer readable instructions stored thereon which, when executed by the processor, implement any of the message queue processing methods described above.
According to a fourth aspect of embodiments of the present invention, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a message queue processing method according to any one of the above.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
in the message queue processing method in the exemplary embodiment of the invention, the monitoring process is selected to be started or not started at the block link point according to the preset mark; when the preset mark is the starting of the monitoring process, acquiring operation information corresponding to the message queue in the block link point through the monitoring process; and judging whether to start a new short connection process according to the operation information, and starting the new short connection process when determining to start the new short connection process. On one hand, a new short connection process is started through the monitoring process, and the message queue is processed according to the new short connection process and the started long connection process, so that the problem of message accumulation caused by the fact that only the long connection process processes the messages in the message queue one by one is avoided, and the message processing efficiency is improved; on the other hand, the monitoring process judges whether to start a new short connection process according to the operation information of the message queue, so that the problem that too many short connection processes are started to occupy operation resources is avoided, the message processing speed is increased, and the operation efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention. It is obvious that the drawings in the following description are only some embodiments of the invention, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 schematically illustrates a schematic diagram of a cross blockchain interaction system in accordance with some embodiments of the present invention;
FIG. 2 schematically illustrates a message queue processing method according to some embodiments of the invention;
FIG. 3 schematically illustrates a message queue processing flow, in accordance with some embodiments of the invention;
FIG. 4 schematically illustrates a schematic diagram of a message queue processing apparatus according to some embodiments of the invention;
FIG. 5 schematically illustrates a structural schematic of a computer system of an electronic device according to some embodiments of the invention;
FIG. 6 schematically illustrates a schematic diagram of a computer-readable storage medium according to some embodiments of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
Furthermore, the drawings are merely schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
In the prior art, a cross-blockchain interactive system and a communication scheme are provided, for example, referring to fig. 1, fig. 1 schematically illustrates a schematic diagram of a cross-blockchain interactive system according to some embodiments of the present invention. In the technical scheme, the subscription client corresponds to a block chain node in a first block chain and is used for maintaining a message queue corresponding to the block chain node, wherein the message queue contains messages subscribed by the block chain node. And the release client corresponds to the second block chain and is used for acquiring and releasing the message generated by the second block chain. The cross-chain interactive terminal is used for acquiring a subscription condition of a block chain node in the first block chain, and when the tail of the message queue contains a message meeting the subscription condition, requesting the message meeting the subscription condition from a publishing client and sending the message to the subscribing client so as to update the message into the message queue, so that the block chain node in the first block chain can pull the message from the message queue.
In the prior art, a message queue is constructed at a block chain node corresponding to a subscription client, so that a loose coupling method is provided for communication between the block chain nodes. An Application Program Interface (API) of the message queue may be provided to a new or existing blockchain node, and an information exchange function between blockchain nodes is implemented through sending a message. When processing a message queue, a block chain node of a subscribing client usually opens a long connection process for processing, and when detecting that a message to be processed appears in the message queue, the block chain node processes the message. When a large number of messages enter the message queue at the same time, the messages in the message queue can be processed one by one through the long connection process. However, such a processing method causes accumulation of messages, and reduces processing efficiency. Alternatively, one or more short-connection processes may be initiated to process messages in the message queue in parallel. However, the short connection process itself also occupies the CPU resource of the block link node and consumes the memory, and when a large number of short connection processes are simultaneously started, the efficiency is further reduced, which affects the efficiency of the long connection process.
Based on this, in the present exemplary embodiment, a message queue processing method is first provided, and fig. 2 schematically illustrates a schematic diagram of a message queue processing method according to some embodiments of the present invention. Referring to fig. 2, the message queue processing method may include the steps of:
step S210, acquiring a preset mark, and judging whether a monitoring process needs to be started at a block link point according to the preset mark;
step S220, if the monitoring process is judged to need to be started at the block chain node, acquiring operation information corresponding to the message queue in the block chain node through the monitoring process;
step S230, judging whether a new short connection process needs to be started according to the operation information;
step S240, if it is determined that a new short connection process needs to be started, a new short connection process is started to process the message queue according to the started long connection process and the new short connection process.
According to the message queue processing method in the embodiment, on one hand, a new short connection process is started through the monitoring process, and the message queue is processed according to the new short connection process and the started long connection process, so that the problem of message accumulation caused by the fact that only the long connection process processes the messages in the message queue one by one is avoided, and the message processing efficiency is improved; on the other hand, the monitoring process judges whether to start a new short connection process according to the operation information of the message queue, so that the problem that too many short connection processes are started to occupy operation resources is avoided, the message processing speed is increased, and the operation efficiency is improved.
Next, a message queue processing method in the present exemplary embodiment will be further explained.
In step S210, a preset flag is obtained, and whether a monitoring process needs to be started at a block link point is determined according to the preset flag.
In some example embodiments of the present invention, the preset flag may refer to preset identification information for triggering execution of an event, for example, if the preset flag may be YES (or YES or TRUE), it is determined to start the monitoring process, and if the preset flag may be NO (or NO or FALSE), it is determined not to start the monitoring process (in this example embodiment, when it is determined not to start the monitoring process, the long connection process is directly executed). Of course, the preset flag may also be other preset identification information, which is not particularly limited in this example embodiment.
Specifically, a preset mark is constructed in advance, and whether a monitoring process needs to be started at a block link point is determined according to the setting of a user on the preset mark. The system constructs a preset mark in advance, and judges whether to start a monitoring process or execute a long connection process (not to start the monitoring process) according to the setting of a user on the preset mark. For example, when the system detects that the user sets the preset flag to be YES (or YES or TRUE), a monitoring process is started at the corresponding block link point of the subscribing client. The user can start the monitoring process or execute the long connection process to process the message queue according to the actual demand through the preset mark so as to achieve the result expected by the user, the operation is simple, and the use experience of the user is improved.
Specifically, a query interface corresponding to the message queue is obtained based on the monitoring process, and job information corresponding to the message queue is obtained according to the query interface. The operation information includes the depth of the message queue, the number states of all the current connection processes of the message queue, and the utilization rate of the operation processor of the client (subscription client) corresponding to the block link point. The monitoring process queries and acquires part of the message queue information through query interfaces of the message queue (the names of the query interfaces corresponding to different types of message queue models may be different; if no query interface exists, developers can configure the query interface by themselves). For example, the number information of the messages in the message queue is inquired and acquired, and the depth of the current message queue is determined according to the number information. All the aforementioned connection processes may include a long connection process and all short connection processes, or may be only all the short connection processes, so that the number and status (e.g., running/stopping) of all the connection processes may be queried and obtained. The node state information such as the utilization rate of the CPU of the subscription client can be obtained through the interface query of the operating system of the block chain node corresponding to the subscription client.
In step S220, if it is determined that the monitoring process needs to be started at the block chain node, the operation information corresponding to the message queue in the block chain node is obtained through the monitoring process.
In some example embodiments of the invention, a Message Queue (MQ) may refer to a method of application-to-application communication. When the system determines that the preset flag set by the user is YES (or YES or TRUE), a monitoring process is started at the block link point corresponding to the subscribing client. The monitoring process obtains a query interface corresponding to the message queue model (or obtains a query interface uploaded by a developer) at a target storage location (a storage device of the subscription client), and obtains operation information corresponding to the message queue through the query interface, for example, the monitoring process obtains operation information such as the depth of the message queue, the number states of all current connection processes of the message queue, and the utilization rate of an operation processor corresponding to the block link point (the subscription client) through the query interface.
Optionally, if it is determined that the monitoring process does not need to be started at the block link point, the long connection process is directly executed to process the message queue according to the long connection process. The long connection process can mean that after a sending end and a receiving end are connected, a Socket channel can be kept to carry out communication for many times without calculating the time for establishing and closing the Socket channel (the Socket channel can mean a communication mode between processes, such as Java EJB calling, Web Service and the like. And if the setting of the preset mark indicates that the monitoring process does not need to be started at the block link point, directly executing the long connection process to process the message queue. Whether the monitoring process is started at the block chain link point is selected by setting a preset mark, so that the flexibility of message queue processing can be increased, different processing modes are set according to the block chain link points under different conditions, and the working efficiency of the system is improved.
In step S230, it is determined whether a new short connection process needs to be started according to the job information.
In some exemplary embodiments of the present invention, the monitoring process determines whether a new short connection process needs to be started according to the acquired operation information, for example, the monitoring process determines whether a new short connection process needs to be started according to the acquired operation information, such as the depth of the message queue, the number status of all current connection processes of the message queue, and the utilization rate of the operation processor of the client (subscription client) corresponding to the block link point.
Specifically, whether the depth of the message queue exceeds a new short connection process starting threshold value is judged based on the monitoring process; and if the depth of the message queue does not exceed the starting threshold of the new short connection process, ending the monitoring process in the current round. The new short connection process starting threshold may be a preset fixed value, or may be a threshold dynamically set according to the message queue processing condition and/or the CPU utilization rate, and the specific size needs to be determined after testing according to the actual condition. For example, the system determines that the new short connection process starting threshold is 10 according to the related information (i.e. it is determined that 10 new short connection processes are started at most by the job task at this time, and when the number of the started new short connection processes exceeds 10, the efficiency of the system for processing messages is affected), and the depth of the message queue is 9, it is determined that the depth of the message queue at this time does not exceed the new short connection process starting threshold (i.e. the depth of the current message queue does not need to start a new short connection process), and the monitoring process ends the monitoring of this round.
Further, if the monitoring process judges that the depth of the message queue exceeds a new short connection process starting threshold, the monitoring process continuously judges whether the number states of all current connection processes of the message queue exceed a total operation number threshold; and when the number states of all the current connection processes of the message queue are determined to exceed the total number threshold of the jobs, ending the monitoring process of the current round. The total number of jobs threshold may be a preset fixed value, or may be a threshold dynamically set according to the message queue processing condition and/or the CPU utilization, and the embodiments of the present invention are not limited thereto. In addition, the number status of all the current connection processes of the message queue may include all the long connection processes and all the short connection processes, and of course, may also be only all the short connection processes, so that the setting of the total number of jobs threshold value may be different for different situations, and the present invention is not particularly limited herein. If the depth of the message queue exceeds the starting threshold of the new short connection process (namely the depth of the current message queue needs to start the new short connection process), continuously judging whether the number states of all the current connection processes of the message queue exceed the total number threshold of the operation, and when the number states of all the current connection processes of the message queue are determined to exceed the total number threshold of the operation, finishing the monitoring of the current round by the monitoring process.
Further, if the monitoring process determines that the number states of all the current connection processes of the message queue do not exceed the total operation number threshold, continuing to judge whether the utilization rate of the operation processor of the client corresponding to the block link point exceeds the utilization rate threshold of the operation processor; and when the utilization rate of the operation processor corresponding to the client side of the block link point is determined to exceed the threshold value of the utilization rate of the operation processor, ending the monitoring process. The CPU utilization threshold may be a preset fixed value, or may be a threshold dynamically set according to the message queue processing condition and/or the CPU utilization, and the like, which is not particularly limited in the present invention. And if the monitoring process determines that the number states of all the current connection processes of the message queue do not exceed the total operation number threshold, continuously judging whether the utilization rate of the operation processor corresponding to the block chain link point and the client exceeds the utilization rate threshold of the operation processor, and when the utilization rate of the operation processor corresponding to the block chain link point and the client exceeds the utilization rate threshold of the operation processor, finishing the monitoring of the current round by the monitoring process. For example, when the utilization rate of the operation processor is 80% (it can be considered that the utilization rate of the operation processor exceeds 80%, the working efficiency of the block chain node is affected), and when the utilization rate of the operation processor of the block chain node corresponding to the client is 82%, it can be considered that the utilization rate of the operation processor of the block chain node corresponding to the client exceeds the utilization rate threshold of the operation processor (that is, at this time, the system determines that the system cannot continuously occupy the resource of the operation processor of the block chain node corresponding to the client, but starts a new short connection process, and occupies the resource of the operation processor), and the monitoring process ends the monitoring of the round. And starting a new short connection process when the utilization rate of the operation processor of the client corresponding to the block link point is determined not to exceed the utilization rate threshold of the operation processor.
It should be noted that the foregoing monitoring process determines, according to the obtained job information, whether a new short connection process needs to be started, which is only an exemplary process, and may also be determined in other determination orders or simultaneously, and the present invention is not limited to this.
Referring to fig. 3, fig. 3 schematically illustrates a message queue processing flow according to some embodiments of the invention, and the steps shown in fig. 3 are described in detail below:
step S310, the system judges whether to start the monitoring process at the block link point according to the setting of the preset flag by the user, and executes step S330 when the setting of the preset flag is determined to be YES (or YES or TRUE); step S320 is performed when it is determined that the setting of the preset flag is NO (or NO or FALSE).
In step S320, a long connection process is performed at the block link point.
Step S330, the monitoring process judges whether the depth of the Message Queue (MQ) exceeds a new short connection process starting threshold value, and when the depth of the message queue exceeds the new short connection process starting threshold value, the step S340 is executed; and when the depth of the message queue is determined not to exceed the starting threshold of the new short connection process, the monitoring process finishes the monitoring of the current round.
Step S340, the monitoring process judges whether the number states of all the current connection processes of the message queue exceed the total number threshold of the operation, and when the number states of all the current connection processes of the message queue do not exceed the total number threshold of the operation, the step S350 is executed; and when the number states of all the current connection processes of the message queue are determined to exceed the total number threshold of the jobs, the monitoring process finishes the monitoring of the current round.
Step S350, the monitoring process judges whether the utilization rate of the operation processor corresponding to the block chain link point on the client exceeds an operation processor utilization rate threshold value, and when the utilization rate of the operation processor corresponding to the block chain link point on the client does not exceed the operation processor utilization rate threshold value, the step S360 is executed; and when the utilization rate of the operation processor corresponding to the client side of the block link point is determined to exceed the utilization rate threshold of the operation processor, the monitoring process finishes the monitoring of the current round.
Step S360, a new short connection process is started.
With continued reference to fig. 2, in step S240, if it is determined that a new short connection process needs to be started, a new short connection process is started to process the message queue according to the started long connection process and the new short connection process.
In some example embodiments of the present invention, the short connection process may refer to that after a sending end and a receiving end establish a connection, a Socket channel may be maintained for communication only once, and then the Socket channel is closed. The short connection process can judge whether a message is still to be processed in the message queue, and if the message is still to be processed, the message in the message queue is processed; otherwise, ending the short connection process. The long connection process may mean that after the sending end and the receiving end establish connection, the Socket channel can be kept to perform multiple communications, and the time for establishing and closing the Socket channel does not need to be calculated. The long connection process may determine whether there is a message to be processed in the message queue, and if there is a message to be processed, determine whether to allow the acquisition of the message in the message queue: if the acquisition is allowed, processing the message in the message queue; if the acquisition is not allowed, ending the long connection process; if no messages are pending, an infinite wait mode may be entered. And when the monitoring process determines that a new short connection process needs to be started, starting the new short connection process, and processing the message queue by the system according to the started long connection process and the new short connection process.
It is noted that although the steps of the methods of the present invention are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
In addition, in the present exemplary embodiment, a message queue processing apparatus is also provided. Referring to fig. 4, the message queue processing apparatus 400 includes: the flag determining unit 410 is configured to obtain a preset flag, and determine whether a monitoring process needs to be started at a block link point according to the preset flag; the job information obtaining unit 420 is configured to obtain job information corresponding to a message queue through the monitoring process if it is determined that the monitoring process needs to be started at the block chain node; the judging unit 430 is configured to judge whether a new short connection process needs to be started according to the job information; the starting unit 440 is configured to start a new short connection process to process the message queue according to the started long connection process and the new short connection process if it is determined that the new short connection process needs to be started.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the job information obtaining unit 420 is further configured to: and if the monitoring process is judged not to be started at the block chain node, directly executing a long connection process to process the message queue according to the long connection process.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the obtaining unit 420 is configured to: acquiring a query interface corresponding to the message queue based on the monitoring process; and acquiring the job information corresponding to the message queue according to the query interface.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the job information includes a depth of the message queue, a number status of all current connection processes of the message queue, and an operation processor utilization rate of the client corresponding to the block link point.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the determining unit 430 is configured to: judging whether the depth of the message queue exceeds a new short connection process starting threshold value or not based on the monitoring process; and if the depth of the message queue does not exceed the starting threshold of the new short connection process, ending the monitoring process.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the determining unit 430 is configured to: based on the monitoring process, if the depth of the message queue exceeds the new short connection process starting threshold, continuously judging whether the number state of all current connection processes of the message queue exceeds a total number of operation threshold; and when the number states of all the current connection processes of the message queue are determined to exceed the total number threshold of the jobs, ending the monitoring process.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the determining unit 430 is configured to: based on the monitoring process, if the number states of all the current connection processes of the message queue are determined not to exceed the total operation number threshold, whether the utilization rate of the operation processor of the client corresponding to the block link point exceeds the utilization rate threshold of the operation processor is continuously judged; if the utilization rate of the operation processor of the client corresponding to the block link point is determined to exceed the threshold of the utilization rate of the operation processor, ending the monitoring process; and if the utilization rate of the operation processor of the client corresponding to the block link point is determined not to exceed the utilization rate threshold of the operation processor, starting a new short connection process.
In an exemplary embodiment of the present invention, based on the foregoing scheme, the message queue processing apparatus 400 is configured to: judging whether the states of all the current connection processes of the message queue are in a locking state or a message waiting state; and if the current states of all the connection processes of the message queue are determined to be in a lock state or a message waiting state, sending warning information to the message queue so that the queue messages can send notification information to the outside.
The specific details of each module of the message queue processing apparatus have been described in detail in the corresponding message queue processing method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the message queue handling means are mentioned, this division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the invention. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the message queue processing method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 500 according to such an embodiment of the invention is described below with reference to fig. 5. The electronic device 500 shown in fig. 5 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the electronic device 500 is embodied in the form of a general purpose computing device. The components of the electronic device 500 may include, but are not limited to: the at least one processing unit 510, the at least one memory unit 520, a bus 530 connecting various system components (including the memory unit 520 and the processing unit 510), and a display unit 540.
Wherein the storage unit stores program code that is executable by the processing unit 510 to cause the processing unit 510 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 510 may execute step S210 shown in fig. 2, acquire a preset flag, and determine whether to start a monitoring process at a block link point according to the preset flag; step S220, if the monitoring process is judged to need to be started at the block chain node, acquiring operation information corresponding to the message queue in the block chain node through the monitoring process; step S230, judging whether a new short connection process needs to be started according to the operation information; step S240, if it is determined that a new short connection process needs to be started, a new short connection process is started to process the message queue according to the started long connection process and the new short connection process.
The storage unit 520 may include readable media in the form of volatile storage units, such as a random access memory unit (RAM)521 and/or a cache memory unit 522, and may further include a read only memory unit (ROM) 523.
The storage unit 520 may also include a program/utility 524 having a set (at least one) of program modules 525, such program modules 525 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 530 may be one or more of any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 500 may also communicate with one or more external devices 570 (e.g., keyboard, pointing device, Bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 500, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 500 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 550. Also, the electronic device 500 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 560. As shown, the network adapter 560 communicates with the other modules of the electronic device 500 over the bus 530. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above-mentioned "exemplary methods" section of the present description, when said program product is run on the terminal device.
Referring to fig. 6, a program product 600 for implementing the above message queue processing method according to an embodiment of the present invention is described, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A message queue processing method, comprising:
acquiring a preset mark, and judging whether a monitoring process needs to be started at a block link point or not according to the preset mark;
if the monitoring process is judged to need to be started at the block chain node, acquiring operation information corresponding to the message queue in the block chain node through the monitoring process;
judging whether a new short connection process needs to be started or not according to the operation information;
and if the fact that a new short connection process needs to be started is determined, starting the new short connection process to process the message queue according to the started long connection process and the new short connection process.
2. The message queue processing method according to claim 1, wherein if it is determined that the monitoring process needs to be started at the blockchain node, acquiring, by the monitoring process, job information corresponding to the message queue in the blockchain node further comprises:
and if the monitoring process is judged not to be started at the block chain node, directly executing a long connection process to process the message queue according to the long connection process.
3. The message queue processing method according to claim 1, wherein the acquiring, by the monitoring process, job information corresponding to the message queue includes:
acquiring a query interface corresponding to the message queue based on the monitoring process;
and acquiring the job information corresponding to the message queue according to the query interface.
4. The message queue processing method according to claim 1, wherein the job information includes a depth of the message queue, and the determining whether a new short connection process needs to be started according to the job information includes:
judging whether the depth of the message queue exceeds a new short connection process starting threshold value or not based on the monitoring process;
and if the depth of the message queue does not exceed the starting threshold of the new short connection process, ending the monitoring process.
5. The message queue processing method according to claim 4, wherein the job information further includes a number status of all current connection processes of the message queue, and the determining whether a new short connection process needs to be started according to the job information includes:
based on the monitoring process, if the depth of the message queue exceeds the new short connection process starting threshold, continuously judging whether the number state of all current connection processes of the message queue exceeds a total number of operation threshold;
and when the number states of all the current connection processes of the message queue are determined to exceed the total number threshold of the jobs, ending the monitoring process.
6. The message queue processing method according to claim 5, wherein the operation information further includes an operation processor utilization rate of the client corresponding to the block link point, and the determining whether a new short connection process needs to be started according to the operation information includes:
based on the monitoring process, if the number states of all the current connection processes of the message queue are determined not to exceed the total operation number threshold, whether the utilization rate of the operation processor of the client corresponding to the block link point exceeds the utilization rate threshold of the operation processor is continuously judged;
if the utilization rate of the operation processor of the client corresponding to the block link point is determined to exceed the threshold of the utilization rate of the operation processor, ending the monitoring process;
and if the utilization rate of the operation processor of the client corresponding to the block link point is determined not to exceed the utilization rate threshold of the operation processor, starting a new short connection process.
7. The message queue processing method according to any one of claims 4 to 6, characterized in that the method further comprises:
judging whether the states of all the current connection processes of the message queue are in a locking state or a message waiting state;
and if the current states of all the connection processes of the message queue are determined to be in a lock state or a message waiting state, sending warning information to the message queue so that the queue messages can send notification information to the outside.
8. A message queue processing apparatus, comprising:
the execution unit is used for acquiring a preset mark and executing a target event at a block link point according to the preset mark; wherein the target event comprises starting a monitoring process;
the acquisition unit is used for acquiring the job information corresponding to the message queue through the monitoring process if the target event is determined to be the starting of the monitoring process;
the judging unit is used for judging whether a new short connection process needs to be started or not according to the operation information;
and the starting unit is used for starting a new short connection process to process the message queue according to the started long connection process and the new short connection process if the new short connection process is determined to be required to be started.
9. An electronic device, comprising:
a processor; and
a memory having stored thereon computer readable instructions which, when executed by the processor, implement the message queue processing method of any of claims 1 to 7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out a message queue processing method according to any one of claims 1 to 7.
CN201910713837.3A 2019-08-02 2019-08-02 Message queue processing method and device, electronic equipment and storage medium Pending CN110659142A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910713837.3A CN110659142A (en) 2019-08-02 2019-08-02 Message queue processing method and device, electronic equipment and storage medium
PCT/CN2019/117686 WO2021022710A1 (en) 2019-08-02 2019-11-12 Message queue processing method, device, electronic apparatus, and computer readable non-volatile storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910713837.3A CN110659142A (en) 2019-08-02 2019-08-02 Message queue processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110659142A true CN110659142A (en) 2020-01-07

Family

ID=69036884

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910713837.3A Pending CN110659142A (en) 2019-08-02 2019-08-02 Message queue processing method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN110659142A (en)
WO (1) WO2021022710A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708586A (en) * 2020-06-22 2020-09-25 平安养老保险股份有限公司 Application starting configuration item loading method and device, computer equipment and storage medium
CN111930443A (en) * 2020-10-15 2020-11-13 杭州云链趣链数字科技有限公司 Operation and maintenance method, system, computer equipment and storage medium based on block chain
CN113704348A (en) * 2021-07-06 2021-11-26 中国科学院计算技术研究所数字经济产业研究院 Credit point management method based on distributed account book

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113032207A (en) * 2021-03-02 2021-06-25 广州虎牙科技有限公司 Application process monitoring method and device, electronic equipment and storage medium
CN113138868B (en) * 2021-04-28 2024-04-05 北京沃东天骏信息技术有限公司 Message processing method and device
CN114050983B (en) * 2021-10-26 2023-11-07 中国电信股份有限公司 Flow self-adaptive acquisition method and device, storage medium and electronic equipment
CN114500318B (en) * 2022-02-11 2024-02-06 中国工商银行股份有限公司 Batch operation monitoring method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886457A (en) * 2015-12-16 2017-06-23 泰康保险集团股份有限公司 Message queue processing method and processing device
WO2018112948A1 (en) * 2016-12-23 2018-06-28 深圳前海达闼云端智能科技有限公司 Block generation method and device, and blockchain network
CN109995666A (en) * 2019-04-12 2019-07-09 深圳市元征科技股份有限公司 A kind of method for message transmission and relevant apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2948700A1 (en) * 2015-08-11 2017-02-11 Txmq, Inc. Systems and methods for websphere mq performance metrics analysis
CN109670950B (en) * 2018-10-29 2023-09-15 平安科技(深圳)有限公司 Transaction monitoring method, device, equipment and storage medium based on blockchain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106886457A (en) * 2015-12-16 2017-06-23 泰康保险集团股份有限公司 Message queue processing method and processing device
WO2018112948A1 (en) * 2016-12-23 2018-06-28 深圳前海达闼云端智能科技有限公司 Block generation method and device, and blockchain network
CN109995666A (en) * 2019-04-12 2019-07-09 深圳市元征科技股份有限公司 A kind of method for message transmission and relevant apparatus

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111708586A (en) * 2020-06-22 2020-09-25 平安养老保险股份有限公司 Application starting configuration item loading method and device, computer equipment and storage medium
CN111708586B (en) * 2020-06-22 2023-06-20 平安养老保险股份有限公司 Application starting configuration item loading method and device, computer equipment and storage medium
CN111930443A (en) * 2020-10-15 2020-11-13 杭州云链趣链数字科技有限公司 Operation and maintenance method, system, computer equipment and storage medium based on block chain
CN113704348A (en) * 2021-07-06 2021-11-26 中国科学院计算技术研究所数字经济产业研究院 Credit point management method based on distributed account book
CN113704348B (en) * 2021-07-06 2023-06-30 中国科学院计算技术研究所数字经济产业研究院 Credit score management method based on distributed account book

Also Published As

Publication number Publication date
WO2021022710A1 (en) 2021-02-11

Similar Documents

Publication Publication Date Title
CN110659142A (en) Message queue processing method and device, electronic equipment and storage medium
CN105357038B (en) Monitor the method and system of cluster virtual machine
CN107729139B (en) Method and device for concurrently acquiring resources
CN110609755A (en) Message processing method, device, equipment and medium for cross-block chain node
CN112099935B (en) Task processing method and device
CN106020984B (en) Method and device for creating process in electronic equipment
US20230029198A1 (en) Scheduling complex jobs in a distributed network
CN110058926B (en) Method, apparatus, and computer-readable medium for processing GPU tasks
CN109299124B (en) Method and apparatus for updating a model
CN111078422A (en) Message processing method, message processing device, readable storage medium and electronic equipment
CN105373393A (en) Method for realizing hot plug of equipment in OS in non-event driven mode
CN107632893B (en) Message queue processing method and device
CN111694645B (en) Task processing method and related device in distributed task scheduling system
CN115904636A (en) Event distribution method, event distribution device, storage medium, and electronic apparatus
CN111949862B (en) Method and device for managing business task flow and electronic equipment
CN110362314B (en) Information processing method and device, computer readable medium and electronic equipment
CN113656239A (en) Monitoring method and device for middleware and computer program product
CN114816866A (en) Fault processing method and device, electronic equipment and storage medium
CN112596761A (en) Service update release method, device and related equipment
CN108288135B (en) System compatibility method and device, computer readable storage medium and electronic equipment
CN112749193A (en) Workflow processing method and device, storage medium and electronic equipment
CN112416698A (en) Monitoring system expansion method and device, storage medium and electronic equipment
US20220164219A1 (en) Processing system, processing method, higher-level system, lower-level system, higher-level program, and lower-level program
US11550624B2 (en) Method, device, and computer program product for executing a job in an application system
CN113391896B (en) Task processing method and device, storage medium and electronic equipment

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