CN112532528A - Message routing method and device for rule engine - Google Patents

Message routing method and device for rule engine Download PDF

Info

Publication number
CN112532528A
CN112532528A CN202011384594.2A CN202011384594A CN112532528A CN 112532528 A CN112532528 A CN 112532528A CN 202011384594 A CN202011384594 A CN 202011384594A CN 112532528 A CN112532528 A CN 112532528A
Authority
CN
China
Prior art keywords
message
transmission path
routing
destination node
target message
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
CN202011384594.2A
Other languages
Chinese (zh)
Other versions
CN112532528B (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011384594.2A priority Critical patent/CN112532528B/en
Publication of CN112532528A publication Critical patent/CN112532528A/en
Application granted granted Critical
Publication of CN112532528B publication Critical patent/CN112532528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0823Network architectures or network communication protocols for network security for authentication of entities using certificates
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/083Network architectures or network communication protocols for network security for authentication of entities using passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1044Group management mechanisms 
    • H04L67/1046Joining mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/166Implementing security features at a particular protocol layer at the transport layer

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a message routing method for a rule engine, relates to the field of rule engines, and can be used in the fields of cloud platforms, Internet of things and the like. The specific implementation scheme is as follows: performing, by the rules engine: in response to the target message, planning a first transmission path of the target message based on a routing rule set in a rule engine, and enabling the target message to be routed to a first node according to the first transmission path; and in response to the target message failing to circulate the message in the first transmission path, replanning a second transmission path of the target message based on the routing rule, and enabling the target message to be routed to one or more second nodes different from the first node according to the second transmission path, wherein the one or more second nodes comprise external destination nodes.

Description

Message routing method and device for rule engine
Technical Field
The application relates to the field of rule engines, which can be used in the fields of cloud platforms, internet of things and the like, and more particularly relates to a message routing method and device, electronic equipment and a storage medium for a rule engine.
Background
Under the condition of applying the rule engine in the fields of the internet of things and the like, data loss may be caused due to abnormal message processing, abnormal data destination and the like in the message circulation process.
Disclosure of Invention
The application provides a message routing method and device for a rule engine, an electronic device and a storage medium.
According to a first aspect, there is provided a message routing method for a rules engine, comprising: performing the following operations by the rule engine: in response to the acquisition of the target message, planning a first transmission path of the target message based on a routing rule set in the rule engine, and enabling the target message to be routed to a first node according to the first transmission path; and in response to the target message failing to flow in the first transmission path, replanning a second transmission path of the target message based on the routing rule, and enabling the target message to be routed to one or more second nodes different from the first node according to the second transmission path, wherein the one or more second nodes comprise external destination nodes.
According to a second aspect, there is provided a message routing apparatus for use in a rules engine, the apparatus comprising: a first path planning module, configured to plan a first transmission path of a target message based on a routing rule set in the rule engine in response to acquiring the target message; a first message routing module, configured to route the target message to a first node according to the first transmission path; a second path planning module, configured to, in response to a message flow failure of the target message in the first transmission path, re-plan a second transmission path of the target message based on the routing rule; and a second message routing module, configured to route the target message to one or more second nodes different from the first node according to the second transmission path, where the one or more second nodes include an external destination node.
According to a third aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of the embodiment of the present application.
According to a fourth aspect, there is provided a non-transitory computer readable storage medium having computer instructions stored thereon, comprising: the computer instructions are used for causing the computer to execute the method of the embodiment of the application.
According to the technical scheme provided by the embodiment of the application, some routing rules can be created in the rule engine in advance, and besides the configuration of the relevant information such as the address of the specified internal destination node, the relevant information such as the address of the external destination node can be added in the routing rules. Therefore, when the message fails to flow when the message is routed to the specified internal destination node through the routing rules, the message which fails to flow can be rerouted to the newly added external destination node, so that data loss can be prevented, and convenience and flexibility of routing rule configuration can be improved to meet personalized requirements of users.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 illustrates a system architecture of a message routing method and apparatus for a rules engine suitable for embodiments of the present application;
FIG. 2 illustrates a flow diagram of a message routing method for a rules engine according to an embodiment of the application;
fig. 3 schematically illustrates a diagram of dynamically planning a transmission path by routing rules according to an embodiment of the present application;
FIG. 4 illustrates a block diagram of a message routing apparatus according to an embodiment of the present application; and
fig. 5 illustrates a block diagram of an electronic device for implementing a message routing method for a rules engine according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Under the scenario of applying the rule engine service in the public cloud, data loss may be caused by abnormal message processing, abnormal data destination and the like in the message circulation process. In order to improve the reliability of the message circulation, an error destination can be added, so that once any one or more of the above exceptions occur in the message circulation process, the data in which the above exceptions occur can be written into the error destination for subsequent related operations.
Currently, the rule engine service in the application scenario only supports setting a corresponding error destination (i.e., an internal error destination) inside a cloud platform where the rule engine is located, and thus there is a certain limitation. For example, an internal wrong destination cannot meet the personalized needs of the user. For some users, data in which the above exception occurs in the message flow process is stored in an internal error destination, and convenience and flexibility are not high. Meanwhile, as the user's demand for private cloud wrong destinations and the like becomes stronger, the rule engine product is required to provide a related scheme supporting the external wrong destinations.
In this regard, the embodiment of the present application provides a message routing method and apparatus for a rule engine capable of supporting an external error destination.
The present application will be described in detail with reference to specific examples.
A system architecture of a message routing method and apparatus for a rules engine suitable for embodiments of the present application is described below.
Fig. 1 illustrates a system architecture of a message routing method and apparatus for a rules engine suitable for embodiments of the present application. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present application may be applied to help those skilled in the art understand the technical content of the present application, but does not mean that the embodiments of the present application may not be used in other environments or scenarios.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, message middleware 103, a rules engine 104 provided in a public cloud, destination nodes 105, 106 provided in the public cloud, and a destination node 107 provided in a private cloud.
It should be noted that, in the embodiment of the present application, the rule engine 104 may include a destination node creation module 1041, a rule creation module 1042, and a rule editing module 1043. Wherein information about external destination nodes, such as destination node 107, may be created by destination node creation module 1041. Routing rules for use by the rules engine 104 may be created by the rule creation module 1042. Wherein each routing rule may comprise at least one data source and at least two destination nodes. Illustratively, in one embodiment, the information shown in Table 1 may be configured in a routing rule. The routing rule indicates that a message generated by a data source, i.e. the terminal device 101, 102, is routed from the data source to the internal destination node 105 according to a filtering condition, and when a message routing failure occurs in the transmission path, i.e. the message is not successfully delivered to the internal destination node 105, the message is routed to both the internal destination node 106 and the external destination node 107. Wherein the destination node 107 comprises a Kafka cluster.
TABLE 1
Data source Destination node
Terminal device 101 (internal) destination node 105
Terminal device 102 (internal) destination node 106
(external) destination node 107
Alternatively, in one embodiment, the information shown in table 2 may be configured in one routing rule. The routing rule indicates that a message generated by a data source, i.e., the terminal device 101, 102, is routed from the data source to the internal destination node 105 according to a filtering condition, and when a message routing failure occurs in the transmission path, i.e., the message is not successfully delivered to the internal destination node 105, the message is routed to the external destination node 107.
TABLE 2
Data source Destination node
Terminal device 101 (internal) destination node 105
Terminal device 102 (external) destination node 107
In addition, in this embodiment of the application, the routing rule may also be edited by the rule editing module 1043, including but not limited to: adding, deleting, modifying the relevant information of the external destination node.
In the embodiment of the present application, a message source, such as a message generated by the terminal device 101, 102, is cached in the message middleware 103, and then enters the rule engine 104 for data processing, such as data parsing, data format conversion, and the like, and then the rule engine 104 may dynamically plan a transmission path of the message (or data) through a preset routing rule, so as to deliver the message (here, the processed message) to a corresponding destination node.
It should be understood that, in the embodiment of the present application, the message routing refers to dynamically planning a transmission path of a message through a routing rule, so that the message is routed from a message source to a target node according to a filtering condition, and flexible control on data routing and improvement of data security can be achieved through the message routing. Furthermore, in the embodiment of the present application, it is supported that multiple routing paths exist simultaneously, as shown in table 1, one transmission path corresponding to the internal destination node 106 and one transmission path corresponding to the external destination node 107 exist simultaneously, and one transmission path corresponding to the internal destination node 105 also exists simultaneously.
It should be understood that the number of end devices (i.e., data sources), message middlewares, and destination nodes in fig. 1 are merely illustrative. There may be any number of end devices, message middleware, destination nodes, as desired for an implementation.
An application scenario of the message routing method and apparatus for a rule engine suitable for the embodiments of the present application is described below.
The message routing method and apparatus provided in the embodiment of the present application may be applied to all occasions and fields of rule engine service supporting an external destination node, and the embodiment of the present application is not limited herein.
According to an embodiment of the present application, a message routing method for a rules engine is provided.
FIG. 2 illustrates a flow diagram of a message routing method for a rules engine according to an embodiment of the application.
As shown in FIG. 2, the method 200 includes performing operations S201-S202 by the rules engine.
In operation S201, in response to acquiring the target message, a first transmission path of the target message is planned based on a routing rule set in the rule engine, and the target message is routed to the first node according to the first transmission path.
In operation S202, in response to a message flow failure of the target message occurring in the first transmission path, a second transmission path of the target message is re-planned based on the routing rule, and the target message is routed to one or more second nodes different from the first node according to the second transmission path, wherein the one or more second nodes include an external destination node.
In this embodiment of the application, since the message generated by the data source may be cached in the message middleware first, in operation S201, the rule engine may acquire messages from the message middleware one by one, and select a routing rule for planning a transmission path for the currently acquired message from a plurality of routing rules preset in the rule engine according to the data source information of the generated message, then plan a first transmission path for the currently acquired message according to the selected routing rule first, and route a processing result to a destination node indicated by the first transmission path, that is, a first node, after the message is processed by the rule engine.
Because the message may be abnormal after being processed by the rule engine, the data with the abnormal processing may not be accurately transmitted to the first node indicated by the first transmission path, and even if the message is not abnormal after being processed by the rule engine, the message may not be accurately transmitted to the first node indicated by the first transmission path due to network jitter, interruption and the like. Therefore, in order to avoid data loss caused by that the message is not accurately delivered to the first node, in operation S202, the rule engine may dynamically adjust a transmission path based on the routing rule selected for the message when it is known that the currently acquired message fails to circulate through the first transmission path, for example, another (or several) transmission paths of the message are re-planned, so that after the message is processed by the rule engine, the processing result may be routed to another (or several) destination nodes indicated by the another (or several) transmission paths, that is, to the second node.
It should be understood that, in the embodiment of the present application, for a message with a failed first routing, when a transmission path is re-planned and a message routing is re-performed, an external destination node and/or an internal destination node may be flexibly selected according to actual needs, so that the message with the failed first routing is intensively delivered to other destination nodes to prevent data loss, and at the same time, the message is processed by a subsequent operation.
Illustratively, for example, if a routing rule applicable to a certain message (e.g., a message generated by terminal device a in the internet of things) includes information about a data source and a destination node as shown in table 3, a first transmission path planned by the rule engine for the message may indicate that a processing result of the message is routed to destination node 1, and in a case that the result cannot be accurately delivered to destination node 1, a second transmission path planned by the rule engine for the message may include two sub-transmission paths, one of which may indicate that the processing result of the message is routed to an internal Kafka cluster, and the other of which may indicate that the processing result of the message is simultaneously routed to an external Kafka cluster.
TABLE 3
Data source Destination node
Terminal equipment A (Internally) specified destination node 1
Internal Kafka cluster
External Kafka cluster
With reference to table 3 and fig. 3, the schematic diagram of the routing rule dynamic programming transmission path is as follows: for the message generated by the terminal device a, the planned first transmission path is "the message generated by the terminal device a is directly routed to the destination node 1 after being processed by the rule engine"; in the case where the message cannot be delivered to the destination node 1 (the "x" in the figure indicates that the message cannot be delivered), a second transmission path is planned, and the second transmission path includes a sub transmission path 1 and a sub transmission path 2, where the sub transmission path 1 is "to be processed by the rule engine and to which the flow fails, and is rerouted to the internal Kafka cluster", and the sub transmission path 2 is "to be processed by the rule engine and to which the flow fails, and is rerouted to the external Kafka cluster", and the sub transmission path 1 and the sub transmission path 2 may coexist at the same time.
According to the embodiment of the application, some routing rules can be created in the rule engine in advance, and besides the relevant information such as the address of the specified destination node, the relevant information such as the address of an external destination node can be added in the routing rules. Therefore, when the message fails to flow when the message is routed to the designated destination node through the routing rules, the message which fails to flow can be rerouted to the newly added external destination node, so that data loss can be prevented, and convenience and flexibility of routing rule configuration can be improved to meet personalized requirements of users.
As an alternative embodiment, the method may further comprise: acquiring address information of an external destination node created for a target message before replanning a second transmission path of the target message based on a corresponding routing rule; and adding the address information to a list of external destination nodes for use in configuring the routing rule.
In an embodiment of the present application, a kafka cluster may be created outside a public cloud, such as within a private cloud, as an error destination node. In this case, the address information of the Kafka cluster may be added to a preset external destination node list, and based on the address information stored in the list, for example, the address information of the newly created "external destination node", for example, the address information of the "external Kafka cluster", may be added to the routing rule whose configuration information is shown in table 4, so as to obtain the routing rule whose configuration information is shown in table 3.
TABLE 4
Data source Destination node
Terminal equipment A (Internally) specified destination node 1
Internal Kafka cluster
It should be understood that the routing rules described in table 3 characterize: the message is first routed to the node inside the public cloud where the rule engine is located, i.e. destination node 1, and in case of message flow failure, is then routed to both the kafka cluster inside the public cloud and the kafka cluster inside the external private cloud. The routing rules described in table 4 characterize: the message is first routed to a node inside the public cloud where the rule engine is located, namely, destination node 1, and is then routed to the kafka cluster inside the public cloud when the message flow fails.
By the embodiment of the application, the routing rule aiming at the external error destination can be configured in the rule engine, so that the data with the flow error can be sent to the external error destination again. Moreover, the embodiment of the invention provides a perfect solution scheme including creating an external Kafka error destination, adding the external Kafka error destination in the routing rule, sending data to the external Kafka error destination and the like, so that the rule engine in the public cloud can effectively support the external Kafka error destination.
In addition, in the embodiment of the present application, an internal destination node list may also be created. The internal destination node list may include two sub-lists, respectively for recording the target destination node and the error destination node.
Further, in the embodiment of the present application, the external destination node list and the internal destination node list may be adjusted according to actual requirements, so as to improve the diversity and configuration flexibility of the rule engine destination node. Specifically, the user can flexibly configure an error destination list (including an external error destination list and an internal error destination list) that can be used by creating or deleting or modifying an error destination, thereby improving configurability of the error destination.
Further, in the embodiment of the present application, an incorrect destination may be added, deleted or modified in the routing rule according to an actual requirement, so as to improve configurability of the routing rule in the rule engine.
In addition, in the embodiment of the present application, if a routing rule includes multiple internal error destinations and/or multiple external error destinations, in practical use, the routing rule may also be flexibly configured, such as selecting one or more error destinations therein for replanning a transmission path in case of a message flow failure. Therefore, not only the creation and deletion of external error destinations can be supported, but also internal and external error destinations which can be used in the flexible adjustment of routing rules can be supported.
As an alternative embodiment, the method may further comprise: the external destination node list is exposed in response to receiving a query request for the external destination node list.
Similarly, in the embodiment of the present application, the internal destination node list may also be presented in response to receiving a query request for the internal destination node list (including the aforementioned two sub-lists).
By the embodiment of the application, the function of inquiring and displaying the classification list comprising the external error destination nodes (such as the external Kafka cluster) and the internal error destination nodes is provided, so that a user can conveniently check all currently available error destination nodes, and the user can conveniently and flexibly configure the routing rule.
As an alternative embodiment, the method may further comprise: the rules engine is caused to establish a connection with an external destination node prior to causing the target message to be routed to one or more second nodes different from the first node according to a second transmission path. Illustratively, the rules engine may be caused to establish a connection with an external destination node based on at least one of the following information: a user name and password; a digital certificate.
Since the external error destination is not a public cloud service or is not the same account as a rule engine in the public cloud service, it is necessary to provide a corresponding processing method to ensure connection with the external error destination and transmission of corresponding data, and the like.
For example, in the embodiment of the present application, the user may add, in the rule engine, related information required to connect the Kafka cluster, such as a connection address, topic (topic), a digital certificate, a user name and a password of the Kafka cluster, for a newly created external error destination, such as the Kafka cluster. Based on this information, the rules engine in the public cloud can establish a connection with an external target node to ensure that data can be transmitted normally.
It should be noted that, in this embodiment of the present application, a data sending module for an external error destination, such as a Kafka cluster, may be added to the rule engine, and the module may send data to a corresponding topic after the rule engine establishes a connection with the external error destination, such as a Kafka cluster, according to the routing rule (including information about the data source, the specified destination, the external error destination, and the like) created in the foregoing operation.
In addition, in the embodiment of the present application, the rule engine may establish a communication connection with an external error destination such as a kafka cluster based on a digital authentication method of SSL (secure socket protocol) and/or an authentication method of "user name and password" so as to ensure the security of data transmission. Specifically, an uploading module for connecting digital certificates required by the external Kafka cluster can be added in the rule engine, and related certificates required to be used can be uploaded to the rule engine through the uploading module, so that the rule engine can support secure connection with the external Kafka cluster in an SSL mode.
In addition, in the embodiment of the application, based on an external error destination, such as a rule engine service of a Kafka cluster, an SSL-based authentication mode can be selected to effectively ensure the security of data connection and data transmission process, and an authentication mode using a username encryption code can also be selected, so that the configurability is strong. Specifically, the user can configure a connection mode between the rule engine and an external error destination, such as a Kafka cluster, according to actual requirements, and flexibly select a mode of using a digital certificate or a username encryption code. In addition, if the user uses the connection mode of the user name and the password, the rule engine service can use a specific encryption and decryption module to store and use the user name and the password.
In addition, as an optional embodiment, the method may further include: after the rule engine establishes a connection with an external destination node, a connectivity check is performed on the rule engine and the external destination node. By the method and the device, after the rule engine is connected with the external target node, connectivity detection is carried out on the rule engine and the external destination node, and the availability of the external destination node can be ensured.
Specifically, a connectivity test module may be added to the rule engine to perform the connectivity test described above. More specifically, the connectivity test may include the steps of: and sending data to an external destination node such as an external Kafka cluster, detecting whether a correct result can be returned or not, if the correct result can be returned, the connectivity between the characterization rule engine and the external Kafka cluster is good, otherwise, the connectivity between the characterization rule engine and the external Kafka cluster is not good.
By the embodiment of the application, the connectivity test module is created for the external error destination, such as an external Kafka cluster, so that a user can conveniently obtain the communication condition of the corresponding external error destination in time, and the availability of the external error destination can be ensured when the corresponding external error destination is added into the routing rule.
As an alternative embodiment, the external destination node to which the present application relates may include: kafka cluster, whereby messages under different topics can be sorted for storage.
It should be understood that a Kafka cluster contains one or more servers, which are referred to as brookers. Each message issued to the Kafka cluster has a category, which is called topic. The messages of different topocs are stored separately, and the message of one topoc is stored on one or more brokers logically, but the user only needs to specify the topoc of the message to produce or consume the data without concern about where the data is stored. Furthermore, each topic comprises one or more partitions (partitions) into which messages produced by different producers can be distributed.
According to the embodiment of the application, the application also provides a message routing device.
Fig. 4 illustrates a block diagram of a message routing apparatus according to an embodiment of the present application.
As shown in fig. 4, the message routing apparatus 400 may be applied to a rules engine. The message routing apparatus 400 may include: a first path planning module 410, a first message routing module 420, a second path planning module 430, and a second message routing module 440. The apparatus may be used to implement the message routing method as shown in fig. 2.
Specifically, the first path planning module 410 is configured to plan a first transmission path of the target message based on a routing rule set in the rule engine in response to acquiring the target message.
The first message routing module 420 is configured to route the target message to the first node according to the first transmission path.
And a second path planning module 430, configured to re-plan a second transmission path of the target message based on the routing rule in response to a message flow failure of the target message in the first transmission path.
A second message routing module 440 configured to route the target message to one or more second nodes different from the first node according to a second transmission path, wherein the one or more second nodes comprise an external destination node.
As an alternative embodiment, the apparatus may further comprise: an address acquisition module for acquiring address information of an external destination node created for the target message before replanning the second transmission path of the target message based on the routing rule; and an information adding module for adding the address information to the external destination node list for use in configuring the routing rules.
As an alternative embodiment, the apparatus may further comprise: a list presentation module for presenting the external destination node list in response to receiving a query request for the external destination node list.
As an alternative embodiment, the apparatus further comprises: a connection module for establishing a connection between the rules engine and an external destination node before routing the target message to one or more second nodes different from the first node according to the second transmission path.
As an alternative embodiment, the connection module is configured to enable the rules engine to establish a connection with the external destination node based on at least one of the following information: a user name and password; a digital certificate.
As an alternative embodiment, the apparatus may further comprise: and the connectivity detection module is used for performing connectivity detection on the rule engine and the external destination node after the rule engine establishes connection with the external destination node.
As an alternative embodiment, the external destination node comprises: kafka cluster.
It should be noted that, the embodiments of the apparatus portion of the present application are the same as or similar to the embodiments of the method portion of the present application, and are not described herein again.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 5 is a block diagram of an electronic device for a message routing method of a rules engine according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). In fig. 5, one processor 501 is taken as an example.
Memory 502 is a non-transitory computer readable storage medium as provided herein. Wherein the memory stores instructions executable by at least one processor to cause the at least one processor to perform the message routing method for a rules engine provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the message routing method for a rules engine provided herein.
The memory 502, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the message routing method for a rules engine in the embodiments of the present application (e.g., the first path planning module 410, the first message routing module 420, the second path planning module 430, and the second message routing module 440 shown in fig. 4). The processor 501 executes various functional applications of the server and data processing, i.e., implements the message routing method for the rule engine in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 502.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device for the message routing method of the rule engine, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 502 optionally includes memory located remotely from the processor 501, and these remote memories may be connected over a network to the electronics for the rules engine's message routing method. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for implementing the message routing method for a rule engine of the present application may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device for the message routing method of the rules engine, such as a touch screen, keypad, mouse, track pad, touch pad, pointer, one or more mouse buttons, track ball, joystick, or other input device. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, Programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other; the server may be a server of a distributed system or a server incorporating a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.
According to the technical scheme provided by the embodiment of the application, some routing rules can be created in the rule engine in advance, and besides the configuration of the relevant information such as the address of the specified destination node, the relevant information such as the address of an external destination node can be added in the routing rules. Therefore, when the message fails to flow when the message is routed to the designated destination node through the routing rules, the message which fails to flow can be rerouted to the newly added external destination node, so that data loss can be prevented, and convenience and flexibility of routing rule configuration can be improved to meet personalized requirements of users.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A message routing method for a rules engine, comprising, by the rules engine:
in response to the acquisition of a target message, planning a first transmission path of the target message based on a routing rule set in the rule engine, and enabling the target message to be routed to a first node according to the first transmission path; and
and in response to the target message failing to circulate in the first transmission path, replanning a second transmission path of the target message based on the routing rule, and enabling the target message to be routed to one or more second nodes different from the first node according to the second transmission path, wherein the one or more second nodes comprise external destination nodes.
2. The method of claim 1, further comprising: prior to re-planning the second transmission path of the target message based on the routing rule,
acquiring address information of the external destination node created for the target message; and
adding the address information to a list of external destination nodes for use in configuring the routing rule.
3. The method of claim 2, further comprising:
presenting the external destination node list in response to receiving a query request for the external destination node list.
4. The method of claim 1, further comprising: prior to routing the destination message to one or more second nodes different from the first node according to the second transmission path,
causing the rules engine to establish a connection with the external destination node.
5. The method of claim 4, wherein:
causing the rules engine to establish a connection with the external destination node based on at least one of: a user name and password; a digital certificate.
6. The method of claim 4, further comprising: after the rules engine establishes a connection with the external destination node,
performing connectivity detection on the rules engine and the external destination node.
7. The method of claim 1, wherein the external destination node comprises: kafka cluster.
8. A message routing apparatus for application to a rules engine, the apparatus comprising:
the first path planning module is used for planning a first transmission path of a target message based on a routing rule set in the rule engine in response to the target message being acquired;
a first message routing module, configured to route the target message to a first node according to the first transmission path;
a second path planning module, configured to, in response to a message flow failure of the target message in the first transmission path, re-plan a second transmission path of the target message based on the routing rule; and
a second message routing module to route the destination message to one or more second nodes different from the first node according to the second transmission path, wherein the one or more second nodes include an external destination node.
9. An electronic device, comprising:
at least one processor; and
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 method of any one of claims 1-7.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202011384594.2A 2020-11-30 2020-11-30 Message routing method and device for rule engine Active CN112532528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011384594.2A CN112532528B (en) 2020-11-30 2020-11-30 Message routing method and device for rule engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011384594.2A CN112532528B (en) 2020-11-30 2020-11-30 Message routing method and device for rule engine

Publications (2)

Publication Number Publication Date
CN112532528A true CN112532528A (en) 2021-03-19
CN112532528B CN112532528B (en) 2023-04-25

Family

ID=74995815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011384594.2A Active CN112532528B (en) 2020-11-30 2020-11-30 Message routing method and device for rule engine

Country Status (1)

Country Link
CN (1) CN112532528B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422739A (en) * 2021-06-21 2021-09-21 上海哔哩哔哩科技有限公司 Data transmission method, sending end and data transmission system
CN113824645A (en) * 2021-08-18 2021-12-21 北京百度网讯科技有限公司 Data transmission method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080297305A1 (en) * 2007-05-31 2008-12-04 Mark Cameron Little Rules associated with messages
CN102520965A (en) * 2011-12-28 2012-06-27 山东中创软件工程股份有限公司 Method and system for message processing
CN106464665A (en) * 2014-02-28 2017-02-22 泰科消防及安全有限公司 Rules engine combined with message routing
CN106789587A (en) * 2016-12-28 2017-05-31 国家计算机网络与信息安全管理中心 The communicator and method of reliable news under a kind of cloud computing environment
CN107003924A (en) * 2014-10-15 2017-08-01 艾拉物联公司 The elastic regulation engine of consumer device has been connected for managing
CN107657360A (en) * 2017-08-16 2018-02-02 浙江力太科技有限公司 A kind of method that real time data cooperates with industrial Internet of Things
CN110471970A (en) * 2019-08-08 2019-11-19 紫光云技术有限公司 A kind of regulation engine data forwarding method that can flexibly match
CN110971432A (en) * 2018-09-29 2020-04-07 华为技术有限公司 Data transmission method and related device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080297305A1 (en) * 2007-05-31 2008-12-04 Mark Cameron Little Rules associated with messages
CN102520965A (en) * 2011-12-28 2012-06-27 山东中创软件工程股份有限公司 Method and system for message processing
CN106464665A (en) * 2014-02-28 2017-02-22 泰科消防及安全有限公司 Rules engine combined with message routing
CN107003924A (en) * 2014-10-15 2017-08-01 艾拉物联公司 The elastic regulation engine of consumer device has been connected for managing
CN106789587A (en) * 2016-12-28 2017-05-31 国家计算机网络与信息安全管理中心 The communicator and method of reliable news under a kind of cloud computing environment
CN107657360A (en) * 2017-08-16 2018-02-02 浙江力太科技有限公司 A kind of method that real time data cooperates with industrial Internet of Things
CN110971432A (en) * 2018-09-29 2020-04-07 华为技术有限公司 Data transmission method and related device
CN110471970A (en) * 2019-08-08 2019-11-19 紫光云技术有限公司 A kind of regulation engine data forwarding method that can flexibly match

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
阿里云: "《设备消息通过RocketMQ流转到服务器_消息通信_最佳实践_阿里云物联网平台》", 《阿里云计算文档》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113422739A (en) * 2021-06-21 2021-09-21 上海哔哩哔哩科技有限公司 Data transmission method, sending end and data transmission system
CN113824645A (en) * 2021-08-18 2021-12-21 北京百度网讯科技有限公司 Data transmission method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112532528B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
US10841256B2 (en) Upgrading components of a messaging system used by a microservice-based application
US10305749B2 (en) Low latency flow cleanup of openflow configuration changes
CN111683139B (en) Method and device for balancing load
CN112532528B (en) Message routing method and device for rule engine
US11546228B2 (en) Zero-touch configuration of network devices using hardware metadata
US20160269426A1 (en) Deploying a security appliance system in a high availability environment without extra network burden
CN112202746B (en) RPC member information acquisition method, device, electronic equipment and storage medium
CN110995480A (en) Block chain network deployment method, device, electronic equipment and medium
CN111552934A (en) Database access method and device
CN111698346A (en) Private network address conversion method and device, private network gateway and storage medium
CN111770176B (en) Traffic scheduling method and device
US8903871B2 (en) Dynamic management of log persistence
US20200186432A1 (en) System and method for automating the discovery process
US20220103415A1 (en) Remote network and cloud infrastructure management
CN111865980B (en) Information processing method and device of information storage center
CN111884847B (en) Method and device for processing fault
CN112565225B (en) Method and device for data transmission, electronic equipment and readable storage medium
CN112084000B (en) Container cluster testing method and device
CN111770154B (en) Service detection method, device, equipment and storage medium
CN112069137A (en) Method and device for generating information, electronic equipment and computer readable storage medium
WO2023169193A1 (en) Method and device for generating smart contract
US20160094443A1 (en) Protocol independent multicast (pim) multicast route entry synchronization
CN112527635B (en) Fault injection method and device, electronic equipment and storage medium
CN112165430B (en) Data routing method, device, equipment and storage medium
CN115277428A (en) Method and apparatus for configuring a network

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