Data transmission, publishing and subscription methods and devices

A data transmission method and data publishing technology, applied in the fields of data transmission, publishing and subscription, can solve the problem of data transmission not guaranteeing reliability, and achieve the effect of ensuring reliability

Inactive Publication Date: 2018-06-15
TSINGHUA UNIV
3 Cites 9 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0005] The embodiment of the present application provides methods and devices for data transmission, publication and subscription, wh...
View more

Method used

In this application, the data subscriber can send a data subscription request to the server, and then receive the first data that matches the data type contained in the data subscription request sent by the server, because the first data sent by the data publisher can be forwarded by the server One data to the data subscriber, which can ensure the reliability of data transmission between the data publisher and the data s...
View more

Abstract

The invention discloses data transmission, publishing and subscription methods, used for solving the problem that the reliability of data transmission between a data publisher and a subscriber is notensured in the prior art. The method comprises the steps of: receiving first data sent by the data publisher; determining the data type of the first data; according to the pre-established mapping relationship among the data publisher, the data subscriber and the data type, determining a data subscriber corresponding to the data type of the first data; and sending the first data to the data subscriber. The invention further discloses data transmission, publishing and subscription devices.

Application Domain

Transmission

Technology Topic

Data transmissionData type +2

Image

  • Data transmission, publishing and subscription methods and devices
  • Data transmission, publishing and subscription methods and devices
  • Data transmission, publishing and subscription methods and devices

Examples

  • Experimental program(1)

Example Embodiment

[0046] In order to make the purpose, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be described clearly and completely in conjunction with specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
[0047] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0048] In order to solve the problem that the reliability of data transmission between the data publisher and the subscriber in the prior art is not guaranteed, an embodiment of the present application provides a data transmission method. The execution subject of the method may be a server or any implementation of the method. Apply for the device provided by the method. In the following, taking the server as an example for the execution of the method, the implementation of the method will be described in detail. It can be understood that the execution of the method is the server is only an exemplary description, and should not be understood as limited.
[0049] Such as figure 1 As shown, a schematic diagram of the implementation flow of the data transmission method provided in this embodiment of the application applied to a server includes:
[0050] Step 11: Receive the first data sent by the data issuer;
[0051] As mentioned in the background art, in the prior art, during the data transmission process between the data publisher and the data subscriber, the reliability of the data transmission is not guaranteed, which will result in some important data that may not be subscribed to by the data. The party receives that, in order to solve this problem, the data subscription and publishing method provided in 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.
[0052] Specifically, the first data may be data requested by a data subscriber to subscribe, for example, may include sensor data in a network formed by sensors, such as sensor data such as temperature, humidity, and light intensity. Such as figure 2 As shown, the data subscription and publishing method provided in this application embodiment is applied to a schematic diagram of actual scenarios, including data publishers: on-site intelligent monitoring unit 1 to on-site intelligent monitoring unit 3, server (storage publisher status table, that is, data publishing The state table and the subscription/publishing relationship table of the party are the mapping relationship and the service level filtering table described below), and the data subscriber: the centralized monitoring center 1 and the centralized monitoring center 2.
[0053] in figure 2 In the data publisher, the field intelligent monitoring unit 1 to the field intelligent monitoring unit 3 are responsible for the collection and monitoring of sensor data in the network formed by monitoring sensors, and the server is responsible for data transmission between the data subscriber and the data publisher, and data subscription The centralized monitoring center 1 and the centralized monitoring center 2 are responsible for monitoring the sensor data they care about, that is, monitoring the sensor data they request for subscription.
[0054] Step 12. Determine the data type of the first data;
[0055] It should be understood that the types of data that different data subscribers request to subscribe are often different. For example, in a network formed by multiple sensors, some data subscribers may focus on temperature and humidity, while some data subscribers may focus on whether it will happen. Fire, so 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 multiple types of sensor data, such as temperature sensors collected by a temperature sensor. The data, or the humidity sensor data collected by the humidity sensor, or the light intensity sensor data collected by the light intensity sensor, etc., other types of sensor data.
[0056] Step 13. 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;
[0057] As mentioned above, the data types that different data subscribers request to subscribe are often different. Therefore, after the data type of the first data is determined, the mapping between the data publisher, the data subscriber and the data type can be established in advance. The relationship is to 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.
[0058] 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 The address information of the subscriber; then according to the data type, determine the data publisher that matches the data type; finally establish the mapping relationship between the data publisher, the data subscriber and the 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 unsubscribe a certain type of data to the server. The server can cancel the previous subscription after receiving this unsubscribe request. The established mapping relationship between the data publisher, the data subscriber and the data type.
[0059] Optionally, under normal circumstances, in order to reduce the energy consumption of the data publisher when monitoring the environment, the data publisher in this embodiment of the application may include two states: offline state and 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. When the status of the data publisher includes offline status and online status, before receiving the first data sent by the data publisher, if it is determined that the status of the data publisher is online, a subscription request is sent to the data publisher to This allows the data publisher to send data corresponding to the type of data contained in the subscription request.
[0060] Step 14. Send the first data to the data subscriber;
[0061] After the data subscriber requesting to subscribe to the first data is determined above, the first data can be sent to the data subscriber to satisfy the data subscription request of the data subscriber.
[0062] 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 the preset service level, a data release completion message is sent to the data publisher to prompt the data publisher to delete the first data. Among them, the preset service level includes the first level and the second level. When the preset service level is determined to be the first level, the first data sent by the data issuer may be received, and the first data may 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 publication message can also be sent to the data publisher; optionally, in order to release the server space in time, if the data publisher is received If the release release message is sent, the first data is deleted.
[0063] The first-level data may be some alarm data in the embodiment of this application. For example, when the data issuer determines that the collected data is greater than or less than a preset threshold, the alarm data may be sent to the server, and the server is in 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 then After the alarm data is sent to the data subscriber, the alarm data release message is first sent to the data publisher to indicate that the alarm data has been sent to the data subscriber, and then the first release message is deleted when the release message sent by the data publisher is received. One data to release the storage space of the server.
[0064] It should be understood that, in order to be able to reduce the data redundancy of the data issuer, when it is determined that the preset service level is the second level, only a data release completion message needs to be sent to the data issuer, so that the data issuer deletes the first data. The second-level data in this embodiment of the application may be the state change data of the data issuer. For example, when the state of the data issuer changes from an offline state to an online state or an online state to an offline state, in order to facilitate the server in time To obtain the status change, the data publisher can send the status change data to the server.
[0065] 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 based on the pre-established mapping relationship between the data publisher, the data subscriber, and the data type. The data subscriber corresponding to the data type of the data type then sends 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 communication between the data publisher and the data subscriber is guaranteed. Reliability of data transmission.
[0066] Such as image 3 As shown, the schematic diagram of the implementation process of the data publishing method provided by the embodiment of this application includes:
[0067] Step 21: Receive a data subscription request sent by the server;
[0068] As mentioned above, in order to reduce the power consumption of the data publisher, the state of the data publisher can include offline state and online state. When the state of the data publisher includes offline state and online state, the data subscription sent by the server is received The request, specifically, can receive the data subscription request sent by the server when the status of the data publisher is online.
[0069] Step 22: Send the first data that matches the data type included in the data subscription request to the server;
[0070] Optionally, after sending the first data that matches the data type contained in the data subscription request to the server, if the message received by the data publication from the server is received, a publication release message is sent to the server to prompt the server Delete the first data.
[0071] In addition, in order to reduce excessive data redundancy caused by the data publisher, the first data is deleted if the message that the data publication is completed is received from the server.
[0072] 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 ensure the reliability of data transmission between the data publisher and the data subscriber.
[0073] Such as Figure 4 As shown, the schematic diagram of the implementation process of the data subscription method provided by the embodiment of this application includes:
[0074] Step 31: Send a data subscription request to the server;
[0075] Step 32: Receive the first data that matches the data type included in the data subscription request sent by the server.
[0076] In this application, the data subscriber can send a data subscription request to the server, and then receive the first data that matches the data type contained in the data subscription request sent by the server, because the server can forward the first data sent by the data publisher to The data subscriber can ensure the reliability of data transmission between the data publisher and the data subscriber.
[0077] Below figure 2 As an example, the schematic diagram of the data subscription and publishing method provided by this application in an actual scenario is shown to introduce the method in detail. figure 2 The server shown stores the publisher status table, which is the status table of the data publisher, the subscription/publishing relationship table, which is the above-mentioned mapping relationship and the service level filter table. The server can be based on The message proxy server of the Message Queuing Telemetry Transport (Message Queuing Telemetry Transport, MQTT) protocol, in which the MQTT protocol uses a lightweight subscription/publish mode for message transmission.
[0078] MQTT is specially optimized for low bandwidth, low computing power, and unstable network environment. It can be applied to message push for embedded smart terminals and mobile terminals. It can effectively save the power consumption and traffic of the terminal. There are three types Message data publishing service quality:
[0079] (1) "At most once", the release of message data completely relies on the underlying TCP/IP network. Message data loss or duplication can occur. This level can be used in the following situations, the environmental sensor data, it does not matter if you lose a reading record, because there will be a second transmission soon. In the embodiment of the present application, the "at most once" may be environmental sensor data collected periodically by the data issuer.
[0080] (2) "At least once" to ensure that the message arrives, but message duplication may occur. In the embodiment of the present application, the service level data may be status change data of the data issuer.
[0081] (3) "Only once" to ensure that the message arrives once. This level can be used in situations where, in the billing system, duplicate or missing messages can lead to incorrect results. In the embodiment of the present application, the data of the service level may be alarm data sent by the data issuer.
[0082] Such as Figure 5 Shown is a schematic diagram of the data transmission process in the data subscription and publication method provided by the embodiment of the application, including the following steps:
[0083] Step a, the data release sends state change data to the server;
[0084] Step b, after the server receives the state change data, it modifies the data issuer state table;
[0085] Step c, the server receives the data subscription request sent by the data subscriber;
[0086] 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, and the subscription list stores the address information of the data subscriber, the type of data to be subscribed, and Can provide the mapping relationship between data publishers of the data type;
[0087] Step e: The server sends a subscription request response to the data subscriber to prompt the data subscriber that the data subscription request is successfully sent and verified;
[0088] Step f, the server queries the status list of the data publisher;
[0089] Step g: When determining that the status of the data publisher corresponding to the data the data subscriber requests to subscribe is online, the server sends its data subscription request to the data publisher corresponding to the data the data subscriber requests to subscribe;
[0090] Step h: The data publisher sends the first data to the server, and the first data is the data corresponding to the data that the data subscriber requests to subscribe;
[0091] Step i: The server receives the first data and queries the subscription list to determine which data subscribers have requested to subscribe to the first data;
[0092] Step j: The server sends the first data to a data subscriber that requests to subscribe to the first data;
[0093] Step k: When the data subscriber wants to cancel the data subscription request it has previously sent, it can send a request for unsubscription to the server. The unsubscribe request includes the address information of the data subscriber and the type of data that it wants to unsubscribe ;
[0094] Step 1. After receiving the unsubscribe request, the server may, according to the unsubscribe request including the address information of the data subscriber and the type of data to be unsubscribed, compare the data stored in the subscription list with the data subscriber’s The mapping relationship between the address information, the data type you want to unsubscribe, and the data publisher that can provide the data type is released;
[0095] Step m: The server sends an unsubscribe response to the data subscriber to prompt the data subscriber that the unsubscribe request takes effect.
[0096] Since the data transmitted between the data publisher and the data subscriber in the embodiment of this application can include three service levels, namely periodic sensor data (the service level of this type of data can be set to 0 in this application), The state change data of the data issuer (the service level of this type of data can be set to 1 in this application) and the alarm data of the data issuer (the service level of this type of data can be set to 2 in this application).
[0097] Such as Image 6 Shown is a schematic diagram of the process of data transmission with a service level of 0. During the data transmission process, after the data publisher sends data with a service level of 0 to the server, the server only needs to send the data to the data requesting to subscribe to the data The subscriber and the data publisher can discard the data after sending the data to reduce data redundancy.
[0098] Such as Figure 7 Shown is a schematic diagram of the process of data transmission with service level 1. In 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 again After the data subscriber requesting to subscribe to the data, in order to ensure the reliability of data transmission, it can also send a publish data response to the data publisher to prompt that the data has been sent to the data subscriber. The data publisher receives the published data The stored data is discarded after responding.
[0099] Such as Picture 8 Shown is a schematic diagram of the process of data transmission with service level 2. In this 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, and the server receives the data Then, first store the data locally, and then send the data to the data subscriber requesting to subscribe to the data. To ensure the reliability of data transmission, you can also send the received message to the data publisher to prompt the data It has been sent to the data subscriber. After receiving the message received by the publication, the data publisher sends a publication release message to the server to prompt the server to discard the stored data. The server discards the publication release message after receiving the publication release message After discarding the stored data, the data publisher sends a release completion message to the data publisher, and the data publisher discards the stored data after receiving the release completion message.
[0100] In order to solve the problem that the reliability of data transmission between the data publisher and the subscriber in the prior art is not guaranteed, an embodiment of the present application also provides a server 40, such as Picture 9 As shown, it includes the following functional units:
[0101] The receiving unit 41 is configured to receive the first data sent by the data issuer;
[0102] The first determining unit 42 is configured to determine the data type of the first data;
[0103] The second determining 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;
[0104] The first sending unit 44 is configured to send the first data to the data subscriber.
[0105] In an embodiment, the server further includes:
[0106] The second sending unit 45 is configured to, if it is determined that the service level of the first data is the preset service level, send a data release completion message to the data publisher, so that the data publisher deletes the first data publisher. data.
[0107] In an implementation manner, 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 a data issuer sent After the first data of, the device further includes:
[0108] The storage unit 46 is configured to store the first data.
[0109] After the first sending unit 44 sends the first data to the data subscriber, the device further includes:
[0110] The third sending unit 47 is configured to send a first data publishing message to the data publishing party;
[0111] The deleting unit 48 is configured to delete the first data if a release message sent by the data issuer is received.
[0112] In one embodiment, the mapping relationship between the data publisher, the data subscriber and the data type is established through the following functional units:
[0113] The first receiving unit 49 is configured to receive a subscription request sent by a data subscriber;
[0114] The third determining unit 410 is configured to determine the type of data included in the subscription request and the address information of the data subscriber according to the subscription request;
[0115] The fourth determining unit 411 is configured to determine a data issuer matching the data type according to the data type;
[0116] The establishing unit 412 is configured to establish a mapping relationship between the data publisher, the data subscriber, and the data type.
[0117] In an embodiment, when the status of the data issuer includes an offline state and an online state, before the receiving unit 41 receives the first data sent by the data issuer, the device further includes:
[0118] 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’s sending and the subscription request include Data corresponding to the data type.
[0119] 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 based on the pre-established mapping relationship between the data publisher, the data subscriber, and the data type. The data subscriber corresponding to the data type of the data type then sends 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 communication between the data publisher and the data subscriber is guaranteed. Reliability of data transmission.
[0120] In order to solve the problem that the reliability of data transmission between the data publisher and the subscriber in the prior art is not guaranteed, an embodiment of the present application also provides a data publishing device 50, such as Picture 10 As shown, it includes the following functional units:
[0121] The receiving unit 51 is configured to receive a data subscription request sent by the server;
[0122] The sending unit 52 is configured to send first data matching the data type included in the data subscription request to the server.
[0123] In an embodiment, the device further includes:
[0124] The deleting unit 53 is configured to delete the first data if a message indicating that the data publishing is completed is received from the server.
[0125] In an embodiment, the device further includes:
[0126] The first sending unit 54 is configured to send a release release message to the server if the received message of data release sent by the server is received, so that the server deletes the first data.
[0127] In an embodiment, when the status of the data issuer includes an offline status and an online status, the receiving unit 51 is configured to:
[0128] When the status of the data publisher is the online status, a data subscription request sent by the server is received.
[0129] 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 ensure the reliability of data transmission between the data publisher and the data subscriber.
[0130] In order to solve the problem that the reliability of data transmission between the data publisher and the subscriber in the prior art is not guaranteed, an embodiment of the present application also provides a data subscription device 60, such as Picture 11 As shown, it includes the following functional units:
[0131] The sending unit 61 is configured to send a data subscription request to the server;
[0132] The receiving unit 62 is configured to receive the first data that matches the data type included in the data subscription request sent by the server.
[0133] In this application, the data subscriber can send a data subscription request to the server, and then receive the first data that matches the data type contained in the data subscription request sent by the server, because the server can forward the first data sent by the data publisher to The data subscriber can ensure the reliability of data transmission between the data publisher and the data subscriber.
[0134] In order to solve the problem that the reliability of data transmission between the data publisher and the subscriber in the prior art is not guaranteed, an embodiment of the present application also provides a data subscription and publishing system 70, such as Picture 12 As shown, it includes a server 71, a data publishing device 72, and a data subscription device 73, in which,
[0135] The data subscription device 73 is configured to send a data subscription request to the server 71;
[0136] Receiving the first data that matches the data type included in the data subscription request sent by the server 71;
[0137] The data publishing device 72 is configured to receive a data subscription request sent by the server 71;
[0138] Sending to the server 71 first data that matches the data type included in the data subscription request;
[0139] The server 71 is configured to receive the first data sent by the data publishing device 72;
[0140] Determining the data type of the first data;
[0141] 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;
[0142] The first data is sent to the data subscription device 73.
[0143] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0144] This application is described with reference to the flowcharts and/or block diagrams of the methods, equipment (systems), and computer program products of the embodiments of the application. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment can be generated In the process Figure one Process or multiple processes and/or boxes Figure one A device with functions specified in a block or multiple blocks.
[0145] These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device is implemented in the process Figure one Process or multiple processes and/or boxes Figure one Functions specified in a box or multiple boxes.
[0146] These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. Instructions are provided to implement the process Figure one Process or multiple processes and/or boxes Figure one Steps of functions specified in a box or multiple boxes.
[0147] In a typical configuration, the computing device includes one or more processors (CPU), input/output interfaces, network interfaces, and memory.
[0148] The memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
[0149] Computer-readable media includes permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, 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, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
[0150] It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or equipment including a series of elements not only includes those elements, but also includes Other elements that are not explicitly listed, or they also include elements inherent to such processes, methods, commodities, or equipment. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, commodity or equipment that includes the element.
[0151] The above are only examples of this application, and are not used to limit this application. For those skilled in the art, this application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the scope of the claims of this application.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Controller for electric vehicle

Owner:常州市美信电子有限公司

Heating and cooling air conditioner

Owner:GD MIDEA AIR-CONDITIONING EQUIP CO LTD +1

Lossless switching method for inter-satellite data of low-orbit satellites

ActiveCN111211829AGuaranteed reliabilityreduce time overhead
Owner:中国星网网络应用有限公司

Classification and recommendation of technical efficacy words

Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products