CN105553832A - Message sending and receiving method and device - Google Patents
Message sending and receiving method and device Download PDFInfo
- Publication number
- CN105553832A CN105553832A CN201510997710.0A CN201510997710A CN105553832A CN 105553832 A CN105553832 A CN 105553832A CN 201510997710 A CN201510997710 A CN 201510997710A CN 105553832 A CN105553832 A CN 105553832A
- Authority
- CN
- China
- Prior art keywords
- message
- transmitted
- transmission
- sending
- relevant parameters
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/234—Monitoring or handling of messages for tracking messages
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明提供了一种消息发送、接收方法及装置,该消息发送方法包括:在发送设备中生成待传输消息,其中,待传输消息中携带有目的地址;获取待传输消息的相关参数,利用相关参数为待传输消息生成其对应的标识ID;在待传输消息中添加对应标识ID;利用发送设备发送已添加ID的待传输消息至目的地。上述技术方案,通过待传输消息附加的ID在每一个节点生成的记录,可以掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。
The present invention provides a message sending and receiving method and device. The message sending method includes: generating a message to be transmitted in a sending device, wherein the message to be transmitted carries a destination address; obtaining relevant parameters of the message to be transmitted, using the relevant The parameter is to generate the corresponding identification ID for the message to be transmitted; add the corresponding identification ID to the message to be transmitted; use the sending device to send the message to be transmitted with the added ID to the destination. In the above technical solution, through the records generated at each node by the ID attached to the message to be transmitted, the transmission path of each transmission message can be grasped, and the transmission status during the transmission process of the transmission message can be known.
Description
技术领域technical field
本发明涉及计算机技术领域,特别是涉及一种消息发送、接收方法及装置。The invention relates to the field of computer technology, in particular to a message sending and receiving method and device.
背景技术Background technique
随着通信技术和网络技术的迅速发展,产生了大量消息传递类的应用工具,例如,消息发布订阅系统,该系统中存在三种角色,分别为生产者(producer)、代理(broker)、消费者(consumer)。Producer向某个topic发布消息,而consumer订阅某个topic的消息,进而一旦有新的关于某个topic的消息,broker会传递给订阅它的consumer。With the rapid development of communication technology and network technology, a large number of application tools for message delivery have been produced, such as message publishing and subscription systems. There are three roles in this system, namely producer (producer), agent (broker), consumer The consumer. The Producer publishes a message to a topic, and the consumer subscribes to a topic message, and once there is a new message about a topic, the broker will pass it to the consumer who subscribes to it.
现有技术中,消息在producer、broker、consumer三者之间进行传递过程中时,不能掌握消息的传递路径,无法了解消息传递的状态。In the prior art, when a message is transmitted among the producer, broker, and consumer, the transmission path of the message cannot be grasped, and the status of the message transmission cannot be known.
发明内容Contents of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的消息发送、接收方法及装置。In view of the above problems, the present invention is proposed to provide a message sending and receiving method and device for overcoming the above problems or at least partially solving the above problems.
基于本发明的一个方面,提供了一种消息发送方法,包括:Based on one aspect of the present invention, a method for sending a message is provided, including:
在发送设备中生成待传输消息,其中,所述待传输消息中携带有目的地址;generating a message to be transmitted in the sending device, wherein the message to be transmitted carries a destination address;
获取所述待传输消息的相关参数,利用所述相关参数为所述待传输消息生成其对应的标识ID;Acquire relevant parameters of the message to be transmitted, and use the relevant parameters to generate a corresponding identification ID for the message to be transmitted;
在所述待传输消息中添加对应标识ID;Adding a corresponding identification ID in the message to be transmitted;
利用所述发送设备发送已添加ID的待传输消息至所述目的地。Sending the ID-added message to be transmitted to the destination by using the sending device.
可选地,获取所述待传输消息的相关参数,具体包括:Optionally, obtaining relevant parameters of the message to be transmitted specifically includes:
获取所述待传输消息的下列至少之一的相关参数:所述发送设备的IP地址、MAC地址、目的地址、发送时间戳。Obtaining at least one of the following related parameters of the message to be transmitted: IP address, MAC address, destination address, and sending time stamp of the sending device.
可选地,利用所述相关参数为所述待传输消息生成其对应的ID,具体包括:Optionally, using the relevant parameters to generate a corresponding ID for the message to be transmitted, specifically includes:
利用预设规则将获取的多个相关参数排序并调整,以生成其对应的ID。The obtained multiple related parameters are sorted and adjusted by using preset rules to generate their corresponding IDs.
可选地,所述利用预设规则将获取的多个相关参数排序并调整,包括:Optionally, using preset rules to sort and adjust the obtained multiple related parameters includes:
将多个相关参数按预定顺序排列;arranging a plurality of relevant parameters in a predetermined order;
在各相关参数间设置间隔符和/或间隔字段。Set a spacer and/or space field between related parameters.
可选地,在所述待传输消息中添加对应标识ID,具体包括:Optionally, adding a corresponding identification ID to the message to be transmitted specifically includes:
在所述待传输消息的头部添加对应ID;或者,Adding a corresponding ID to the header of the message to be transmitted; or,
在所述待传输消息的尾部添加对应ID。Add the corresponding ID at the end of the message to be transmitted.
可选地,还包括:Optionally, also include:
在所述发送设备的key-value存储列表中存储所述待传输消息的相关参数,其中,所述待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。Store the relevant parameters of the message to be transmitted in the key-value storage list of the sending device, wherein the ID of the message to be transmitted is used as a stored key, and a specific value or at least a part of its related parameters is used as a stored value.
可选地,将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述待传输消息的原key-value存储列表。Optionally, the updated key-value storage list is uploaded to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the message to be transmitted is stored.
基于本发明的另一个方面,还提供了一种消息接收方法,包括:Based on another aspect of the present invention, a message receiving method is also provided, including:
接收带标识ID的传输消息,其中,所述ID根据所述传输消息的相关参数生成;receiving a transmission message with an identification ID, wherein the ID is generated according to relevant parameters of the transmission message;
获取所述传输消息的ID,并解析以获取所述传输消息的相关参数;Obtaining the ID of the transmission message, and parsing it to obtain relevant parameters of the transmission message;
在接收设备中记录所述传输消息的ID和所述相关参数。Recording the ID of the transmission message and the related parameters in the receiving device.
可选地,所述相关参数包括下列至少之一:Optionally, the relevant parameters include at least one of the following:
发送所述传输消息的发送设备的IP地址、MAC地址、目的地址、发送时间戳;The IP address, MAC address, destination address, and sending timestamp of the sending device sending the transmission message;
所述接收设备的IP地址、MAC地址、接收时间戳。The IP address, MAC address, and receiving time stamp of the receiving device.
可选地,在接收设备中记录所述传输消息的ID和所述相关参数,具体包括:Optionally, record the ID of the transmission message and the related parameters in the receiving device, specifically including:
在所述接收设备中以key-value存储列表中存储所述传输消息的相关参数,其中,所述传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。Store related parameters of the transmission message in a key-value storage list in the receiving device, wherein the ID of the transmission message is used as a storage key, and a specific value or at least a part of its related parameters is used as a storage value.
可选地,将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述传输消息的原key-value存储列表。Optionally, the updated key-value storage list is uploaded to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the transmission message is stored.
基于本发明的另一个方面,还提供了一种消息发送装置,设置于消息的发送设备中,包括:Based on another aspect of the present invention, there is also provided a message sending device, which is set in a message sending device, including:
消息生成模块,适于在所述发送设备中生成待传输消息,其中,所述待传输消息中携带有目的地址;A message generating module, adapted to generate a message to be transmitted in the sending device, wherein the message to be transmitted carries a destination address;
标识生成模块,适于获取所述待传输消息的相关参数,利用所述相关参数为所述待传输消息生成其对应的标识ID;An identification generating module, adapted to obtain relevant parameters of the message to be transmitted, and use the relevant parameters to generate a corresponding identification ID for the message to be transmitted;
添加模块,适于在所述待传输消息中添加对应标识ID;An adding module, adapted to add a corresponding identification ID to the message to be transmitted;
发送模块,适于利用所述发送设备发送已添加ID的待传输消息至所述目的地。A sending module, adapted to use the sending device to send the ID-added message to be transmitted to the destination.
可选地,所述标识生成模块还适于:Optionally, the identification generation module is also suitable for:
获取所述待传输消息的下列至少之一的相关参数:所述发送设备的IP地址、MAC地址、目的地址、发送时间戳。Obtaining at least one of the following related parameters of the message to be transmitted: IP address, MAC address, destination address, and sending time stamp of the sending device.
可选地,所述标识生成模块还适于:Optionally, the identification generation module is also suitable for:
利用预设规则将获取的多个相关参数排序并调整,以生成其对应的ID。The obtained multiple related parameters are sorted and adjusted by using preset rules to generate their corresponding IDs.
可选地,所述标识生成模块还适于:Optionally, the identification generation module is also suitable for:
将多个相关参数按预定顺序排列;arranging a plurality of relevant parameters in a predetermined order;
在各相关参数间设置间隔符和/或间隔字段。Set a spacer and/or space field between related parameters.
可选地,所述添加模块还适于:Optionally, the added module is also suitable for:
在所述待传输消息的头部添加对应ID;或者,Adding a corresponding ID to the header of the message to be transmitted; or,
在所述待传输消息的尾部添加对应ID。Add the corresponding ID at the end of the message to be transmitted.
可选地,还包括:Optionally, also include:
存储模块,适于在所述发送设备的key-value存储列表中存储所述待传输消息的相关参数,其中,所述待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。The storage module is adapted to store the relevant parameters of the message to be transmitted in the key-value storage list of the sending device, wherein the ID of the message to be transmitted is used as a storage key, and a specific value or at least a part of its related parameters is used as store value.
可选地,还包括:Optionally, also include:
第一上传模块,适于将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述待传输消息的原key-value存储列表。The first upload module is adapted to upload the updated key-value storage list to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the message to be transmitted is stored.
基于本发明的另一个方面,还提供了一种消息接收装置,设置于消息的接收设备,包括:Based on another aspect of the present invention, there is also provided a message receiving device, which is set on a message receiving device, including:
接收模块,适于接收带标识ID的传输消息,其中,所述ID根据所述传输消息的相关参数生成;The receiving module is adapted to receive a transmission message with an identification ID, wherein the ID is generated according to relevant parameters of the transmission message;
获取模块,适于获取所述传输消息的ID,并解析以获取所述传输消息的相关参数;An acquisition module, adapted to acquire the ID of the transmission message, and parse it to obtain relevant parameters of the transmission message;
记录模块,适于在接收设备中记录所述传输消息的ID和所述相关参数。The recording module is adapted to record the ID of the transmission message and the related parameters in the receiving device.
可选地,所述相关参数包括下列至少之一:Optionally, the relevant parameters include at least one of the following:
发送所述传输消息的发送设备的IP地址、MAC地址、目的地址、发送时间戳;The IP address, MAC address, destination address, and sending timestamp of the sending device sending the transmission message;
所述接收设备的IP地址、MAC地址、接收时间戳。The IP address, MAC address, and receiving time stamp of the receiving device.
可选地,所述记录模块还适于:Optionally, the recording module is also suitable for:
在所述接收设备中以key-value存储列表中存储所述待传输消息的相关参数,其中,所述待传输消息的ID作为存储key,其特定值或其相关参数的至少一部分作为存储value。Store related parameters of the message to be transmitted in a key-value storage list in the receiving device, wherein the ID of the message to be transmitted is used as a storage key, and its specific value or at least a part of its related parameters is used as a storage value.
可选地,还包括:Optionally, also include:
第二上传模块,适于将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述传输消息的原key-value存储列表。The second upload module is adapted to upload the updated key-value storage list to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the transmission message is stored.
采用本发明实施例中的方法,待传输消息生成之后,并不是立即发送至目的地,而是利用待传输消息的相关参数,生成一个标识ID,并将生成的ID添加至待传输消息,使ID成为待传输消息的一部分,再将附有ID的待传输消息发送出去。由于ID已成为待传输消息的一部分,使得在待传输消息经过的每一个节点中,均会生成对应的ID的记录。通过待传输消息附加的ID在每一个节点生成的记录,可以掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。若出现传输消息发送过程中出现异常情况,例如,传输中断,或者传输消息丢失,在每一个节点中查询是否存在传输消息对应的ID,进一步确定该传输消息在哪个节点出现异常,因此,通过本发明实施例提供的方法,便于用户快速查找出传输过程中的出现异常情况的节点。Using the method in the embodiment of the present invention, after the message to be transmitted is generated, it is not sent to the destination immediately, but an identification ID is generated by using the relevant parameters of the message to be transmitted, and the generated ID is added to the message to be transmitted, so that The ID becomes part of the message to be transmitted, and then the message to be transmitted with the ID is sent out. Since the ID has become a part of the message to be transmitted, a record of the corresponding ID will be generated in each node through which the message to be transmitted passes. Through the records generated at each node by the ID attached to the message to be transmitted, the transmission path of each transmission message can be grasped, and the transmission status during the transmission process of the transmission message can be understood. If there is an abnormal situation in the process of sending the transmission message, for example, the transmission is interrupted, or the transmission message is lost, check whether there is an ID corresponding to the transmission message in each node, and further determine which node the transmission message is abnormal. Therefore, through this The method provided by the embodiment of the invention is convenient for the user to quickly find out the abnormal node in the transmission process.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
根据下文结合附图对本发明具体实施例的详细描述,本领域技术人员将会更加明了本发明的上述以及其他目的、优点和特征。Those skilled in the art will be more aware of the above and other objects, advantages and features of the present invention according to the following detailed description of specific embodiments of the present invention in conjunction with the accompanying drawings.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:
图1示出了根据本发明一个实施例的消息发送方法的处理流程示意图;FIG. 1 shows a schematic diagram of a processing flow of a message sending method according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的消息接收方法的处理流程示意图;FIG. 2 shows a schematic diagram of a processing flow of a message receiving method according to an embodiment of the present invention;
图3示出了根据本发明一个实施例的消息发送装置的结构示意图;FIG. 3 shows a schematic structural diagram of a message sending device according to an embodiment of the present invention;
图4示出了根据本发明一个实施例的消息发送装置的另一种结构示意图;FIG. 4 shows another schematic structural diagram of a message sending device according to an embodiment of the present invention;
图5示出了根据本发明一个实施例的消息接收装置的结构示意图;以及FIG. 5 shows a schematic structural diagram of a message receiving device according to an embodiment of the present invention; and
图6示出了根据本发明一个实施例的消息接收装置的另一种结构示意图。Fig. 6 shows another schematic structural diagram of a message receiving device according to an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
为解决上述技术问题,本发明实施例提供了一种消息发送方法。图1示出了根据本发明一个实施例的消息发送方法的处理流程示意图。参见图1,该方法至少包括以下步骤S102至步骤S108。In order to solve the above technical problem, an embodiment of the present invention provides a message sending method. Fig. 1 shows a schematic diagram of a processing flow of a method for sending a message according to an embodiment of the present invention. Referring to Fig. 1, the method at least includes the following steps S102 to S108.
首先,本发明实施例执行步骤S102,在发送设备中生成待传输消息,其中,待传输消息中携带有目的地址。First, the embodiment of the present invention executes step S102 to generate a message to be transmitted in the sending device, wherein the message to be transmitted carries a destination address.
生成待传输消息后,执行步骤S104,获取待传输消息的相关参数,利用相关参数为待传输消息生成其对应的标识ID。After the message to be transmitted is generated, step S104 is executed to obtain relevant parameters of the message to be transmitted, and use the relevant parameters to generate a corresponding identification ID for the message to be transmitted.
生成待传输消息对应的ID后,执行步骤S106,在传输消息中添加对应标识ID。After the ID corresponding to the message to be transmitted is generated, step S106 is executed to add the corresponding identification ID to the transmission message.
最后,执行步骤S108,利用发送设备发送已添加ID的待传输消息至目的地。Finally, step S108 is executed, using the sending device to send the message to be transmitted with the ID added to the destination.
采用本发明实施例中的方法,待传输消息生成之后,并不是立即发送至目的地,而是利用待传输消息的相关参数,生成一个标识(ID),并将生成的ID添加至待传输消息,使ID成为待传输消息的一部分,再将附有ID的待传输消息发送出去。由于ID已成为待传输消息的一部分,使得在待传输消息经过的每一个节点中,均会生成对应的ID的记录。通过待传输消息附加的ID在每一个节点生成的记录,可以掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。若出现传输消息发送过程中出现异常情况,例如,传输中断,或者传输消息丢失,在每一个节点中查询是否存在传输消息对应的ID,进一步确定该传输消息在哪个节点出现异常,因此,通过本发明实施例提供的方法,便于用户快速查找出传输过程中的出现异常情况的节点。Using the method in the embodiment of the present invention, after the message to be transmitted is generated, it is not sent to the destination immediately, but an identification (ID) is generated by using the relevant parameters of the message to be transmitted, and the generated ID is added to the message to be transmitted , make the ID a part of the message to be transmitted, and then send the message to be transmitted with the ID attached. Since the ID has become a part of the message to be transmitted, a record of the corresponding ID will be generated in each node through which the message to be transmitted passes. Through the records generated at each node by the ID attached to the message to be transmitted, the transmission path of each transmission message can be grasped, and the transmission status during the transmission process of the transmission message can be understood. If there is an abnormal situation in the process of sending the transmission message, for example, the transmission is interrupted, or the transmission message is lost, check whether there is an ID corresponding to the transmission message in each node, and further determine which node the transmission message is abnormal. Therefore, through this The method provided by the embodiment of the invention is convenient for the user to quickly find out the abnormal node in the transmission process.
每一个待传输消息相对于其他待传输消息具有唯一性,而ID相当于待传输消息的身份,为了能够区分出每一个待传输消息,因此,需要每一个待传输消息对应唯一的ID,尽量利用具有唯一性的相关参数生成对应的ID,使得每一个待传输消息对应的ID也具有唯一性。待传输消息对应的ID具有唯一性后,使得待传输消息附加的ID在每一个节点生成的记录也具有唯一性,更有利于掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。Each message to be transmitted is unique compared to other messages to be transmitted, and the ID is equivalent to the identity of the message to be transmitted. In order to be able to distinguish each message to be transmitted, each message to be transmitted needs to correspond to a unique ID. Try to use The unique related parameters generate the corresponding ID, so that the ID corresponding to each message to be transmitted is also unique. After the ID corresponding to the message to be transmitted is unique, the record generated by the ID attached to the message to be transmitted is also unique at each node, which is more conducive to mastering the delivery path of each message to be transmitted and understanding the transmission process of the message to be transmitted state.
在本发明的一个优选实施例中,ID根据待传输消息的相关参数生成,其中,待传输消息的相关参数至少包括下列之一:发送设备的IP地址、MAC地址、目的地址、发送时间戳。In a preferred embodiment of the present invention, the ID is generated according to the relevant parameters of the message to be transmitted, wherein the relevant parameters of the message to be transmitted include at least one of the following: IP address, MAC address, destination address, and sending time stamp of the sending device.
需要说明地是,互联网协议地址(InternetProtocolAddress,简称IP地址),是IP协议提供的一种统一的地址格式,它为互联网上的每一个网络和每一台主机分配一个逻辑地址。媒体访问地址(MediaAccessControl,简称MAC),或称为物理地址、硬件地址,用来定义网络设备的位置,表示互联网上每一个站点的符。由此得出,一个主机会有一个唯一的MAC地址,而每个网络位置会有一个专属于它的IP地址,IP地址和MAC地址均具有唯一性。It should be noted that the Internet Protocol Address (Internet Protocol Address, referred to as IP address) is a unified address format provided by the IP protocol, which assigns a logical address to each network and each host on the Internet. Media access address (MediaAccessControl, referred to as MAC), or called physical address, hardware address, is used to define the location of network equipment and represent the identifier of each site on the Internet. It can be concluded that a host will have a unique MAC address, and each network location will have an IP address dedicated to it, and both the IP address and the MAC address are unique.
为了使生成的ID具有唯一性,本发明实施例将具有唯一性的相关参数生成对应的ID,例如,发送设备的IP地址、MAC地址、发送时间戳。In order to make the generated ID unique, the embodiment of the present invention generates a corresponding ID with unique related parameters, for example, the IP address, MAC address, and sending timestamp of the sending device.
在本发明的一个优选实施例中,利用预设规则将获取的多个待传输消息的相关参数排序并调整,生成对应的ID。其中,多个相关参数至少包括一个具有唯一性的相关参数,例如,发送设备的IP地址、MAC地址、发送时间戳等。具体地,待传输消息对应的ID的生成步骤为将多个相关参数按预定顺序排列,然后在各相关参数间设置间隔符和/或间隔字段。例如,生成待传输消息对应的ID的相关参数为发送设备的IP地址、发送时间戳,其中,IP地址为192.168.1.1,发送时间戳为2015年12月20日10:00。IP地址、发送时间戳这两个相关参数的预定顺序为IP地址、发送时间戳,并且在这两个相关参数之间设置加号,则生成的ID为192.168.1.1+2015年12月20日10:00。若发送设备生成新的待传输消息,新的待传输消息对应的ID为192.168.1.1+2015年12月20日10:20。根据待传输消息的ID中的IP地址区分出不同发送设备的地址,根据待传输消息的ID中的发送时间戳区分出同一发送设备中不同待传输消息,使得待传输消息生成的ID具有唯一性,使得待传输消息附加的ID在每一个节点生成的记录也具有唯一性,更有利于掌握每条传输消息的传递路径。In a preferred embodiment of the present invention, preset rules are used to sort and adjust the acquired relevant parameters of the multiple messages to be transmitted, and generate corresponding IDs. Wherein, the multiple related parameters include at least one unique related parameter, for example, the IP address, MAC address, sending time stamp, etc. of the sending device. Specifically, the step of generating the ID corresponding to the message to be transmitted is to arrange a plurality of related parameters in a predetermined order, and then set a spacer and/or a space field between each related parameter. For example, the relevant parameters for generating the ID corresponding to the message to be transmitted are the IP address of the sending device and the sending time stamp, where the IP address is 192.168.1.1, and the sending time stamp is 10:00 on December 20, 2015. The predetermined order of the two related parameters of IP address and sending timestamp is IP address and sending timestamp, and if a plus sign is set between these two related parameters, the generated ID is 192.168.1.1+December 20, 2015 10:00. If the sending device generates a new message to be transmitted, the ID corresponding to the new message to be transmitted is 192.168.1.1+10:20 on December 20, 2015. Distinguish the addresses of different sending devices according to the IP address in the ID of the message to be transmitted, and distinguish different messages to be transmitted in the same sending device according to the sending timestamp in the ID of the message to be transmitted, so that the ID generated by the message to be transmitted is unique , so that the record generated by the ID attached to the message to be transmitted is also unique at each node, which is more conducive to mastering the delivery path of each message to be transmitted.
需要说明地是,生成ID的多个相关参数的个数可任意选择,各相关参数间设置的间隔符还可为冒号、分号等,另外,ID中包括的各相关参数还可选择设置间隔字段进行连接。本发明实施例中关于待传输消息对应的ID的例举仅仅是一个示例,对本发明并不造成任何限定。It should be noted that the number of multiple related parameters that generate the ID can be selected arbitrarily, and the spacers set between the related parameters can also be colons, semicolons, etc. In addition, the related parameters included in the ID can also choose to set interval fields to connect. The enumeration of the ID corresponding to the message to be transmitted in the embodiment of the present invention is only an example, and does not impose any limitation on the present invention.
待传输消息对应的ID生成之后,将其添加在待传输消息中,具体地,在待传输消息的头部添加对应的ID,或者,在待传输消息的尾部添加对应的ID。待传输消息的添加位置按照传输协议执行,便于传输过程中接收方接收到传输消息后,能够识别并解析出对应的ID。After the ID corresponding to the message to be transmitted is generated, it is added to the message to be transmitted, specifically, the corresponding ID is added to the header of the message to be transmitted, or the corresponding ID is added to the tail of the message to be transmitted. The adding position of the message to be transmitted is implemented according to the transmission protocol, so that the receiving party can identify and parse out the corresponding ID after receiving the transmission message during the transmission process.
生成的ID添加至对应的待传输消息后,将附有ID的待传输消息发送出去,此时,将待传输消息的相关参数存储到发送设备的关键字-值(key-value)存储列表中,其中,在key-value存储列表中的key列存储待传输消息的ID,在key-value存储列表中的value列存储特定值或其相关参数的至少一部分。After the generated ID is added to the corresponding message to be transmitted, the message to be transmitted with the ID is sent out, at this time, the relevant parameters of the message to be transmitted are stored in the key-value (key-value) storage list of the sending device , wherein the key column in the key-value storage list stores the ID of the message to be transmitted, and the value column in the key-value storage list stores a specific value or at least a part of its related parameters.
具体地,若生成的ID中包括了待传输消息的所有相关参数,在key-value存储列表中的key列存储待传输消息的ID,为了节省存储空间,key-value存储列表中的value列可存储无意义的特定值(例如0\false\F),以符合key-value存储列表的存储格式。若生成的ID中包括了待传输消息的部分相关参数,key-value存储列表中的value列可存储对应的ID中没有包括的相关参数,或者key-value存储列表中的value列可存储对应的ID中没有包括的相关参数中的一部分,该部分相关参数可根据实际情况具体选定。例如,待传输消息包括10个相关参数,若生成的ID中包括了待传输消息的4个相关参数,此时,key-value存储列表中的value列可存储对应的ID中没有包括的6个相关参数,或者,key-value存储列表中的value列可存储对应的ID中没有包括的6个相关参数中的2个,其中,本发明实施例中的相关参数的个数仅作为具体例举,对本发明并不造成任何限定。Specifically, if the generated ID includes all relevant parameters of the message to be transmitted, the key column in the key-value storage list stores the ID of the message to be transmitted. In order to save storage space, the value column in the key-value storage list can be Store meaningless specific values (such as 0\false\F) to conform to the storage format of the key-value storage list. If the generated ID includes some relevant parameters of the message to be transmitted, the value column in the key-value storage list can store relevant parameters not included in the corresponding ID, or the value column in the key-value storage list can store the corresponding Part of the relevant parameters not included in the ID, the relevant parameters of this part can be selected according to the actual situation. For example, the message to be transmitted includes 10 related parameters. If the generated ID includes 4 related parameters of the message to be transmitted, at this time, the value column in the key-value storage list can store 6 parameters that are not included in the corresponding ID. Related parameters, or, the value column in the key-value storage list can store 2 of the 6 related parameters not included in the corresponding ID, wherein the number of related parameters in the embodiment of the present invention is only a specific example , does not impose any limitation on the present invention.
存储完成后,将key-value存储列表上传至分布式存储系统。其中,分布式存储系统,是将数据分散存储在多台独立的设备上,分布式网络存储系统采用可扩展的系统结构,利用多台存储服务器分担存储负荷,利用位置服务器定位存储信息,它不但提高了系统的可靠性、可用性和存取效率,还易于扩展。After the storage is complete, upload the key-value storage list to the distributed storage system. Among them, the distributed storage system is to disperse and store data on multiple independent devices. The distributed network storage system adopts a scalable system structure, uses multiple storage servers to share the storage load, and uses location servers to locate and store information. It not only It improves the reliability, availability and access efficiency of the system, and is also easy to expand.
若发送设备生成新的待传输消息,相应地,为该待传输消息生成对应的ID,当该附有ID的待传输消息发送出去后,将该已发送的待传输消息的相关参数存储到发送设备的key-value存储列表中。由于key-value存储列表增加了ID和相关参数的信息,将本次更新后的key-value存储列表上传至分布式存储系统,由分布式存储系统更新其上存储待传输消息的原key-value存储列表。If the sending device generates a new message to be transmitted, correspondingly, a corresponding ID is generated for the message to be transmitted, and when the message to be transmitted with the ID is sent out, the relevant parameters of the sent message to be transmitted are stored in the sending In the key-value storage list of the device. Since the key-value storage list has added ID and related parameter information, upload the updated key-value storage list to the distributed storage system, and the distributed storage system will update the original key-value on which the message to be transmitted is stored Store the list.
基于同一发明构思,本发明实施例还提供了一种消息接收方法。图2示出了根据本发明一个实施例的消息接收方法的处理流程示意图。参见图2,该方法至少包括以下步骤S202至步骤S206。Based on the same inventive concept, the embodiment of the present invention also provides a message receiving method. Fig. 2 shows a schematic flowchart of a message receiving method according to an embodiment of the present invention. Referring to Fig. 2, the method at least includes the following steps S202 to S206.
首先,本发明实施例执行步骤S202,接收带标识ID的传输消息,其中,ID根据传输消息的相关参数生成。First, the embodiment of the present invention executes step S202 to receive a transmission message with an ID, wherein the ID is generated according to relevant parameters of the transmission message.
接收完传输消息后,执行步骤S204,获取传输消息的ID,并解析以获取传输消息的相关参数。After the transmission message is received, step S204 is executed to obtain the ID of the transmission message and parse it to obtain relevant parameters of the transmission message.
最后,执行步骤S206,在接收设备中记录传输消息的ID和相关参数。Finally, step S206 is executed to record the ID and related parameters of the transmission message in the receiving device.
采用本发明实施例提供的方法,接收设备接收带ID的传输消息后,获取传输消息的ID,并记录传输消息的ID,即在接收环节生成传输消息的一个记录,便于用户掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。Using the method provided by the embodiment of the present invention, after receiving the transmission message with ID, the receiving device obtains the ID of the transmission message and records the ID of the transmission message, that is, a record of the transmission message is generated in the receiving link, so that the user can grasp each transmission message The delivery path to understand the delivery status during the transmission of the transmission message.
接收设备接收到附有ID的待传输消息后,在本发明的一个优选实施例中,在接收设备中不仅记录传输消息的ID,还要记录发送设备的IP地址、MAC地址、目的地址、发送时间戳,以及接收设备的IP地址、MAC地址、接收时间戳。After the receiving device receives the message to be transmitted with the ID attached, in a preferred embodiment of the present invention, not only the ID of the transmitted message is recorded in the receiving device, but also the IP address, MAC address, destination address, sending Timestamp, as well as the receiving device's IP address, MAC address, and receiving timestamp.
将记录的传输消息的ID和相关参数存储到接收设备的key-value存储列表中,其中,在key-value存储列表中的key列存储待传输消息的ID,在key-value存储列表中的value列存储特定值或其相关参数的至少一部分作为存储value。接收设备的key-value存储列表中存储待传输消息的ID和相关参数,相当于在接收环节对传输消息进行记录。Store the ID and related parameters of the recorded transmission message in the key-value storage list of the receiving device, wherein the key column in the key-value storage list stores the ID of the message to be transmitted, and the value in the key-value storage list A column stores a specific value or at least part of its associated parameter as a stored value. The ID and related parameters of the message to be transmitted are stored in the key-value storage list of the receiving device, which is equivalent to recording the transmitted message in the receiving link.
具体地,若生成的ID中包括了待传输消息的所有相关参数,在接收设备的key-value存储列表中的key列存储待传输消息的ID,为了节省存储空间,key-value存储列表中的value列可存储无意义的特定值(例如,0\false\F),以符合key-value存储列表的存储格式。若生成的ID中包括了待传输消息的部分相关参数,key-value存储列表中的value列可存储对应的ID中没有包括的相关参数,或者key-value存储列表中的value列可存储对应的ID中没有包括的相关参数中的一部分,该部分相关参数可根据实际情况具体选定。例如,待传输消息包括10个相关参数,若生成的ID中包括了待传输消息的4个相关参数,此时,key-value存储列表中的value列可存储对应的ID中没有包括的6个相关参数,或者,key-value存储列表中的value列可存储对应的ID中没有包括的6个相关参数中的2个,其中,本发明实施例中涉及的相关参数的个数仅作为具体例举,对本发明并不造成任何限定。Specifically, if the generated ID includes all relevant parameters of the message to be transmitted, the key column in the key-value storage list of the receiving device stores the ID of the message to be transmitted. In order to save storage space, the key-value storage list in the key-value storage list The value column can store meaningless specific values (for example, 0\false\F) to conform to the storage format of the key-value storage list. If the generated ID includes some relevant parameters of the message to be transmitted, the value column in the key-value storage list can store relevant parameters not included in the corresponding ID, or the value column in the key-value storage list can store the corresponding Part of the relevant parameters not included in the ID, the relevant parameters of this part can be selected according to the actual situation. For example, the message to be transmitted includes 10 related parameters. If the generated ID includes 4 related parameters of the message to be transmitted, at this time, the value column in the key-value storage list can store 6 parameters that are not included in the corresponding ID. Related parameters, or, the value column in the key-value storage list can store 2 of the 6 related parameters that are not included in the corresponding ID, wherein the number of related parameters involved in the embodiment of the present invention is only used as a specific example For example, it does not impose any limitation on the present invention.
接收设备完成存储后,将key-value存储列表上传至分布式存储系统。若接收设备又接收到传输消息,相应地,将传输消息对应的ID和相关参数存储到接收设备的key-value存储列表中。由于接收设备的key-value存储列表增加了ID和相关参数的信息,将本次更新后的key-value存储列表上传至分布式存储系统,由分布式存储系统覆盖掉其上存储的接收设备的上传的原key-value存储列表。After the receiving device completes the storage, it uploads the key-value storage list to the distributed storage system. If the receiving device receives the transmission message again, correspondingly, the ID and related parameters corresponding to the transmission message are stored in the key-value storage list of the receiving device. Since the key-value storage list of the receiving device has added ID and related parameter information, the updated key-value storage list is uploaded to the distributed storage system, and the distributed storage system overwrites the information of the receiving device stored on it. The uploaded original key-value storage list.
需要补充地是,传输消息从源地址发送出来,到达目的地址之前,传输过程中会通过一些中间环节,例如,路由器,传输消息在经过路由器时,也需要对传输消息进行解析,并将传输消息对应的ID记录下来。What needs to be added is that before the transmission message is sent from the source address and reaches the destination address, it will pass through some intermediate links during the transmission process, such as a router. When the transmission message passes through the router, it also needs to parse the transmission message and convert the transmission message The corresponding ID is recorded.
综上,在传输消息的发送环节、中间环节、接收环节均记录了传输消息对应的ID,通过每一个环节形成的ID记录,可以掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。To sum up, the ID corresponding to the transmission message is recorded in the sending link, intermediate link, and receiving link of the transmission message. Through the ID records formed in each link, the transmission path of each transmission message can be grasped, and the process of transmitting the message can be understood. Delivery status.
基于同一发明构思,本发明实施例还提供了一种消息发送装置。图3示出了根据本发明一个实施例的消息发送装置的结构示意图。参见图3,该装置至少包括:Based on the same inventive concept, an embodiment of the present invention also provides a message sending device. Fig. 3 shows a schematic structural diagram of a message sending device according to an embodiment of the present invention. Referring to Figure 3, the device at least includes:
消息生成模块310,适于在发送设备中生成待传输消息,其中,待传输消息中携带有目的地址;The message generation module 310 is adapted to generate a message to be transmitted in the sending device, wherein the message to be transmitted carries a destination address;
标识生成模块320,与消息生成模块310耦合,适于获取待传输消息的相关参数,利用相关参数为待传输消息生成其对应的标识ID;The identification generation module 320, coupled with the message generation module 310, is adapted to obtain relevant parameters of the message to be transmitted, and utilizes the relevant parameters to generate its corresponding identification ID for the message to be transmitted;
添加模块330,与标识生成模块320耦合,适于在待传输消息中添加对应标识ID;The adding module 330, coupled with the identification generating module 320, is suitable for adding a corresponding identification ID in the message to be transmitted;
发送模块340,与添加模块330耦合,适于利用发送设备发送已添加ID的待传输消息至目的地。The sending module 340, coupled with the adding module 330, is adapted to use the sending device to send the to-be-transmitted message with the added ID to the destination.
在本发明的一个优选实施例中,标识生成模块320还适于:In a preferred embodiment of the present invention, the identification generation module 320 is also suitable for:
获取待传输消息的下列至少之一的相关参数:发送设备的IP地址、MAC地址、目的地址、发送时间戳。Obtain relevant parameters of at least one of the following of the message to be transmitted: IP address, MAC address, destination address, and sending time stamp of the sending device.
在本发明的一个优选实施例中,标识生成模块320还适于:In a preferred embodiment of the present invention, the identification generating module 320 is also suitable for:
利用预设规则将获取的多个相关参数排序并调整,以生成其对应的ID。The obtained multiple related parameters are sorted and adjusted by using preset rules to generate their corresponding IDs.
在本发明的一个优选实施例中,标识生成模块320还适于:In a preferred embodiment of the present invention, the identification generation module 320 is also suitable for:
将多个相关参数按预定顺序排列;arranging a plurality of relevant parameters in a predetermined order;
在各相关参数间设置间隔符和/或间隔字段。Set a spacer and/or space field between related parameters.
在本发明的一个优选实施例中,参见图4,消息发送装置还包括:In a preferred embodiment of the present invention, referring to FIG. 4, the message sending device further includes:
存储模块350,与发送模块340耦合,适于在发送设备的key-value存储列表中存储待传输消息的相关参数,其中,待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。The storage module 350, coupled with the sending module 340, is adapted to store relevant parameters of the message to be transmitted in the key-value storage list of the sending device, wherein the ID of the message to be transmitted is used as a storage key, a specific value or at least a part of its relevant parameters As a storage value.
在本发明的一个优选实施例中,参见图4,消息发送装置还包括:In a preferred embodiment of the present invention, referring to FIG. 4, the message sending device further includes:
第一上传模块360,与存储模块350耦合,适于将本次更新后的key-value存储列表上传至分布式存储系统,由分布式存储系统更新其上存储待传输消息的原key-value存储列表。The first upload module 360, coupled with the storage module 350, is suitable for uploading the updated key-value storage list to the distributed storage system, and the distributed storage system updates the original key-value storage on which the message to be transmitted is stored. list.
基于同一发明构思,本发明实施例还提供了一种消息接收装置,设置于消息的接收设备。图5示出了根据本发明一个实施例的消息接收装置的结构示意图。参见图5,该装置至少包括:Based on the same inventive concept, an embodiment of the present invention also provides a message receiving device, which is set in a message receiving device. Fig. 5 shows a schematic structural diagram of a message receiving device according to an embodiment of the present invention. Referring to Figure 5, the device at least includes:
接收模块510,适于接收带标识ID的传输消息,其中,ID根据传输消息的相关参数生成;The receiving module 510 is adapted to receive a transmission message with an ID, wherein the ID is generated according to relevant parameters of the transmission message;
获取模块520,与接收模块510耦合,适于获取传输消息的ID,并解析以获取传输消息的相关参数;The obtaining module 520, coupled with the receiving module 510, is adapted to obtain the ID of the transmission message, and parse it to obtain relevant parameters of the transmission message;
记录模块530,与获取模块520耦合,适于在接收设备中记录传输消息的ID和相关参数。The recording module 530, coupled with the obtaining module 520, is adapted to record the ID and related parameters of the transmission message in the receiving device.
在本发明的一个优选实施例中,相关参数包括下列至少之一:In a preferred embodiment of the present invention, relevant parameters include at least one of the following:
发送传输消息的发送设备的IP地址、MAC地址、目的地址、发送时间戳;The IP address, MAC address, destination address, and sending timestamp of the sending device sending the transmission message;
接收设备的IP地址、MAC地址、接收时间戳。The receiving device's IP address, MAC address, and receiving timestamp.
在本发明的一个优选实施例中,记录模块530还适于:In a preferred embodiment of the present invention, the recording module 530 is also suitable for:
在接收设备中以key-value存储列表中存储待传输消息的相关参数,其中,待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。In the receiving device, the relevant parameters of the message to be transmitted are stored in a key-value storage list, wherein the ID of the message to be transmitted is used as a storage key, and a specific value or at least a part of its related parameters is used as a storage value.
在本发明的一个优选实施例中,参见图6,消息接收装置还包括:In a preferred embodiment of the present invention, referring to FIG. 6, the message receiving device further includes:
第二上传模块540,与记录模块530耦合,适于将本次更新后的key-value存储列表上传至分布式存储系统,由分布式存储系统更新其上存储传输消息的原key-value存储列表。The second upload module 540, coupled with the recording module 530, is adapted to upload the updated key-value storage list to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the transmission message is stored .
综上,采用本发明实施例提供的消息发送、接收方法及装置可以达到如下有益效果:To sum up, the following beneficial effects can be achieved by adopting the message sending and receiving method and device provided by the embodiment of the present invention:
采用本发明实施例中的方法,待传输消息生成之后,并不是立即发送至目的地,而是利用待传输消息的相关参数,生成一个标识ID,并将生成的ID添加至待传输消息,使ID成为待传输消息的一部分,再将附有ID的待传输消息发送出去。由于ID已成为待传输消息的一部分,使得在待传输消息经过的每一个节点中,均会生成对应的ID的记录。通过待传输消息附加的ID在每一个节点生成的记录,可以掌握每条传输消息的传递路径,了解传输消息传输过程中的传递状态。若出现传输消息发送过程中出现异常情况,例如,传输中断,或者传输消息丢失,在每一个节点中查询是否存在传输消息对应的ID,进一步确定该传输消息在哪个节点出现异常,因此,通过本发明实施例提供的方法,便于用户快速查找出传输过程中的出现异常情况的节点。Using the method in the embodiment of the present invention, after the message to be transmitted is generated, it is not sent to the destination immediately, but an identification ID is generated by using the relevant parameters of the message to be transmitted, and the generated ID is added to the message to be transmitted, so that The ID becomes part of the message to be transmitted, and then the message to be transmitted with the ID is sent out. Since the ID has become a part of the message to be transmitted, a record of the corresponding ID will be generated in each node through which the message to be transmitted passes. Through the records generated at each node by the ID attached to the message to be transmitted, the transmission path of each transmission message can be grasped, and the transmission status during the transmission process of the transmission message can be understood. If there is an abnormal situation in the process of sending the transmission message, for example, the transmission is interrupted, or the transmission message is lost, check whether there is an ID corresponding to the transmission message in each node, and further determine which node the transmission message is abnormal. Therefore, through this The method provided by the embodiment of the invention is convenient for the user to quickly find out the abnormal node in the transmission process.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. And form different embodiments. For example, in the claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的消息发送、接收装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the message sending and receiving device according to the embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
至此,本领域技术人员应认识到,虽然本文已详尽示出和描述了本发明的多个示例性实施例,但是,在不脱离本发明精神和范围的情况下,仍可根据本发明公开的内容直接确定或推导出符合本发明原理的许多其他变型或修改。因此,本发明的范围应被理解和认定为覆盖了所有这些其他变型或修改。So far, those skilled in the art should appreciate that, although a number of exemplary embodiments of the present invention have been shown and described in detail herein, without departing from the spirit and scope of the present invention, the disclosed embodiments of the present invention can still be used. Many other variations or modifications consistent with the principles of the invention are directly identified or derived from the content. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.
基于本发明的一个方面,还公开了:A1、一种消息发送方法,包括:Based on one aspect of the present invention, it also discloses: A1, a message sending method, including:
在发送设备中生成待传输消息,其中,所述待传输消息中携带有目的地址;generating a message to be transmitted in the sending device, wherein the message to be transmitted carries a destination address;
获取所述待传输消息的相关参数,利用所述相关参数为所述待传输消息生成其对应的标识ID;Acquire relevant parameters of the message to be transmitted, and use the relevant parameters to generate a corresponding identification ID for the message to be transmitted;
在所述待传输消息中添加对应标识ID;Adding a corresponding identification ID in the message to be transmitted;
利用所述发送设备发送已添加ID的待传输消息至所述目的地。Sending the ID-added message to be transmitted to the destination by using the sending device.
A2、根据A1所述的方法,其中,获取所述待传输消息的相关参数,具体包括:A2. The method according to A1, wherein obtaining relevant parameters of the message to be transmitted includes:
获取所述待传输消息的下列至少之一的相关参数:所述发送设备的IP地址、MAC地址、目的地址、发送时间戳。Obtaining at least one of the following related parameters of the message to be transmitted: IP address, MAC address, destination address, and sending time stamp of the sending device.
A3、根据A2所述的方法,其中,利用所述相关参数为所述待传输消息生成其对应的ID,具体包括:A3. The method according to A2, wherein, using the relevant parameters to generate its corresponding ID for the message to be transmitted, specifically includes:
利用预设规则将获取的多个相关参数排序并调整,以生成其对应的ID。The obtained multiple related parameters are sorted and adjusted by using preset rules to generate their corresponding IDs.
A4、根据A3所述的方法,其中,所述利用预设规则将获取的多个相关参数排序并调整,包括:A4. The method according to A3, wherein said using preset rules to sort and adjust the obtained multiple related parameters includes:
将多个相关参数按预定顺序排列;arranging a plurality of related parameters in a predetermined order;
在各相关参数间设置间隔符和/或间隔字段。Set a spacer and/or space field between related parameters.
A5、根据A1所述的方法,其中,在所述待传输消息中添加对应标识ID,具体包括:A5. The method according to A1, wherein adding a corresponding identification ID to the message to be transmitted specifically includes:
在所述待传输消息的头部添加对应ID;或者,Adding a corresponding ID to the header of the message to be transmitted; or,
在所述待传输消息的尾部添加对应ID。Add the corresponding ID at the end of the message to be transmitted.
A6、根据A1至A5任一项所述的方法,其中,还包括:A6. The method according to any one of A1 to A5, further comprising:
在所述发送设备的key-value存储列表中存储所述待传输消息的相关参数,其中,所述待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。Store the relevant parameters of the message to be transmitted in the key-value storage list of the sending device, wherein the ID of the message to be transmitted is used as a stored key, and a specific value or at least a part of its related parameters is used as a stored value.
A7、根据A6所述的方法,其中,将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述待传输消息的原key-value存储列表。A7. The method according to A6, wherein the updated key-value storage list is uploaded to the distributed storage system, and the distributed storage system updates the original key-value on which the message to be transmitted is stored Store the list.
基于本发明的另一个方面,还公开了B8、一种消息接收方法,包括:Based on another aspect of the present invention, B8, a message receiving method is also disclosed, comprising:
接收带标识ID的传输消息,其中,所述ID根据所述传输消息的相关参数生成;receiving a transmission message with an identification ID, wherein the ID is generated according to relevant parameters of the transmission message;
获取所述传输消息的ID,并解析以获取所述传输消息的相关参数;Obtaining the ID of the transmission message, and parsing it to obtain relevant parameters of the transmission message;
在接收设备中记录所述传输消息的ID和所述相关参数。Recording the ID of the transmission message and the related parameters in the receiving device.
B9、根据B8所述的方法,其中,所述相关参数包括下列至少之一:B9. The method according to B8, wherein the relevant parameters include at least one of the following:
发送所述传输消息的发送设备的IP地址、MAC地址、目的地址、发送时间戳;The IP address, MAC address, destination address, and sending timestamp of the sending device sending the transmission message;
所述接收设备的IP地址、MAC地址、接收时间戳。The IP address, MAC address, and receiving time stamp of the receiving device.
B10、根据B8或B9所述的方法,其中,在接收设备中记录所述传输消息的ID和所述相关参数,具体包括:B10. The method according to B8 or B9, wherein the ID of the transmission message and the related parameters are recorded in the receiving device, specifically including:
在所述接收设备中以key-value存储列表中存储所述传输消息的相关参数,其中,所述传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。Store related parameters of the transmission message in a key-value storage list in the receiving device, wherein the ID of the transmission message is used as a storage key, and a specific value or at least a part of its related parameters is used as a storage value.
B11、根据B10所述的方法,其中,将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述传输消息的原key-value存储列表。B11. The method according to B10, wherein the updated key-value storage list is uploaded to the distributed storage system, and the distributed storage system updates the original key-value storage on which the transmission message is stored list.
基于本发明的另一个方面,还公开了:C12、一种消息发送装置,设置于消息的发送设备中,包括:Based on another aspect of the present invention, it is also disclosed: C12, a message sending device, which is set in a message sending device, including:
消息生成模块,适于在所述发送设备中生成待传输消息,其中,所述待传输消息中携带有目的地址;A message generating module, adapted to generate a message to be transmitted in the sending device, wherein the message to be transmitted carries a destination address;
标识生成模块,适于获取所述待传输消息的相关参数,利用所述相关参数为所述待传输消息生成其对应的标识ID;An identification generating module, adapted to obtain relevant parameters of the message to be transmitted, and use the relevant parameters to generate a corresponding identification ID for the message to be transmitted;
添加模块,适于在所述待传输消息中添加对应标识ID;An adding module, adapted to add a corresponding identification ID to the message to be transmitted;
发送模块,适于利用所述发送设备发送已添加ID的待传输消息至所述目的地。A sending module, adapted to use the sending device to send the ID-added message to be transmitted to the destination.
C13、根据C12所述的装置,其中,所述标识生成模块还适于:C13. The device according to C12, wherein the identification generation module is further adapted to:
获取所述待传输消息的下列至少之一的相关参数:所述发送设备的IP地址、MAC地址、目的地址、发送时间戳。Obtaining at least one of the following related parameters of the message to be transmitted: IP address, MAC address, destination address, and sending time stamp of the sending device.
C14、根据C13所述的装置,其中,所述标识生成模块还适于:C14. The device according to C13, wherein the identification generation module is further adapted to:
利用预设规则将获取的多个相关参数排序并调整,以生成其对应的ID。The obtained multiple related parameters are sorted and adjusted by using preset rules to generate their corresponding IDs.
C15、根据C14所述的装置,其中,所述标识生成模块还适于:C15. The device according to C14, wherein the identification generation module is further adapted to:
将多个相关参数按预定顺序排列;arranging a plurality of related parameters in a predetermined order;
在各相关参数间设置间隔符和/或间隔字段。Set a spacer and/or space field between related parameters.
C16、根据C12所述的装置,其中,所述添加模块还适于:C16. The device according to C12, wherein the adding module is further adapted to:
在所述待传输消息的头部添加对应ID;或者,Adding a corresponding ID to the header of the message to be transmitted; or,
在所述待传输消息的尾部添加对应ID。Add the corresponding ID at the end of the message to be transmitted.
C17、根据C12至C16任一项所述的装置,其中,还包括:C17. The device according to any one of C12 to C16, further comprising:
存储模块,适于在所述发送设备的key-value存储列表中存储所述待传输消息的相关参数,其中,所述待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。The storage module is adapted to store the relevant parameters of the message to be transmitted in the key-value storage list of the sending device, wherein the ID of the message to be transmitted is used as a storage key, and a specific value or at least a part of its related parameters is used as store value.
C18、根据C17所述的装置,其中,还包括:C18. The device according to C17, further comprising:
第一上传模块,适于将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述待传输消息的原key-value存储列表。The first upload module is adapted to upload the updated key-value storage list to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the message to be transmitted is stored.
基于本发明的另一个方面,还公开了:D19、一种消息接收装置,设置于消息的接收设备,包括:Based on another aspect of the present invention, it is also disclosed: D19, a message receiving device, which is set on a message receiving device, including:
接收模块,适于接收带标识ID的传输消息,其中,所述ID根据所述传输消息的相关参数生成;The receiving module is adapted to receive a transmission message with an identification ID, wherein the ID is generated according to relevant parameters of the transmission message;
获取模块,适于获取所述传输消息的ID,并解析以获取所述传输消息的相关参数;An acquisition module, adapted to acquire the ID of the transmission message, and parse it to obtain relevant parameters of the transmission message;
记录模块,适于在接收设备中记录所述传输消息的ID和所述相关参数。The recording module is adapted to record the ID of the transmission message and the related parameters in the receiving device.
D20、根据D19所述的装置,其中,所述相关参数包括下列至少之一:D20. The device according to D19, wherein the relevant parameters include at least one of the following:
发送所述传输消息的发送设备的IP地址、MAC地址、目的地址、发送时间戳;The IP address, MAC address, destination address, and sending timestamp of the sending device sending the transmission message;
所述接收设备的IP地址、MAC地址、接收时间戳。The IP address, MAC address, and receiving time stamp of the receiving device.
D21、根据D19或D20所述的装置,其中,所述记录模块还适于:D21. The device according to D19 or D20, wherein the recording module is further adapted to:
在所述接收设备中以key-value存储列表中存储所述待传输消息的相关参数,其中,所述待传输消息的ID作为存储key,特定值或其相关参数的至少一部分作为存储value。Store related parameters of the message to be transmitted in a key-value storage list in the receiving device, wherein the ID of the message to be transmitted is used as a storage key, and a specific value or at least a part of its related parameters is used as a stored value.
D22、根据D21所述的装置,其中,还包括:D22. The device according to D21, further comprising:
第二上传模块,适于将本次更新后的key-value存储列表上传至分布式存储系统,由所述分布式存储系统更新其上存储所述传输消息的原key-value存储列表。The second upload module is adapted to upload the updated key-value storage list to the distributed storage system, and the distributed storage system updates the original key-value storage list on which the transmission message is stored.
Claims (10)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510997710.0A CN105553832A (en) | 2015-12-25 | 2015-12-25 | Message sending and receiving method and device |
PCT/CN2016/111561 WO2017107963A1 (en) | 2015-12-25 | 2016-12-22 | Message sending and receiving method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510997710.0A CN105553832A (en) | 2015-12-25 | 2015-12-25 | Message sending and receiving method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105553832A true CN105553832A (en) | 2016-05-04 |
Family
ID=55832771
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510997710.0A Pending CN105553832A (en) | 2015-12-25 | 2015-12-25 | Message sending and receiving method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105553832A (en) |
WO (1) | WO2017107963A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106789415A (en) * | 2016-12-12 | 2017-05-31 | 东软集团股份有限公司 | The acquisition method of facility information, apparatus and system |
WO2017107963A1 (en) * | 2015-12-25 | 2017-06-29 | 北京奇虎科技有限公司 | Message sending and receiving method and apparatus |
CN109040334A (en) * | 2018-07-12 | 2018-12-18 | 山东师范大学 | Static Intranet mapping method, external network server, Intranet communication equipment and system |
CN111327687A (en) * | 2020-01-21 | 2020-06-23 | 香港乐蜜有限公司 | Data transmission method and device, electronic equipment and storage medium |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108964985B (en) * | 2018-06-14 | 2020-07-28 | 烽火通信科技股份有限公司 | Method for managing virtual client terminal equipment using protocol message |
CN111338814A (en) * | 2020-02-13 | 2020-06-26 | 北京奇艺世纪科技有限公司 | Message processing method and device, storage medium and electronic device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101436952A (en) * | 2007-11-14 | 2009-05-20 | 华为技术有限公司 | Method for automatically configuring pressing table and network node equipment |
CN101789868A (en) * | 2000-09-26 | 2010-07-28 | 兰代拉·纳特股份公司 | An access point for mobile devices in a packet based network and a method and a system for billing in such a network |
EP2282460A1 (en) * | 2008-06-12 | 2011-02-09 | Huawei Technologies Co., Ltd. | Document transmission realizing method, apparatus and user device for message business |
CN102571635A (en) * | 2012-01-18 | 2012-07-11 | 浪潮(北京)电子信息产业有限公司 | Message transmission method and equipment |
CN103944671A (en) * | 2014-05-22 | 2014-07-23 | 中国地质大学(武汉) | Method and system for real-time transmission of ultra-wideband airborne data based on multichannel aggregation |
CN104935499A (en) * | 2015-05-28 | 2015-09-23 | 杭州华三通信技术有限公司 | Message format conversion method and equipment |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8761181B1 (en) * | 2013-04-19 | 2014-06-24 | Cubic Corporation | Packet sequence number tracking for duplicate packet detection |
CN105553832A (en) * | 2015-12-25 | 2016-05-04 | 北京奇虎科技有限公司 | Message sending and receiving method and device |
-
2015
- 2015-12-25 CN CN201510997710.0A patent/CN105553832A/en active Pending
-
2016
- 2016-12-22 WO PCT/CN2016/111561 patent/WO2017107963A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101789868A (en) * | 2000-09-26 | 2010-07-28 | 兰代拉·纳特股份公司 | An access point for mobile devices in a packet based network and a method and a system for billing in such a network |
CN101436952A (en) * | 2007-11-14 | 2009-05-20 | 华为技术有限公司 | Method for automatically configuring pressing table and network node equipment |
EP2282460A1 (en) * | 2008-06-12 | 2011-02-09 | Huawei Technologies Co., Ltd. | Document transmission realizing method, apparatus and user device for message business |
CN102571635A (en) * | 2012-01-18 | 2012-07-11 | 浪潮(北京)电子信息产业有限公司 | Message transmission method and equipment |
CN103944671A (en) * | 2014-05-22 | 2014-07-23 | 中国地质大学(武汉) | Method and system for real-time transmission of ultra-wideband airborne data based on multichannel aggregation |
CN104935499A (en) * | 2015-05-28 | 2015-09-23 | 杭州华三通信技术有限公司 | Message format conversion method and equipment |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017107963A1 (en) * | 2015-12-25 | 2017-06-29 | 北京奇虎科技有限公司 | Message sending and receiving method and apparatus |
CN106789415A (en) * | 2016-12-12 | 2017-05-31 | 东软集团股份有限公司 | The acquisition method of facility information, apparatus and system |
CN109040334A (en) * | 2018-07-12 | 2018-12-18 | 山东师范大学 | Static Intranet mapping method, external network server, Intranet communication equipment and system |
CN109040334B (en) * | 2018-07-12 | 2021-05-11 | 山东师范大学 | Static intranet mapping method, extranet server, intranet communication device and system |
CN111327687A (en) * | 2020-01-21 | 2020-06-23 | 香港乐蜜有限公司 | Data transmission method and device, electronic equipment and storage medium |
CN111327687B (en) * | 2020-01-21 | 2023-02-21 | 卓米私人有限公司 | Data transmission method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2017107963A1 (en) | 2017-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105553832A (en) | Message sending and receiving method and device | |
CN111901230B (en) | Internet of things gateway and system supporting equipment access verification and equipment access verification method | |
CN105100260A (en) | Method and device for carrying out access through proxy server | |
CN106464746A (en) | Computer system to support failover in event stream processing system | |
CN109274777B (en) | A method, device, equipment and readable storage medium for exporting configuration files | |
EP3206406A1 (en) | Hls protocol-based user information acquisition method and server | |
CN104410680A (en) | Method, client terminal, server and system of sharing file/file folder | |
CN108650519A (en) | The method and device to release news based on block chain | |
CN106790549A (en) | A kind of data-updating method and device | |
TW200841675A (en) | Dispatching client requests to appropriate server-side methods | |
CN104991921A (en) | Data query method, client and server | |
CN104022945A (en) | Method and device for realizing instant communication in client end | |
CN102932471B (en) | Browser logon server and realize browser log in method and system | |
CN111294250B (en) | Pressure testing method, device and system | |
CN104618142B (en) | News subscribing method, treatment node device and bus apparatus | |
JP2022522839A (en) | Methods, equipment, and computer programs for cloud services | |
CN107092502B (en) | Automatic application configuration method and device based on cloud operating system | |
JP2014514639A (en) | System and method for transmitting real-time images | |
CN108173839A (en) | Rights management method and system | |
CN104636135B (en) | A kind of node visit method and system, Client Agent and client | |
CN109618187A (en) | Method and device for acquiring video data | |
CN106055413A (en) | Method, device, server and system for transmitting application configuration items of smart watches | |
CN104410679B (en) | Share extracting method, client, server and the system of file/folder | |
US20160357875A1 (en) | Techniques for promoting and viewing social content written by nearby people | |
CN114793223A (en) | DNS record storage method, device, storage medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160504 |
|
RJ01 | Rejection of invention patent application after publication |