[go: up one dir, main page]

CN112565088B - Message processing method, system, apparatus and network device - Google Patents

Message processing method, system, apparatus and network device Download PDF

Info

Publication number
CN112565088B
CN112565088B CN202011339906.8A CN202011339906A CN112565088B CN 112565088 B CN112565088 B CN 112565088B CN 202011339906 A CN202011339906 A CN 202011339906A CN 112565088 B CN112565088 B CN 112565088B
Authority
CN
China
Prior art keywords
message
frame
node
routing
service
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.)
Active
Application number
CN202011339906.8A
Other languages
Chinese (zh)
Other versions
CN112565088A (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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202011339906.8A priority Critical patent/CN112565088B/en
Publication of CN112565088A publication Critical patent/CN112565088A/en
Application granted granted Critical
Publication of CN112565088B publication Critical patent/CN112565088B/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/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention relates to the field of communication, and discloses a message processing method, a system, a device and network equipment. The message processing method comprises the following steps: receiving a message packaged according to a predefined structure, wherein the message packaged according to the predefined structure comprises an identification frame, a service frame, a blank frame and a content frame; checking whether the message contains a routing frame or not, and determining a corresponding routing strategy according to a checking result so as to process the message; the identification frame comprises a service type which can be processed by the source node and a distinguishing code of the source node, and is used for representing the identity source of the message; the service frame comprises a service type and is used for representing the service requested by the message; the content frame includes the message content. The method is applied to the message transmission process, and the purpose of improving the message timeliness is achieved.

Description

消息处理方法、系统、装置和网络设备Message processing method, system, apparatus and network device

技术领域technical field

本发明实施例涉及通信领域,特别涉及一种消息处理方法、系统、装置和网络设备。Embodiments of the present invention relate to the field of communications, and in particular, to a message processing method, system, apparatus, and network device.

背景技术Background technique

消息服务作为通信中间件的重要部分,为应用服务器提供了信息同步及传输保证。目前的消息服务大多采用IP地址作为网络连接和处理标识,客户端根据不同的业务需求与不同的服务之间建立网络连接,消息服务在收到消息后,根据IP地址经过层层转发到达业务服务进而处理业务。As an important part of communication middleware, message service provides information synchronization and transmission guarantee for application server. Most of the current message services use IP addresses as network connection and processing identifiers. The client establishes network connections with different services according to different business requirements. After the message service receives the message, it forwards to the business service layer by layer according to the IP address. And then deal with the business.

然而,现有的通信场景越来越复杂,微服务化使得每一个服务所承载的功能越来越单一,导致服务数量急剧增多。消息服务收到消息后经过层层转发才能到达业务服务,增加了传递路径,降低了消息的时效性。However, the existing communication scenarios are becoming more and more complex, and the microservices make the functions carried by each service more and more single, resulting in a sharp increase in the number of services. After the message service receives the message, it can reach the business service only after it is forwarded layer by layer, which increases the delivery path and reduces the timeliness of the message.

发明内容SUMMARY OF THE INVENTION

本发明实施方式的目的在于提供一种消息处理方法、系统、装置和网络设备,能够提高消息传输的时效性。The purpose of the embodiments of the present invention is to provide a message processing method, system, apparatus and network device, which can improve the timeliness of message transmission.

为解决上述技术问题,本发明的实施方式提供了一种消息处理方法,包括:接收按照预先定义的结构封装的消息,其中,所述按照预先定义的结构封装的消息包含标识帧,业务帧,空白帧,内容帧;检查所述消息中是否包含路由帧,根据检查结果确定相应的路由策略以进行消息的处理;其中,所述标识帧包含源节点能处理的业务类型和源节点的区分码,用于表示所述消息的身份来源;所述业务帧包含业务类型,用于表示所述消息请求的业务;所述内容帧包含所述消息内容。In order to solve the above technical problem, an embodiment of the present invention provides a message processing method, comprising: receiving a message encapsulated according to a predefined structure, wherein the message encapsulated according to the predefined structure includes an identification frame, a service frame, Blank frame, content frame; check whether the message contains a routing frame, and determine a corresponding routing strategy according to the inspection result to process the message; wherein, the identification frame includes the service type that the source node can handle and the source node's distinguishing code , which is used to represent the identity source of the message; the service frame contains the service type, which is used to represent the service requested by the message; the content frame contains the content of the message.

本发明的实施方式还提供了一种消息处理系统,包括:Embodiments of the present invention also provide a message processing system, including:

发送节点,用于将按照预先定义的结构封装的消息发送给接收节点,其中,所述按照预先定义的结构封装的消息包含标识帧,业务帧,空白帧,内容帧;a sending node, configured to send a message encapsulated according to a predefined structure to a receiving node, wherein the message encapsulated according to the predefined structure includes an identification frame, a service frame, a blank frame, and a content frame;

接收节点,用于接收按照预先定义的结构封装的消息,检查所述消息中是否包含路由帧,根据检查结果确定相应的路由策略以进行消息的处理;a receiving node, configured to receive a message encapsulated according to a predefined structure, check whether the message contains a routing frame, and determine a corresponding routing policy according to the inspection result to process the message;

其中,所述发送节点和接收节点各自携带一个标识帧,所述标识帧包含所述发送节点或所述接收节点能处理的业务类型和所述发送节点或所述接收节点的区分码。Wherein, the sending node and the receiving node each carry an identification frame, and the identification frame includes the service type that the sending node or the receiving node can handle and the distinguishing code of the sending node or the receiving node.

本发明的实施方式还提供了一种消息处理装置,包括:Embodiments of the present invention also provide a message processing device, including:

消息层,用于对消息按照预先定义的结构进行封装处理,包含消息地址,消息分隔和消息内容;The message layer is used to encapsulate the message according to the predefined structure, including the message address, message separation and message content;

包装层,用于屏蔽不同通信机制的差异;The packaging layer is used to shield the differences between different communication mechanisms;

传输层,用于传输按照预先定义的结构封装的消息,包含进程内通信和进程间通信。The transport layer is used to transmit messages encapsulated in a predefined structure, including intra-process communication and inter-process communication.

本发明的实施方式还提供了一种网络设备,包括:Embodiments of the present invention also provide a network device, including:

至少一个处理器;以及,at least one processor; and,

与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,

所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行以上所述的消息处理方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the message processing method described above.

本发明实施方式相对于现有技术而言,按照预先定义的结构封装消息,使消息中包含标识帧,业务帧,空白帧和内容帧,当前节点根据消息中是够包含路由帧确定相应的路由策略以完成消息的处理,降低消息的传输路径,提高消息的时效性。Compared with the prior art, the embodiment of the present invention encapsulates a message according to a predefined structure, so that the message contains an identification frame, a service frame, a blank frame and a content frame, and the current node determines the corresponding route according to whether the message contains enough routing frames. The strategy is to complete the processing of the message, reduce the transmission path of the message, and improve the timeliness of the message.

另外,本发明实施方式提供的消息处理方法,所述检查所述消息中是否包含路由帧,根据检查结果确定相应的路由策略以处理消息,包括:检查所述消息中是否有路由帧;若所述消息中没有路由帧,则采用盲路由规则处理所述消息;若所述消息中有路由帧,则采用定向路由规则处理所述消息,其中,所述路由帧与所述标识帧内容相同。消息中的路由帧为非必须帧,根据消息中是否包含路由帧,确定使用盲路由规则处理消息还是定向路由规则处理消息,实现了消息定向传输和非定向传输,提高了消息传输的时效性。In addition, in the message processing method provided by the embodiment of the present invention, the checking whether the message contains a routing frame, and determining a corresponding routing policy to process the message according to the checking result, includes: checking whether there is a routing frame in the message; If there is no routing frame in the message, the blind routing rule is used to process the message; if there is a routing frame in the message, the message is processed using the directional routing rule, wherein the routing frame has the same content as the identification frame. The routing frame in the message is a non-essential frame. According to whether the message contains a routing frame, it is determined whether to use the blind routing rule to process the message or the directional routing rule to process the message, which realizes message directional transmission and non-directional transmission, and improves the timeliness of message transmission.

另外,本发明实施方式提供的消息处理方法,所述采用盲路由规则处理所述消息,包括:保存所述消息中的标识帧,更新所述消息中的标识帧为当前节点预先设置的标识帧;当前节点检查所述消息中业务帧的业务类型和所述节点预先设置的标识帧的业务类型是否一致;若一致,则所述当前节点获取所述消息内容帧中的消息内容以处理业务,在所述消息中添加路由帧,并在所述路由帧中设置消息的原始标识帧为下一节点地址,将所述处理业务的结果写入所述消息内容帧中,发送到所述下一节点;当前节点收到消息后根据业务类型判断是否能处理该业务,若不能处理,则选择默认路由节点进行转发,这降低了消息的传输路径,提高了消息的处理效率。In addition, in the message processing method provided by the embodiment of the present invention, the processing of the message using a blind routing rule includes: saving the identification frame in the message, and updating the identification frame in the message to the identification frame preset by the current node. The current node checks whether the service type of the service frame in the message is consistent with the service type of the identification frame preset by the node; if consistent, the current node obtains the message content in the message content frame to process the service, A routing frame is added to the message, and the original identification frame of the message is set in the routing frame as the address of the next node, the result of the processing service is written into the message content frame, and sent to the next node After receiving the message, the current node judges whether the service can be processed according to the service type. If it cannot be processed, the default routing node is selected for forwarding, which reduces the transmission path of the message and improves the processing efficiency of the message.

另外,本发明实施方式提供的消息处理方法,所述采用定向路由规则处理所述消息,包括:保存所述消息中的标识帧,更新所述消息中的标识帧为当前节点预先设置的标识帧;当前节点按照与封装路由帧顺序相反的顺序获取所述消息中的一个路由帧;检查所述路由帧中的业务类型与所述当前节点预先设置的标识帧的业务类型是否一致,其中,若一致,则所述当前节点获取消息内容帧中的消息内容以处理业务,在所述消息中添加新的路由帧,并在所述新的路由帧中设置消息的原始标识帧为下一节点地址,将所述处理业务的结果写入所述消息内容帧中,并发送到所述下一节点;若不一致,检查所述消息中是否有下一个路由帧。根据消息中所有路由帧规定的路由路径实现消息的传输处理,提高了消息的传输效率和时效性。In addition, in the message processing method provided by the embodiment of the present invention, the processing of the message using a directional routing rule includes: saving the identification frame in the message, and updating the identification frame in the message to the identification frame preset by the current node. ; The current node obtains a routing frame in the message according to the reverse order of the encapsulated routing frame order; Check whether the service type in the routing frame is consistent with the service type of the identification frame preset by the current node, wherein, if are consistent, the current node obtains the message content in the message content frame to process the service, adds a new routing frame to the message, and sets the original identification frame of the message in the new routing frame as the address of the next node , write the result of processing the service into the message content frame, and send it to the next node; if inconsistent, check whether there is a next routing frame in the message. The transmission processing of the message is realized according to the routing paths specified by all the routing frames in the message, which improves the transmission efficiency and timeliness of the message.

另外,本发明实施方式提供的消息处系统,包括:所述节点记录与自身建立通道的节点;所述节点提取自身标识帧的业务类型以及与自身建立通道的节点的标识帧的业务类型;所述节点根据业务类型将所有节点进行归类,保存为业务和节点关系记录。消息处理系统中的所有节点都会记录与当前节点建立通道的节点,并将每个节点及其能处理的业务类型归类保存,便于消息路由以及新节点的添加。In addition, the message processing system provided by the embodiment of the present invention includes: the node records the node that establishes the channel with itself; the node extracts the service type of the self-identification frame and the service type of the identification frame of the node that establishes the channel with itself; The above node classifies all nodes according to business types and saves them as business and node relationship records. All nodes in the message processing system will record the nodes that establish a channel with the current node, and classify and save each node and the business types it can handle, which is convenient for message routing and the addition of new nodes.

另外,本发明实施方式提供的消息处理系统,包括:当有新节点接入时,新节点主动发送注册消息到当前节点,其中,所述注册消息按照预先定义的结构进行封装,包含标识帧;所述当前节点获取所述新节点注册消息的标识帧,并更新业务和节点关系记录。新节点接入消息处理系统后,当前节点就可以路由消息到新节点,当前节点相当于也具备了新节点的业务处理能力,从而实现了服务的自发现,生长式的扩展了当前节点的业务能力。In addition, the message processing system provided by the embodiment of the present invention includes: when a new node accesses, the new node actively sends a registration message to the current node, wherein the registration message is encapsulated according to a predefined structure and includes an identification frame; The current node acquires the identification frame of the new node registration message, and updates service and node relationship records. After the new node is connected to the message processing system, the current node can route messages to the new node. The current node is equivalent to having the business processing capability of the new node, thus realizing the self-discovery of services and expanding the business of the current node. ability.

附图说明Description of drawings

一个或多个实施例通过与之对应的附图中的图片进行示例性说明,这些示例性说明并不构成对实施例的限定,附图中具有相同参考数字标号的元件表示为类似的元件,除非有特别申明,附图中的图不构成比例限制。One or more embodiments are exemplified by the pictures in the corresponding drawings, and these exemplifications do not constitute limitations of the embodiments, and elements with the same reference numerals in the drawings are denoted as similar elements, Unless otherwise stated, the figures in the accompanying drawings do not constitute a scale limitation.

图1是本发明的第一实施方式提供的消息处理方法的流程图;1 is a flowchart of a message processing method provided by a first embodiment of the present invention;

图2是本发明的第二实施方式提供的消息处理方法的流程图;2 is a flowchart of a message processing method provided by a second embodiment of the present invention;

图3是图2所示的本发明的第二实施方式提供的消息处理方法中步骤202的流程图;3 is a flowchart of step 202 in the message processing method provided by the second embodiment of the present invention shown in FIG. 2;

图4是图2所示的本发明的第二实施方式提供的消息处理方法中步骤203的流程图;FIG. 4 is a flowchart of step 203 in the message processing method provided by the second embodiment of the present invention shown in FIG. 2;

图5是本发明的第三实施方式提供的消息处理系统的流程图;5 is a flowchart of a message processing system provided by a third embodiment of the present invention;

图6是本发明的第四实施方式提供的消息处理装置的流程图;6 is a flowchart of a message processing apparatus provided by a fourth embodiment of the present invention;

图7是本发明的第七实施方式提供的网络设备的结构示意图。FIG. 7 is a schematic structural diagram of a network device provided by a seventh embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合附图对本发明的各实施方式进行详细的阐述。然而,本领域的普通技术人员可以理解,在本发明各实施方式中,为了使读者更好地理解本申请而提出了许多技术细节。但是,即使没有这些技术细节和基于以下各实施方式的种种变化和修改,也可以实现本申请所要求保护的技术方案。以下各个实施例的划分是为了描述方便,不应对本发明的具体实现方式构成任何限定,各个实施例在不矛盾的前提下可以相互结合相互引用。In order to make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those of ordinary skill in the art can appreciate that, in the various embodiments of the present invention, many technical details are set forth in order for the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present application can be realized. The following divisions of the various embodiments are for the convenience of description, and should not constitute any limitation on the specific implementation of the present invention, and the various embodiments may be combined with each other and referred to each other on the premise of not contradicting each other.

本发明的第一实施方式涉及一种消息处理方法,具体流程如图1所示,包括:The first embodiment of the present invention relates to a message processing method, and the specific process is shown in FIG. 1 , including:

步骤101,接收按照预先定义的结构封装的消息,其中,按照预先定义的结构封装的消息包含标识帧,业务帧,空白帧,内容帧。Step 101: Receive a message encapsulated according to a predefined structure, wherein the message encapsulated according to the predefined structure includes an identification frame, a service frame, a blank frame, and a content frame.

在本实施方式中,标识帧为必须帧,是消息的第一帧,包含源节点能处理的业务类型和源节点的区分码,用于表示消息的身份来源,标识帧表示为IDCode=s.业务类型.区分码;业务帧为必须帧,是消息的第二帧,包含业务类型,用于表示消息要请求的业务,业务帧表示为BizCode=s.业务类型;内容帧为必须帧,包含消息内容,可以使用收发节点双方所接受的任何编码格式来对消息内容进行处理,比如:平文本,json等等,当然,以上仅为具体的举例说明,在实际的使用过程中编码格式可以使用任何现有的编码方法进行操作,此处不做一一赘述。In this embodiment, the identification frame is a necessary frame, which is the first frame of the message, and includes the service type that the source node can handle and the discrimination code of the source node, which is used to indicate the identity source of the message, and the identification frame is represented as IDCode=s. Service type. Distinguishing code; the service frame is a required frame, which is the second frame of the message, including the service type, which is used to indicate the service to be requested by the message, and the service frame is expressed as BizCode=s. Service type; the content frame is a required frame, including The message content can be processed in any encoding format accepted by both the sending and receiving nodes, such as plain text, json, etc. Of course, the above are only specific examples, and the encoding format can be used in actual use. Any existing encoding method is used to perform operations, which will not be repeated here.

步骤102,检查消息中是否包含路由帧,根据检查结果确定相应的路由策略以进行消息的处理。Step 102 , check whether the message contains a routing frame, and determine a corresponding routing policy according to the check result to process the message.

具体地说,路由帧为非必须帧,表示消息规定的路由路径,该帧的内容与标识帧的内容相同。一条消息中可以没有路由帧,也可以有一个或多个路由帧,如果第三帧不是空白帧,那么就是路由帧,路由一直到一个空白帧结束。而空白帧用来分隔消息地址与消息内容,空白帧以上为路由帧,空白帧以下就是内容帧。Specifically, the routing frame is a non-essential frame, indicating the routing path specified by the message, and the content of the frame is the same as the content of the identification frame. There may be no routing frame in a message, or there may be one or more routing frames. If the third frame is not a blank frame, it is a routing frame, and routing will continue until the end of a blank frame. The blank frame is used to separate the message address and the message content. Above the blank frame is the routing frame, and below the blank frame is the content frame.

本发明实施方式相对于现有技术而言,按照预先定义的结构封装消息,使消息中包含标识帧,业务帧,空白帧和内容帧,当前节点根据消息中是够包含路由帧确定相应的路由策略以完成消息的处理,降低消息的传输路径,提高消息的时效性。Compared with the prior art, the embodiment of the present invention encapsulates a message according to a predefined structure, so that the message contains an identification frame, a service frame, a blank frame and a content frame, and the current node determines the corresponding route according to whether the message contains enough routing frames. The strategy is to complete the processing of the message, reduce the transmission path of the message, and improve the timeliness of the message.

本发明的第二实施方式涉及一种消息处理方法,该方法与第一实施方式提供的消息处理方法基本相同,区别之处在于,如图2所示,步骤102包括:The second embodiment of the present invention relates to a message processing method, which is basically the same as the message processing method provided in the first embodiment, except that, as shown in FIG. 2 , step 102 includes:

步骤201,检查消息中是否包含路由帧。Step 201, check whether the message contains a routing frame.

具体地说,若消息中没有路由帧,则执行步骤202,若消息中有路由帧,则执行步骤203。Specifically, if there is no routing frame in the message, step 202 is executed; if there is a routing frame in the message, step 203 is executed.

步骤202,采用盲路由规则处理消息。Step 202, using blind routing rules to process messages.

具体地,如图3所示,步骤202包括:Specifically, as shown in FIG. 3, step 202 includes:

步骤301,保存消息中的标识帧,更新消息中的标识帧为当前节点预先设置的标识帧。In step 301, the identification frame in the message is saved, and the identification frame in the update message is the identification frame preset by the current node.

在本实施方式中,当前节点预先设置的标识帧是在网络部署节点时,根据该节点可以处理的业务类型,为该节点设置标识帧。In this embodiment, the identification frame preset by the current node is when the node is deployed in the network, and the identification frame is set for the node according to the service type that the node can handle.

步骤302,当前节点检查消息中业务帧的业务类型和节点预先设置的标识帧的业务类型是否一致。Step 302, the current node checks whether the service type of the service frame in the message is consistent with the service type of the identification frame preset by the node.

具体地说,若消息中业务帧的业务类型和节点预先设置的标识帧的业务类型一致,则执行步骤303,304和305。Specifically, if the service type of the service frame in the message is consistent with the service type of the identification frame preset by the node, steps 303, 304 and 305 are executed.

步骤303,当前节点获取消息内容帧中的消息内容以处理业务。Step 303, the current node obtains the message content in the message content frame to process the service.

步骤304,在消息中添加路由帧,并在路由帧中设置消息的原始标识帧为下一节点地址。Step 304, adding a routing frame to the message, and setting the original identification frame of the message as the address of the next node in the routing frame.

步骤305,将处理业务的结果写入所述消息内容帧中,并发送到下一节点。Step 305: Write the result of processing the service into the message content frame, and send it to the next node.

若消息中业务帧的业务类型和节点预先设置的标识帧的业务类型不一致,则执行步骤306。If the service type of the service frame in the message is inconsistent with the service type of the identification frame preset by the node, step 306 is executed.

步骤306,在消息中添加路由帧,并在路由帧中设置默认路由节点为下一节点。Step 306, adding a routing frame to the message, and setting the default routing node as the next node in the routing frame.

具体地说,每个节点都有一个默认路由,该默认路由是预先规定好的。Specifically, each node has a default route, which is pre-specified.

步骤203,采用定向路由规则处理消息。Step 203, using the directional routing rule to process the message.

具体地,如图4所示,步骤203包括:Specifically, as shown in Figure 4, step 203 includes:

步骤401,保存消息中的标识帧,更新消息中的标识帧为当前节点预先设置的标识帧。In step 401, the identification frame in the message is saved, and the identification frame in the update message is the identification frame preset by the current node.

在本实施方式中,当前节点预先设置的标识帧是在网络部署节点时,根据该节点可以处理的业务类型,为该节点设置标识帧。In this embodiment, the identification frame preset by the current node is when the node is deployed in the network, and the identification frame is set for the node according to the service type that the node can handle.

步骤402,当前节点按照与封装路由帧顺序相反的顺序获取消息中的一个路由帧。Step 402, the current node obtains a routing frame in the message in the reverse order of the encapsulation routing frame.

步骤403,检查路由帧中的业务类型与当前节点预先设置的标识帧的业务类型是否一致。Step 403: Check whether the service type in the routing frame is consistent with the service type of the identification frame preset by the current node.

具体地说,若路由帧中的业务类型与当前节点预先设置的标识帧的业务类型一致,则执行步骤404,405和406。Specifically, if the service type in the routing frame is consistent with the service type of the identification frame preset by the current node, steps 404, 405 and 406 are executed.

步骤404,当前节点获取消息内容帧中的消息内容以处理业务。Step 404, the current node obtains the message content in the message content frame to process the service.

步骤405,在消息中添加新的路由帧,并在新的路由帧中设置消息的原始标识帧为下一节点地址。Step 405: Add a new routing frame to the message, and set the original identification frame of the message as the address of the next node in the new routing frame.

步骤406,将处理业务的结果写入消息内容帧中,并发送到下一节点。Step 406, the result of processing the service is written into the message content frame, and sent to the next node.

若路由帧中的业务类型与当前节点预先设置的标识帧的业务类型不一致,则执行步骤407。If the service type in the routing frame is inconsistent with the service type of the identification frame preset by the current node, step 407 is executed.

步骤407,检查消息中是否有下一个路由帧。Step 407, check whether there is a next routing frame in the message.

具体地说,若消息中有下一个路由帧,则执行步骤408和409。Specifically, if there is a next routing frame in the message, steps 408 and 409 are executed.

步骤408,当前节点获取路由帧。Step 408, the current node obtains the routing frame.

步骤409,检查当前节点与路由帧对应的节点是否建立了通道。Step 409 , check whether a channel is established between the current node and the node corresponding to the routing frame.

具体地,若当前节点与路由帧对应的节点建立了通道,则执行步骤409;若没有建立通道,则执行步骤410。Specifically, if a channel is established between the current node and the node corresponding to the routing frame, step 409 is executed; if no channel is established, step 410 is executed.

步骤409,将消息发送至路由帧对应的节点。Step 409: Send the message to the node corresponding to the routing frame.

步骤410,在消息中添加新的路由帧,并在新的路由帧中设置默认路由节点为下一节点。Step 410, adding a new routing frame to the message, and setting the default routing node as the next node in the new routing frame.

若消息中没有下一个路由帧,则执行步骤411和412。If there is no next routing frame in the message, steps 411 and 412 are executed.

步骤411,更新消息内容帧为错误状态。Step 411, update the message content frame to an error state.

步骤412,在消息中添加新的路由帧,并在新的路由帧中设置消息的原始标识帧为下一节点地址并发送到下一节点。Step 412: Add a new routing frame to the message, and set the original identification frame of the message in the new routing frame as the address of the next node and send it to the next node.

本发明实施方式相对于现有技术而言,在实现第一实施方式带来的有益效果基础上,根据消息中是否包含路由帧,确定使用盲路由规则还是定向路由规则来处理消息,实现了消息的非定向传输和定向传输,提高了消息的传输效率和时效性。Compared with the prior art, the embodiments of the present invention, based on the beneficial effects brought by the first embodiment, determine whether to use blind routing rules or directional routing rules to process messages according to whether a routing frame is included in the message. The non-directional transmission and directional transmission improve the transmission efficiency and timeliness of the message.

本发明的第三实施方式涉及一种消息处理系统,如图5所示,包括:The third embodiment of the present invention relates to a message processing system, as shown in FIG. 5 , including:

发送节点,用于将按照预先定义的结构封装的消息发送给接收节点,其中,所述按照预先定义的结构封装的消息包含标识帧,业务帧,空白帧,内容帧;a sending node, configured to send a message encapsulated according to a predefined structure to a receiving node, wherein the message encapsulated according to the predefined structure includes an identification frame, a service frame, a blank frame, and a content frame;

接收节点,用于接收按照预先定义的结构封装的消息,检查所述消息中是否包含路由帧,根据检查结果确定相应的路由策略以进行消息的处理;a receiving node, configured to receive a message encapsulated according to a predefined structure, check whether the message contains a routing frame, and determine a corresponding routing policy according to the inspection result to process the message;

其中,所述发送节点和接收节点各自携带一个标识帧,所述标识帧包含所述发送节点或所述接收节点能处理的业务类型和所述发送节点或所述接收节点的区分码。Wherein, the sending node and the receiving node each carry an identification frame, and the identification frame includes the service type that the sending node or the receiving node can handle and the distinguishing code of the sending node or the receiving node.

本发明第四实施方式涉及一种消息处理装置,如图6所示,包括:The fourth embodiment of the present invention relates to a message processing apparatus, as shown in FIG. 6 , including:

消息层601,用于对消息按照预先定义的结构进行封装处理,包含消息地址,消息分隔和消息内容;The message layer 601 is used to encapsulate the message according to a predefined structure, including message address, message separation and message content;

包装层602,用于屏蔽不同通信机制的差异;The packaging layer 602 is used to shield the difference of different communication mechanisms;

传输层603,用于传输按照预先定义的结构封装的消息,包含进程内通信和进程间通信。The transport layer 603 is used to transmit messages encapsulated according to a predefined structure, including intra-process communication and inter-process communication.

本发明五实施方式涉及一种网络设备,如图7所示,包括:The fifth embodiment of the present invention relates to a network device, as shown in FIG. 7 , including:

至少一个处理器701;以及,at least one processor 701; and,

与所述至少一个处理器701通信连接的存储器702;其中,a memory 702 in communication with the at least one processor 701; wherein,

所述存储器702存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器701执行,以使所述至少一个处理器701能够执行本发明第一至第五实施方式所述的异常行为检测方法。The memory 702 stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor 701 to enable the at least one processor 701 to execute the first to fifth embodiments of the present invention The abnormal behavior detection method described in the method.

其中,存储器和处理器采用总线方式连接,总线可以包括任意数量的互联的总线和桥,总线将一个或多个处理器和存储器的各种电路连接在一起。总线还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路连接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口在总线和收发机之间提供接口。收发机可以是一个元件,也可以是多个元件,比如多个接收器和发送器,提供用于在传输介质上与各种其他装置通信的单元。经处理器处理的数据通过天线在无线介质上进行传输,进一步,天线还接收数据并将数据传送给处理器。The memory and the processor are connected by a bus, and the bus may include any number of interconnected buses and bridges, and the bus connects one or more processors and various circuits of the memory. The bus may also connect together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides the interface between the bus and the transceiver. A transceiver may be a single element or multiple elements, such as multiple receivers and transmitters, providing a means for communicating with various other devices over a transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives the data and transmits the data to the processor.

处理器负责管理总线和通常的处理,还可以提供各种功能,包括定时,外围接口,电压调节、电源管理以及其他控制功能。而存储器可以被用于存储处理器在执行操作时所使用的数据。The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Instead, memory may be used to store data used by the processor in performing operations.

本领域的普通技术人员可以理解,上述各实施方式是实现本发明的具体实施例,而在实际应用中,可以在形式上和细节上对其作各种改变,而不偏离本发明的精神和范围。Those skilled in the art can understand that the above-mentioned embodiments are specific examples for realizing the present invention, and in practical applications, various changes in form and details can be made without departing from the spirit and the spirit of the present invention. scope.

Claims (8)

1. A message processing method, comprising:
receiving a message packaged according to a predefined structure, wherein the message packaged according to the predefined structure comprises an identification frame, a service frame, a blank frame and a content frame;
checking whether the message contains a routing frame or not, and determining a corresponding routing strategy according to a checking result so as to process the message;
the identification frame comprises a service type which can be processed by the source node and a distinguishing code of the source node, and is used for representing the identity source of the message; the service frame comprises a service type and is used for representing the service requested by the message; the content frame contains the message content;
wherein, the checking whether the message contains the routing frame or not, and determining the corresponding routing strategy according to the checking result to process the message includes:
checking whether the message contains a routing frame;
if the message has no routing frame, processing the message in a non-directional transmission mode by adopting a blind routing rule;
and if the message has a routing frame, processing the message in a directional transmission mode by adopting a directional routing rule, wherein the routing frame is the same as the identification frame.
2. The message processing method according to claim 1, wherein the processing the message in a non-directional transmission manner using the blind routing rule comprises:
storing the identification frame in the message, and updating the identification frame in the message to be the identification frame preset by the current node;
the current node checks whether the service type of the service frame in the message is consistent with the service type of the identification frame preset by the node;
if the message content is consistent with the next node address, the current node acquires the message content in the message content frame to process the service, adds a routing frame in the message, sets an original identification frame of the message in the routing frame as the next node address, writes the result of processing the service into the message content frame, and sends the result to the next node;
and if not, adding a routing frame in the message, and setting a default routing node as a next node in the routing frame.
3. The message processing method according to claim 1, wherein the processing the message in a directional transmission manner by using a directional routing rule comprises:
storing the identification frame in the message, and updating the identification frame in the message to be the identification frame preset by the current node;
the current node acquires a routing frame in the message according to the sequence opposite to the sequence of the encapsulated routing frame;
checking whether the service type in the routing frame is consistent with the service type of an identification frame preset by the current node, wherein if so, the current node acquires the message content in the message content frame to process the service, adds a new routing frame in the message, sets the original identification frame of the message in the new routing frame as the address of the next node, writes the result of processing the service into the message content frame, and sends the result to the next node;
if not, checking whether the message has the next routing frame.
4. The message processing method of claim 3, wherein said checking whether there is a next routing frame in the message comprises:
if the message has a next routing frame, the current node acquires the routing frame, and checks whether the current node and a node corresponding to the routing frame establish a channel, wherein if the channel is established, the message is sent to the node corresponding to the routing frame, if the channel is not established, a new routing frame is added into the message, and a default routing node is set in the new routing frame as the next node;
and if the message has no next routing frame, updating the message content frame to be in an error state, adding a new routing frame into the message, setting an original identification frame of the message in the new routing frame as a next node address, and sending the next node address to the next node.
5. A message processing system, comprising:
the system comprises a sending node and a receiving node, wherein the sending node is used for sending a message packaged according to a predefined structure to the receiving node, and the message packaged according to the predefined structure comprises an identification frame, a service frame, a blank frame and a content frame;
the receiving node is used for receiving the message encapsulated according to the predefined structure, checking whether the message contains a routing frame or not, and determining a corresponding routing strategy according to the checking result so as to process the message;
the sending node and the receiving node respectively carry an identification frame, and the identification frame comprises service types which can be processed by the sending node or the receiving node and distinguishing codes of the sending node or the receiving node;
wherein, the checking whether the message contains the routing frame, and determining the corresponding routing strategy according to the checking result to process the message includes:
checking whether the message contains a routing frame;
if the message has no routing frame, processing the message in a non-directional transmission mode by adopting a blind routing rule;
and if the message has a routing frame, processing the message in a directional transmission mode by adopting a directional routing rule, wherein the routing frame is the same as the identification frame.
6. Message processing system according to claim 5, characterized in that it comprises:
the node records a node establishing a channel with the node;
the node extracts the service type of the self identification frame and the service type of the identification frame of the node establishing a channel with the node;
and classifying all the nodes according to the service types by the nodes, and storing the nodes as service and node relation records.
7. Message processing system according to claim 5, characterized in that it comprises:
when a new node is accessed, the new node actively sends a registration message to the current node, wherein the registration message is encapsulated according to a predefined structure and comprises an identification frame;
and the current node acquires the identification frame of the new node registration message and updates the service and node relation record.
8. A network device, comprising:
at least one processor; and (c) a second step of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message processing method of any one of claims 1 to 4.
CN202011339906.8A 2020-11-25 2020-11-25 Message processing method, system, apparatus and network device Active CN112565088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011339906.8A CN112565088B (en) 2020-11-25 2020-11-25 Message processing method, system, apparatus and network device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011339906.8A CN112565088B (en) 2020-11-25 2020-11-25 Message processing method, system, apparatus and network device

Publications (2)

Publication Number Publication Date
CN112565088A CN112565088A (en) 2021-03-26
CN112565088B true CN112565088B (en) 2022-10-18

Family

ID=75043748

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011339906.8A Active CN112565088B (en) 2020-11-25 2020-11-25 Message processing method, system, apparatus and network device

Country Status (1)

Country Link
CN (1) CN112565088B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754487A (en) * 2008-12-08 2010-06-23 华为技术有限公司 Management and control method and device of multi-business transmission network
CN102006231A (en) * 2010-11-23 2011-04-06 北京华环电子股份有限公司 Method and device for establishing intelligent route of data service network element as well as data service transmission apparatus
CN102883399A (en) * 2012-10-19 2013-01-16 南京大学 Cluster-based CTP (coordinated test program) routing protocol

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100459580C (en) * 2006-02-13 2009-02-04 杭州华三通信技术有限公司 Method of forwarding services with three-layer resilient packet ring
CN101227418B (en) * 2007-01-19 2012-04-04 华为技术有限公司 A method, device and system for realizing fusion of IP messages
CN102511145B (en) * 2010-05-25 2014-11-05 华为技术有限公司 Method, system and corresponding apparatus for implementing policy and charging control
JP5035480B1 (en) * 2012-01-27 2012-09-26 オムロン株式会社 Data relay device, data transmission device, network system
CN102857975B (en) * 2012-10-19 2014-12-31 南京大学 Method for establishing load balance CTP (Collection Tree Protocol) routing protocol
CN104079482B (en) * 2013-03-26 2017-06-27 华为技术有限公司 A kind of method and device of selection routed path
CN105763443A (en) * 2016-04-28 2016-07-13 西安电子科技大学 HWMP-based double route cooperation method
CN110168512A (en) * 2016-12-12 2019-08-23 跨端口网路解决公司 AD-HOC for connecting network host and peripheral equipment senses exchange data circuit
CN108345621B (en) * 2017-01-24 2022-03-08 腾讯科技(深圳)有限公司 Data reconciliation method, system and data system
CN109120528B (en) * 2017-06-23 2020-12-01 华为技术有限公司 Network communication method and related equipment
CN107704502B (en) * 2017-08-28 2021-10-29 创新先进技术有限公司 Routing method, device, equipment and system
US10659252B2 (en) * 2018-01-26 2020-05-19 Nicira, Inc Specifying and utilizing paths through a network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101754487A (en) * 2008-12-08 2010-06-23 华为技术有限公司 Management and control method and device of multi-business transmission network
CN102006231A (en) * 2010-11-23 2011-04-06 北京华环电子股份有限公司 Method and device for establishing intelligent route of data service network element as well as data service transmission apparatus
CN102883399A (en) * 2012-10-19 2013-01-16 南京大学 Cluster-based CTP (coordinated test program) routing protocol

Also Published As

Publication number Publication date
CN112565088A (en) 2021-03-26

Similar Documents

Publication Publication Date Title
KR102434610B1 (en) Handover method, device and system
CN111556136B (en) Data interaction method between internal containers of power edge Internet of things agent
US20210136653A1 (en) Internet of Things Service Routing Method
US6799220B1 (en) Tunneling management messages over a channel architecture network
US20140112171A1 (en) Network system and method for improving routing capability
WO2020038443A1 (en) Bridging communication method and device
WO2022042235A1 (en) Data packet sending method and apparatus, data packet processing method and apparatus, device, and data packet
CN112565334B (en) Access method and device of Internet of things equipment and MQTT gateway
US11917523B2 (en) Polymorphic network control system and method supporting mobile access of terminal
CN108446105A (en) A kind of Lightweight AP I Server Development Frameworks and development approach
CN115065637A (en) Method and device for transmitting computing power resource information and electronic equipment
CN108199903B (en) Distributed aggregation system configuration method and device
CN112565088B (en) Message processing method, system, apparatus and network device
US20230308346A1 (en) Method for configuring a terminal device
WO2022116009A1 (en) Data transmission method and apparatus, and communication device
CN101510901B (en) Communication method, communication apparatus and system between distributed equipment
JP7584204B2 (en) Apparatus, method and program for data processing
US11451513B2 (en) Notification device and notification method
CN108848156B (en) Access gateway processing method, device and storage medium
US8036218B2 (en) Technique for achieving connectivity between telecommunication stations
JPWO2022201445A5 (en)
CN114079974A (en) Network capability opening method and device, UPF entity and CPE network element
CN110190985A (en) The method that management equipment is managed remote storage device
US11811658B1 (en) Method for mobile ad-hoc network (manet) multi-hop routing in a broadcast domain
CN104184727B (en) A kind of method and apparatus of message transmission

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