CN112631806A - Asynchronous message arranging and scheduling method and device, electronic equipment and storage medium - Google Patents

Asynchronous message arranging and scheduling method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112631806A
CN112631806A CN202011587499.2A CN202011587499A CN112631806A CN 112631806 A CN112631806 A CN 112631806A CN 202011587499 A CN202011587499 A CN 202011587499A CN 112631806 A CN112631806 A CN 112631806A
Authority
CN
China
Prior art keywords
message
queue
primary
original
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011587499.2A
Other languages
Chinese (zh)
Other versions
CN112631806B (en
Inventor
刘瑜
文志鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202011587499.2A priority Critical patent/CN112631806B/en
Publication of CN112631806A publication Critical patent/CN112631806A/en
Application granted granted Critical
Publication of CN112631806B publication Critical patent/CN112631806B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention relates to a cloud storage technology, and discloses an asynchronous message arranging and scheduling method, which comprises the following steps: the method comprises the steps of obtaining original messages, arranging the original messages to obtain a primary message queue, grouping and packaging the primary message queue, searching a database to obtain a primary standard message, judging whether the logic relation of the primary standard message is legal or not, arranging the primary standard message to obtain a secondary message queue when the logic relation of the primary standard message is illegal, grouping and packaging the secondary message queue, searching the database to obtain a secondary standard message, and carrying out logic scheduling on the secondary standard message. Furthermore, the invention relates to a blockchain technique, wherein the original message can be obtained from a node in the blockchain. The invention also provides an asynchronous message arranging and scheduling device, electronic equipment and a computer readable storage medium. The invention can solve the problem of mess scheduling sequence disorder.

Description

Asynchronous message arranging and scheduling method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of cloud storage, in particular to an asynchronous message arranging and scheduling method, an asynchronous message arranging and scheduling device, electronic equipment and a computer readable storage medium.
Background
The intelligent scheduling platform obtains the service operation message flow of each service center by accessing each service center, and realizes the real-time monitoring and scheduling of the task queue of each post of the flow service. In the prior art, message arrangement is performed on service operation message streams of a service system, and sequential consumption is set for messages of all posts of the same stream, so that real-time monitoring and scheduling are realized. For example, a service may have three message packets created, captured, and submitted, and it is required to ensure that the three message packets are consumed in sequence. However, with a plurality of accessed systems and complex operation scenes at the front end, some systems can send a plurality of operation messages of the same service in a short time, and the sequence of the messages after reaching the intelligent scheduling platform is disordered, so that the former message is not consumed, and the latter message starts to be consumed, which affects real-time monitoring and scheduling.
Disclosure of Invention
The invention provides an asynchronous message arranging and scheduling method, an asynchronous message arranging and scheduling device and a computer readable storage medium, and mainly aims to solve the problem of mess scheduling sequence disorder.
In order to achieve the above object, the present invention provides an asynchronous message arranging and scheduling method, which includes:
acquiring an original message by using a preset distributed system, and storing the original message to a preset database and a preset storage system;
arranging the original messages in the storage system to form a primary message queue;
grouping and packaging the primary message queue, and searching the database according to the packaged message queue to obtain a primary standard message;
judging whether the logic relationship of the primary standard message is legal or not, when the logic relationship of the primary standard message is legal, performing logic scheduling on the primary standard message, and when the logic relationship of the primary standard message is illegal, arranging the primary standard message to obtain a secondary message queue;
and grouping and packaging the second-level message queue, searching the database according to the packaged message queue to obtain a second-level standard message, and performing logic scheduling on the second-level standard message.
Optionally, the obtaining, by using a preset distributed system, an original message and storing the original message in a preset database and storage system includes:
utilizing the distributed system to subscribe the original message of each service end in real time;
and storing the subscribed original message into a preset database, and storing the message serial number, the message ID and the message deadline in the original message into the storage system.
Optionally, the arranging the original messages in the storage system to form a primary message queue includes:
carrying out hash processing on the message serial number of the original message to obtain a hash value;
summarizing original messages with the same hash value to obtain task messages;
sequencing the task messages according to the message deadline of the original message to obtain a task queue;
and executing message distribution, application decoupling, asynchronous message and flow cutting operation on the task queue according to a preset message middleware to obtain the primary message queue.
Optionally, the packet packing of the primary message queue includes:
carrying out delay processing on the task messages in the primary message queue by using a preset first delay time;
and packaging and grouping the delayed task messages to obtain a plurality of work packages.
Optionally, the searching the database according to the packed message queue to obtain a first-level standard message includes:
delivering the work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the task message in the work package by using the thread in the thread pool, extracting the message with the same message ID in the database according to the message ID, and taking the message as a primary standard message.
Optionally, the arranging the primary standard messages to obtain a secondary message queue includes:
carrying out delay processing on the primary standard message according to a preset second delay time;
and arranging the primary standard message according to the message deadline and the message serial number in the primary standard message to obtain the secondary message queue.
Optionally, the grouping and packaging the second-level message queue, and searching the database according to the packaged message queue to obtain a second-level standard message, including:
packing the primary standard message in the secondary message queue to obtain a plurality of message work packets;
delivering the message work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the primary standard message in the message working packet by using the thread in the thread pool, and extracting the message with the same message ID in the database according to the message ID to obtain a secondary standard message.
In order to solve the above problem, the present invention further provides an asynchronous message arranging and scheduling apparatus, including:
the message storage module is used for acquiring an original message by using a preset distributed system and storing the original message to a preset database and a preset storage system;
the primary message arrangement module is used for arranging the original messages in the storage system to form a primary message queue;
the first-level message query module is used for grouping and packaging the first-level message queue and searching the database according to the packaged message queue to obtain a first-level standard message;
the second-level message arrangement module is used for judging whether the logic relationship of the first-level standard message is legal or not, carrying out logic scheduling on the first-level standard message when the logic relationship of the first-level standard message is legal, and arranging the first-level standard message to obtain a second-level message queue when the logic relationship of the first-level standard message is illegal;
and the second-level message query module is used for grouping and packaging the second-level message queue, searching the database according to the packaged message queue to obtain a second-level standard message, and performing logic scheduling on the second-level standard message.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the asynchronous message arranging and scheduling method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the asynchronous message arranging and scheduling method described above.
The method comprises the steps of arranging the original messages to obtain a primary message queue, grouping and packaging the primary message queue to obtain a primary standard message, arranging the primary standard message to obtain a secondary message queue when the logical relation of the primary standard message is illegal, grouping and packaging the secondary message queue to obtain a secondary standard message, and carrying out logical scheduling on the secondary standard message. The invention carries out two-stage message queue through time sequential signaling, judges whether the logic relationship of the first-stage standard message is legal or not, and considers the logic relationship between the messages, thereby ensuring that the message scheduling is more accurate. Therefore, the asynchronous message arranging and scheduling method, the asynchronous message arranging and scheduling device, the electronic equipment and the computer readable storage medium can solve the problem that the message scheduling sequence is disordered.
Drawings
Fig. 1 is a flowchart illustrating an asynchronous message arranging and scheduling method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart showing a detailed implementation of one of the steps in FIG. 1;
FIG. 3 is a schematic flow chart showing another step of FIG. 1;
FIG. 4 is a schematic flow chart showing another step of FIG. 1;
FIG. 5 is a schematic flow chart showing another step in FIG. 1;
FIG. 6 is a functional block diagram of an asynchronous message queuing and scheduling apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device for implementing the asynchronous message arranging and scheduling method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an asynchronous message arranging and scheduling method. The execution subject of the asynchronous message arranging and scheduling method includes, but is not limited to, at least one of electronic devices, such as a server and a terminal, which can be configured to execute the method provided by the embodiments of the present application. In other words, the asynchronous message arranging and scheduling method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flowchart of an asynchronous message arranging and scheduling method according to an embodiment of the present invention. In this embodiment, the asynchronous message arranging and scheduling method includes:
and S1, acquiring the original message by using a preset distributed system, and storing the original message to a preset database and storage system.
In the embodiment of the present invention, the original message may be a service operation flow message of a service end such as each branch office, a mobile end, an enterprise direct connection end, and the like in each field. The original message comprises information such as a message serial number, a message ID, message deadline, message content and the like.
Specifically, referring to fig. 2, the S1 includes:
s10, subscribing the original message of each service end in real time by using the distributed system;
s11, storing the subscribed original message into a preset database, and storing the message serial number, the message ID and the message deadline in the original message into the storage system.
The distributed system can be a Halo frame, a SPringBOOT frame and the like, and the embodiment of the invention acquires the original message from a service end in real time by using the Halo frame and the like and stores the original message in a database. The storage system may be a Remote Dictionary Server (Redis), a non-relational database such as SSDB, and the like. In the embodiment of the invention, Redis is a key-value storage system, and more values types are supported to be stored, including string (character string), list (linked list), set (set), hash (hash type), and the like. The preset database can be a relational database, including Oracle, SQLServer, and the like.
Furthermore, the embodiment of the invention can acquire the original message in real time through the distributed system, thereby ensuring the timeliness and the accuracy of the original message.
And S2, arranging the original messages in the storage system to form a primary message queue.
In this embodiment of the present invention, referring to fig. 3, the S2 includes:
s20, carrying out hash processing on the message serial number of the original message to obtain a hash value;
s21, summarizing the original messages with the same hash value to obtain task messages;
s22, sequencing the task messages according to the message deadline of the original message to obtain a task queue;
and S23, executing message distribution, application decoupling, asynchronous message and flow cutting operation on the task queue according to the preset message middleware to obtain the primary message queue.
In the embodiment of the invention, the original messages of the same message serial number are collected into the task message, so that the problem of sequence disorder caused by different sending time of the same service stream is effectively avoided.
The Hash (Hash) processing is to convert a message serial number with any length into a Hash value with a fixed length, the Hash processing is compression processing, so that the occupation of a storage space can be reduced, and meanwhile, the Hash processing is a one-way algorithm and is not easy to break, so that the safety is higher. The preset message middleware can be the currently published Kafka middleware, which is an open source stream processing platform, written by Java and Scala, and is a high-throughput distributed message system that can process all the information stream data in the task queue. The first-level message queue refers to mq (message queue) information, which adopts a first-in first-out data structure to place data (original messages) to be transmitted in a queue, and uses a queue mechanism to realize message transmission. The "first-in first-out" means that the information arranged in front of the queue information is processed in advance. In the embodiment of the invention, the application decoupling means that when one message is processed by a plurality of systems or modules correspondingly, the Kafka middleware can reduce the coupling among the systems or modules. The asynchronous message refers to the asynchronous processing of computer multithreading, and the thread of the current system or module is not blocked to wait for the completion of the processing, but the subsequent system or module is allowed to operate. The flow peak clipping means that under the condition of high concurrency, the Kafka middleware uses MQ information for buffering, disperses the information in the MQ information, and processes the information within a period of time to provide peak service processing capacity.
Furthermore, in the embodiment of the invention, the primary message queue is formed by arranging the original messages, so that the original messages are processed according to the queue, and the accuracy of asynchronous message processing is improved.
And S3, grouping and packaging the primary message queue, and searching the database according to the packaged message queue to obtain the primary standard message.
In this embodiment of the present invention, referring to fig. 4, the performing packet packing on the first-level message queue includes:
s30, delaying the task message in the primary message queue by using a preset first delay time;
and S31, packaging and grouping the delayed task messages to obtain a plurality of work packages.
The preset first delay time may be 10s, because the original message of the primary message queue comes from an MQ cluster, and the original message passing through the MQ cluster is asynchronous, which may cause delay and that the original message does not arrive according to the production time sequence, the original message with a disordered sequence is avoided being acquired, and the original message of the latest 10 seconds is not read, which is equivalent to processing after delaying for 10 s.
In detail, the searching the database according to the packed message queue to obtain a first-level standard message includes:
delivering the work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the task message in the work package by using the thread in the thread pool, extracting the message with the same message ID in the database according to the message ID, and taking the message as a primary standard message.
The preset reorganization executor may be Batch processing work (Batch job), and the reorganization executor is configured to call a thread in a thread pool to process the work package.
Furthermore, in the embodiment of the invention, the first-level standard message is obtained by grouping and packaging the first-level message queue and searching the database according to the packaged first-level message queue, so that the accuracy of message processing is improved.
And S4, judging whether the logic relation of the primary standard message is legal.
In the embodiment of the present invention, the logical relationship refers to a causal relationship, for example, the message a is consumed according to the sequence of creation, capture and submission, that is, the message a is created first, and then the teller captures the message a, and then the message a is submitted, and when the sequence is correct and complete, the logical relationship is legal.
And when the logic relation of the primary standard message is legal, executing S5 to perform logic scheduling on the primary standard message.
The logic scheduling refers to performing sequential consumption according to a causal relationship, so as to complete scheduling of the messages.
And when the logic relation of the primary standard message is illegal, executing S6 to arrange the primary standard message to obtain a secondary message queue.
In detail, referring to fig. 5, the S6 includes:
s60, delaying the primary standard message according to a preset second delay time;
s61, arranging the first-level standard message according to the message deadline and the message serial number in the first-level standard message to obtain the second-level message queue.
Wherein the preset second delay time may be 30 s. In the embodiment of the invention, the first-level standard message with illegal logic relationship (namely, incorrect or incomplete causal relationship sequence) is subjected to delay processing, so that a more complete message is obtained.
And S7, grouping and packaging the secondary message queue, searching the database according to the packaged message queue to obtain a secondary standard message, and performing logic scheduling on the secondary standard message.
In detail, the grouping and packaging the second-level message queue, and searching the database according to the packaged message queue to obtain a second-level standard message includes:
packing the primary standard message in the secondary message queue to obtain a plurality of message work packets;
delivering the message work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the primary standard message in the message working packet by using the thread in the thread pool, and extracting the message with the same message ID in the database according to the message ID to obtain a secondary standard message.
In the embodiment of the invention, the secondary message queue can delay for a longer time, so that more complete messages are obtained, and the scheduling of the messages is more accurate.
The method comprises the steps of arranging the original messages to obtain a primary message queue, grouping and packaging the primary message queue to obtain a primary standard message, arranging the primary standard message to obtain a secondary message queue when the logical relation of the primary standard message is illegal, grouping and packaging the secondary message queue to obtain a secondary standard message, and carrying out logical scheduling on the secondary standard message. The invention carries out two-stage message queue through time sequential signaling, judges whether the logic relationship of the first-stage standard message is legal or not, and considers the logic relationship between the messages, thereby ensuring that the message scheduling is more accurate. Therefore, the invention can solve the problem of mess scheduling sequence disorder.
Fig. 6 is a functional block diagram of an asynchronous message queuing and scheduling apparatus according to an embodiment of the present invention.
The asynchronous message arranging and scheduling device 100 of the present invention may be installed in an electronic device. According to the implemented functions, the asynchronous message arranging and scheduling device 100 may include a message storage module 101, a primary message arranging module 102, a primary message querying module 103, a secondary message arranging module 104, and a secondary message querying module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the message storage module 101 is configured to acquire an original message by using a preset distributed system, and store the original message to a preset database and a preset storage system.
In the embodiment of the present invention, the original message may be a service operation flow message of a service end such as each branch office, a mobile end, an enterprise direct connection end, and the like in each field. The original message comprises information such as a message serial number, a message ID, message deadline, message content and the like.
Specifically, the message storage module 101 stores the original message to a preset database and storage system through the following operations:
utilizing the distributed system to subscribe the original message of each service end in real time;
and storing the subscribed original message into a preset database, and storing the message serial number, the message ID and the message deadline in the original message into the storage system.
The distributed system can be a Halo frame, a SPringBOOT frame and the like, and the embodiment of the invention acquires the original message from a service end in real time by using the Halo frame and the like and stores the original message in a database. The storage system may be a non-relational database such as a Remote Dictionary Server (Redis) and a Secure Storage Database (SSDB). In the embodiment of the invention, Redis is a key-value storage system, and more values types are supported to be stored, including string (character string), list (linked list), set (set), hash (hash type), and the like. The preset database can be a relational database, including Oracle, SQLServer, and the like.
Furthermore, the embodiment of the invention can acquire the original message in real time through the distributed system, thereby ensuring the timeliness and the accuracy of the original message.
The primary message arrangement module 102 is configured to arrange the original messages in the storage system to form a primary message queue.
In this embodiment of the present invention, the coordinate calculation module 102 obtains a primary message queue by:
carrying out hash processing on the message serial number of the original message to obtain a hash value;
summarizing original messages with the same hash value to obtain task messages;
sequencing the task messages according to the message deadline of the original message to obtain a task queue;
and executing message distribution, application decoupling, asynchronous message and flow cutting operation on the task queue according to a preset message middleware to obtain the primary message queue.
In the embodiment of the invention, the original messages of the same message serial number are collected into the task message, so that the problem of sequence disorder caused by different sending time of the same service stream is effectively avoided.
The Hash (Hash) processing is to convert a message serial number with any length into a Hash value with a fixed length, the Hash processing is compression processing, so that the occupation of a storage space can be reduced, and meanwhile, the Hash processing is a one-way algorithm and is not easy to break, so that the safety is higher. The preset message middleware can be the currently published Kafka middleware, which is an open source stream processing platform, written by Java and Scala, and is a high-throughput distributed message system that can process all the information stream data in the task queue. The first-level message queue refers to mq (message queue) information, which adopts a first-in first-out data structure to place data (original messages) to be transmitted in a queue, and uses a queue mechanism to realize message transmission. The "first-in first-out" means that the information arranged in front of the queue information is processed in advance. In the embodiment of the invention, the application decoupling means that when one message is processed by a plurality of systems or modules correspondingly, the Kafka middleware can reduce the coupling among the systems or modules. The asynchronous message refers to the asynchronous processing of computer multithreading, and the thread of the current system or module is not blocked to wait for the completion of the processing, but the subsequent system or module is allowed to operate. The flow peak clipping means that under the condition of high concurrency, the Kafka middleware uses MQ information for buffering, disperses the information in the MQ information, and processes the information within a period of time to provide peak service processing capacity.
Furthermore, in the embodiment of the invention, the primary message queue is formed by arranging the original messages, so that the original messages are processed according to the queue, and the accuracy of asynchronous message processing is improved.
The primary message query module 103 is configured to perform packet packing on the primary message queue, and search the database according to the packed message queue to obtain a primary standard message.
Preferably, the primary message query module 103 performs packet packing on the primary message queue by:
carrying out delay processing on the task messages in the primary message queue by using a preset first delay time;
and packaging and grouping the delayed task messages to obtain a plurality of work packages.
The preset first delay time may be 10s, because the original message of the primary message queue comes from an MQ cluster, and the original message passing through the MQ cluster is asynchronous, which may cause delay and that the original message does not arrive according to the production time sequence, the original message with a disordered sequence is avoided being acquired, and the original message of the latest 10 seconds is not read, which is equivalent to processing after delaying for 10 s.
In detail, the primary message query module 103 obtains a primary standard message by:
delivering the work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the task message in the work package by using the thread in the thread pool, extracting the message with the same message ID in the database according to the message ID, and taking the message as a primary standard message.
The preset reorganization executor may be Batch processing work (Batch job), and the reorganization executor is configured to call a thread in a thread pool to process the work package.
Furthermore, in the embodiment of the invention, the first-level standard message is obtained by grouping and packaging the first-level message queue and searching the database according to the packaged first-level message queue, so that the accuracy of message processing is improved.
The secondary message arranging module 104 is configured to determine whether the logical relationship of the primary standard message is legal, perform logical scheduling on the primary standard message when the logical relationship of the primary standard message is legal, and arrange the primary standard message when the logical relationship of the primary standard message is illegal to obtain a secondary message queue.
In the embodiment of the present invention, the logical relationship refers to a causal relationship, for example, the message a is consumed according to the sequence of creation, capture and submission, that is, the message a is created first, and then the teller captures the message a, and then the message a is submitted, and when the sequence is correct and complete, the logical relationship is legal.
And when the logic relation of the primary standard message is legal, performing logic scheduling on the primary standard message.
The logic scheduling refers to performing sequential consumption according to a causal relationship, so as to complete scheduling of the messages.
And when the logic relation of the primary standard messages is illegal, arranging the primary standard messages to obtain a secondary message queue.
In detail, the secondary message queuing module 104 obtains a secondary message queue by:
carrying out delay processing on the primary standard message according to a preset second delay time;
and arranging the primary standard message according to the message deadline and the message serial number in the primary standard message to obtain the secondary message queue.
Wherein the preset second delay time may be 30 s. In the embodiment of the invention, the first-level standard message with illegal logic relationship (namely, incorrect or incomplete causal relationship sequence) is subjected to delay processing, so that a more complete message is obtained.
The secondary message query module 105 is configured to perform packet packing on the secondary message queue, search the database according to the packed message queue to obtain a secondary standard message, and perform logic scheduling on the secondary standard message.
In detail, the secondary message query module 105 obtains the secondary standard message by:
packing the primary standard message in the secondary message queue to obtain a plurality of message work packets;
delivering the message work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the primary standard message in the message working packet by using the thread in the thread pool, and extracting the message with the same message ID in the database according to the message ID to obtain a secondary standard message.
In the embodiment of the invention, the secondary message queue can delay for a longer time, so that more complete messages are obtained, and the scheduling of the messages is more accurate.
Fig. 7 is a schematic structural diagram of an electronic device implementing an asynchronous message arranging and scheduling method according to an embodiment of the present invention.
The electronic device 1 may comprise a processor 10, a memory 11 and a bus, and may further comprise a computer program, such as an asynchronous message queuing and scheduling program 12, stored in the memory 11 and operable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. The memory 11 may also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device 1. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device 1. The memory 11 may be used not only for storing application software installed in the electronic device 1 and various types of data, such as codes of the asynchronous message arrangement and scheduling program 12, but also for temporarily storing data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device 1 by running or executing programs or modules (such as asynchronous message arrangement and scheduling programs) stored in the memory 11 and calling data stored in the memory 11.
The bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 7 only shows an electronic device with components, and it will be understood by a person skilled in the art that the structure shown in fig. 7 does not constitute a limitation of the electronic device 1, and may comprise fewer or more components than shown, or a combination of certain components, or a different arrangement of components.
For example, although not shown, the electronic device 1 may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so as to implement functions of charge management, discharge management, power consumption management, and the like through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device 1 may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device 1 may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used for establishing a communication connection between the electronic device 1 and other electronic devices.
Optionally, the electronic device 1 may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable for displaying information processed in the electronic device 1 and for displaying a visualized user interface, among other things.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The asynchronous message queuing and scheduling program 12 stored in the memory 11 of the electronic device 1 is a combination of instructions that, when executed in the processor 10, enable:
acquiring an original message by using a preset distributed system, and storing the original message to a preset database and a preset storage system;
arranging the original messages in the storage system to form a primary message queue;
grouping and packaging the primary message queue, and searching the database according to the packaged message queue to obtain a primary standard message;
judging whether the logic relationship of the primary standard message is legal or not, when the logic relationship of the primary standard message is legal, performing logic scheduling on the primary standard message, and when the logic relationship of the primary standard message is illegal, arranging the primary standard message to obtain a secondary message queue;
and grouping and packaging the second-level message queue, searching the database according to the packaged message queue to obtain a second-level standard message, and performing logic scheduling on the second-level standard message.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiments corresponding to fig. 1 to fig. 5, which is not repeated herein.
Further, the integrated modules/units of the electronic device 1, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring an original message by using a preset distributed system, and storing the original message to a preset database and a preset storage system;
arranging the original messages in the storage system to form a primary message queue;
grouping and packaging the primary message queue, and searching the database according to the packaged message queue to obtain a primary standard message;
judging whether the logic relationship of the primary standard message is legal or not, when the logic relationship of the primary standard message is legal, performing logic scheduling on the primary standard message, and when the logic relationship of the primary standard message is illegal, arranging the primary standard message to obtain a secondary message queue;
and grouping and packaging the second-level message queue, searching the database according to the packaged message queue to obtain a second-level standard message, and performing logic scheduling on the second-level standard message.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. An asynchronous message arranging and scheduling method, the method comprising:
acquiring an original message by using a preset distributed system, and storing the original message to a preset database and a preset storage system;
arranging the original messages in the storage system to form a primary message queue;
grouping and packaging the primary message queue, and searching the database according to the packaged message queue to obtain a primary standard message;
judging whether the logic relationship of the primary standard message is legal or not, when the logic relationship of the primary standard message is legal, performing logic scheduling on the primary standard message, and when the logic relationship of the primary standard message is illegal, arranging the primary standard message to obtain a secondary message queue;
and grouping and packaging the second-level message queue, searching the database according to the packaged message queue to obtain a second-level standard message, and performing logic scheduling on the second-level standard message.
2. The asynchronous message queuing and scheduling method of claim 1 wherein said obtaining the original message using a predetermined distributed system and storing the original message to a predetermined database and storage system comprises:
utilizing the distributed system to subscribe the original message of each service end in real time;
and storing the subscribed original message into a preset database, and storing the message serial number, the message ID and the message deadline in the original message into the storage system.
3. The asynchronous message queuing and scheduling method of claim 1 wherein said queuing original messages in said storage system to form a primary message queue comprises:
carrying out hash processing on the message serial number of the original message to obtain a hash value;
summarizing original messages with the same hash value to obtain task messages;
sequencing the task messages according to the message deadline of the original message to obtain a task queue;
and executing message distribution, application decoupling, asynchronous message and flow cutting operation on the task queue according to a preset message middleware to obtain the primary message queue.
4. The asynchronous message queuing and scheduling method of claim 1 wherein said packetizing said primary message queue comprises:
carrying out delay processing on the task messages in the primary message queue by using a preset first delay time;
and packaging and grouping the delayed task messages to obtain a plurality of work packages.
5. The asynchronous message queuing and scheduling method of claim 1 wherein said searching said database according to a packed message queue to obtain a primary standard message comprises:
delivering the work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the task message in the work package by using the thread in the thread pool, extracting the message with the same message ID in the database according to the message ID, and taking the message as a primary standard message.
6. The asynchronous message queuing and scheduling method of any of claims 1 to 5 wherein said queuing said primary standard message to obtain a secondary message queue comprises:
carrying out delay processing on the primary standard message according to a preset second delay time;
and arranging the primary standard message according to the message deadline and the message serial number in the primary standard message to obtain the secondary message queue.
7. The asynchronous message queuing and scheduling method of any of claims 1 to 5 wherein said packing said secondary message queue in packets and looking up said database according to the packed message queue to obtain a secondary standard message comprises:
packing the primary standard message in the secondary message queue to obtain a plurality of message work packets;
delivering the message work package to a preset thread pool by using a preset reorganization actuator;
and extracting the message ID of the primary standard message in the message working packet by using the thread in the thread pool, and extracting the message with the same message ID in the database according to the message ID to obtain a secondary standard message.
8. An asynchronous message queuing and scheduling apparatus, the apparatus comprising:
the message storage module is used for acquiring an original message by using a preset distributed system and storing the original message to a preset database and a preset storage system;
the primary message arrangement module is used for arranging the original messages in the storage system to form a primary message queue;
the first-level message query module is used for grouping and packaging the first-level message queue and searching the database according to the packaged message queue to obtain a first-level standard message;
the second-level message arrangement module is used for judging whether the logic relationship of the first-level standard message is legal or not, carrying out logic scheduling on the first-level standard message when the logic relationship of the first-level standard message is legal, and arranging the first-level standard message to obtain a second-level message queue when the logic relationship of the first-level standard message is illegal;
and the second-level message query module is used for grouping and packaging the second-level message queue, searching the database according to the packaged message queue to obtain a second-level standard message, and performing logic scheduling on the second-level standard message.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the asynchronous message queuing and scheduling method of any one of claims 1 to 7.
10. A computer-readable storage medium, storing a computer program, wherein the computer program, when executed by a processor, implements the asynchronous message ordering and scheduling method according to any one of claims 1 to 7.
CN202011587499.2A 2020-12-28 2020-12-28 Asynchronous message arrangement and scheduling method and device, electronic equipment and storage medium Active CN112631806B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011587499.2A CN112631806B (en) 2020-12-28 2020-12-28 Asynchronous message arrangement and scheduling method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011587499.2A CN112631806B (en) 2020-12-28 2020-12-28 Asynchronous message arrangement and scheduling method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112631806A true CN112631806A (en) 2021-04-09
CN112631806B CN112631806B (en) 2024-04-23

Family

ID=75285775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011587499.2A Active CN112631806B (en) 2020-12-28 2020-12-28 Asynchronous message arrangement and scheduling method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112631806B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113163009A (en) * 2021-04-20 2021-07-23 平安消费金融有限公司 Data transmission method, device, electronic equipment and storage medium
CN113687928A (en) * 2021-08-03 2021-11-23 广州华多网络科技有限公司 Message scheduling control method and corresponding device, equipment and medium thereof
CN113704258A (en) * 2021-08-20 2021-11-26 辽宁振兴银行股份有限公司 Method for storing transaction messages based on MongoDB database

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391271A (en) * 2017-05-17 2017-11-24 阿里巴巴集团控股有限公司 A kind of delayed tasks triggering method and device based on Message Queuing system
CN107656825A (en) * 2017-09-01 2018-02-02 上海艾融软件股份有限公司 Message treatment method, apparatus and system
CN111045839A (en) * 2019-12-04 2020-04-21 中国建设银行股份有限公司 Sequence calling method and device based on two-phase transaction message in distributed environment
CN112084486A (en) * 2020-09-08 2020-12-15 中国平安财产保险股份有限公司 User information verification method and device, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107391271A (en) * 2017-05-17 2017-11-24 阿里巴巴集团控股有限公司 A kind of delayed tasks triggering method and device based on Message Queuing system
CN107656825A (en) * 2017-09-01 2018-02-02 上海艾融软件股份有限公司 Message treatment method, apparatus and system
CN111045839A (en) * 2019-12-04 2020-04-21 中国建设银行股份有限公司 Sequence calling method and device based on two-phase transaction message in distributed environment
CN112084486A (en) * 2020-09-08 2020-12-15 中国平安财产保险股份有限公司 User information verification method and device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113163009A (en) * 2021-04-20 2021-07-23 平安消费金融有限公司 Data transmission method, device, electronic equipment and storage medium
CN113687928A (en) * 2021-08-03 2021-11-23 广州华多网络科技有限公司 Message scheduling control method and corresponding device, equipment and medium thereof
CN113687928B (en) * 2021-08-03 2024-03-22 广州华多网络科技有限公司 Message scheduling control method and corresponding device, equipment and medium thereof
CN113704258A (en) * 2021-08-20 2021-11-26 辽宁振兴银行股份有限公司 Method for storing transaction messages based on MongoDB database
CN113704258B (en) * 2021-08-20 2023-12-26 辽宁振兴银行股份有限公司 Method for storing transaction messages based on MongoDB database

Also Published As

Publication number Publication date
CN112631806B (en) 2024-04-23

Similar Documents

Publication Publication Date Title
CN112631806A (en) Asynchronous message arranging and scheduling method and device, electronic equipment and storage medium
CN111723727A (en) Cloud monitoring method and device based on edge computing, electronic equipment and storage medium
CN111651471B (en) Target data query method and device, electronic equipment and storage medium
CN113163009A (en) Data transmission method, device, electronic equipment and storage medium
CN110928905B (en) Data processing method and device
CN112395251A (en) Intelligent analysis method and device for data file, electronic equipment and storage medium
CN111813573A (en) Communication method of management platform and robot software and related equipment thereof
CN112667480A (en) Dynamic monitoring method and device for business data, electronic equipment and storage medium
CN113890712A (en) Data transmission method and device, electronic equipment and readable storage medium
CN112702228A (en) Service current limiting response method and device, electronic equipment and readable storage medium
CN107784085B (en) Data list exporting method and terminal thereof
CN111124801B (en) Intelligent system resource monitoring method and device and computer readable storage medium
CN112256783A (en) Data export method and device, electronic equipment and storage medium
CN110807050B (en) Performance analysis method, device, computer equipment and storage medium
CN112015815B (en) Data synchronization method, device and computer readable storage medium
CN114157679A (en) Cloud-native-based distributed application monitoring method, device, equipment and medium
CN111522707A (en) Big data platform scheduling early warning method and device and computer readable storage medium
CN114697316B (en) Batch downloading method, device and equipment of data and computer readable medium
CN104217314A (en) Routing information capturing method and device
CN111401819B (en) Intersystem data pushing method and system
CN112631675A (en) Workflow configuration method, device, equipment and computer readable storage medium
CN113452703B (en) Combined communication request response method and device, electronic equipment and readable storage medium
CN113326421B (en) Data identification method and device for record carrier, electronic equipment and storage medium
CN116755637B (en) Transaction data storage method, device, equipment and medium
CN115348321B (en) Data acquisition method and related device based on flow control

Legal Events

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