[go: up one dir, main page]

CN108173902A - Data transmission, publication and method for subscribing and device - Google Patents

Data transmission, publication and method for subscribing and device Download PDF

Info

Publication number
CN108173902A
CN108173902A CN201711229189.1A CN201711229189A CN108173902A CN 108173902 A CN108173902 A CN 108173902A CN 201711229189 A CN201711229189 A CN 201711229189A CN 108173902 A CN108173902 A CN 108173902A
Authority
CN
China
Prior art keywords
data
publisher
server
subscriber
sent
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
Application number
CN201711229189.1A
Other languages
Chinese (zh)
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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201711229189.1A priority Critical patent/CN108173902A/en
Priority to PCT/CN2017/116924 priority patent/WO2019104772A1/en
Publication of CN108173902A publication Critical patent/CN108173902A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

This application discloses a kind of data transmission, publication and method for subscribing, for solving the problems, such as that the data transmission in the prior art between data publication side and subscriber does not ensure reliability.This method includes:Receive the first data that data publication side is sent;Determine the data type of first data;According to the mapping relations between the data publication side, data subscription side and the data type pre-established, data subscription side corresponding with the data type of first data is determined;First data are sent to the data subscription side.Disclosed herein as well is a kind of data transmission, publication and subscribe to device.

Description

数据传输、发布及订阅方法和装置Data transmission, publication and subscription method and device

技术领域technical field

本申请涉及无线通信技术领域,尤其涉及一种数据传输、发布及订阅方法和装置。The present application relates to the technical field of wireless communication, and in particular to a data transmission, publishing and subscribing method and device.

背景技术Background technique

随着物联网技术的快速发展,各种类型的传感器遍布现实世界的各个角落,这些传感器可探测包括地震、电磁、温度、湿度、噪声、光强度、压力、土壤成分、移动物体的大小、速度和方向等周边环境中多种多样的物理量。通过传感器探测的这些物理量在军事侦探、环境检测、工业监测、活动感知及健康医疗等应用领域有着广泛的应用背景。With the rapid development of Internet of Things technology, various types of sensors are spread in every corner of the real world. These sensors can detect earthquakes, electromagnetics, temperature, humidity, noise, light intensity, pressure, soil composition, size, speed and Various physical quantities in the surrounding environment such as directions. These physical quantities detected by sensors have a wide range of application backgrounds in military detectives, environmental detection, industrial monitoring, activity perception, and health care.

目前,伴随着移动互联网的发展,这些传感器所形成的网络可以作为数据的发布方,为有使用这些数据需求的数据订阅方提供这些数据。当数据订阅方想要获取某些传感数据时,可以向数据发布方发送订阅请求,以获取这些传感器探测的数据。At present, with the development of the mobile Internet, the network formed by these sensors can serve as a data publisher and provide these data for data subscribers who need to use these data. When the data subscriber wants to obtain some sensory data, it can send a subscription request to the data publisher to obtain the data detected by these sensors.

在上述场景中,数据发布方在接收到数据订阅方的数据订阅请求之后,往往只按照数据订阅方的数据订阅请求,将与数据订阅请求相关的数据发送给数据订阅方,而不保证数据传输的可靠性,这将导致某些数据比如告警数据可能没有被数据订阅方收到。In the above scenario, after receiving the data subscription request from the data subscriber, the data publisher often only sends the data related to the data subscription request to the data subscriber according to the data subscription request of the data subscriber, without guaranteeing data transmission reliability, which will cause some data such as alarm data may not be received by data subscribers.

发明内容Contents of the invention

本申请实施例提供数据传输、发布及订阅方法和装置,用于解决现有技术中数据发布方与数据订阅方之间的数据传输不保证可靠性的问题。The embodiments of the present application provide methods and devices for data transmission, publication and subscription, which are used to solve the problem in the prior art that data transmission between a data publisher and a data subscriber does not guarantee reliability.

本申请实施例采用下述技术方案:The embodiment of the application adopts the following technical solutions:

一种数据传输方法,所述方法应用于服务器,包括:A data transmission method, the method being applied to a server, comprising:

接收数据发布方发送的第一数据;receiving the first data sent by the data publisher;

确定所述第一数据的数据类型;determining the data type of the first data;

根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;determining a data subscriber corresponding to the data type of the first data according to the pre-established mapping relationship between the data publisher, the data subscriber and the data type;

将所述第一数据发送给所述数据订阅方。Send the first data to the data subscriber.

一种数据发布方法,所述方法应用于数据发布方,包括:A method for publishing data, said method being applied to a data publisher, comprising:

接收服务器发送的数据订阅请求;Receive the data subscription request sent by the server;

向所述服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据。Sending first data matching the data type included in the data subscription request to the server.

一种数据发布方法,所述方法应用于数据发布方,包括:A method for publishing data, said method being applied to a data publisher, comprising:

接收服务器发送的数据订阅请求;Receive the data subscription request sent by the server;

向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。Sending first data matching the data type contained in the data subscription request to the server.

一种服务器,包括:A server comprising:

接收单元,用于接收数据发布方发送的第一数据;a receiving unit, configured to receive the first data sent by the data publisher;

第一确定单元,用于确定所述第一数据的数据类型;a first determining unit, configured to determine the data type of the first data;

第二确定单元,用于根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;The second determining unit is configured to determine the data subscriber corresponding to the data type of the first data according to the pre-established mapping relationship between the data publisher, the data subscriber and the data type;

第一发送单元,用于将所述第一数据发送给所述数据订阅方。A first sending unit, configured to send the first data to the data subscriber.

一种数据发布装置,包括:A data publishing device, comprising:

接收单元,用于接收服务器发送的数据订阅请求;a receiving unit, configured to receive a data subscription request sent by the server;

发送单元,用于向所述服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据。A sending unit, configured to send the first data matching the data type included in the data subscription request to the server.

一种数据订阅装置,包括:A data subscription device, comprising:

发送单元,用于向服务器发送数据订阅请求;a sending unit, configured to send a data subscription request to the server;

接收单元,用于接收服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。The receiving unit is configured to receive the first data sent by the server and matching the data type included in the data subscription request.

本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:The above at least one technical solution adopted in the embodiment of the present application can achieve the following beneficial effects:

本申请中,服务器能够首先接收数据发布方发送的第一数据,确定第一数据的数据类型,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,再将第一数据发送给数据订阅方,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,从而保证了数据发布方与数据订阅方之间数据传输的可靠性。In this application, the server can first receive the first data sent by the data publisher, determine the data type of the first data, and determine the data type of the first data according to the pre-established mapping relationship between the data publisher, data subscriber and data type. The data subscriber corresponding to the data type, and then send the first data to the data subscriber. Since the first data sent by the data publisher can be forwarded to the data subscriber through the server, the relationship between the data publisher and the data subscriber is guaranteed. Reliability of data transmission.

本申请中,数据发布方能够接收服务器发送的数据订阅请求,然后向服务器发送与订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。In this application, the data publisher can receive the data subscription request sent by the server, and then send the first data matching the data type contained in the subscription request to the server, because the server can forward the first data sent by the data publisher to the data The subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.

本申请中,数据订阅方能够向服务器发送数据订阅请求,再接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。In this application, the data subscriber can send a data subscription request to the server, and then receive the first data sent by the server that matches the data type contained in the data subscription request, because the server can forward the first data sent by the data publisher to the The data subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The schematic embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation to the application. In the attached picture:

图1为本申请实施例提供的数据传输方法的实现流程示意图;FIG. 1 is a schematic diagram of the implementation flow of the data transmission method provided by the embodiment of the present application;

图2本申请提供的数据传输方法应用在实际场景中的示意图;Fig. 2 is a schematic diagram of the application of the data transmission method provided by this application in an actual scene;

图3为本申请实施例提供的数据发布方法的实现流程示意图;FIG. 3 is a schematic diagram of the implementation flow of the data release method provided by the embodiment of the present application;

图4为本申请实施例提供的数据订阅方法的实现流程示意图;FIG. 4 is a schematic diagram of the implementation flow of the data subscription method provided by the embodiment of the present application;

图5为本申请实施例提供的方法中数据传输的过程示意图;5 is a schematic diagram of the process of data transmission in the method provided by the embodiment of the present application;

图6为本申请实施例提供的方法中服务等级为0的数据传输的过程示意图;6 is a schematic diagram of the process of data transmission with service level 0 in the method provided by the embodiment of the present application;

图7为本申请实施例提供的方法中服务等级为1的数据传输的过程示意图;7 is a schematic diagram of the process of data transmission with service level 1 in the method provided by the embodiment of the present application;

图8为本申请实施例提供的方法中服务等级为2的数据传输的过程示意图;FIG. 8 is a schematic diagram of the process of data transmission with service level 2 in the method provided by the embodiment of the present application;

图9为本申请实施例提供的服务器的结构示意图;FIG. 9 is a schematic structural diagram of a server provided by an embodiment of the present application;

图10为本申请实施例提供的数据发布装置的结构示意图;FIG. 10 is a schematic structural diagram of a data release device provided by an embodiment of the present application;

图11为本申请实施例提供的数据订阅装置的结构示意图;FIG. 11 is a schematic structural diagram of a data subscription device provided by an embodiment of the present application;

图12为本申请实施例提供的数据订阅及发布系统的结构示意图。FIG. 12 is a schematic structural diagram of the data subscription and publishing system provided by the embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments of the present application and corresponding drawings. Apparently, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.

以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by various embodiments of the present application will be described in detail below in conjunction with the accompanying drawings.

为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例提供一种数据传输方法,该方法的执行主体可以是服务器,也可以是任何实现本申请提供的方法的装置。下面,以该方法的执行主体是服务器为例,对该方法的实施方式进行详细介绍,可以理解,该方法的执行主体是服务器只是一种示例性的说明,并不应理解为对该方法的限定。In order to solve the problem in the prior art that the reliability of data transmission between the data publisher and the subscriber is not guaranteed, this embodiment of the application provides a data transmission method, the execution subject of this method can be a server, or any Applies to the means provided by the method. In the following, taking the execution subject of the method as an example, the implementation of the method will be introduced in detail. It can be understood that the execution subject of the method is a server is only an exemplary description, and should not be understood as an explanation of the method. limited.

如图1所示,为本申请实施例提供的数据传输方法应用于服务器的实现流程示意图,包括:As shown in Figure 1, it is a schematic diagram of the implementation process of the data transmission method provided by the embodiment of the present application applied to the server, including:

步骤11,接收数据发布方发送的第一数据;Step 11, receiving the first data sent by the data publisher;

如背景技术中所述,现有技术中,数据发布方与数据订阅方之间的数据传输过程中,并没有保证数据传输的可靠性,这将导致某些重要的数据可能不会被数据订阅方接收到,为了解决这个问题,本申请实施例提供的数据订阅及发布方法可以通过服务器接收数据发布发送的第一数据,保证了该第一数据传输的可靠性。As mentioned in the background technology, in the prior art, the reliability of data transmission is not guaranteed during the data transmission process between the data publisher and the data subscriber, which will cause some important data may not be subscribed by the data The party received, in order to solve this problem, the data subscription and publishing method provided by the embodiment of the present application can receive the first data sent by the data publishing through the server, which ensures the reliability of the first data transmission.

具体来说,该第一数据可以是数据订阅方请求订阅的数据,比如可以包括传感器形成的网络中的传感数据,比如温度、湿度、光强度等传感数据。如图2所示,为本申请实施例提供的数据订阅及发布方法应用在实际场景的示意图,包括数据发布方:现场智能监控单元1~现场智能监控单元3、服务器(存储发布者状态表也就是数据发布方的状态表、订阅/发布关系表也就是下文所述的映射关系以及服务等级过滤表)、数据订阅方:集中监控中心1和集中监控中心2。Specifically, the first data may be data that a data subscriber requests to subscribe, for example, may include sensory data in a network formed by sensors, such as sensory data such as temperature, humidity, and light intensity. As shown in Figure 2, it is a schematic diagram of the application of the data subscription and publishing method provided by the embodiment of the present application in the actual scene, including the data publisher: on-site intelligent monitoring unit 1 ~ on-site intelligent monitoring unit 3, server (storage publisher status table also It is the status table of the data publisher, the subscription/publishing relationship table (that is, the mapping relationship and service level filtering table described below), and the data subscriber: centralized monitoring center 1 and centralized monitoring center 2.

在图2中,数据发布方即现场智能监控单元1~现场智能监控单元3负责监控传感器形成的网络中的传感数据的采集和监控,服务器负责数据订阅方和数据发布方之间的数据传输,数据订阅方即集中监控中心1和集中监控中心2负责监控其所关注的传感数据,也就是监控其请求订阅的传感数据。In Fig. 2, the data publishers, that is, the on-site intelligent monitoring unit 1 to the on-site intelligent monitoring unit 3 are responsible for the collection and monitoring of sensing data in the network formed by monitoring sensors, and the server is responsible for the data transmission between the data subscriber and the data publisher , the data subscribers, that is, the centralized monitoring center 1 and the centralized monitoring center 2 are responsible for monitoring the sensory data they care about, that is, monitoring the sensory data they request to subscribe to.

步骤12,确定第一数据的数据类型;Step 12, determining the data type of the first data;

应理解,不同的数据订阅方请求订阅的数据类型往往都不相同,比如在多种传感器形成的网络中,有些数据订阅方可能主要关注温湿度、而有些数据订阅方则可能主要关注是否会发生火灾,因此在接收到该第一数据后,还可以确定该第一数据的数据类型,该第一数据的数据类型可以是多种类型的传感数据,比如可以是温度传感器采集的温度传感数据、或者是湿度传感器采集的湿度传感数据、还可以是光强度传感器采集的光强度传感数据,等等,其他类型的传感数据。It should be understood that the types of data requested by different data subscribers are often different. For example, in a network formed by multiple sensors, some data subscribers may mainly focus on temperature and humidity, while others may mainly focus on whether Therefore, after receiving the first data, the data type of the first data can also be determined. The data type of the first data can be various types of sensor data, such as temperature sensor data collected by a temperature sensor. The data, or the humidity sensing data collected by the humidity sensor, can also be the light intensity sensing data collected by the light intensity sensor, etc., and other types of sensing data.

步骤13,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方;Step 13, according to the pre-established mapping relationship between the data publisher, the data subscriber and the data type, determine the data subscriber corresponding to the data type of the first data;

如上文所述不同的数据订阅方请求订阅的数据类型往往都不相同,因此在确定了第一数据的数据类型之后,可以根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,从而为不同的数据订阅方提供其所请求订阅的数据。As mentioned above, the data types requested by different data subscribers are often different. Therefore, after the data type of the first data is determined, it can be based on the pre-established mapping between data publishers, data subscribers and data types. relationship, and determine the data subscriber corresponding to the data type of the first data, so as to provide different data subscribers with the data they request to subscribe to.

可选的,数据发布方、数据订阅方与数据类型之间的映射关系的建立则可以首先,接收数据订阅方发送的订阅请求;然后,根据订阅请求,确定订阅请求中包含的数据类型和数据订阅方的地址信息;再根据数据类型,确定与数据类型相匹配的数据发布方;最后建立数据发布方、数据订阅方与数据类型的映射关系。在某些情况下,数据订阅方不再请求订阅某一类型的数据时,也可以向服务器发送取消订阅某一类型的数据的订阅请求,服务器在接收到这一取消订阅请求后,可以解除之前建立的数据发布方、该数据订阅方与该数据类型的映射关系。Optionally, the establishment of the mapping relationship between the data publisher, the data subscriber and the data type can firstly receive the subscription request sent by the data subscriber; then, according to the subscription request, determine the data type and data contained in the subscription request Subscriber's address information; then according to the data type, determine the data publisher that matches the data type; finally establish the mapping relationship between the data publisher, data subscriber and data type. In some cases, when the data subscriber no longer requests to subscribe to a certain type of data, it can also send a subscription request to the server to unsubscribe from a certain type of data. After receiving the unsubscribe request, the server can cancel the previous The established mapping relationship between the data publisher, the data subscriber and the data type.

可选的,通常情况下,在对环境进行监测时,为了降低数据发布方的能耗,本申请实施例中的数据发布方可以包括两种状态:离线状态和在线状态,其中离线状态可以是数据发布方处于休眠的状态,在线状态则可以是数据发布方处于工作的状态。当数据发布方的状态包括离线状态和在线状态时,在接收数据发布方发送的第一数据之前,若确定数据发布方的状态为在线状态,则将订阅请求发送给所述数据发布方,以使得数据发布方发送与订阅请求中包含的数据类型相对应的数据。Optionally, usually, when monitoring the environment, in order to reduce the energy consumption of the data publisher, the data publisher in the embodiment of the present application may include two states: an offline state and an online state, where the offline state may be The data publisher is in a dormant state, and the online state may be that the data publisher is in a working state. When the status of the data publisher includes an offline status and an online status, before receiving the first data sent by the data publisher, if it is determined that the status of the data publisher is an online status, a subscription request is sent to the data publisher to Causes the data publisher to send data corresponding to the data type contained in the subscription request.

步骤14,将第一数据发送给数据订阅方;Step 14, sending the first data to the data subscriber;

在上述确定了请求订阅该第一数据的数据订阅方之后,便可以将该第一数据发送给该数据订阅方,以满足该数据订阅方的数据订阅请求。After the data subscriber requesting to subscribe to the first data is determined, the first data may be sent to the data subscriber to satisfy the data subscription request of the data subscriber.

此外,为了及时释放服务器的空间,若确定第一数据的服务等级为预设的服务等级,则向数据发布方发送数据发布完成消息,用于提示数据发布方删除第一数据。其中,预设的服务等级包括第一等级和第二等级,当确定预设的服务等级为第一等级时,则接收数据发布方发送的第一数据之后,还可以存储第一数据;在将第一数据发送给数据订阅方之后,为了保证第一数据传输的可靠性,还可以向数据发布方发送第一数据发布消息;可选的,为了及时释放服务器的空间,若接收到数据发布方发送的发布释放消息,则删除第一数据。In addition, in order to release the space of the server in time, if it is determined that the service level of the first data is a preset service level, a data publishing completion message is sent to the data publisher to prompt the data publisher to delete the first data. Wherein, the preset service level includes the first level and the second level. When it is determined that the preset service level is the first level, after receiving the first data sent by the data publisher, the first data can also be stored; After the first data is sent to the data subscriber, in order to ensure the reliability of the first data transmission, the first data publishing message can also be sent to the data publisher; optionally, in order to release the space of the server in time, if the data publisher receives If the release message is sent, the first data is deleted.

该第一等级的数据在本申请实施例中可以是一些告警数据,比如当数据发布方确定其采集的数据大于或小于预设的门限值时,则可以向服务器发送该告警数据,服务器在接收到该告警数据,可以根据该告警数据中包含的服务等级标识来确定该告警数据的服务等级,为了保证数据订阅方能够收到该告警数据,服务器可以首先存储该告警数据,并在将该告警数据发送给数据订阅方之后,首先向数据发布方发送该告警数据发布消息,以表明该告警数据已发送至数据订阅方,然后在接收到数据发布方发送的发布释放消息时,删除该第一数据,以释放服务器的存储空间。The first-level data may be some alarm data in the embodiment of the present application. For example, when the data publisher determines that the data it collects is greater than or less than a preset threshold value, it can send the alarm data to the server. After receiving the alarm data, the service level of the alarm data can be determined according to the service level identifier contained in the alarm data. In order to ensure that the data subscriber can receive the alarm data, the server can first store the alarm data, and After the alarm data is sent to the data subscriber, first send the alarm data publishing message to the data publisher to indicate that the alarm data has been sent to the data subscriber, and then delete the first alarm data when receiving the release message sent by the data publisher. data to free up storage space on the server.

应理解,为了能够减少数据发布方的数据冗余,当确定预设的服务等级为第二等级时,则只需向数据发布方发送数据发布完成消息,以使得数据发布方删除第一数据。该第二等级的数据在本申请实施例中可以是数据发布方的状态改变数据,比如当数据发布方的状态从离线状态转变为在线状态或者是在线状态转变为离线状态时,为了便于服务器及时获取其状态改变,数据发布方可以将其状态改变数据发送给服务器。It should be understood that, in order to reduce the data redundancy of the data publisher, when it is determined that the preset service level is the second level, it only needs to send a data publishing completion message to the data publisher, so that the data publisher deletes the first data. The second level of data may be the status change data of the data publisher in this embodiment of the application, for example, when the status of the data publisher changes from offline to online or from online to offline, in order to facilitate the server to Obtain its state change, and the data publisher can send its state change data to the server.

本申请中,服务器能够首先接收数据发布方发送的第一数据,确定第一数据的数据类型,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,再将第一数据发送给数据订阅方,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,从而保证了数据发布方与数据订阅方之间数据传输的可靠性。In this application, the server can first receive the first data sent by the data publisher, determine the data type of the first data, and determine the data type of the first data according to the pre-established mapping relationship between the data publisher, data subscriber and data type. The data subscriber corresponding to the data type, and then send the first data to the data subscriber. Since the first data sent by the data publisher can be forwarded to the data subscriber through the server, the relationship between the data publisher and the data subscriber is guaranteed. Reliability of data transmission.

如图3所示,为本申请实施例提供的数据发布方法的实现流程示意图,包括:As shown in Figure 3, it is a schematic diagram of the implementation flow of the data release method provided by the embodiment of the present application, including:

步骤21,接收服务器发送的数据订阅请求;Step 21, receiving the data subscription request sent by the server;

如上文所述,为了减小数据发布方的功耗,数据发布方的状态可以包括离线状态和在线中状态,当数据发布方的状态包括离线状态和在线状态时,则接收服务器发送的数据订阅请求,具体来说,则可以当数据发布方的状态为在线状态时,则接收服务器发送的数据订阅请求。As mentioned above, in order to reduce the power consumption of the data publisher, the status of the data publisher can include offline status and online status. When the status of the data publisher includes offline status and online status, the data subscription sent by the server is received. The request, specifically, may receive a data subscription request sent by the server when the status of the data publisher is online.

步骤22,向服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据;Step 22, sending the first data matching the data type included in the data subscription request to the server;

可选的,在向服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据之后,若接收到服务器发送的数据发布收到的消息,则向服务器发送发布释放消息,用于提示服务器删除第一数据。Optionally, after sending the first data that matches the data type contained in the data subscription request to the server, if a data release message sent by the server is received, send a release message to the server to prompt the server Delete the first data.

此外,为了减少数据发布方会产生过多的数据冗余,若接收到服务器发送的数据发布完成的消息,则删除第一数据。In addition, in order to reduce excessive data redundancy generated by the data publisher, if the message that the data publishing is completed is received from the server, the first data is deleted.

本申请中,数据发布方能够接收服务器发送的数据订阅请求,然后向服务器发送与订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。In this application, the data publisher can receive the data subscription request sent by the server, and then send the first data matching the data type contained in the subscription request to the server, because the server can forward the first data sent by the data publisher to the data The subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.

如图4所示,为本申请实施例提供的数据订阅方法的实现流程示意图,包括:As shown in Figure 4, it is a schematic diagram of the implementation flow of the data subscription method provided by the embodiment of this application, including:

步骤31,向服务器发送数据订阅请求;Step 31, sending a data subscription request to the server;

步骤32,接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据。Step 32, receiving the first data sent by the server and matching the data type contained in the data subscription request.

本申请中,数据订阅方能够向服务器发送数据订阅请求,再接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。In this application, the data subscriber can send a data subscription request to the server, and then receive the first data sent by the server that matches the data type contained in the data subscription request, because the server can forward the first data sent by the data publisher to the The data subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.

下面以图2所示的本申请提供的数据订阅及发布方法应用在实际场景中的示意图为例,对该方法进行详细介绍,图2所示的服务器中存储了存储发布者状态表也就是数据发布方的状态表、订阅/发布关系表也就是上文所述的映射关系以及服务等级过滤表,该服务器在实际应用中可以是基于消息队列遥测传输(Message Queuing Telemetry Transport,MQTT)协议的消息代理服务器,其中MQTT协议采用了一种轻量级的订阅/发布模式来进行消息传输。The following is a schematic diagram of the application of the data subscription and publishing method provided by the application shown in Figure 2 as an example to introduce the method in detail. The server shown in Figure 2 stores the publisher status table, which is the data The publisher's status table, subscription/publishing relationship table is the above-mentioned mapping relationship and service level filtering table. In practical applications, the server can be a message based on the Message Queuing Telemetry Transport (MQTT) protocol Proxy server, in which the MQTT protocol adopts a lightweight subscription/publishing mode for message transmission.

MQTT针对低带宽,低计算能力,以及不稳定的网络环境做了特殊的优化,可以适用于针对嵌入式智能终端和移动终端的消息推送,能够有效节省终端的耗电量和流量,具有三种消息数据发布服务质量:MQTT is specially optimized for low bandwidth, low computing power, and unstable network environments. It can be applied to message push for embedded smart terminals and mobile terminals, and can effectively save terminal power consumption and traffic. There are three Message data publishing service quality:

(1)“至多一次”,消息数据发布完全依赖底层TCP/IP网络。会发生消息数据丢失或重复。这一级别可用于如下情况,环境传感器数据,丢失一次读记录无所谓,因为不久后还会有第二次发送。本申请实施例中,该“至多一次”可以是数据发布方周期性的采集的环境传感数据。(1) "At most one time", message data publishing completely depends on the underlying TCP/IP network. Message data loss or duplication can occur. This level can be used in the following situations, environmental sensor data, it does not matter if a read record is lost, because there will be a second send in the near future. In the embodiment of the present application, the "at most one time" may be the environmental sensing data collected periodically by the data issuer.

(2)“至少一次”,确保消息到达,但消息重复可能会发生。在本申请实施例中,该服务等级的数据可以是数据发布方的状态改变数据。(2) "at least once", to ensure that the message arrives, but message duplication may occur. In this embodiment of the application, the data of the service level may be status change data of the data issuer.

(3)“只有一次”,确保消息到达一次。这一级别可用于如下情况,在计费系统中,消息重复或丢失会导致不正确的结果。在本申请实施例中,该服务等级的数据可以是数据发布方发送的告警数据。(3) "Only once", to ensure that the message arrives once. This level can be used in cases where duplicate or missing messages can lead to incorrect results in billing systems. In this embodiment of the present application, the data of the service level may be the alarm data sent by the data issuer.

如图5所示为本申请实施例提供的数据订阅及发布方法中数据传输的过程示意图,包括下述步骤:As shown in Figure 5, it is a schematic diagram of the process of data transmission in the data subscription and publishing method provided by the embodiment of the present application, including the following steps:

步骤a,数据发布方向服务器发送状态改变数据;Step a, the data publishing direction sends the state change data to the server;

步骤b,服务器接收到该状态改变数据之后,修改数据发布方状态表;Step b, after the server receives the state change data, it modifies the state table of the data issuer;

步骤c,服务器接收数据订阅方发送的数据订阅请求;Step c, the server receives the data subscription request sent by the data subscriber;

步骤d,服务器验证该数据订阅请求,并在该数据订阅请求验证通过后,将该数据订阅请求添加至订阅列表,该订阅列表中保存了数据订阅方的地址信息、想要订阅的数据类型以及能够提供该数据类型的数据发布方之间的映射关系;Step d, the server verifies the data subscription request, and after the data subscription request is verified, adds the data subscription request to the subscription list, which stores the address information of the data subscriber, the type of data to be subscribed, and The mapping relationship between data publishers that can provide the data type;

步骤e,服务器向数据订阅方发送订阅请求响应,以提示数据订阅方其数据订阅请求发送成功并通过验证;Step e, the server sends a subscription request response to the data subscriber to remind the data subscriber that the data subscription request has been successfully sent and passed the verification;

步骤f,服务器查询数据发布方的状态列表;Step f, the server queries the status list of the data publisher;

步骤g,服务器在确定与数据订阅方请求订阅的数据对应的数据发布方的状态为在线状态时,将其数据订阅请求发送给与数据订阅方请求订阅的数据对应的数据发布方;Step g, when the server determines that the status of the data publisher corresponding to the data requested by the data subscriber is online, send its data subscription request to the data publisher corresponding to the data requested by the data subscriber;

步骤h,数据发布方将第一数据发送给服务器,该第一数据即为与数据订阅方请求订阅的数据对应的数据;Step h, the data publisher sends the first data to the server, and the first data is the data corresponding to the data requested by the data subscriber;

步骤i,服务器接收该第一数据,并查询订阅列表,确定哪些数据订阅方请求订阅了该第一数据;Step i, the server receives the first data, and queries the subscription list to determine which data subscribers request to subscribe to the first data;

步骤j,服务器将该第一数据发送给请求订阅了该第一数据的数据订阅方;Step j, the server sends the first data to the data subscriber who requests to subscribe to the first data;

步骤k,当数据订阅方想要取消其之前发送的数据订阅请求时,可以向服务器发送取消订阅的请求,该取消订阅的请求中包括该数据订阅方的地址信息、想要取消订阅的数据类型;Step k, when the data subscriber wants to cancel the data subscription request sent before, it can send an unsubscribe request to the server, and the unsubscribe request includes the address information of the data subscriber and the type of data to be unsubscribed ;

步骤l,服务器接收到该取消订阅的请求后,可以根据该取消订阅的请求中包括该数据订阅方的地址信息、想要取消订阅的数据类型,将订阅列表中保存的与该数据订阅方的地址信息、想要取消订阅的数据类型以及能够提供该数据类型的数据发布方之间的映射关系解除;Step 1, after the server receives the request for unsubscribing, according to the address information of the data subscriber included in the request for unsubscribing and the type of data to be unsubscribed, the server can store the information in the subscription list that is related to the data subscriber. The mapping relationship between the address information, the data type that you want to unsubscribe, and the data publisher that can provide the data type is released;

步骤m,服务器向数据订阅方发送取消订阅响应,以提示数据订阅方的取消订阅的请求生效。In step m, the server sends an unsubscribe response to the data subscriber to prompt the data subscriber that the unsubscribe request takes effect.

由于本申请实施例中数据发布方与数据订阅方之间的传输的数据可以包括三个服务等级,即周期性的传感数据(该类数据的服务等级在本申请中可以设置为0)、数据发布方的状态改变数据(该类数据的服务等级在本申请中可以设置为1)以及数据发布方的告警数据(该类数据的服务等级在本申请中可以设置为2)。Since the data transmitted between the data publisher and the data subscriber in the embodiment of the present application may include three service levels, that is, periodic sensing data (the service level of this type of data may be set to 0 in this application), The status change data of the data publisher (the service level of this type of data can be set to 1 in this application) and the alarm data of the data publisher (the service level of this type of data can be set to 2 in this application).

如图6所示,为服务等级为0的数据传输的过程示意图,该数据传输过程中,数据发布方将服务等级为0的数据发送给服务器之后,服务器只需将该数据发送给请求订阅该数据的数据订阅方,且数据发布方发送该数据之后便可以丢弃该数据,以减少数据的冗余。As shown in Figure 6, it is a schematic diagram of the data transmission process with a service level of 0. During the data transmission process, after the data publisher sends the data with a service level of 0 to the server, the server only needs to send the data to the request to subscribe to the The data subscriber of the data, and the data publisher can discard the data after sending the data to reduce data redundancy.

如图7所示为服务等级为1的数据传输的过程示意图,该数据传输过程中,数据发布方首先在本地存储将要发送的数据,然后将服务等级为1的数据发送给服务器,服务器再将该数据发送给请求订阅该数据的数据订阅方之后,为保证数据传输的可靠性,还可以向数据发布方发送发布数据响应,以提示该数据已发送至数据订阅方,数据发布方在接收到该发布数据响应后才丢弃其存储的数据。Figure 7 is a schematic diagram of the data transmission process with service level 1. During the data transmission process, the data publisher first stores the data to be sent locally, and then sends the data with service level 1 to the server, and the server sends the data to the server. After the data is sent to the data subscriber who requested to subscribe to the data, in order to ensure the reliability of data transmission, it can also send a release data response to the data publisher to remind that the data has been sent to the data subscriber. The data it stores is discarded only after the Publish Data Response.

如图8所示为服务等级为2的数据传输的过程示意图,该数据传输过程中,数据发布方首先在本地存储将要发送的数据,然后将服务等级为2的数据发送给服务器,服务器在接收到该数据后,首先在本地存储该数据,再将该数据发送给请求订阅该数据的数据订阅方之后,为保证数据传输的可靠性,还可以向数据发布方发送发布收到的消息,以提示该数据已发送至数据订阅方,数据发布方在接收到该发布收到的消息后向服务器发送发布释放的消息,以提示服务器可以丢弃其存储的数据,服务器在接收到该发布释放的消息之后便丢弃其存储的数据,并在丢弃其存储的数据之后,向数据发布方发送发布完成的消息,数据发布方在接收到发布完成的消息之后才丢弃其存储的数据。Figure 8 is a schematic diagram of the process of data transmission with service level 2. During the data transmission process, the data publisher first stores the data to be sent locally, and then sends the data with service level 2 to the server. After receiving the data, first store the data locally, and then send the data to the data subscriber who requests to subscribe to the data, in order to ensure the reliability of data transmission, you can also send the received message to the data publisher to Prompt that the data has been sent to the data subscriber. After receiving the message received by the publication, the data publisher sends a release message to the server to remind the server that it can discard the stored data. After the server receives the release message Afterwards, the stored data is discarded, and after discarding the stored data, a release completion message is sent to the data publisher, and the data publisher discards the stored data only after receiving the release completion message.

为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种服务器40,如图9所示,包括下述功能单元:In order to solve the problem in the prior art that the data transmission between the data publisher and the subscriber does not guarantee reliability, the embodiment of the present application also provides a server 40, as shown in FIG. 9 , including the following functional units:

接收单元41,用于接收数据发布方发送的第一数据;a receiving unit 41, configured to receive the first data sent by the data publisher;

第一确定单元42,用于确定所述第一数据的数据类型;A first determining unit 42, configured to determine the data type of the first data;

第二确定单元43,用于根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;The second determination unit 43 is configured to determine the data subscriber corresponding to the data type of the first data according to the pre-established mapping relationship between the data publisher, the data subscriber and the data type;

第一发送单元44,用于将所述第一数据发送给所述数据订阅方。The first sending unit 44 is configured to send the first data to the data subscriber.

在一种实施方式中,所述服务器还包括:In one embodiment, the server also includes:

第二发送单元45,用于若确定所述第一数据的服务等级为预设的服务等级,则向所述数据发布方发送数据发布完成消息,以使得所述数据发布方删除所述第一数据。The second sending unit 45 is configured to send a data publishing completion message to the data publisher if it is determined that the service level of the first data is a preset service level, so that the data publisher deletes the first data. data.

在一种实施方式中,所述预设的服务等级包括第一等级和第二等级,当确定所述预设的服务等级为所述第一等级时,所述接收单元41接收数据发布方发送的第一数据之后,所述装置还包括:In one embodiment, the preset service level includes a first level and a second level, and when it is determined that the preset service level is the first level, the receiving unit 41 receives the After the first data, the apparatus further includes:

存储单元46,用于存储所述第一数据。The storage unit 46 is configured to store the first data.

则所述第一发送单元44若将所述第一数据发送给所述数据订阅方之后,所述装置还包括:After the first sending unit 44 sends the first data to the data subscriber, the device further includes:

第三发送单元47,用于向所述数据发布方发送第一数据发布消息;A third sending unit 47, configured to send a first data publishing message to the data publishing party;

删除单元48,用于若接收到所述数据发布方发送的发布释放消息,则删除所述第一数据。A deleting unit 48, configured to delete the first data if the release release message sent by the data publisher is received.

在一种实施方式中,所述数据发布方、数据订阅方与所述数据类型之间的映射关系是通过下述功能单元,建立的:In one embodiment, the mapping relationship between the data publisher, the data subscriber and the data type is established through the following functional units:

第一接收单元49,用于接收数据订阅方发送的订阅请求;The first receiving unit 49 is configured to receive a subscription request sent by a data subscriber;

第三确定单元410,用于根据所述订阅请求,确定所述订阅请求中包含的数据类型和所述数据订阅方的地址信息;The third determining unit 410 is configured to determine the type of data contained in the subscription request and the address information of the data subscriber according to the subscription request;

第四确定单元411,用于根据所述数据类型,确定与所述数据类型相匹配的数据发布方;A fourth determining unit 411, configured to determine a data publisher matching the data type according to the data type;

建立单元412,用于建立所述数据发布方、数据订阅方与所述数据类型的映射关系。The establishment unit 412 is configured to establish a mapping relationship between the data publisher, the data subscriber and the data type.

在一种实施方式中,当所述数据发布方的状态包括离线状态和在线状态时,在接收单元41接收数据发布方发送的第一数据之前,所述装置还包括:In one embodiment, when the state of the data publisher includes an offline state and an online state, before the receiving unit 41 receives the first data sent by the data publisher, the device further includes:

第四发送单元413,用于若确定所述数据发布方的状态为在线状态,则将所述订阅请求发送给所述数据发布方,以使得所述数据发布方发送与所述订阅请求中包含的数据类型相对应的数据。The fourth sending unit 413 is configured to send the subscription request to the data publisher if it is determined that the status of the data publisher is online, so that the data publisher sends the subscription request contained in the subscription request. The corresponding data of the data type.

本申请中,服务器能够首先接收数据发布方发送的第一数据,确定第一数据的数据类型,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,再将第一数据发送给数据订阅方,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,从而保证了数据发布方与数据订阅方之间数据传输的可靠性。In this application, the server can first receive the first data sent by the data publisher, determine the data type of the first data, and determine the data type of the first data according to the pre-established mapping relationship between the data publisher, data subscriber and data type. The data subscriber corresponding to the data type, and then send the first data to the data subscriber. Since the first data sent by the data publisher can be forwarded to the data subscriber through the server, the relationship between the data publisher and the data subscriber is guaranteed. Reliability of data transmission.

为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种数据发布装置50,如图10所示,包括下述功能单元:In order to solve the problem in the prior art that the data transmission between the data publisher and the subscriber does not guarantee reliability, the embodiment of the present application also provides a data publishing device 50, as shown in FIG. 10 , including the following functional units:

接收单元51,用于接收服务器发送的数据订阅请求;A receiving unit 51, configured to receive a data subscription request sent by the server;

发送单元52,用于向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。A sending unit 52, configured to send first data matching the data type included in the data subscription request to the server.

在一种实施方式中,所述装置还包括:In one embodiment, the device also includes:

删除单元53,用于若接收到所述服务器发送的数据发布完成的消息,则删除所述第一数据。The deleting unit 53 is configured to delete the first data if receiving the message that the data publishing is completed sent by the server.

在一种实施方式中,所述装置还包括:In one embodiment, the device also includes:

第一发送单元54,用于若接收到所述服务器发送的数据发布收到的消息,则向所述服务器发送发布释放消息,以使得所述服务器删除所述第一数据。The first sending unit 54 is configured to send a release release message to the server if the data release received message sent by the server is received, so that the server deletes the first data.

在一种实施方式中,当所述数据发布方的状态包括离线状态和在线状态时,则接收单元51,用于:In one embodiment, when the state of the data publisher includes an offline state and an online state, the receiving unit 51 is configured to:

当所述数据发布方的状态为所述在线状态时,则接收服务器发送的数据订阅请求。When the status of the data publisher is the online status, the data subscription request sent by the server is received.

本申请中,数据发布方能够接收服务器发送的数据订阅请求,然后向服务器发送与订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。In this application, the data publisher can receive the data subscription request sent by the server, and then send the first data matching the data type contained in the subscription request to the server, because the server can forward the first data sent by the data publisher to the data The subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.

为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种数据订阅装置60,如图11所示,包括下述功能单元:In order to solve the problem in the prior art that the data transmission between the data publisher and the subscriber does not guarantee reliability, the embodiment of the present application also provides a data subscription device 60, as shown in Figure 11, including the following functional units:

发送单元61,用于向服务器发送数据订阅请求;A sending unit 61, configured to send a data subscription request to a server;

接收单元62,用于接收服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。The receiving unit 62 is configured to receive the first data sent by the server and matching the data type included in the data subscription request.

本申请中,数据订阅方能够向服务器发送数据订阅请求,再接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。In this application, the data subscriber can send a data subscription request to the server, and then receive the first data sent by the server that matches the data type contained in the data subscription request, because the server can forward the first data sent by the data publisher to the The data subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.

为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种数据订阅及发布系统70,如图12所示,包括服务器71、数据发布装置72和数据订阅装置73,其中,In order to solve the problem in the prior art that the data transmission between the data publisher and the subscriber does not guarantee reliability, the embodiment of the present application also provides a data subscription and publishing system 70, as shown in FIG. 12 , including a server 71, a data Publishing means 72 and data subscribing means 73, wherein,

所述数据订阅装置73,用于向所述服务器71发送数据订阅请求;The data subscription device 73 is configured to send a data subscription request to the server 71;

接收所述服务器71发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据;receiving the first data sent by the server 71 that matches the data type contained in the data subscription request;

所述数据发布装置72,用于接收所述服务器71发送的数据订阅请求;The data publishing device 72 is configured to receive the data subscription request sent by the server 71;

向所述服务器71发送与数据订阅请求中包含的数据类型相匹配的第一数据;sending to the server 71 first data matching the data type contained in the data subscription request;

所述服务器71,用于接收所述数据发布装置72发送的第一数据;The server 71 is configured to receive the first data sent by the data publishing device 72;

确定所述第一数据的数据类型;determining the data type of the first data;

根据预先建立的数据发布装置72、数据订阅装置73与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅装置73;Determine the data subscription device 73 corresponding to the data type of the first data according to the pre-established mapping relationship between the data publishing device 72, the data subscription device 73 and the data type;

将所述第一数据发送给所述数据订阅装置73。Send the first data to the data subscription device 73 .

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as methods, systems, or computer program products. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read only memory (ROM) or flash RAM. Memory is an example of computer readable media.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information. Information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes Other elements not expressly listed, or elements inherent in the process, method, commodity, or apparatus are also included. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only examples of the present application, and are not intended to limit the present application. For those skilled in the art, various modifications and changes may occur in this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims (12)

1.一种数据传输方法,所述方法应用于服务器,其特征在于,包括:1. A data transmission method, said method being applied to a server, is characterized in that, comprising: 接收数据发布方发送的第一数据;receiving the first data sent by the data publisher; 确定所述第一数据的数据类型;determining the data type of the first data; 根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;determining a data subscriber corresponding to the data type of the first data according to the pre-established mapping relationship between the data publisher, the data subscriber and the data type; 将所述第一数据发送给所述数据订阅方。Send the first data to the data subscriber. 2.如权利要求1所述的方法,其特征在于,在将所述第一数据发送给所述数据订阅方之后,所述方法还包括:2. The method according to claim 1, wherein after sending the first data to the data subscriber, the method further comprises: 若确定所述第一数据的服务等级为预设的服务等级,则向所述数据发布方发送数据发布完成消息,用于提示所述数据发布方删除所述第一数据。If it is determined that the service level of the first data is a preset service level, then sending a data publishing completion message to the data publisher to prompt the data publisher to delete the first data. 3.如权利要求1所述的方法,其特征在于,所述预设的服务等级包括第一等级和第二等级,当确定所述预设的服务等级为所述第一等级时,3. The method according to claim 1, wherein the preset service level includes a first level and a second level, and when it is determined that the preset service level is the first level, 则接收数据发布方发送的第一数据之后,所述方法还包括:After receiving the first data sent by the data publisher, the method further includes: 存储所述第一数据。The first data is stored. 则若将所述第一数据发送给所述数据订阅方之后,所述方法还包括:After the first data is sent to the data subscriber, the method further includes: 向所述数据发布方发送第一数据发布消息;sending a first data publishing message to the data publishing party; 若接收到所述数据发布方发送的发布释放消息,则删除所述第一数据。If the release release message sent by the data publisher is received, the first data is deleted. 4.如权利要求1所述的方法,其特征在于,所述数据发布方、数据订阅方与所述数据类型之间的映射关系是通过下述方法建立的:4. The method according to claim 1, wherein the mapping relationship between the data publisher, the data subscriber and the data type is established by the following method: 接收数据订阅方发送的订阅请求;Receive the subscription request sent by the data subscriber; 根据所述订阅请求,确定所述订阅请求中包含的数据类型和所述数据订阅方的地址信息;According to the subscription request, determine the data type contained in the subscription request and the address information of the data subscriber; 根据所述数据类型,确定与所述数据类型相匹配的数据发布方;According to the data type, determine a data publisher matching the data type; 建立所述数据发布方、数据订阅方与所述数据类型的映射关系。A mapping relationship between the data publisher, the data subscriber and the data type is established. 5.如权利要求4所述的方法,其特征在于,当所述数据发布方的状态包括离线状态和在线状态时,在接收数据发布方发送的第一数据之前,所述方法还包括:5. The method according to claim 4, wherein when the status of the data publisher includes an offline status and an online status, before receiving the first data sent by the data publisher, the method further comprises: 若确定所述数据发布方的状态为在线状态,则将所述订阅请求发送给所述数据发布方,用于提示所述数据发布方发送与所述订阅请求中包含的数据类型相对应的数据。If it is determined that the status of the data publisher is online, the subscription request is sent to the data publisher to prompt the data publisher to send data corresponding to the data type contained in the subscription request . 6.一种数据发布方法,所述方法应用于数据发布方,其特征在于,包括:6. A method for publishing data, said method being applied to a data publishing party, characterized in that, comprising: 接收服务器发送的数据订阅请求;Receive the data subscription request sent by the server; 向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。Sending first data matching the data type included in the data subscription request to the server. 7.如权利要求6所述的方法,其特征在于,在向所述服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据之后,所述方法还包括:7. The method according to claim 6, characterized in that, after sending the first data matching the data type contained in the data subscription request to the server, the method further comprises: 若接收到所述服务器发送的数据发布收到的消息,则向所述服务器发送发布释放消息,以使得所述服务器删除所述第一数据;If the data release message sent by the server is received, send a release release message to the server, so that the server deletes the first data; 若接收到所述服务器发送的数据发布完成的消息,则删除所述第一数据。If receiving the message that the data release is completed sent by the server, the first data is deleted. 8.如权利要求6所述的方法,其特征在于,当所述数据发布方的状态包括离线状态和在线状态时,则接收服务器发送的数据订阅请求,包括:8. The method according to claim 6, wherein when the status of the data publisher includes an offline status and an online status, receiving the data subscription request sent by the server includes: 当所述数据发布方的状态为所述在线状态时,则接收服务器发送的数据订阅请求。When the status of the data publisher is the online status, the data subscription request sent by the server is received. 9.一种数据订阅方法,所述方法应用于数据订阅方,其特征在于,包括:9. A data subscription method, said method being applied to a data subscriber, comprising: 向服务器发送数据订阅请求;Send a data subscription request to the server; 接收所述服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。receiving first data sent by the server and matching the data type included in the data subscription request. 10.一种服务器,其特征在于,包括:10. A server, characterized in that, comprising: 接收单元,用于接收数据发布方发送的第一数据;a receiving unit, configured to receive the first data sent by the data publisher; 第一确定单元,用于确定所述第一数据的数据类型;a first determining unit, configured to determine the data type of the first data; 第二确定单元,用于根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;The second determining unit is configured to determine the data subscriber corresponding to the data type of the first data according to the pre-established mapping relationship between the data publisher, the data subscriber and the data type; 第一发送单元,用于将所述第一数据发送给所述数据订阅方。A first sending unit, configured to send the first data to the data subscriber. 11.一种数据发布装置,其特征在于,包括:11. A data release device, characterized in that it comprises: 接收单元,用于接收服务器发送的数据订阅请求;a receiving unit, configured to receive a data subscription request sent by the server; 发送单元,用于向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。A sending unit, configured to send first data matching the data type included in the data subscription request to the server. 12.一种数据订阅装置,其特征在于,包括:12. A data subscription device, comprising: 发送单元,用于向服务器发送数据订阅请求;a sending unit, configured to send a data subscription request to the server; 接收单元,用于接收服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。The receiving unit is configured to receive the first data sent by the server and matching the data type included in the data subscription request.
CN201711229189.1A 2017-11-29 2017-11-29 Data transmission, publication and method for subscribing and device Pending CN108173902A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201711229189.1A CN108173902A (en) 2017-11-29 2017-11-29 Data transmission, publication and method for subscribing and device
PCT/CN2017/116924 WO2019104772A1 (en) 2017-11-29 2017-12-18 Data transmission, publication and subscription method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711229189.1A CN108173902A (en) 2017-11-29 2017-11-29 Data transmission, publication and method for subscribing and device

Publications (1)

Publication Number Publication Date
CN108173902A true CN108173902A (en) 2018-06-15

Family

ID=62524201

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711229189.1A Pending CN108173902A (en) 2017-11-29 2017-11-29 Data transmission, publication and method for subscribing and device

Country Status (2)

Country Link
CN (1) CN108173902A (en)
WO (1) WO2019104772A1 (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109278674A (en) * 2018-08-31 2019-01-29 百度在线网络技术(北京)有限公司 Pilotless automobile system safety detection method, device, equipment and storage medium
CN109411063A (en) * 2018-09-30 2019-03-01 北京中广瑞波科技股份有限公司 A kind of medical health service system and method
CN110880992A (en) * 2019-11-29 2020-03-13 中盈优创资讯科技有限公司 Method and device for acquiring network telemetering telemetric protocol data
CN111866161A (en) * 2020-07-28 2020-10-30 中国联合网络通信集团有限公司 Information subscription and publishing method and apparatus, server, system, device, and medium
CN112840332A (en) * 2018-08-23 2021-05-25 阿尔库斯有限公司 Separate data store in a network routing environment
CN113098969A (en) * 2021-04-09 2021-07-09 薪得付信息技术(上海)有限公司 Data distribution method, device and system and electronic equipment
CN113965602A (en) * 2021-10-26 2022-01-21 广州小鹏汽车科技有限公司 Subscription and release communication method, server and system of vehicle-mounted ECU
CN114938392A (en) * 2022-06-23 2022-08-23 成都质数斯达克科技有限公司 Distributed subscription and publishing system and method
CN115378554A (en) * 2022-10-24 2022-11-22 北京博点智合科技有限公司 Data transmission method, device, equipment and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013029390A1 (en) * 2011-08-26 2013-03-07 中兴通讯股份有限公司 Augmented reality information transmission method and mobile augmented reality server
CN105376194A (en) * 2014-08-15 2016-03-02 中国电信股份有限公司 Real-time communication method, real-time communication system and real-time communication platform equipment
CN105959165A (en) * 2016-07-15 2016-09-21 重庆邮电大学 Extensible messaging and presence protocol (XMPP)-based service releasing and subscribing method in industrial measurement and control network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013029390A1 (en) * 2011-08-26 2013-03-07 中兴通讯股份有限公司 Augmented reality information transmission method and mobile augmented reality server
CN105376194A (en) * 2014-08-15 2016-03-02 中国电信股份有限公司 Real-time communication method, real-time communication system and real-time communication platform equipment
CN105959165A (en) * 2016-07-15 2016-09-21 重庆邮电大学 Extensible messaging and presence protocol (XMPP)-based service releasing and subscribing method in industrial measurement and control network

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112840332A (en) * 2018-08-23 2021-05-25 阿尔库斯有限公司 Separate data store in a network routing environment
CN109278674A (en) * 2018-08-31 2019-01-29 百度在线网络技术(北京)有限公司 Pilotless automobile system safety detection method, device, equipment and storage medium
CN109278674B (en) * 2018-08-31 2020-10-09 百度在线网络技术(北京)有限公司 Unmanned vehicle system safety detection method, device, equipment and storage medium
CN109411063A (en) * 2018-09-30 2019-03-01 北京中广瑞波科技股份有限公司 A kind of medical health service system and method
CN110880992A (en) * 2019-11-29 2020-03-13 中盈优创资讯科技有限公司 Method and device for acquiring network telemetering telemetric protocol data
CN111866161A (en) * 2020-07-28 2020-10-30 中国联合网络通信集团有限公司 Information subscription and publishing method and apparatus, server, system, device, and medium
CN113098969A (en) * 2021-04-09 2021-07-09 薪得付信息技术(上海)有限公司 Data distribution method, device and system and electronic equipment
CN113965602A (en) * 2021-10-26 2022-01-21 广州小鹏汽车科技有限公司 Subscription and release communication method, server and system of vehicle-mounted ECU
CN114938392A (en) * 2022-06-23 2022-08-23 成都质数斯达克科技有限公司 Distributed subscription and publishing system and method
CN115378554A (en) * 2022-10-24 2022-11-22 北京博点智合科技有限公司 Data transmission method, device, equipment and readable storage medium

Also Published As

Publication number Publication date
WO2019104772A1 (en) 2019-06-06

Similar Documents

Publication Publication Date Title
CN108173902A (en) Data transmission, publication and method for subscribing and device
US9043383B2 (en) Stream processing using a client-server architecture
CN104219316B (en) A kind of call request processing method and processing device in distributed system
CN109547511B (en) A real-time WEB message push method, server, client and system
KR102208935B1 (en) Messaging api over http protocol to establish context for data exchange
KR102167613B1 (en) Message push method and device
CN102523197B (en) Enterprise's social information exchange method, server and enterprise's social networking system
WO2019072197A1 (en) Red packet distribution method, device, and medium
TW202018645A (en) Blockchain-based data processing method and apparatus, and server
CN104580073A (en) A method and device for implementing message transmission between heterogeneous systems
CN105208654B (en) Notification message sending method and device
EP3803616A1 (en) Change notifications for object storage
CN112134915A (en) A general network processing system with application layer protocol decoupling
CN108347350A (en) A kind of communication means and device
KR20180080410A (en) Method for providing energency sitaution service based on iot protocol
HK1201602A1 (en) Method and device for generating message index for convenience of presenting message to recipient
CN102724195A (en) Access request tracing method and related device
JP2014513351A (en) Authentication information processing
CN118972245A (en) A dynamic and adaptive application audit log collection and transmission method and device
CN112583879A (en) Request processing method, device and system, storage medium and electronic equipment
CN106470225B (en) A kind of notification message management method and device
CN113746794B (en) Account handling method, device, electronic device and computer storage medium
CN105337778A (en) Internet of Things event-driven service management system
CN106656729B (en) A method and device for sending information
EP3097675B1 (en) Crash recovery for smart objects

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180615

RJ01 Rejection of invention patent application after publication