Distributed system abnormal message forwarding control method, device, equipment and medium

By waiting for notification from the business thread in a distributed system, the problem of uncontrollable asynchronous message replication timing is solved, ensuring the consistency of the state of the master and slave node and the stability of the application.

CN118677943BActive Publication Date: 2024-12-06ARCHFORCE FINANCIAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411155182.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-12-06
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

In a distributed system, the parallel forwarding method of asynchronous message replication causes the forwarding timing of the message to be uncontrollable, and the slave node may complete the message processing before the master node.

Method used

By starting the submit thread when the master node receives the pending message, the message is submitted to the business thread and forwarding thread at the application side at the same time. The business thread processes the message and determines whether it is an exception message. The forwarding thread adds an exception identifier according to the processing results and forwards it to the slave node , the exception message will not be submitted after receiving the node.

Benefits of technology

Ensure that the number and content of messages received and processed by the master and slave nodes are the same, avoid application exceptions caused by abnormal messages, and ensure the consistency of the status of the master and slave nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677943B_ABST
    Figure CN118677943B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of communication technology, and provides a distributed system abnormal message forwarding control method, device, equipment and medium. The method can first determine whether a message to be processed is an abnormal message based on the processing result of the message to be processed by a business thread, and then the business thread sends an abnormal message notification to a forwarding thread. After receiving the notification, the forwarding thread adds an abnormal identifier to the abnormal message and then forwards it to a slave node. Since the forwarding thread waits for the notification before forwarding the message, the phenomenon that the abnormal message has been forwarded to the slave node but the application processing corresponding to the master node has not been completed will not occur; the slave node does not submit the message with the abnormal identifier to the application program, so that the abnormal message is also forwarded, that is, the number and content of the messages received and processed by the master and slave nodes are the same, so as to ensure the consistency of the master and slave node states, but the slave node does not submit the abnormal message to the application, so even if the abnormal message is forwarded to the slave node, it will not cause application abnormality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, device, equipment and medium for controlling abnormal message forwarding in a distributed system. Background Art

[0002] In the prior art, for distributed systems, the asynchronous message replication of distributed message middleware usually adopts the parallel forwarding method, that is, the business processing and forwarding processes of the message are carried out simultaneously. The advantage of this solution is that the forwarding delay is low, and there is no need to wait for the business processing to be completed before forwarding, and the forwarding process will not block the message processing process.

[0003] However, in the above processing method, the forwarding progress of the message is not controlled, and the business processing process cannot control the timing of forwarding, so it may happen that the slave node completes the message processing before the master node. Summary of the invention

[0004] In view of the above, it is necessary to provide a method, device, equipment and medium for controlling the forwarding of abnormal messages in a distributed system, aiming to solve the problem that the timing of forwarding abnormal messages in a distributed system cannot be controlled.

[0005] A distributed system abnormal message forwarding control method is applied to a distributed system, wherein the distributed system includes a master node, a slave node and an application end; the distributed system abnormal message forwarding control method includes:

[0006] When the master node receives a message to be processed, the master node starts a delivery thread to deliver the message to be processed to the service thread of the application end and the forwarding thread of the master node at the same time;

[0007] The service thread processes the message to be processed to obtain a processing result, and determines whether the message to be processed is an abnormal message according to the processing result;

[0008] When it is determined that the message to be processed is an abnormal message, the service thread sends an abnormal message notification to the forwarding thread;

[0009] When the forwarding thread receives the abnormal message notification, the forwarding thread adds an abnormal identifier to the message to be processed to obtain a target message, and forwards the target message to the slave node;

[0010] When the slave node receives the target message and identifies the exception identifier, the slave node does not submit the target message to the application.

[0011] According to a preferred embodiment of the present invention, after determining whether the message to be processed is an abnormal message according to the processing result, the method further includes:

[0012] When it is determined that the message to be processed is not the abnormal message, the service thread sends a notification of normal processing completion of the message to be processed to the forwarding thread.

[0013] According to a preferred embodiment of the present invention, after the master node starts a delivery thread to deliver the to-be-processed message to the service thread of the application end and the forwarding thread of the master node at the same time, the method further includes:

[0014] When the forwarding thread receives the message to be processed, the forwarding thread obtains a preconfigured message format;

[0015] The forwarding thread encapsulates the message to be processed based on the message format;

[0016] After completing the encapsulation, the forwarding thread waits for the service thread to send a notification;

[0017] The notification sent includes the abnormal message notification and the normal processing completion notification.

[0018] According to a preferred embodiment of the present invention, the service thread sending an abnormal message notification to the forwarding thread includes:

[0019] When the pending message is processed abnormally, the service thread generates an abnormal sequence number;

[0020] The service thread sends the exception message notification to the forwarding thread based on the exception sequence number.

[0021] According to a preferred embodiment of the present invention, the forwarding thread adds an exception identifier to the message to be processed to obtain a target message, including:

[0022] The forwarding thread adds the exception identifier to the message header of the message to be processed to obtain the target message.

[0023] According to a preferred embodiment of the present invention, when the forwarding thread receives the abnormal message notification, the method further includes:

[0024] The forwarding thread rolls back the application end to a state before processing the pending message.

[0025] According to a preferred embodiment of the present invention, after the service thread sends a notification to the forwarding thread that the to-be-processed message has been processed normally, the method further includes:

[0026] The forwarding thread forwards the encapsulated message to be processed to the slave node;

[0027] When the slave node receives the encapsulated message to be processed, the slave node submits the encapsulated message to be processed to the application.

[0028] A distributed system abnormal message forwarding control device runs in a distributed system, wherein the distributed system includes a master node, a slave node and an application end; the distributed system abnormal message forwarding control device includes:

[0029] The master node is used to start a delivery thread to deliver the message to be processed to the service thread of the application end and the forwarding thread of the master node at the same time when the master node receives the message to be processed;

[0030] The business thread is used to process the message to be processed to obtain a processing result, and determine whether the message to be processed is an abnormal message according to the processing result;

[0031] The service thread is further configured to send an abnormal message notification to the forwarding thread when it is determined that the message to be processed is an abnormal message;

[0032] The forwarding thread is used for adding an exception identifier to the message to be processed to obtain a target message when the forwarding thread receives the exception message notification, and forwarding the target message to the slave node;

[0033] The slave node is used for not submitting the target message to the application when the slave node receives the target message and identifies the abnormal identifier.

[0034] A computer device, comprising:

[0035] a memory storing at least one instruction; and

[0036] The processor executes the instructions stored in the memory to implement the distributed system abnormal message forwarding control method.

[0037] A computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in a computer device to implement the distributed system abnormal message forwarding control method.

[0038] It can be seen from the above technical scheme that the present invention can first determine whether the message to be processed is an abnormal message based on the processing result of the message to be processed by the business thread, and then the business thread sends an abnormal message notification to the forwarding thread. After receiving the notification, the forwarding thread adds an abnormal identifier to the abnormal message and then forwards the obtained target message to the slave node. Since the forwarding thread waits for the notification before forwarding the message, the abnormal message will not be forwarded to the slave node but the application processing corresponding to the master node has not been completed. The slave node does not submit the message with the abnormal identifier to the application program. In this way, the abnormal message is also forwarded, that is, the number and content of the messages received and processed by the master and slave nodes are the same to ensure the consistency of the master and slave node states, but the slave node does not submit the abnormal message to the application. Therefore, even if the abnormal message is forwarded to the slave node, it will not cause application abnormality. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 It is a flow chart of a preferred embodiment of a distributed system abnormal message forwarding control method of the present invention;

[0040] Figure 2 It is a functional module diagram of a preferred embodiment of the abnormal message forwarding control device of a distributed system of the present invention;

[0041] Figure 3 It is a structural diagram of a computer device of a preferred embodiment of the present invention for implementing a distributed system abnormal message forwarding control method. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0043] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of a distributed system abnormal message forwarding control method of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.

[0044] The distributed system abnormal message forwarding control method is applied to one or more computer devices, and the computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0045] The computer device may be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.

[0046] The computer device may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.

[0047] The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0048] Among them, Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0049] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0050] The network where the computer device is located includes but is not limited to the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (VPN), etc.

[0051] The distributed system abnormal message forwarding control method described in this embodiment is applied to a distributed system, and the distributed system includes a master node, a slave node and an application end. The distributed system abnormal message forwarding control method includes:

[0052] S10, when the master node receives a message to be processed, the master node starts a delivery thread to deliver the message to be processed to the business thread of the application end and the forwarding thread of the master node at the same time.

[0053] In this embodiment, the master node refers to a node in the distributed system that actively forwards received messages to the outside.

[0054] In this embodiment, the slave node refers to a node in the distributed system that receives a message forwarded by the master node.

[0055] S11, the business thread processes the message to be processed to obtain a processing result, and determines whether the message to be processed is an abnormal message according to the processing result.

[0056] In this embodiment, the processing of the to-be-processed message by the service thread refers to the process of applying the message.

[0057] In this embodiment, when the message to be processed is normal, normal application processing can be performed and the processing result can be obtained; when the message to be processed is abnormal, normal application processing cannot be performed, and the processing result will also show abnormality.

[0058] Therefore, whether the message to be processed is an abnormal message can be determined through the processing result.

[0059] In this embodiment, after determining whether the message to be processed is an abnormal message according to the processing result, the method further includes:

[0060] When it is determined that the message to be processed is not the abnormal message, the service thread sends a notification of normal processing completion of the message to be processed to the forwarding thread.

[0061] In the above embodiment, according to different notifications sent by the service thread to the forwarding thread, the forwarding thread will perform targeted processing.

[0062] In this embodiment, after the master node starts the delivery thread to deliver the to-be-processed message to the service thread of the application end and the forwarding thread of the master node at the same time, the method further includes:

[0063] When the forwarding thread receives the message to be processed, the forwarding thread obtains a preconfigured message format;

[0064] The forwarding thread encapsulates the message to be processed based on the message format;

[0065] After completing the encapsulation, the forwarding thread waits for the service thread to send a notification;

[0066] The notification sent includes the abnormal message notification and the normal processing completion notification.

[0067] In the above embodiment, the forwarding thread first encapsulates the message to be processed into a message in a specified format to facilitate subsequent processing.

[0068] Furthermore, after completing the encapsulation, the forwarding thread does not directly forward the encapsulated message to the slave node, but waits for the notification from the business thread, and determines how to proceed next based on the notification from the business thread, so as to avoid forwarding unprocessed exception messages to the slave node, and at the same time avoid the problem that the slave node completes message processing before the master node (in the prior art, the business thread can start processing after the master node delivers the message, but because the master node will also forward the message to the slave node, and the slave node will deliver the message to the application, at this time, if the business thread processes slowly and the application corresponding to the slave node processes quickly, the slave node will complete message processing before the master node).

[0069] S12: When it is determined that the message to be processed is an abnormal message, the service thread sends an abnormal message notification to the forwarding thread.

[0070] In this embodiment, the service thread sending an exception message notification to the forwarding thread includes:

[0071] When the pending message is processed abnormally, the service thread generates an abnormal sequence number;

[0072] The service thread sends the exception message notification to the forwarding thread based on the exception sequence number.

[0073] Through the above embodiment, when an abnormal message is received, an abnormal message notification can be sent to the forwarding thread, so that the forwarding thread can respond to the abnormal message in a targeted manner.

[0074] S13, when the forwarding thread receives the abnormal message notification, the forwarding thread adds an abnormal identifier to the message to be processed to obtain a target message, and forwards the target message to the slave node.

[0075] In this embodiment, the forwarding thread adds an exception identifier to the message to be processed to obtain a target message, including:

[0076] The forwarding thread adds the exception identifier to the message header of the message to be processed to obtain the target message.

[0077] The exception flag can be custom configured.

[0078] Through the above embodiments, abnormal messages can be marked so that the slave node can recognize the message abnormality and perform targeted processing.

[0079] In this embodiment, when the forwarding thread receives the abnormal message notification, the method further includes:

[0080] The forwarding thread rolls back the application end to a state before processing the pending message.

[0081] Through the above embodiment, the business layer can be restored to the state before processing the abnormal message. Since the rollback is very fast, it hardly affects the normal business process and the user can hardly perceive it.

[0082] S14, when the slave node receives the target message and identifies the abnormal identifier, the slave node does not submit the target message to the application.

[0083] Through the above embodiment, after receiving the abnormal message, the slave node does not submit the abnormal message to the application, which is equivalent to directly discarding the abnormal message after receiving it. In this way, the number and content of messages received and processed by the master and slave nodes are the same (both normal messages and abnormal messages are received), the master node rolls back the abnormal message, and the slave node discards the abnormal message. Neither of them processes the abnormal message, and the master node and the slave node only process the normal message, and the state of the application layer is also consistent, thus ensuring the consistency of the master and slave node states. However, since the slave node does not submit the abnormal message to the application, even if the abnormal message is forwarded to the slave node, it will not cause application abnormality by submitting the abnormal message to the application as in the prior art.

[0084] In this embodiment, after the service thread sends a notification to the forwarding thread that the to-be-processed message has been processed normally, the method further includes:

[0085] The forwarding thread forwards the encapsulated message to be processed to the slave node;

[0086] When the slave node receives the encapsulated message to be processed, the slave node submits the encapsulated message to be processed to the application.

[0087] Through the above embodiment, normal messages can be delivered to the application for processing.

[0088] It can be seen from the above technical scheme that the present invention can first determine whether the message to be processed is an abnormal message based on the processing result of the message to be processed by the business thread, and then the business thread sends an abnormal message notification to the forwarding thread. After receiving the notification, the forwarding thread adds an abnormal identifier to the abnormal message and then forwards the obtained target message to the slave node. Since the forwarding thread waits for the notification before forwarding the message, the abnormal message will not be forwarded to the slave node but the application processing corresponding to the master node has not been completed. The slave node does not submit the message with the abnormal identifier to the application program. In this way, the abnormal message is also forwarded, that is, the number and content of the messages received and processed by the master and slave nodes are the same to ensure the consistency of the master and slave node states, but the slave node does not submit the abnormal message to the application. Therefore, even if the abnormal message is forwarded to the slave node, it will not cause application abnormality.

[0089] like Figure 2 As shown, it is a functional module diagram of a preferred embodiment of the distributed system abnormal message forwarding control device of the present invention. The distributed system abnormal message forwarding control device 11 runs in a distributed system, including a master node 110, a slave node 220 and an application end 330, the master node 110 includes a submission thread 1101, a forwarding thread 1102, and the application end 330 includes a business thread 3301. Each functional module described in the present invention refers to a series of computer program segments that can be executed by a processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0090] The master node 110 is used to start the delivery thread 1101 to deliver the message to be processed to the service thread 3301 of the application end 330 and the forwarding thread 1102 of the master node 110 at the same time when the master node 110 receives the message to be processed;

[0091] The business thread 3301 is used to process the message to be processed to obtain a processing result, and determine whether the message to be processed is an abnormal message according to the processing result;

[0092] The business thread 3301 is further configured to send an abnormal message notification to the forwarding thread 1102 when it is determined that the message to be processed is an abnormal message;

[0093] The forwarding thread 1102 is used for adding an exception identifier to the message to be processed to obtain a target message when the forwarding thread 1102 receives the exception message notification, and forwarding the target message to the slave node 220;

[0094] The slave node 220 is configured to not submit the target message to the application when the slave node 220 receives the target message and identifies the abnormal identifier.

[0095] It can be seen from the above technical scheme that the present invention can first determine whether the message to be processed is an abnormal message based on the processing result of the message to be processed by the business thread, and then the business thread sends an abnormal message notification to the forwarding thread. After receiving the notification, the forwarding thread adds an abnormal identifier to the abnormal message and then forwards the obtained target message to the slave node. Since the forwarding thread waits for the notification before forwarding the message, the abnormal message will not be forwarded to the slave node but the application processing corresponding to the master node has not been completed. The slave node does not submit the message with the abnormal identifier to the application program. In this way, the abnormal message is also forwarded, that is, the number and content of the messages received and processed by the master and slave nodes are the same to ensure the consistency of the master and slave node states, but the slave node does not submit the abnormal message to the application. Therefore, even if the abnormal message is forwarded to the slave node, it will not cause application abnormality.

[0096] like Figure 3 , which is a schematic diagram of the structure of a computer device of a preferred embodiment of the present invention for implementing a distributed system abnormal message forwarding control method.

[0097] The computer device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a distributed system abnormal message forwarding control program.

[0098] Those skilled in the art will appreciate that the schematic diagram is merely an example of the computer device 1 and does not constitute a limitation on the computer device 1. The computer device 1 may be a bus-type structure or a star-type structure. The computer device 1 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the computer device 1 may also include input and output devices, network access devices, etc.

[0099] It should be noted that the computer device 1 is only an example, and other existing or future electronic products that are suitable for the present invention should also be included in the protection scope of the present invention and included here by reference.

[0100] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the computer device 1, such as a mobile hard disk of the computer device 1. In other embodiments, the memory 12 can also be an external storage device of the computer device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 1. Further, the memory 12 can also include both an internal storage unit of the computer device 1 and an external storage device. The memory 12 can not only be used to store application software and various types of data installed in the computer device 1, such as the code of the distributed system abnormal message forwarding control program, etc., but also can be used to temporarily store data that has been output or is to be output.

[0101] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits 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 13 is the control core (Control Unit) of the computer device 1, and uses various interfaces and lines to connect various components of the entire computer device 1, and executes various functions and processes data of the computer device 1 by running or executing programs or modules stored in the memory 12 (for example, executing a distributed system abnormal message forwarding control program, etc.), and calling data stored in the memory 12.

[0102] The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned embodiments of the abnormal message forwarding control method of the distributed system, for example Figure 1 Steps shown.

[0103] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the computer device 1. For example, the computer program may be divided into a master node 110, a slave node 220, and an application end 330, wherein the master node 110 includes a submission thread 1101 and a forwarding thread 1102, and the application end 330 includes a service thread 3301.

[0104] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute a part of the distributed system abnormal message forwarding control method described in each embodiment of the present invention.

[0105] If the module / unit integrated in the computer device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware devices through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above-mentioned method embodiments can be implemented.

[0106] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, etc.

[0107] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0108] The blockchain referred to in this invention is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the blockchain underlying platform, platform product service layer, and application service layer.

[0109] The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 The bus is represented by only one straight line, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.

[0110] Although not shown, the computer device 1 may also include a power source (such as a battery) for supplying power to various components. Preferably, the power source may be logically connected to the at least one processor 13 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, and power status indicators. The computer device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.

[0111] Furthermore, the computer device 1 may also include a network interface. 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 is usually used to establish a communication connection between the computer device 1 and other computer devices.

[0112] Optionally, the computer device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), or a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the computer device 1 and to display a visual user interface.

[0113] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0114] Figure 3 Only the computer device 1 having components 12-13 is shown, and it can be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the computer device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0115] Combination Figure 1 , the memory 12 in the computer device 1 stores a plurality of instructions to implement a distributed system abnormal message forwarding control method, and the processor 13 can execute the plurality of instructions to implement:

[0116] When the master node receives a message to be processed, the master node starts a delivery thread to deliver the message to be processed to the service thread of the application end and the forwarding thread of the master node at the same time;

[0117] The service thread processes the message to be processed to obtain a processing result, and determines whether the message to be processed is an abnormal message according to the processing result;

[0118] When it is determined that the message to be processed is an abnormal message, the service thread sends an abnormal message notification to the forwarding thread;

[0119] When the forwarding thread receives the abnormal message notification, the forwarding thread adds an abnormal identifier to the message to be processed to obtain a target message, and forwards the target message to the slave node;

[0120] When the slave node receives the target message and identifies the exception identifier, the slave node does not submit the target message to the application.

[0121] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 1The description of the relevant steps in the corresponding embodiments will not be repeated here.

[0122] It should be noted that the data involved in this case were all obtained legally.

[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0124] The present invention can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present invention can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present invention can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0125] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0126] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0127] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0128] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.

[0129] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the present invention can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. A distributed system abnormal message forwarding control method, It is characterized in that Applied to a distributed system, the distributed system includes a master node, a slave node and an application end; The distributed system abnormal message forwarding control method comprises: When the master node receives a message to be processed, the master node starts a delivery thread to deliver the message to be processed to the service thread of the application end and the forwarding thread of the master node at the same time; The service thread processes the message to be processed to obtain a processing result, and determines whether the message to be processed is an abnormal message according to the processing result; When it is determined that the message to be processed is an abnormal message, the service thread sends an abnormal message notification to the forwarding thread; When the forwarding thread receives the abnormal message notification, the forwarding thread adds an abnormal identifier to the message to be processed to obtain a target message, and forwards the target message to the slave node; When the slave node receives the target message and identifies the exception identifier, the slave node does not submit the target message to the application.

2. The distributed system abnormal message forwarding control method according to claim 1, It is characterized in that After determining whether the message to be processed is an abnormal message according to the processing result, the method further includes: When it is determined that the message to be processed is not the abnormal message, the service thread sends a notification of normal processing completion of the message to be processed to the forwarding thread.

3. The distributed system abnormal message forwarding control method according to claim 2, It is characterized in that After the master node starts the delivery thread to deliver the to-be-processed message to the service thread of the application end and the forwarding thread of the master node at the same time, the method further includes: When the forwarding thread receives the message to be processed, the forwarding thread obtains a preconfigured message format; The forwarding thread encapsulates the message to be processed based on the message format; After completing the encapsulation, the forwarding thread waits for the service thread to send a notification; The notification sent includes the abnormal message notification and the normal processing completion notification.

4. The distributed system abnormal message forwarding control method according to claim 1, It is characterized in that The service thread sending an abnormal message notification to the forwarding thread includes: When the pending message is processed abnormally, the service thread generates an abnormal sequence number; The service thread sends the exception message notification to the forwarding thread based on the exception sequence number.

5. The distributed system abnormal message forwarding control method according to claim 1, It is characterized in that The forwarding thread adds an exception identifier to the message to be processed to obtain a target message, including: The forwarding thread adds the exception identifier to the message header of the message to be processed to obtain the target message.

6. The distributed system abnormal message forwarding control method according to claim 1, It is characterized in that When the forwarding thread receives the abnormal message notification, the method further includes: The forwarding thread rolls back the application end to a state before processing the pending message.

7. The distributed system abnormal message forwarding control method according to claim 3, It is characterized in that After the service thread sends a notification to the forwarding thread that the message to be processed has been processed normally, the method further includes: The forwarding thread forwards the encapsulated message to be processed to the slave node; When the slave node receives the encapsulated message to be processed, the slave node submits the encapsulated message to be processed to the application.

8. A distributed system abnormal message forwarding control device, It is characterized in that Running in a distributed system, the distributed system includes a master node, a slave node and an application end; the distributed system abnormal message forwarding control device includes: The master node is used to start a delivery thread to deliver the message to be processed to the service thread of the application end and the forwarding thread of the master node at the same time when the master node receives the message to be processed; The business thread is used to process the message to be processed to obtain a processing result, and determine whether the message to be processed is an abnormal message according to the processing result; The service thread is further configured to send an abnormal message notification to the forwarding thread when it is determined that the message to be processed is an abnormal message; The forwarding thread is used for adding an exception identifier to the message to be processed to obtain a target message when the forwarding thread receives the exception message notification, and forwarding the target message to the slave node; The slave node is used for not submitting the target message to the application when the slave node receives the target message and identifies the abnormal identifier.

9. A computer device, It is characterized in that The computer device comprises: a memory storing at least one instruction; and A processor executes instructions stored in the memory to implement the distributed system abnormal message forwarding control method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, Features: The computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in a computer device to implement the distributed system abnormal message forwarding control method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Distributed message sending processing system and processing method thereof

    CN111245900A

  • Multithreaded, mixed-HDL / ESL Concurrent Fault Simulator for Large-Scale Integrated Circuit Designs

    US20130007549A1