WO2019104772A1 - 数据传输、发布及订阅方法和装置 - Google Patents

数据传输、发布及订阅方法和装置 Download PDF

Info

Publication number
WO2019104772A1
WO2019104772A1 PCT/CN2017/116924 CN2017116924W WO2019104772A1 WO 2019104772 A1 WO2019104772 A1 WO 2019104772A1 CN 2017116924 W CN2017116924 W CN 2017116924W WO 2019104772 A1 WO2019104772 A1 WO 2019104772A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
server
subscriber
sent
publisher
Prior art date
Application number
PCT/CN2017/116924
Other languages
English (en)
French (fr)
Inventor
粟欣
曾捷
刘蓓
陈圆
许希斌
赵明
肖立民
Original Assignee
清华大学
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 清华大学 filed Critical 清华大学
Publication of WO2019104772A1 publication Critical patent/WO2019104772A1/zh

Links

Images

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

Definitions

  • the present application relates to the field of wireless communication technologies, and in particular, to a data transmission, distribution, and subscription method and apparatus.
  • sensors With the rapid development of Internet of Things technology, various types of sensors are scattered all over the real world. These sensors can detect earthquakes, electromagnetics, temperature, humidity, noise, light intensity, pressure, soil composition, size and speed of moving objects. A variety of physical quantities in the surrounding environment such as direction. These physical quantities detected by sensors have a wide range of applications in military detectives, environmental testing, industrial monitoring, activity sensing, and health care applications.
  • the networks formed by these sensors can be used as data publishers to provide data for data subscribers who need to use these data.
  • a 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.
  • the data publisher after receiving the data subscription request of the data subscriber, the data publisher often sends the data related to the data subscription request to the data subscriber only according to the data subscriber's data subscription request, without guaranteeing the data transmission. Reliability, which will result in some data such as alarm data may not be received by the data subscriber.
  • the embodiment of the present application provides a data transmission, distribution, and subscription method and apparatus for solving the problem that data transmission between a data publisher and a data subscriber in the prior art does not guarantee reliability.
  • a data transmission method comprising:
  • a data publishing method the method being applied to a data publisher, comprising:
  • the first data that matches the type of data contained in the data subscription request is sent to the server.
  • a data publishing method the method being applied to a data publisher, comprising:
  • a server that includes:
  • a receiving unit configured to receive first data sent by a data publisher
  • a first determining unit configured to determine a data type of the first data
  • a second determining unit configured to determine, according to a mapping relationship between the pre-established data issuer, the data subscriber, and the data type, a data subscriber corresponding to the data type of the first data
  • a first sending unit configured to send the first data to the data subscriber.
  • a data distribution device comprising:
  • a receiving unit configured to receive a data subscription request sent by the server
  • a sending unit configured to send, to the server, first data that matches a data type included in the data subscription request.
  • a data subscription device comprising:
  • a sending unit configured to send a data subscription request to the server
  • a receiving unit configured to receive, by the server, first data that matches a data type included in the data subscription request.
  • the server can first receive the first data sent by the data publisher, determine the data type of the first data, and determine the first data according to the mapping relationship between the pre-established data publisher, the data subscriber, and the data type.
  • the data subscriber corresponding to the data type sends the first data to the data subscriber, and the first data sent by the data publisher to the data subscriber can be forwarded through the server, thereby ensuring the relationship between the data publisher and the data subscriber. The reliability of data transmission.
  • the data publisher can receive the data subscription request sent by the server, and then send the first data matching the data type included in the subscription request to the server, because the first data to the data sent by the data publisher can be forwarded through the server.
  • the subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.
  • the data subscriber can send a data subscription request to the server, and then receive the first data that is sent by the server and matches the data type included in the data subscription request, because the first data sent by the data publisher can be forwarded by the server to
  • the data subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.
  • FIG. 1 is a schematic flowchart of an implementation process of a data transmission method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a data transmission method provided by the application in an actual scenario
  • FIG. 3 is a schematic flowchart of an implementation process of a data publishing method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart of an implementation process of a data subscription method according to an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a process of data transmission in a method according to an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram of a process of data transmission with a service level of 0 in the method provided by the embodiment of the present application;
  • FIG. 7 is a schematic diagram of a process of data transmission with a service level of 1 in the method provided by the embodiment of the present application.
  • FIG. 8 is a schematic diagram of a process of data transmission with a service level of 2 in the method provided by the embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a data distribution apparatus according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of a data subscription apparatus according to an embodiment of the present application.
  • FIG. 12 is a schematic structural diagram of a data subscription and delivery system according to an embodiment of the present application.
  • the embodiment of the present application provides a data transmission method, and the execution body of the method may be a server, or may be any implementation.
  • a device for applying the provided method is a server, and the implementation manner of the method is described in detail. It can be understood that the execution subject of the method is only an exemplary description of the server, and should not be understood as the method. limited.
  • a schematic diagram of an implementation process of applying a data transmission method according to an embodiment of the present application to a server includes:
  • Step 11 Receive first data sent by a data publisher
  • the data transmission process between the data publisher and the data subscriber does not guarantee the reliability of the data transmission, which may cause some important data may not be subscribed by the data.
  • the data subscription and distribution method provided by the embodiment of the present application can receive the first data sent and sent by the server, and ensure the reliability of the first data transmission.
  • the first data may be data that the data subscriber requests to subscribe to, such as sensing data in a network formed by the sensor, such as temperature, humidity, light intensity, and the like.
  • the data subscription and publishing method provided by the embodiment of the present application is applied to an actual scenario, including a data publisher: a field intelligent monitoring unit 1 to a field intelligent monitoring unit 3, and a server (a storage publisher status table is also shown). That is, the data publisher's status table, the subscription/publishing relationship table, that is, the mapping relationship and the service level filtering table described below, and the data subscribers: the centralized monitoring center 1 and the centralized monitoring center 2.
  • the data issuer that is, the on-site intelligent monitoring unit 1 to the on-site intelligent monitoring unit 3 is responsible for monitoring the collection and monitoring of sensor data in the network formed by the sensor, and the server is responsible for data transmission between the data subscriber and the data issuer.
  • the data subscribers namely the centralized monitoring center 1 and the centralized monitoring center 2, are responsible for monitoring the sensory data of interest, that is, monitoring the sensor data for which the subscription is requested.
  • Step 12 determining a data type of the first data
  • the data types that different data subscribers request to subscribe to are often different. For example, in a network formed by multiple sensors, some data subscribers may mainly focus on temperature and humidity, while some data subscribers may mainly focus on whether or not it will occur. a fire, so after receiving the first data, the data type of the first data may also be determined.
  • the data type of the first data may be multiple types of sensing data, such as temperature sensing collected by a temperature sensor.
  • the data, or the humidity sensing data collected by the humidity sensor may also be the light intensity sensing data collected by the light intensity sensor, etc., other types of sensing data.
  • Step 13 Determine, according to a mapping relationship between a pre-established data publisher, a data subscriber, and a data type, a data subscriber corresponding to the data type of the first data;
  • the data types of different data subscribers requesting subscriptions are often different, so after determining the data type of the first data, it can be based on a mapping between pre-established data publishers, data subscribers, and data types. The relationship determines a data subscriber corresponding to the data type of the first data to provide different data subscribers with the data they are requesting to subscribe to.
  • the mapping between the data publisher, the data subscriber, and the data type may first be performed by receiving a subscription request sent by the data subscriber; and then determining, according to the subscription request, the data type and data included in the subscription request.
  • the address information of the subscriber; according to the data type, the data publisher matching the data type is determined; finally, the mapping relationship between the data publisher, the data subscriber, and the data type is established.
  • the data subscriber when it no longer requests to subscribe to a certain type of data, it can also send a subscription request to the server to unsubscribe to a certain type of data. After receiving the unsubscribe request, the server can release the request.
  • 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 can be a state in which the data publisher is working.
  • the status of the data issuer includes the offline status and the online status
  • the subscription request is sent to the data issuer to Causes the data publisher to send data corresponding to the type of data contained in the subscription request.
  • Step 14 Send the first data to the data subscriber
  • the first data may be sent to the data subscriber to satisfy the data subscriber's data subscription request.
  • a data release completion message is sent to the data issuer for prompting the data issuer to delete the first data.
  • the preset service level includes a first level and a second level.
  • the preset service level is determined to be the first level, after receiving the first data sent by the data publisher, the first data may 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 release message may also be sent to the data issuer; optionally, in order to release the space of the server in time, if the data issuer is received The sent release release message deletes the first data.
  • the first level of data may be some alarm data in the embodiment of the present application.
  • the alarm data may be sent to the server.
  • the service level of the alarm data may be determined according to the service level identifier included in the alarm data.
  • the server may first store the alarm data, and After the alarm data is sent to the data subscriber, the alarm data release message is first sent to the data issuer to indicate that the alarm data has been sent to the data subscriber, and then the first release message is sent when the data release party sends the release message. A data to free up storage space on the server.
  • the data of the second level may be the state change data of the data publisher in the embodiment of the present application. For example, when the status of the data publisher changes from the offline state to the online state or the online state transitions to the offline state, the server is timely. To get its state change, the data publisher can send its state change data to the server.
  • the server can first receive the first data sent by the data publisher, determine the data type of the first data, and determine the first data according to the mapping relationship between the pre-established data publisher, the data subscriber, and the data type.
  • the data subscriber corresponding to the data type sends the first data to the data subscriber, and the first data sent by the data publisher to the data subscriber can be forwarded through the server, thereby ensuring the relationship between the data publisher and the data subscriber. The reliability of data transmission.
  • a schematic flowchart of an implementation process of a data publishing method includes:
  • Step 21 Receive a data subscription request sent by the server.
  • the status of the data publisher may include an offline state and an online state.
  • the state of the data publisher includes an offline state and an online state
  • the data subscription sent by the server is received.
  • the request in particular, may receive a data subscription request sent by the server when the status of the data publisher is online.
  • Step 22 Send, to the server, first data that matches a data type included in the data subscription request;
  • the release release message is sent to the server for prompting the server. Delete the first data.
  • the data publisher can receive the data subscription request sent by the server, and then send the first data matching the data type included in the subscription request to the server, because the first data to the data sent by the data publisher can be forwarded through the server.
  • the subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.
  • a schematic flowchart of an implementation process of a data subscription method includes:
  • Step 31 Send a data subscription request to the server
  • Step 32 Receive first data sent by the server that matches the data type included in the data subscription request.
  • the data subscriber can send a data subscription request to the server, and then receive the first data that is sent by the server and matches the data type included in the data subscription request, because the first data sent by the data publisher can be forwarded by the server to
  • the data subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.
  • the server shown in FIG. 2 stores the storage publisher status table, that is, the data.
  • the publisher's status table and subscription/publishing relationship table are also the mapping relationship and the service level filtering table described above, and the server may be a message proxy server based on the Message Queuing Telemetry Transport (MQTT) protocol in practical applications.
  • MQTT protocol uses a lightweight subscription/release mode for message transmission.
  • MQTT has been specially optimized for low bandwidth, low computing power, and unstable network environment. It can be applied to message push for embedded intelligent terminals and mobile terminals, which can effectively save power consumption and traffic of terminals.
  • Message data publishing service quality :
  • the data of the service level may be state change data of the data issuer.
  • the data of the service level may be alarm data sent by the data publisher.
  • FIG. 5 is a schematic diagram of a process of data transmission in a data subscription and publishing method provided by an embodiment of the present application, including the following steps:
  • Step a the data release direction server sends status change data
  • Step b after receiving the state change data, the server modifies the data issuer state table
  • Step c The server receives a data subscription request sent by the data subscriber
  • 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, where the subscription list stores the address information of the data subscriber, the type of data to be subscribed, and Ability to provide a mapping relationship between data publishers of the data type;
  • Step e the server sends a subscription request response to the data subscriber to prompt the data subscriber to send the data subscription request successfully and pass the verification;
  • Step f the server queries the status list of the data issuer
  • Step g when determining, by the server, that the status of the data issuer corresponding to the data requested by the data subscriber is online, sending the data subscription request to the data issuer corresponding to the data requested by the data subscriber to subscribe;
  • Step h the data publisher sends the first data to the server, where the first data is data corresponding to the data requested by the data subscriber to subscribe;
  • Step i The server receives the first data, and queries a subscription list to determine which data subscribers request to subscribe to the first data;
  • Step j the server sends the first data to a data subscriber that requests to subscribe to the first data
  • step k when the data subscriber wants to cancel the data subscription request sent by the data subscriber, the request for canceling the subscription may be sent to the server, where the unsubscribe request includes the address information of the data subscriber and the data type that is to be unsubscribed. ;
  • Step l After receiving the request for unsubscribing, the server may include the address information of the data subscriber and the data type of the data subscription that is to be unsubscribed according to the unsubscribed request, and the subscriber in the subscription list saved with the data subscriber The address information, the type of data that you want to unsubscribe, and the mapping relationship between the data publishers that can provide the data type are removed;
  • step m the server sends an unsubscribe response to the data subscriber to prompt the data subscriber to cancel the subscription request.
  • 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 the data may be set to 0 in the present application), The status change data of the data issuer (the service level of the data can be set to 1 in the present application) and the alarm data of the data issuer (the service level of the data can be set to 2 in the present application).
  • FIG. 6 a schematic diagram of a process of data transmission with a service level of 0.
  • the server After the data issuer sends data with a service level of 0 to the server, the server only needs to send the data to the request subscription.
  • the data subscriber of the data, and the data publisher can discard the data after it is sent to reduce data redundancy.
  • FIG. 7 is a schematic diagram of a process of data transmission with service level 1.
  • the data publisher first stores the data to be sent locally, and then sends the data with the service level 1 to the server, and the server will After the data is sent to the data subscriber who requests to subscribe to the data, in order to ensure the reliability of the data transmission, a data release response may also be sent to the data publisher to indicate that the data has been sent to the data subscriber, and the data publisher receives the data.
  • the published data is discarded before its stored data is discarded.
  • FIG. 8 is a schematic diagram of a process of data transmission with a service level of 2.
  • the data publisher first stores the data to be sent locally, and then sends the data with the service level 2 to the server, and the server receives the data.
  • the data is first stored locally, and then the data is sent to the data subscriber who requests to subscribe to the data.
  • the data publisher may also send the received message to the data publisher. Prompting that the data has been sent to the data subscriber, the data publisher sends a release release message to the server after receiving the message received by the publication, to prompt the server to discard the stored data, and the server receives the release release message.
  • the stored data is discarded, and after the stored data is discarded, the message is sent to the data publisher, and the data publisher discards the stored data after receiving the message that the release is completed.
  • the embodiment of the present application further provides a server 40, as shown in FIG. 9, including the following functional units:
  • the receiving unit 41 is configured to receive first data sent by the data publisher
  • a first determining unit 42 configured to determine a data type of the first data
  • the second determining unit 43 is configured to determine, according to a mapping relationship between the data publisher, the data subscriber, and the data type, the data subscriber corresponding to the data type of the first data;
  • the first sending unit 44 is configured to send the first data to the data subscriber.
  • the server further includes:
  • the second sending unit 45 is configured to: if it is determined that the service level of the first data is a preset service level, send a data release complete message to the data issuer, so that the data issuer deletes the first data.
  • the preset service level includes a first level and a second level, and when determining that the preset service level is the first level, the receiving unit 41 receives a data issuer to send After the first data, the device further includes:
  • the storage unit 46 is configured to store the first data.
  • the device further includes:
  • a third sending unit 47 configured to send a first data release message to the data issuer
  • the deleting unit 48 is configured to delete the first data if the release release message sent by the data issuer is received.
  • mapping relationship between the data issuer, the data subscriber, and the data type is established by using the following functional units:
  • a first receiving unit 49 configured to receive a subscription request sent by a data subscriber
  • the third determining unit 410 is configured to determine, according to the subscription request, a data type included in the subscription request and address information of the data subscriber;
  • a fourth determining unit 411 configured to determine, according to the data type, a data issuer that matches the data type
  • the establishing unit 412 is configured to establish a mapping relationship between the data publisher, the data subscriber, and the data type.
  • the apparatus when the status of the data publisher includes an offline status and an online status, before the receiving unit 41 receives the first data sent by the data publisher, the apparatus further includes:
  • the fourth sending unit 413 is configured to: if it is determined that the status of the data issuer is an online state, send the subscription request to the data issuer, so that the data issuer sends and the subscription request includes The data type corresponds to the data.
  • the server can first receive the first data sent by the data publisher, determine the data type of the first data, and determine the first data according to the mapping relationship between the pre-established data publisher, the data subscriber, and the data type.
  • the data subscriber corresponding to the data type sends the first data to the data subscriber, and the first data sent by the data publisher to the data subscriber can be forwarded through the server, thereby ensuring the relationship between the data publisher and the data subscriber. The reliability of data transmission.
  • the embodiment of the present application further provides a data distribution apparatus 50, as shown in FIG. 10, including the following functional units:
  • the receiving unit 51 is configured to receive a data subscription request sent by the server;
  • the sending unit 52 is configured to send, to the server, first data that matches a data type included in the data subscription request.
  • the device further includes:
  • the deleting unit 53 is configured to delete the first data if the message that the data distribution completed by the server is received is received.
  • the device further includes:
  • the first sending unit 54 is configured to send a release release message to the server if the received message is sent by the server, so that the server deletes the first data.
  • the receiving unit 51 when the status of the data publisher includes an offline status and an online status, the receiving unit 51 is configured to:
  • the data publisher can receive the data subscription request sent by the server, and then send the first data matching the data type included in the subscription request to the server, because the first data to the data sent by the data publisher can be forwarded through the server.
  • the subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.
  • the embodiment of the present application further provides a data subscription device 60, as shown in FIG. 11, including the following functional units:
  • a sending unit 61 configured to send a data subscription request to the server
  • the receiving unit 62 is configured to receive, by the server, first data that matches a data type included in the data subscription request.
  • the data subscriber can send a data subscription request to the server, and then receive the first data that is sent by the server and matches the data type included in the data subscription request, because the first data sent by the data publisher can be forwarded by the server to
  • the data subscriber can guarantee the reliability of data transmission between the data publisher and the data subscriber.
  • the embodiment of the present application further provides a data subscription and distribution system 70, as shown in FIG. 12, including the server 71 and the data. a publishing device 72 and a data subscription device 73, wherein
  • the data subscription device 73 is configured to send a data subscription request to the server 71.
  • the data distribution device 72 is configured to receive a data subscription request sent by the server 71.
  • the server 71 is configured to receive first data sent by the data distribution device 72.
  • the first data is sent to the data subscription device 73.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment in combination of software and hardware.
  • the application can 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.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, 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 disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.

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

本申请公开了一种数据传输、发布及订阅方法,用于解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题。该方法包括:接收数据发布方发送的第一数据;确定所述第一数据的数据类型;根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;将所述第一数据发送给所述数据订阅方。本申请还公开了一种数据传输、发布及订阅装置。

Description

数据传输、发布及订阅方法和装置 技术领域
本申请涉及无线通信技术领域,尤其涉及一种数据传输、发布及订阅方法和装置。
背景技术
随着物联网技术的快速发展,各种类型的传感器遍布现实世界的各个角落,这些传感器可探测包括地震、电磁、温度、湿度、噪声、光强度、压力、土壤成分、移动物体的大小、速度和方向等周边环境中多种多样的物理量。通过传感器探测的这些物理量在军事侦探、环境检测、工业监测、活动感知及健康医疗等应用领域有着广泛的应用背景。
目前,伴随着移动互联网的发展,这些传感器所形成的网络可以作为数据的发布方,为有使用这些数据需求的数据订阅方提供这些数据。当数据订阅方想要获取某些传感数据时,可以向数据发布方发送订阅请求,以获取这些传感器探测的数据。
在上述场景中,数据发布方在接收到数据订阅方的数据订阅请求之后,往往只按照数据订阅方的数据订阅请求,将与数据订阅请求相关的数据发送给数据订阅方,而不保证数据传输的可靠性,这将导致某些数据比如告警数据可能没有被数据订阅方收到。
发明内容
本申请实施例提供数据传输、发布及订阅方法和装置,用于解决现有技术中数据发布方与数据订阅方之间的数据传输不保证可靠性的问题。
本申请实施例采用下述技术方案:
一种数据传输方法,所述方法应用于服务器,包括:
接收数据发布方发送的第一数据;
确定所述第一数据的数据类型;
根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;
将所述第一数据发送给所述数据订阅方。
一种数据发布方法,所述方法应用于数据发布方,包括:
接收服务器发送的数据订阅请求;
向所述服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据。
一种数据发布方法,所述方法应用于数据发布方,包括:
接收服务器发送的数据订阅请求;
向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。
一种服务器,包括:
接收单元,用于接收数据发布方发送的第一数据;
第一确定单元,用于确定所述第一数据的数据类型;
第二确定单元,用于根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;
第一发送单元,用于将所述第一数据发送给所述数据订阅方。
一种数据发布装置,包括:
接收单元,用于接收服务器发送的数据订阅请求;
发送单元,用于向所述服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据。
一种数据订阅装置,包括:
发送单元,用于向服务器发送数据订阅请求;
接收单元,用于接收服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:
本申请中,服务器能够首先接收数据发布方发送的第一数据,确定第一数据的数据类型,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,再将第一数据发送给数据订阅方,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,从而保证了数据发布方与数据订阅方之间数据传输的可靠性。
本申请中,数据发布方能够接收服务器发送的数据订阅请求,然后向服务器发送与订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。
本申请中,数据订阅方能够向服务器发送数据订阅请求,再接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1为本申请实施例提供的数据传输方法的实现流程示意图;
图2本申请提供的数据传输方法应用在实际场景中的示意图;
图3为本申请实施例提供的数据发布方法的实现流程示意图;
图4为本申请实施例提供的数据订阅方法的实现流程示意图;
图5为本申请实施例提供的方法中数据传输的过程示意图;
图6为本申请实施例提供的方法中服务等级为0的数据传输的过程示意图;
图7为本申请实施例提供的方法中服务等级为1的数据传输的过程示意图;
图8为本申请实施例提供的方法中服务等级为2的数据传输的过程示意图;
图9为本申请实施例提供的服务器的结构示意图;
图10为本申请实施例提供的数据发布装置的结构示意图;
图11为本申请实施例提供的数据订阅装置的结构示意图;
图12为本申请实施例提供的数据订阅及发布系统的结构示意图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
以下结合附图,详细说明本申请各实施例提供的技术方案。
为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例提供一种数据传输方法,该方法的执行主体可以是服务器,也可以是任何实现本申请提供的方法的装置。下面,以该方法的执行主体是服务器为例,对该方法的实施方式进行详细介绍,可以理解,该方法的执行主体是服务器只是一种示例性的说明,并不应理解为对该方法的限定。
如图1所示,为本申请实施例提供的数据传输方法应用于服务器的实现流程示意图,包括:
步骤11,接收数据发布方发送的第一数据;
如背景技术中所述,现有技术中,数据发布方与数据订阅方之间的数据传输过程中,并没有保证数据传输的可靠性,这将导致某些重要的数据可能不会被数据订阅方接收到,为了解决这个问题,本申请实施例提供的数据订阅及发布方法可以通过服务器接收数据发布发送的第一数据,保证了该第一数据传输 的可靠性。
具体来说,该第一数据可以是数据订阅方请求订阅的数据,比如可以包括传感器形成的网络中的传感数据,比如温度、湿度、光强度等传感数据。如图2所示,为本申请实施例提供的数据订阅及发布方法应用在实际场景的示意图,包括数据发布方:现场智能监控单元1~现场智能监控单元3、服务器(存储发布者状态表也就是数据发布方的状态表、订阅/发布关系表也就是下文所述的映射关系以及服务等级过滤表)、数据订阅方:集中监控中心1和集中监控中心2。
在图2中,数据发布方即现场智能监控单元1~现场智能监控单元3负责监控传感器形成的网络中的传感数据的采集和监控,服务器负责数据订阅方和数据发布方之间的数据传输,数据订阅方即集中监控中心1和集中监控中心2负责监控其所关注的传感数据,也就是监控其请求订阅的传感数据。
步骤12,确定第一数据的数据类型;
应理解,不同的数据订阅方请求订阅的数据类型往往都不相同,比如在多种传感器形成的网络中,有些数据订阅方可能主要关注温湿度、而有些数据订阅方则可能主要关注是否会发生火灾,因此在接收到该第一数据后,还可以确定该第一数据的数据类型,该第一数据的数据类型可以是多种类型的传感数据,比如可以是温度传感器采集的温度传感数据、或者是湿度传感器采集的湿度传感数据、还可以是光强度传感器采集的光强度传感数据,等等,其他类型的传感数据。
步骤13,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方;
如上文所述不同的数据订阅方请求订阅的数据类型往往都不相同,因此在确定了第一数据的数据类型之后,可以根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,从而为不同的数据订阅方提供其所请求订阅的数据。
可选的,数据发布方、数据订阅方与数据类型之间的映射关系的建立则可 以首先,接收数据订阅方发送的订阅请求;然后,根据订阅请求,确定订阅请求中包含的数据类型和数据订阅方的地址信息;再根据数据类型,确定与数据类型相匹配的数据发布方;最后建立数据发布方、数据订阅方与数据类型的映射关系。在某些情况下,数据订阅方不再请求订阅某一类型的数据时,也可以向服务器发送取消订阅某一类型的数据的订阅请求,服务器在接收到这一取消订阅请求后,可以解除之前建立的数据发布方、该数据订阅方与该数据类型的映射关系。
可选的,通常情况下,在对环境进行监测时,为了降低数据发布方的能耗,本申请实施例中的数据发布方可以包括两种状态:离线状态和在线状态,其中离线状态可以是数据发布方处于休眠的状态,在线状态则可以是数据发布方处于工作的状态。当数据发布方的状态包括离线状态和在线状态时,在接收数据发布方发送的第一数据之前,若确定数据发布方的状态为在线状态,则将订阅请求发送给所述数据发布方,以使得数据发布方发送与订阅请求中包含的数据类型相对应的数据。
步骤14,将第一数据发送给数据订阅方;
在上述确定了请求订阅该第一数据的数据订阅方之后,便可以将该第一数据发送给该数据订阅方,以满足该数据订阅方的数据订阅请求。
此外,为了及时释放服务器的空间,若确定第一数据的服务等级为预设的服务等级,则向数据发布方发送数据发布完成消息,用于提示数据发布方删除第一数据。其中,预设的服务等级包括第一等级和第二等级,当确定预设的服务等级为第一等级时,则接收数据发布方发送的第一数据之后,还可以存储第一数据;在将第一数据发送给数据订阅方之后,为了保证第一数据传输的可靠性,还可以向数据发布方发送第一数据发布消息;可选的,为了及时释放服务器的空间,若接收到数据发布方发送的发布释放消息,则删除第一数据。
该第一等级的数据在本申请实施例中可以是一些告警数据,比如当数据发布方确定其采集的数据大于或小于预设的门限值时,则可以向服务器发送该告 警数据,服务器在接收到该告警数据,可以根据该告警数据中包含的服务等级标识来确定该告警数据的服务等级,为了保证数据订阅方能够收到该告警数据,服务器可以首先存储该告警数据,并在将该告警数据发送给数据订阅方之后,首先向数据发布方发送该告警数据发布消息,以表明该告警数据已发送至数据订阅方,然后在接收到数据发布方发送的发布释放消息时,删除该第一数据,以释放服务器的存储空间。
应理解,为了能够减少数据发布方的数据冗余,当确定预设的服务等级为第二等级时,则只需向数据发布方发送数据发布完成消息,以使得数据发布方删除第一数据。该第二等级的数据在本申请实施例中可以是数据发布方的状态改变数据,比如当数据发布方的状态从离线状态转变为在线状态或者是在线状态转变为离线状态时,为了便于服务器及时获取其状态改变,数据发布方可以将其状态改变数据发送给服务器。
本申请中,服务器能够首先接收数据发布方发送的第一数据,确定第一数据的数据类型,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,再将第一数据发送给数据订阅方,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,从而保证了数据发布方与数据订阅方之间数据传输的可靠性。
如图3所示,为本申请实施例提供的数据发布方法的实现流程示意图,包括:
步骤21,接收服务器发送的数据订阅请求;
如上文所述,为了减小数据发布方的功耗,数据发布方的状态可以包括离线状态和在线中状态,当数据发布方的状态包括离线状态和在线状态时,则接收服务器发送的数据订阅请求,具体来说,则可以当数据发布方的状态为在线状态时,则接收服务器发送的数据订阅请求。
步骤22,向服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据;
可选的,在向服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据之后,若接收到服务器发送的数据发布收到的消息,则向服务器发送发布释放消息,用于提示服务器删除第一数据。
此外,为了减少数据发布方会产生过多的数据冗余,若接收到服务器发送的数据发布完成的消息,则删除第一数据。
本申请中,数据发布方能够接收服务器发送的数据订阅请求,然后向服务器发送与订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。
如图4所示,为本申请实施例提供的数据订阅方法的实现流程示意图,包括:
步骤31,向服务器发送数据订阅请求;
步骤32,接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据。
本申请中,数据订阅方能够向服务器发送数据订阅请求,再接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。
下面以图2所示的本申请提供的数据订阅及发布方法应用在实际场景中的示意图为例,对该方法进行详细介绍,图2所示的服务器中存储了存储发布者状态表也就是数据发布方的状态表、订阅/发布关系表也就是上文所述的映射关系以及服务等级过滤表,该服务器在实际应用中可以是基于消息队列遥测传输(MessageQueuingTelemetryTransport,MQTT)协议的消息代理服务器,其中MQTT协议采用了一种轻量级的订阅/发布模式来进行消息传输。
MQTT针对低带宽,低计算能力,以及不稳定的网络环境做了特殊的优化,可以适用于针对嵌入式智能终端和移动终端的消息推送,能够有效节省终端的 耗电量和流量,具有三种消息数据发布服务质量:
(1)“至多一次”,消息数据发布完全依赖底层TCP/IP网络。会发生消息数据丢失或重复。这一级别可用于如下情况,环境传感器数据,丢失一次读记录无所谓,因为不久后还会有第二次发送。本申请实施例中,该“至多一次”可以是数据发布方周期性的采集的环境传感数据。
(2)“至少一次”,确保消息到达,但消息重复可能会发生。在本申请实施例中,该服务等级的数据可以是数据发布方的状态改变数据。
(3)“只有一次”,确保消息到达一次。这一级别可用于如下情况,在计费系统中,消息重复或丢失会导致不正确的结果。在本申请实施例中,该服务等级的数据可以是数据发布方发送的告警数据。
如图5所示为本申请实施例提供的数据订阅及发布方法中数据传输的过程示意图,包括下述步骤:
步骤a,数据发布方向服务器发送状态改变数据;
步骤b,服务器接收到该状态改变数据之后,修改数据发布方状态表;
步骤c,服务器接收数据订阅方发送的数据订阅请求;
步骤d,服务器验证该数据订阅请求,并在该数据订阅请求验证通过后,将该数据订阅请求添加至订阅列表,该订阅列表中保存了数据订阅方的地址信息、想要订阅的数据类型以及能够提供该数据类型的数据发布方之间的映射关系;
步骤e,服务器向数据订阅方发送订阅请求响应,以提示数据订阅方其数据订阅请求发送成功并通过验证;
步骤f,服务器查询数据发布方的状态列表;
步骤g,服务器在确定与数据订阅方请求订阅的数据对应的数据发布方的状态为在线状态时,将其数据订阅请求发送给与数据订阅方请求订阅的数据对应的数据发布方;
步骤h,数据发布方将第一数据发送给服务器,该第一数据即为与数据订 阅方请求订阅的数据对应的数据;
步骤i,服务器接收该第一数据,并查询订阅列表,确定哪些数据订阅方请求订阅了该第一数据;
步骤j,服务器将该第一数据发送给请求订阅了该第一数据的数据订阅方;
步骤k,当数据订阅方想要取消其之前发送的数据订阅请求时,可以向服务器发送取消订阅的请求,该取消订阅的请求中包括该数据订阅方的地址信息、想要取消订阅的数据类型;
步骤l,服务器接收到该取消订阅的请求后,可以根据该取消订阅的请求中包括该数据订阅方的地址信息、想要取消订阅的数据类型,将订阅列表中保存的与该数据订阅方的地址信息、想要取消订阅的数据类型以及能够提供该数据类型的数据发布方之间的映射关系解除;
步骤m,服务器向数据订阅方发送取消订阅响应,以提示数据订阅方的取消订阅的请求生效。
由于本申请实施例中数据发布方与数据订阅方之间的传输的数据可以包括三个服务等级,即周期性的传感数据(该类数据的服务等级在本申请中可以设置为0)、数据发布方的状态改变数据(该类数据的服务等级在本申请中可以设置为1)以及数据发布方的告警数据(该类数据的服务等级在本申请中可以设置为2)。
如图6所示,为服务等级为0的数据传输的过程示意图,该数据传输过程中,数据发布方将服务等级为0的数据发送给服务器之后,服务器只需将该数据发送给请求订阅该数据的数据订阅方,且数据发布方发送该数据之后便可以丢弃该数据,以减少数据的冗余。
如图7所示为服务等级为1的数据传输的过程示意图,该数据传输过程中,数据发布方首先在本地存储将要发送的数据,然后将服务等级为1的数据发送给服务器,服务器再将该数据发送给请求订阅该数据的数据订阅方之后,为保证数据传输的可靠性,还可以向数据发布方发送发布数据响应,以提示该数据 已发送至数据订阅方,数据发布方在接收到该发布数据响应后才丢弃其存储的数据。
如图8所示为服务等级为2的数据传输的过程示意图,该数据传输过程中,数据发布方首先在本地存储将要发送的数据,然后将服务等级为2的数据发送给服务器,服务器在接收到该数据后,首先在本地存储该数据,再将该数据发送给请求订阅该数据的数据订阅方之后,为保证数据传输的可靠性,还可以向数据发布方发送发布收到的消息,以提示该数据已发送至数据订阅方,数据发布方在接收到该发布收到的消息后向服务器发送发布释放的消息,以提示服务器可以丢弃其存储的数据,服务器在接收到该发布释放的消息之后便丢弃其存储的数据,并在丢弃其存储的数据之后,向数据发布方发送发布完成的消息,数据发布方在接收到发布完成的消息之后才丢弃其存储的数据。
为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种服务器40,如图9所示,包括下述功能单元:
接收单元41,用于接收数据发布方发送的第一数据;
第一确定单元42,用于确定所述第一数据的数据类型;
第二确定单元43,用于根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;
第一发送单元44,用于将所述第一数据发送给所述数据订阅方。
在一种实施方式中,所述服务器还包括:
第二发送单元45,用于若确定所述第一数据的服务等级为预设的服务等级,则向所述数据发布方发送数据发布完成消息,以使得所述数据发布方删除所述第一数据。
在一种实施方式中,所述预设的服务等级包括第一等级和第二等级,当确定所述预设的服务等级为所述第一等级时,所述接收单元41接收数据发布方发送的第一数据之后,所述装置还包括:
存储单元46,用于存储所述第一数据。
则所述第一发送单元44若将所述第一数据发送给所述数据订阅方之后,所述装置还包括:
第三发送单元47,用于向所述数据发布方发送第一数据发布消息;
删除单元48,用于若接收到所述数据发布方发送的发布释放消息,则删除所述第一数据。
在一种实施方式中,所述数据发布方、数据订阅方与所述数据类型之间的映射关系是通过下述功能单元,建立的:
第一接收单元49,用于接收数据订阅方发送的订阅请求;
第三确定单元410,用于根据所述订阅请求,确定所述订阅请求中包含的数据类型和所述数据订阅方的地址信息;
第四确定单元411,用于根据所述数据类型,确定与所述数据类型相匹配的数据发布方;
建立单元412,用于建立所述数据发布方、数据订阅方与所述数据类型的映射关系。
在一种实施方式中,当所述数据发布方的状态包括离线状态和在线状态时,在接收单元41接收数据发布方发送的第一数据之前,所述装置还包括:
第四发送单元413,用于若确定所述数据发布方的状态为在线状态,则将所述订阅请求发送给所述数据发布方,以使得所述数据发布方发送与所述订阅请求中包含的数据类型相对应的数据。
本申请中,服务器能够首先接收数据发布方发送的第一数据,确定第一数据的数据类型,根据预先建立的数据发布方、数据订阅方与数据类型之间的映射关系,确定与第一数据的数据类型对应的数据订阅方,再将第一数据发送给数据订阅方,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,从而保证了数据发布方与数据订阅方之间数据传输的可靠性。
为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种数据发布装置50,如图10所示,包括下述功 能单元:
接收单元51,用于接收服务器发送的数据订阅请求;
发送单元52,用于向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。
在一种实施方式中,所述装置还包括:
删除单元53,用于若接收到所述服务器发送的数据发布完成的消息,则删除所述第一数据。
在一种实施方式中,所述装置还包括:
第一发送单元54,用于若接收到所述服务器发送的数据发布收到的消息,则向所述服务器发送发布释放消息,以使得所述服务器删除所述第一数据。
在一种实施方式中,当所述数据发布方的状态包括离线状态和在线状态时,则接收单元51,用于:
当所述数据发布方的状态为所述在线状态时,则接收服务器发送的数据订阅请求。
本申请中,数据发布方能够接收服务器发送的数据订阅请求,然后向服务器发送与订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。
为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种数据订阅装置60,如图11所示,包括下述功能单元:
发送单元61,用于向服务器发送数据订阅请求;
接收单元62,用于接收服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。
本申请中,数据订阅方能够向服务器发送数据订阅请求,再接收服务器发送的与数据订阅请求中包含的数据类型相匹配的第一数据,由于能够通过服务 器转发数据发布方发送的第一数据至数据订阅方,能够保证数据发布方和数据订阅方之间的数据传输的可靠性。
为解决现有技术中数据发布方与订阅方之间的数据传输不保证可靠性的问题,本申请实施例还提供一种数据订阅及发布系统70,如图12所示,包括服务器71、数据发布装置72和数据订阅装置73,其中,
所述数据订阅装置73,用于向所述服务器71发送数据订阅请求;
接收所述服务器71发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据;
所述数据发布装置72,用于接收所述服务器71发送的数据订阅请求;
向所述服务器71发送与数据订阅请求中包含的数据类型相匹配的第一数据;
所述服务器71,用于接收所述数据发布装置72发送的第一数据;
确定所述第一数据的数据类型;
根据预先建立的数据发布装置72、数据订阅装置73与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅装置73;
将所述第一数据发送给所述数据订阅装置73。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或 其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非 排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。
以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (12)

  1. 一种数据传输方法,所述方法应用于服务器,其特征在于,包括:
    接收数据发布方发送的第一数据;
    确定所述第一数据的数据类型;
    根据预先建立的数据发布方、数据订阅方与所述数据类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;
    将所述第一数据发送给所述数据订阅方。
  2. 如权利要求1所述的方法,其特征在于,在将所述第一数据发送给所述数据订阅方之后,所述方法还包括:
    若确定所述第一数据的服务等级为预设的服务等级,则向所述数据发布方发送数据发布完成消息,用于提示所述数据发布方删除所述第一数据。
  3. 如权利要求1所述的方法,其特征在于,所述预设的服务等级包括第一等级和第二等级,当确定所述预设的服务等级为所述第一等级时,
    则接收数据发布方发送的第一数据之后,所述方法还包括:
    存储所述第一数据。
    则若将所述第一数据发送给所述数据订阅方之后,所述方法还包括:
    向所述数据发布方发送第一数据发布消息;
    若接收到所述数据发布方发送的发布释放消息,则删除所述第一数据。
  4. 如权利要求1所述的方法,其特征在于,所述数据发布方、数据订阅方与所述数据类型之间的映射关系是通过下述方法建立的:
    接收数据订阅方发送的订阅请求;
    根据所述订阅请求,确定所述订阅请求中包含的数据类型和所述数据订阅方的地址信息;
    根据所述数据类型,确定与所述数据类型相匹配的数据发布方;
    建立所述数据发布方、数据订阅方与所述数据类型的映射关系。
  5. 如权利要求4所述的方法,其特征在于,当所述数据发布方的状态包 括离线状态和在线状态时,在接收数据发布方发送的第一数据之前,所述方法还包括:
    若确定所述数据发布方的状态为在线状态,则将所述订阅请求发送给所述数据发布方,用于提示所述数据发布方发送与所述订阅请求中包含的数据类型相对应的数据。
  6. 一种数据发布方法,所述方法应用于数据发布方,其特征在于,包括:
    接收服务器发送的数据订阅请求;
    向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。
  7. 如权利要求6所述的方法,其特征在于,在向所述服务器发送与数据订阅请求中包含的数据类型相匹配的第一数据之后,所述方法还包括:
    若接收到所述服务器发送的数据发布收到的消息,则向所述服务器发送发布释放消息,以使得所述服务器删除所述第一数据;
    若接收到所述服务器发送的数据发布完成的消息,则删除所述第一数据。
  8. 如权利要求6所述的方法,其特征在于,当所述数据发布方的状态包括离线状态和在线状态时,则接收服务器发送的数据订阅请求,包括:
    当所述数据发布方的状态为所述在线状态时,则接收服务器发送的数据订阅请求。
  9. 一种数据订阅方法,所述方法应用于数据订阅方,其特征在于,包括:
    向服务器发送数据订阅请求;
    接收所述服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。
  10. 一种服务器,其特征在于,包括:
    接收单元,用于接收数据发布方发送的第一数据;
    第一确定单元,用于确定所述第一数据的数据类型;
    第二确定单元,用于根据预先建立的数据发布方、数据订阅方与所述数据 类型之间的映射关系,确定与所述第一数据的数据类型对应的数据订阅方;
    第一发送单元,用于将所述第一数据发送给所述数据订阅方。
  11. 一种数据发布装置,其特征在于,包括:
    接收单元,用于接收服务器发送的数据订阅请求;
    发送单元,用于向所述服务器发送与所述数据订阅请求中包含的数据类型相匹配的第一数据。
  12. 一种数据订阅装置,其特征在于,包括:
    发送单元,用于向服务器发送数据订阅请求;
    接收单元,用于接收服务器发送的与所述数据订阅请求中包含的数据类型相匹配的第一数据。
PCT/CN2017/116924 2017-11-29 2017-12-18 数据传输、发布及订阅方法和装置 WO2019104772A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711229189.1 2017-11-29
CN201711229189.1A CN108173902A (zh) 2017-11-29 2017-11-29 数据传输、发布及订阅方法和装置

Publications (1)

Publication Number Publication Date
WO2019104772A1 true WO2019104772A1 (zh) 2019-06-06

Family

ID=62524201

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/116924 WO2019104772A1 (zh) 2017-11-29 2017-12-18 数据传输、发布及订阅方法和装置

Country Status (2)

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

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI813743B (zh) * 2018-08-23 2023-09-01 美商阿爾克斯股份有限公司 在網路路由環境中的獨立資料儲存空間
CN109278674B (zh) * 2018-08-31 2020-10-09 百度在线网络技术(北京)有限公司 无人驾驶汽车系统安全检测方法、装置、设备及存储介质
CN109411063B (zh) * 2018-09-30 2021-08-24 北京中广瑞波科技股份有限公司 一种医疗健康服务系统及方法
CN110880992A (zh) * 2019-11-29 2020-03-13 中盈优创资讯科技有限公司 网络遥测telemetry协议数据的采集方法及装置
CN111866161A (zh) * 2020-07-28 2020-10-30 中国联合网络通信集团有限公司 信息订阅发布方法及装置、服务器、系统、设备、介质
CN113098969B (zh) * 2021-04-09 2022-12-20 薪得付信息技术(上海)有限公司 数据分发方法、装置、系统及电子设备
CN113965602A (zh) * 2021-10-26 2022-01-21 广州小鹏汽车科技有限公司 车载ecu的订阅发布通信方法、服务器及系统
CN114938392B (zh) * 2022-06-23 2023-06-30 成都质数斯达克科技有限公司 一种分布式订阅发布系统及方法
CN115378554A (zh) * 2022-10-24 2022-11-22 北京博点智合科技有限公司 一种数据传输方法、装置、设备和可读存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013029390A1 (zh) * 2011-08-26 2013-03-07 中兴通讯股份有限公司 增强现实信息的传输方法和移动增强现实服务器
CN105376194A (zh) * 2014-08-15 2016-03-02 中国电信股份有限公司 实时通信方法、系统和平台设备
CN105959165A (zh) * 2016-07-15 2016-09-21 重庆邮电大学 一种工业测控网络中基于xmpp协议的发布/订阅服务方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013029390A1 (zh) * 2011-08-26 2013-03-07 中兴通讯股份有限公司 增强现实信息的传输方法和移动增强现实服务器
CN105376194A (zh) * 2014-08-15 2016-03-02 中国电信股份有限公司 实时通信方法、系统和平台设备
CN105959165A (zh) * 2016-07-15 2016-09-21 重庆邮电大学 一种工业测控网络中基于xmpp协议的发布/订阅服务方法

Also Published As

Publication number Publication date
CN108173902A (zh) 2018-06-15

Similar Documents

Publication Publication Date Title
WO2019104772A1 (zh) 数据传输、发布及订阅方法和装置
US9800691B2 (en) Stream processing using a client-server architecture
KR102615419B1 (ko) 가입 및 통지 서비스
US9544295B2 (en) Login method for client application and corresponding server
Tukade et al. Data transfer protocols in IoT—An overview
JP2019537767A5 (zh)
KR102208935B1 (ko) 데이터 교환을 위한 컨텍스트를 설정하는 http 프로토콜을 통한 메시징 api
JP2019533235A5 (zh)
JP2019537768A5 (zh)
WO2015017482A1 (en) Messaging over http protocol for data exchange
CN114567650B (zh) 一种数据处理方法及物联网平台系统
Nakamura et al. Time‐based legality of information flow in the capability‐based access control model for the Internet of Things
JP2017528791A (ja) 制限付きユーザ・プロフィールを維持する方法およびその方法を実行するための命令を含む記憶媒体
WO2017000572A1 (zh) 基于因特网内容适配协议的通信方法、客户端和服务器
JP6034368B2 (ja) 認証情報処理
WO2017136979A1 (zh) 一种远程访问的实现方法、装置和系统
da Rocha et al. An MQTT-SN-based QoS dynamic adaptation method for wireless sensor networks
US20160162559A1 (en) System and method for providing instant query
CN103873355A (zh) 一种信息配对方法
Kangra et al. Internet of Things and Its Relevance
Nkenyereye et al. Internet of Things Management Service-based Event-driven Approach for IoT Applications
US10313198B2 (en) Crash recovery for smart objects
TW202402076A (zh) 具有藍牙廣播的離線網狀傳訊網路
CN111835812A (zh) 全球的数据获取方法、装置、电子设备及计算机存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17933282

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17933282

Country of ref document: EP

Kind code of ref document: A1