WO2023231892A1 - 传输数据的方法和装置 - Google Patents

传输数据的方法和装置 Download PDF

Info

Publication number
WO2023231892A1
WO2023231892A1 PCT/CN2023/096274 CN2023096274W WO2023231892A1 WO 2023231892 A1 WO2023231892 A1 WO 2023231892A1 CN 2023096274 W CN2023096274 W CN 2023096274W WO 2023231892 A1 WO2023231892 A1 WO 2023231892A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
service
publishing
subscribing
simplified
Prior art date
Application number
PCT/CN2023/096274
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 WO2023231892A1 publication Critical patent/WO2023231892A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the embodiments of the present application relate to the field of communication technology, and in particular, to a method and device for transmitting data.
  • Publish and subscribe is a data transmission model that is currently widely used.
  • the subscriber device needs to know the data format of the data published by the publisher device, so that the subscriber device can correctly parse the corresponding data, and the data format It is usually agreed upon in advance.
  • the subscribing device cannot correctly parse it.
  • a method for transmitting data including: a publishing end device receives a first subscription message from a subscribing end device, the first subscription message is used to subscribe to a first service, and the data format of the data of the first service is The data format is unknown to the subscribing device, and the subscribing device includes one or more devices; the publishing device publishes a first full package to the subscribing device, and the first full package includes the first data of the first service.
  • the information used to indicate the data format of the first data of the first service includes information used to indicate the data type of the first data of the first service information and information used to indicate the data meaning of the first data of the first service.
  • the publishing device determines a first simplified package according to the first subscription message, and the first simplified package includes the second data of the first service; in the publishing After the terminal device publishes the first full package to the subscribing terminal device, the publishing terminal device publishes the first simplified package to the subscribing terminal device.
  • the publishing terminal device The time when the device releases the first simplified package is different from the time when the issuing end device releases the first full package by N first release cycles.
  • the first release cycle is the release cycle of the first service, and N is greater than or equal to 1. integer.
  • the first subscription message includes an identifier of the first service
  • the publishing device determines the third service based on the identifier of the first service in the first subscription message.
  • the subscription message carries the identification of the data to be subscribed by the subscribing device. Therefore, the publishing device can determine the data subscribed by the subscribing device based on the identification of the data, so that the publishing device can further proceed based on the subscribing message. Determine how to publish the data.
  • the publishing device publishes the first full package to the subscribing device, including: the publishing device determines the first publishing time according to the reception time of the first subscription message. Base time: The publishing end device publishes the first full package at the first publishing base time.
  • the method further includes: the publishing device receives the third subscription message from the subscribing device.
  • Two subscription messages the second subscription message is used to subscribe to a second service, the data format of the second service is data in a data format known to the subscribing end device;
  • the publishing end device determines based on the second subscription message a second simplified package, the second simplified package includes the data of the second service;
  • the publishing end device publishes the second simplified package to the subscribing end device, and the time when the publishing end device publishes the second simplified package is the same as the first publishing
  • the reference time differs by M second release cycles, the second release cycle is the release cycle of the second service, and M is an integer greater than or equal to 0.
  • the publishing device can determine the publishing time of the data of the second service based on the first publishing reference time and the publishing cycle of the second service ( Including the first release time of the data of the second service), in this case, the first release time of the data of the second service and the first release time of the data of the first service (first release reference time) can be the same, that is, M equals 0 situation. It can also be understood that the data of the first service and the data of the second service may not be released at the same time at the first release reference time.
  • the publishing device publishes the first simplified packet to the subscribing device, including: when there is one subscribing device, the publishing device uses unicast Publish the first simplified package to the subscribing device; or when there are multiple subscribing devices, the publishing device publishes the first simplified package to the subscribing device through multicast.
  • the publishing device publishes the second simplified package to the subscribing device, including: when there is one subscribing device, the publishing device uses unicast Publish the second simplified package to the subscribing device; or when there are multiple subscribing devices, the publishing device publishes the second simplified package to the subscribing device through multicast.
  • the publishing device can send the data subscribed by the subscribing device in unicast or multicast according to different numbers of subscribing devices, which can further improve the transmission efficiency.
  • the information indicating the data type of the first data of the first service includes a string, an integer, or a floating point.
  • a method of transmitting data including: a subscribing device sends a first subscription message to a publishing device, the first subscription message is used to subscribe to a first service, and the data format of the first service is: The data format is unknown to the subscribing device, and the subscribing device includes one or more devices; the subscribing device receives the first full packet from the publishing device, and the first full packet includes the first data of the first service. and information used to indicate the data format of the first data of the first service, the information used to indicate the data format of the first data of the first service includes information used to indicate the data type of the first data of the first service information and information used to indicate the data meaning of the first data of the first service.
  • the method further includes: the subscribing device receives the third packet from the publishing device.
  • a simplified package the first simplified package includes the second data of the first service, and the time when the subscriber device receives the first simplified package is different from the time when the subscriber device receives the first full package by N first releases cycle, the first release cycle is the release cycle of the first service, and N is an integer greater than or equal to 1.
  • the subscribing device receives the first full packet from the publishing device, including: the subscribing device receives the packet published by the publishing device at the first publishing reference time. The first full package.
  • the information indicating the data type of the first data of the first service includes a string, an integer, or a floating point.
  • the information indicating the data meaning of the first data of the first service includes any one of the following: humidity, temperature, methane concentration or temperature, etc.
  • the method further includes: the publishing device receives the third subscription message from the subscribing device.
  • the fourth subscription message is used to subscribe to the fourth service; the publishing end device publishes the data of the fourth service to the subscribing end device, and the time when the publishing end device publishes the data of the fourth service coincides with the third
  • the two release reference times differ by M fourth release cycles.
  • the fourth release cycle is the release cycle of the fourth service, and M is an integer greater than or equal to 0.
  • the publishing end device can determine the publishing reference time based on the reception time of the subscription message. Therefore, for a single piece of data, no matter what time the subscribing device subscribes, a fixed publishing time can be determined; for multiple data, the publishing time of the data can also be unified, and the publishing time of multiple data can be aligned as much as possible. This method can also achieve simultaneous transmission of as much data as possible and improve transmission efficiency.
  • the information used to indicate the data format of the first data of the third service includes information used to indicate the data type of the first data of the third service and information used to indicate the first data of the third service information on the meaning of the data; or when the data format of the third service data is a data format known to the subscribing device, the publishing device publishes the third simplified version to the subscribing device at the second publishing reference time. package, the third simplified package includes the first data of the third service.
  • the publishing device publishes the data of the fourth service to the subscribing device, including: when the data format of the fourth service data is the subscribing device.
  • the publishing device publishes a fourth full packet to the subscribing device.
  • the fourth full packet includes the data of the fourth service and information indicating the data format of the data of the fourth service.
  • the information used to indicate the data format of the data of the fourth service includes information used to indicate the data type of the data of the fourth service and information used to indicate the data meaning of the book of the fourth service; or when the fourth When the data format of the service data is a data format unknown to the subscribing device, the publishing device publishes a fourth simplified package to the subscribing device, and the fourth simplified package includes the data of the fourth service; or when the fourth simplified package When the data format of the service data is a data format known to the subscribing device, the publishing device publishes the fourth simplified package to the subscribing device.
  • the publishing device when the publishing device publishes data in a data format unknown to the subscribing device for the first time, it needs to publish the data in the form of a full package.
  • the data can be published in the form of a simplified package at any subsequent publishing time; when the publishing device When a device publishes data in a data format known to the subscribing device, it can publish the data in the form of a simplified package. This ensures that the subscriber device parses the data correctly while also reducing the amount of data transmitted as much as possible.
  • the publishing device publishes the data of the fourth service to the subscribing device, including: when there is one subscribing device, the publishing device uses a single The publishing end device publishes the data of the fourth service to the subscribing end device through multicast; or when there are multiple subscribing end devices, the publishing end device publishes the data of the fourth service to multiple subscribing end devices through multicast.
  • the publishing device can send the data subscribed by the subscribing device in unicast or multicast according to different numbers of subscribing devices, which can further improve the transmission efficiency.
  • the data meaning information of the first data of the third service includes any of the following: humidity, temperature, speed or methane concentration, etc.; or the data meaning information of the fourth service
  • the data meaning information of the data includes any of the following: humidity, temperature, speed, or methane concentration, etc.
  • a fourth aspect provides a method for transmitting data, including: a subscribing device sending a third subscription message to a publishing device, the third subscription message being used to subscribe to a third service, and the subscribing device including one or more devices ; The subscribing device receives the first data of the third service published by the publishing device at the second publishing reference time.
  • the method further includes: the subscribing device sends a fourth subscription to the publishing device. news, the article Four subscription messages are used to subscribe to the fourth service; the subscribing device receives the data of the fourth service from the publishing device, and the time when the subscribing device receives the data of the fourth service differs by M from the second publishing reference time. a fourth release cycle, the fourth release cycle is the release cycle of the fourth service, and M is an integer greater than or equal to 0.
  • the subscribing device receives the first data of the third service published by the publishing device at the second publishing reference time, including: when the third service When the data format of the data is unknown to the subscribing device, the subscribing device receives the third full package published by the publishing device at the second publishing reference time.
  • the third full package includes the first part of the third service. data and information used to indicate the data format of the first data of the third service.
  • the information used to indicate the data format of the first data of the third service includes information used to indicate the data type of the first data of the third service.
  • the subscriber device receives the publisher
  • the device publishes a third simplified package at the second publishing reference time, and the third simplified package includes the first data of the third service.
  • the subscribing device receives the data of the fourth service from the publishing device, including: when the data format of the fourth service data is the subscribing device. When the data format is unknown to the device, the subscribing device receives a fourth full packet from the publishing device.
  • the fourth full packet includes the data of the fourth service and information indicating the data format of the data of the fourth service.
  • the information used to indicate the data format of the data of the fourth service includes information used to indicate the data type of the data of the fourth service and information used to indicate the meaning of the data of the fourth service; or when the fourth service
  • the subscribing device receives the fourth simplified packet from the publishing device, and the fourth simplified packet includes the data of the fourth service; or when the third simplified packet is received from the publishing device.
  • the data format of the four-service data is a data format known to the subscribing device
  • the subscribing device receives the fourth simplified packet from the publishing device.
  • the subscribing device receives the first data of the third service published by the publishing device at the second publishing reference time, including: when the subscribing device is When there is one subscriber device, the subscriber device receives the first data of the third service published by the publisher device through unicast; or when there are multiple subscriber devices, the subscriber device receives the first data of the third service published by the publisher device through multicast. the first data of the third business.
  • the subscribing device receives data of the fourth service from the publishing device, including: when there is one subscribing device, the subscribing device receives The publisher device publishes the data of the fourth service through unicast; or when there are multiple subscriber devices, the subscriber device receives the data of the fourth service published by the publisher device through multicast.
  • the information used to indicate the data type of the first data of the third service includes a string, an integer or a floating point; the information used to indicate the fourth
  • the data type information of business data includes string, integer or floating point.
  • the information used to indicate the data meaning of the data of the third service includes any of the following: humidity, temperature, speed or methane concentration, etc.; or the user
  • the information indicating the data meaning of the data of the fourth service includes any one of the following: humidity, temperature, speed or methane concentration, etc.
  • a device for transmitting data including a transceiver unit for receiving a first subscription message from a subscribing end device, the first subscription message being used to subscribe to a first service, and the data of the first service
  • the format is a data format unknown to the subscribing device, which includes one or more devices; the transceiver unit is also used to publish a first full package to the subscribing device, and the first full package includes the first service the first data and is used to indicate the first Information about the data format of the first data of the service.
  • the information used to indicate the data format of the first data of the first service includes information used to indicate the data type of the first data of the first service and information used to indicate the data format of the first data of the first service. Information about the data meaning of the first data of the first service.
  • the device further includes a processing unit, and the method further includes: the processing unit, configured to determine a first simplified package according to the first subscription message, the first simplified package The package includes the second data of the first service; the transceiver unit is also configured to, after publishing the first full package to the subscriber device, the subscriber device publishes the first simplified package, and the subscriber device publishes the first simplified package
  • the time is different from the time when the first full package is released by N first release cycles.
  • the first release cycle is the release cycle of the first service, and N is an integer greater than or equal to 1.
  • the first subscription message includes an identifier of the first service
  • the method further includes: the processing unit, further configured to: according to the first subscription message The identifier of the first service determines the first full package.
  • the processing unit is also configured for the device to determine the first publishing reference time according to the receiving time of the first subscription message; the transceiving unit is specifically configured to perform the first publishing reference time on the first subscription message.
  • the first full package is released at a release benchmark time.
  • the transceiver unit is also used to receive a second subscription message from the subscribing device, the second subscription message is used to subscribe to the second service, and the second The data format of the service is a data format known to the subscribing device; the processing unit is also configured to determine a second simplified package according to the second subscription message, the second simplified package includes the data of the second service; the transceiving unit , and is also used to publish the second simplified package to the subscribing device.
  • the time of publishing the second simplified package is different from the first publishing reference time by M second publishing cycles, and the second publishing cycle is the second service.
  • the release cycle, M is an integer greater than or equal to 0.
  • the receiving unit is specifically configured to publish the first full packet to the subscribing device through unicast when there is one subscribing device; or the receiving unit The unit is specifically configured to publish the first full package to multiple subscriber devices through multicast when there are multiple subscriber devices.
  • the receiving unit is specifically configured to publish the first simplified packet to the subscribing device through unicast when there is one subscribing device; or the receiving unit The unit is specifically configured to publish the first simplified package to the subscribing device through multicast when there are multiple subscribing devices.
  • the receiving unit is specifically configured to publish the second simplified packet to the subscribing device through unicast when there is one subscribing device; or the receiving unit The unit is specifically configured to publish the second simplified package to the subscribing device through multicast when there are multiple subscribing devices.
  • the information indicating the data type of the first data of the first service includes a string, an integer, or a floating point.
  • the information indicating the data meaning of the first data of the first service includes any one of the following: humidity, temperature, methane concentration or temperature, etc.
  • the transceiver unit is also configured to receive a first simplified packet from the publishing end device, where the first simplified packet includes the second data of the first service, The time when the first simplified packet is received is different from the time when the first full packet is received by N first release cycles.
  • the first release cycle is the release cycle of the first service, and N is an integer greater than or equal to 1.
  • the first subscription message includes an identification of the first service.
  • the transceiver unit is specifically configured to receive the first full packet issued by the issuing end device at the first issuing reference time.
  • the transceiver unit is also used to send a second subscription message to the publishing end device.
  • the second subscription message is used to subscribe to the second service.
  • the second service The data format of the data is a data format known to the device; the transceiver unit is also used to receive a second simplified packet from the publishing end device, the second simplified packet includes the data of the second service, and the receiving unit
  • the time of the second simplified package differs from the first release reference time by M second release cycles.
  • the second release cycle is the release cycle of the second service, and M is an integer greater than or equal to 0.
  • the transceiver unit is specifically configured to receive the first full packet published by the publishing end device through unicast when the device is one; or the transceiver unit , specifically used to receive the first full packet published by the publishing end device through multicast when there are multiple devices.
  • the transceiver unit is specifically configured to receive the second simplified packet published by the publishing end device through unicast when the device is one; or the transceiver unit , specifically used to receive the second simplified packet published by the publishing end device through multicast when there are multiple devices.
  • the information indicating the data type of the first data of the first service includes a string, an integer, or a floating point.
  • the information indicating the data meaning of the first data of the first service includes any of the following: humidity, temperature, methane concentration or temperature, etc.
  • a device for transmitting data including: a transceiver unit, configured to receive a third subscription message from a subscribing device, the third subscription message being used to subscribe to a third service, the subscribing device including one or A plurality of devices; a determining unit configured to determine a second publishing reference time based on the reception time of the third subscription message; and the transceiving unit further configured to publish the third service to the subscribing end device at the second publishing reference time.
  • a transceiver unit configured to receive a third subscription message from a subscribing device, the third subscription message being used to subscribe to a third service, the subscribing device including one or A plurality of devices; a determining unit configured to determine a second publishing reference time based on the reception time of the third subscription message; and the transceiving unit further configured to publish the third service to the subscribing end device at the second publishing reference time.
  • the transceiver unit is also used to receive a fourth subscription message from the subscribing device, the fourth subscription message being used to subscribe to the fourth service; the transceiver unit , and is also used to publish the data of the fourth service to the subscriber device.
  • the time of publishing the data of the fourth service is different from the second publishing reference time by M fourth publishing cycles.
  • the fourth publishing cycle is the fourth publishing cycle.
  • the release cycle of four services, M is an integer greater than or equal to 0.
  • the transceiver unit is specifically configured to: when the data format of the third service data is a data format unknown to the subscriber device, in the second publishing reference to the subscriber at all times
  • the device issues a third full packet, which includes the first data of the third service and information indicating the data format of the first data of the third service.
  • the third full packet includes information indicating the data format of the first data of the third service.
  • the data format information includes information indicating the data type of the first data of the third service and information indicating the data meaning of the first data of the third service; or the transceiver unit is specifically used when the third service
  • the third simplified package is published to the subscriber device at the second release reference time.
  • the third simplified package includes the third service of the third service. One data.
  • the transceiver unit is specifically configured to publish data to the subscribing device when the data format of the fourth service is unknown to the subscribing device.
  • the fourth full package includes the data of the fourth service and the information indicating the data format of the data of the fourth service.
  • the information indicating the data format of the data of the fourth service includes: Information indicating the data type of the data of the fourth service and information indicating the data meaning of the book of the fourth service; or the transceiver unit, specifically used when the data format of the data of the fourth service is the subscription
  • publish a fourth simplified package to the subscribing end device publish a fourth simplified package to the subscribing end device.
  • the fourth simplified package includes the data of the fourth service; or the transceiver unit is specifically used when the data format of the fourth data is: When the data format is known by the subscribing device, the fourth simplified package is published to the subscribing device.
  • the transceiver unit is specifically configured to publish the first data of the third service to the subscribing device through unicast when there is one subscribing device; Or the transceiver unit is specifically configured to publish the first data of the third service to multiple subscriber devices through multicast when there are multiple subscriber devices.
  • the information used to indicate the data type of the first data of the third service includes a string, an integer or a floating point; the information used to indicate the fourth The data type information of business data includes string, integer or floating point.
  • the data meaning information of the first data of the third service includes any of the following: humidity, temperature, speed or methane concentration, etc.; or the data meaning information of the fourth service
  • the data meaning information of the data includes any of the following: humidity, temperature, speed, or methane concentration, etc.
  • the transceiver unit is also used to send a fourth subscription message to the publishing end device, and the fourth subscription message is used to subscribe to the fourth service; the transceiver unit, It is also used to receive the data of the fourth service from the publishing end device.
  • the time of receiving the data of the fourth service is different from the second publishing reference time by M fourth publishing cycles.
  • the fourth publishing cycle is the fourth publishing period.
  • the release cycle of four services, M is an integer greater than or equal to 0.
  • the transceiver unit is specifically configured to receive the data from the publishing end device in the second data format when the data format of the third service is a data format unknown to the device. Publish a third full packet released at the reference time, the third full packet including the first data of the third service and information indicating the data format of the first data of the third service, the third full packet indicating the third data of the third service.
  • the data format information of a data includes information indicating the Information on the data type of the first data of the third service and information indicating the data meaning of the first data of the third service; or the transceiver unit is specifically used when the data format of the third service data is:
  • a third simplified packet issued by the issuing device at the second issuing reference time is received, where the third simplified packet includes the first data of the third service.
  • the transceiver unit is specifically configured to receive the third data from the publishing end device when the data format of the fourth service data is a data format unknown to the device.
  • the fourth full packet includes data of the fourth service and information indicating the data format of the data of the fourth service.
  • the information indicating the data format of the data of the fourth service includes information for Information indicating the data type of the data of the fourth service and information indicating the meaning of the data of the fourth service; or the transceiver unit, specifically used when the data format of the data of the fourth service is unknown to the device
  • receive the fourth simplified packet from the publishing end device the fourth simplified packet includes the data of the fourth service; or the transceiver unit is specifically used when the data format of the fourth service is:
  • the fourth simplified packet from the publishing end device is received.
  • the transceiver unit is specifically configured to receive the first data of the third service published by the publishing end device through unicast when the device is one; or The transceiver unit is specifically configured to receive the first data of the third service published by the publishing end device through multicast when there are multiple devices.
  • the transceiver unit is specifically configured to, when the device is one, receive the data of the fourth service published by the publishing end device through unicast; or the transceiver unit The unit is specifically configured to receive the data of the fourth service published by the publishing end device through multicast when there are multiple devices.
  • the information used to indicate the data type of the first data of the third service includes a string, an integer or a floating point; the information used to indicate the fourth The data type information of business data includes string, integer or floating point.
  • the information used to indicate the data meaning of the data of the third service includes any of the following: humidity, temperature, speed or methane concentration, etc.; or the user
  • the information indicating the data meaning of the data of the fourth service includes any one of the following: humidity, temperature, speed or methane concentration, etc.
  • a ninth aspect provides a communication device, including: a processor coupled to a memory, the memory is used to store a computer program, and the processor is used to run the computer program, so that the communication device performs the above-mentioned first aspect and any of the above.
  • a method in a possible implementation manner, or causing execution of the method in the above-mentioned second aspect and any possible implementation manner thereof, or causing execution of a method in the above-mentioned third aspect and any possible implementation manner thereof , or, the method in the fourth aspect and any possible implementation manner thereof is executed.
  • a computer-readable storage medium includes a computer program or instructions.
  • the computer program or instructions When the computer program or instructions are run on a computer, it makes it possible as in the first aspect and any of the instructions thereof.
  • the method in the implementation is executed, or the method in the second aspect and any possible implementation thereof is executed, or the method in the third aspect and any possible implementation thereof is caused to be executed. Execute, or cause the method in the fourth aspect and any possible implementation thereof to be executed.
  • a computer program product includes a computer program or instructions.
  • the method is executed, or, the method in the second aspect and any possible implementation thereof is executed, or, the method in the third aspect and any possible implementation thereof is executed, or, The method in the fourth aspect and any possible implementation manner thereof is caused to be executed.
  • a twelfth aspect provides a computer program that, when run on a computer, causes the method in the first aspect and any of its possible implementations to be executed, or causes the method in the second aspect and any of its possible implementations to be executed.
  • the method in one possible implementation is executed, or the method in the third aspect and any possible implementation thereof is executed, or, the method in the fourth aspect and any possible implementation thereof is executed, or, the method in the fourth aspect and any possible implementation thereof is executed. method is executed.
  • Figure 1 is a schematic diagram of a publishing and subscribing system provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of a publish and subscribe scenario provided by an embodiment of this application.
  • Figure 3 is a schematic flow chart of a data transmission method provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of full packet field information provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of a full package provided by an embodiment of the present application.
  • Figure 6 is a schematic flow chart of another method of transmitting data provided by an embodiment of the present application.
  • Figure 7 is a schematic diagram of a simplified package provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of a data transmission method in the publish-subscribe mode provided by the embodiment of the present application.
  • Figure 9 is a schematic diagram of data release time alignment provided by an embodiment of the present application.
  • Figure 11 is an exemplary structural diagram of a communication device according to an embodiment of the present application.
  • Figure 12 is an exemplary structural diagram of a communication device according to another embodiment of the present application.
  • Figure 13 is a schematic structural diagram of a device provided by an embodiment of the present application.
  • LTE long term evolution
  • FDD frequency division duplex
  • TDD time division duplex
  • 5G fifth generation
  • NR new radio
  • the terminal device in the embodiment of the present application may be a device used to implement wireless communication functions, such as a terminal or a chip that can be used in the terminal.
  • terminal equipment can refer to user equipment (User equipment, UE), access terminal, user unit, user station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication equipment, user Agent or user device.
  • Terminal equipment can also be wireless terminals in industrial control, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc.
  • the terminal may be a terminal in vehicle-to-everything (V2X) (such as a vehicle-to-everything device), a terminal in device-to-device communication, or machine-to-machine (M2M) Terminals in communication, terminal equipment in 5G networks, terminal equipment in communication systems evolved after 5G, or terminal equipment in public land mobile communication networks (public land mobile network, PLMN) evolved in the future, etc., the embodiments of this application are suitable for This is not limiting.
  • V2X vehicle-to-everything
  • M2M machine-to-machine
  • the publishing device may be a publisher, and the subscribing device may be a subscriber.
  • the publishing device and the subscribing device can be used in the publishing and subscribing system as shown in Figure 1 to implement message interaction.
  • publishsubscribe The system is a middleware system in which each participant (participating device) in a distributed system interacts in a publish-subscribe manner.
  • events the information exchanged between information producers and consumers is called events.
  • the producer of information is called the publisher
  • the consumer of the information is called the subscriber.
  • Both publishing and subscribing devices can be called clients.
  • Figure 2 shows a schematic diagram of a publish and subscribe scenario.
  • the subscriber device When a publisher device and a subscriber device exchange data, the subscriber device usually knows the data format of the data published by the publisher. When a subscriber device receives published data, the subscriber device can correctly parse the data and determine the correct meaning of the data.
  • the data format of the data can be preset in the standard, such as data set 1 and data set 2 in Figure 2.
  • the subscribing device does not know the data format of such data. Therefore, after receiving such data published by the publishing device, the subscribing device cannot correctly Parse and understand the meaning of such data, such as extended data set 3 in Figure 2.
  • Data in a data format unknown to the subscribing device in advance can be data extended by the manufacturer, which is not recorded in the standard.
  • the publishing device can divide the data into data sets, and the data sets can be divided according to the data type or data meaning. The specific method of combining the divided data is not limited.
  • the subscribing device subscribes to data in an unknown data format
  • This method requires synchronous modification of the subscribing device, but the subscribing device and the publishing device may not be implemented by the same manufacturer, which makes the above synchronous expansion more difficult.
  • a data format query process between the subscribing device and the publishing device is added to the standard. When the subscribing device subscribes to the extended data, it needs to first query the data format of the extended data. This method increases the number of interactions.
  • an interaction is added to the standard.
  • the publishing device When publishing extended data, the publishing device first transmits the data format and then the data. This method increases the number of interactions.
  • the existing methods cannot solve the problem of the subscriber device correctly parsing data in unknown data formats with the original number of interactions or with relatively simple implementation. Therefore, in order to enable the extended data to be correctly parsed by the subscribing device, this application provides a method of transmitting data. In the publish and subscribe scenario, by improving the data transmission process, the subscribing device can correctly and conveniently Parse extended data.
  • FIG. 3 shows a schematic flow chart of a data transmission method 300 provided by an embodiment of the present application. This method can be applied to the scenario shown in Figure 1. The specific steps are as follows:
  • the publishing device receives the first subscription message, and accordingly, the subscribing device sends the first subscription message.
  • the first subscription message is used to subscribe to the first service
  • the data format of the first service is a data format unknown to the subscribing device.
  • the data of the first service may also be a data set. It can also be understood that the data of the first business is not predefined in the standard and is data extended by the manufacturer.
  • the publishing end device publishes the first full package, and accordingly, the subscribing end device receives the first full package.
  • the publisher device publishes the first full package to the subscriber device at the first publishing moment of the first data of the first service.
  • the first full packet includes the first data of the first service and information indicating the data format of the first data of the first service.
  • the information indicating the data format of the first data of the first service includes information indicating the first data format of the first service.
  • Full packet is a method of data transmission.
  • Figure 4 shows a schematic diagram of field information in a full packet.
  • the full package field information includes field types, field values, and field meanings.
  • Figure 5 shows a schematic diagram of the full package.
  • a data collection can be a field list, which is composed of multiple fields.
  • the field type and Field meaning is auxiliary information, used to help parse the field and obtain the meaning corresponding to the field value.
  • the field value is the first data of the first service
  • the field type is the information indicating the data type of the first data of the first service
  • the field meaning is the data used to indicate the first data of the first service. meaning information.
  • the field type can indicate the type corresponding to the field value, such as string, integer or floating point, etc., which can be used to correctly parse the field value;
  • the field meaning can indicate the attributes of the communication device corresponding to the field value, such as the The field value represents humidity, temperature, speed or methane concentration, etc., which can be used to obtain the meaning of the field value. It can be understood that the above two types of information are used to represent the data format. Through the above two field information, the data can be correctly parsed and the meaning of the data can be obtained.
  • the first subscription message includes an identifier of the first service
  • the publishing device determines the first full package based on the identifier of the first service in the first subscription message.
  • the subscribing device does not know the data format of the data of the first service in advance. Therefore, when the publishing device publishes the data of the first service (the first data of the first service) for the first time, Released as the first full package. Because the first full packet contains information indicating the format of the data, the subscribing device can correctly parse the data and obtain its meaning. This method simultaneously transmits data and the corresponding data format, which can save the number of interactions between the subscribing device and the publishing device. By pre-specifying the above types of full packages in the standard, the subscriber device can correctly parse the data and obtain its meaning when receiving the data extended by the manufacturer.
  • FIG. 6 shows a schematic flow chart of another data transmission method 600 provided by the embodiment of the present application. This method can be applied to the scenario shown in Figure 1. The specific steps are as follows:
  • the publishing device receives the first subscription message, and accordingly, the subscribing device sends the first subscription message.
  • the first subscription message is used to subscribe to the first service, and the data format of the first service is a data format unknown to the subscribing device.
  • S602 The publishing device receives the second subscription message, and accordingly, the subscribing device sends the second subscription message.
  • the second subscription message is used to subscribe to the second service
  • the data format of the second service is a data format known to the subscribing end device. It can also be understood that the data of the second service is predefined in the standard.
  • the publishing end determines the first full package.
  • the first subscription message includes an identifier of the first service
  • the publishing device can determine the first full package according to the identifier of the first service in the first subscription message.
  • the publishing device determines the first simplified package.
  • the first simplified package includes second data of the first service. If the subscribing device does not know the data format of the data, the publishing device can publish it in the form of a full package when it publishes the data for the first time.
  • the full package contains field values, field types, and field meanings. The above three types of information can be transmitted to the subscribing device at the same time through the full package without generating multiple additional interactions.
  • the data of the service subscribed by the subscribing device is usually continuously published, and the publishing time interval is the publishing cycle of the corresponding service.
  • the publishing device can use the simplified packet transmission method at any publishing moment after publishing the service in the form of a full package for the first time to reduce the amount of data transmission. In other words, full packages and simplified packages can be transmitted alternately. When the data format changes or there are new subscriptions, full packages need to be transmitted.
  • first data in the embodiment of this application refers to the data released for the first time by a certain service
  • second data refers to the data released at any release moment after the first release of a certain service
  • Figure 7 shows a schematic diagram of a simplified package.
  • the simplified package only carries field values.
  • the publishing device can publish a simplified package that only carries field values. The subscribing device You can correctly parse the data and learn the meaning of the data.
  • the publishing device determines the second simplified package according to the identification of the data of the second service in the second subscription message.
  • the second simplified package is similar to the first simplified package.
  • the data format of the data of the second service is a data format known to the subscriber device, there is no need to determine a full packet containing information indicating the data format of the data of the second service.
  • the second simplified packet only includes the data of the second service and does not include information indicating the data format of the data of the second service. .
  • the publishing side device can perform the following steps to determine the publishing base moment.
  • the publishing end device determines the first publishing reference time.
  • the publishing end device determines the first publishing reference time according to the receiving time of the first subscription message. After receiving the first subscription message (first subscription message), the publishing device can determine the first publishing reference time based on the reception time of the subscription message.
  • Publishing base time subscription time + random value
  • the publishing end device determines the first publishing reference moment.
  • the random value can be a random number within 0-10s.
  • the subscription time of the first business data is 12:36:41. If 4 seconds are added to the subscription time, the first publishing base time is 12:36:45.
  • the publishing end device publishes the first full package, and accordingly, the subscribing end device receives the first full package.
  • the publishing end device publishes the first simplified package, and accordingly, the subscribing end device receives the first simplified package.
  • the publishing device publishes the first simplified package to the subscribing device.
  • the time when the publishing end releases the first simplified package is different from the time when the first full package is released by N first release cycles.
  • the first release cycle is the release cycle of the first service, where N is an integer greater than or equal to 1. That is to say, at any publishing time after the first publishing time of the first service data (first data of the first service), the publishing device can publish the first simplified package to the subscribing device. Wherein, any release time of the data of the first service differs by N release periods of the first service.
  • S609 The publishing device publishes the second simplified package, and accordingly, the subscribing device receives the second simplified package.
  • the publishing end device publishes the second simplified package to the subscribing end device at the first publishing moment of the data of the second service.
  • the second simplified packet only includes the data of the second service and does not include information indicating the data format of the data of the second service.
  • the publishing device publishes the second simplified package to the subscribing device.
  • any release time of the data of the second service differs by N second release cycles, and the second release cycle is the release cycle of the second service. That is to say, when the data subscribed by the subscribing device is in a known data format, in order to reduce the amount of transmission each time, the data can be published in a simplified package at any time when the data is published.
  • the above release cycle of the first service and the release cycle of the second service may be the same or different, and are not limited in this embodiment of the present application.
  • FIG. 8 shows a schematic diagram of a data transmission method in the publish-subscribe mode provided by the embodiment of the present application.
  • Figure 8 shows a publishing device and a subscribing device.
  • the publishing device includes data set 1, data set 2, extended data set 3 and extended data set 4.
  • data set 1 and data set 2 are data in a data format known in advance by the subscriber device (such as the data of the second service above); extended data set 3 and
  • the extended data set 4 is data in a data format that is unknown to the subscriber device in advance (for example, the data of the first service above).
  • the publishing device When the subscribing device subscribes to data set 1 or data set 2, the publishing device publishes data set 1 or data set 2 to the subscribing device in the corresponding data set publishing cycle through simplified packages.
  • the publishing device publishes the corresponding data set through a full package at the first publishing time of the corresponding extended data, and the publishing device publishes the corresponding extended data at the subsequent publishing time. , publishing the corresponding data collection through simplified packages.
  • the publishing end device publishes the second simplified package to the subscribing end device.
  • the time when the publishing end device publishes the second simplified package differs from the first publishing reference time by M second publishing cycles, and the second publishing cycle is The release cycle of the second service, M is an integer greater than or equal to 0.
  • the publishing end device determines the first publishing reference time
  • the publishing end device will publish the first data of the first service for the first time at the first publishing reference time, that is, publish the first full package at the first publishing reference time.
  • the time when the data is released can be determined. It can be seen that the time when the data is released each time has nothing to do with the subscription time.
  • the release end device releases the first full package and the second release reference time at the first release reference time. Simplified package.
  • the release end device releases the first simplified package and the second simplified package at the release time.
  • the publishing end device simultaneously releases the first simplified package and the second simplified package at the release time.
  • the publishing end device publishes data after determining the first publishing reference moment.
  • the publishing device receives the first subscription message at 12:09:55 and determines that the first publishing reference time is 12:10:00, then the publishing device publishes the first subscription message at 12:10:00.
  • the data of a service (the first data of the first service), since the cycle of the first service is 10s, the next release time of the data of the first service (the second data of the first service) is 12:10:10.
  • the publishing device receives the second subscription message at 12:09:57. Since the determined first publishing reference time is 12:10:00, the publishing device publishes the second service data for the first time at 12:10:00. Since The cycle of the second service is 5 seconds, and the next time the data of the second service is released is 12:10:05.
  • the publishing end device publishes the data of the first service and the data of the second service for the first time at the first publishing reference time of 12:10:00.
  • the publishing device receives the second subscription message at 12:10:03. Since the determined first publishing reference time is 12:10:00, the publishing device publishes the second service data for the first time at 12:10:05. Since The cycle of the second service is 5 seconds, and the next time the data of the second service is released is 12:10:10. In this case, the publishing end device only publishes the data of the first service at the first publishing reference time, and may publish the data of the first service and the data of the second service simultaneously at the subsequent publishing time of 12:10:10.
  • Figure 9 shows a schematic diagram of data release time alignment in the first case above.
  • Publisher device The data that needs to be released includes data 1, data 2 and data 3.
  • the release cycle of data 1 is 1s
  • the release cycle of data 2 is 2s
  • the release cycle of data 3 is 3s.
  • the least common multiple of the data 1 release cycle, data 2 release cycle and data 3 release cycle is 3.
  • the first subscription time of data 1, data 2 and data 3 is any time before the publishing base time.
  • the publishing device determines that the publishing base time is 0s based on the subscription time of the first data received.
  • the publishing device calculates the subsequent 8 publishing times of data 1, data 2 and data 3. Since different data have different release cycles, the release times of data 1 determined by the release end device are 0s, 1s, 2s, 3s, 4s, 5s, 6s and 7s respectively; the release times of data 2 determined by the release end device are 0s respectively. , 2s, 4s and 6s; the publishing time of data 3 determined by the publishing device is 0s, 3s and 6s respectively. It can be seen that at some publishing moments, the publishing device can package multiple data and publish them together to the subscribing device.
  • the publishing device can publish data 1, data 2 and data 3 at the same time; at the publishing time of 2s or 4s, the publishing device can publish data 1 and data 2 at the same time; at the publishing time of 3s, the publishing device The device can publish data 1 and data 3 at the same time.
  • the publisher device when there is one subscriber device, publishes the first full packet or the second simplified packet to the subscriber device through unicast; or when there is one subscriber device, The publishing device publishes the first simplified package or the second simplified package to the subscribing device through unicast; or when there are multiple subscribing devices, the publishing device publishes the first simplified package or the second simplified package to multiple subscribing devices through multicast.
  • the device publishes the first full package or the second simplified package; or when there are multiple subscribing devices, the publishing device publishes the first simplified package or the second simplified package to multiple subscribing devices through multicast. Bag.
  • the data type of the first data includes string, integer or floating point.
  • the data meaning of the first data includes any one of the following: temperature, humidity, speed or methane concentration, etc.
  • Step S607 may be executed first, and then step S609 may be executed; steps S607 and S609 may also be executed at the same time.
  • the execution order of the above steps S608 and S609 is not limited. Step S608 may be executed first, and then step S609; step S609 may be executed first, and then step S608; or steps S608 and S609 may be executed simultaneously.
  • the execution order of the above steps S603, S604, S605 and S606 is not limited.
  • the execution sequence of the above step S606 can be performed at any time after step S601.
  • the execution order of step S602 can be after step S601 and at any time before step S605.
  • the specific execution order of step S602 is not limited.
  • data of the first service whose data format is not known in advance by the subscribing device is released in the form of a first full package when the publishing device releases the data of the first service for the first time. Because the first full packet contains the data of the first service and information indicating the data format of the data of the first service, the subscribing device can correctly parse the data of the first service and obtain its meaning. The next time the publishing device publishes the data of the first service, it publishes it in the form of the first simplified package. The subscribing device can correctly parse the data of the first service and obtain its meaning based on the field values in the first simplified package.
  • the data of the second service whose data format is known in advance by the subscribing device is released in the form of a second simplified package when the publishing device releases the data of the second service for the first time and the next time the publishing device releases the data of the second service.
  • the subscribing device can correctly parse the data of the second service and obtain its meaning based on the field values in the second simplified package.
  • This method can not only support the subscriber device to correctly parse data in a previously unknown data format, but also simplify the interaction process between the publisher device and the subscriber device, thereby saving the overhead of interactive signaling.
  • the publishing device can also determine the sending time based on the reception time of the first subscription message (first subscription message). Release reference time (first release reference time). Therefore, for the data of a single business, a fixed release time can be determined no matter when the subscribing device subscribes; for the data of multiple businesses, the release time of the data can also be unified, and the release time of multiple data can be aligned as much as possible. . This method can also achieve simultaneous transmission of as much data as possible and improve transmission efficiency.
  • the time when the publishing device first publishes the data of the first service and the data of the second service to the subscribing device is uncertain.
  • the data publishing time of the existing service is the same as the time when the service is first subscribed. time related.
  • a publisher device needs to publish multiple data or multiple data sets to a subscriber device the multiple data or multiple data sets cannot be packaged and sent because each data or data set is released at a different time.
  • the release cycle of data 1 is 10s, the subscription time is 12:36:41, and the next release time of data 1 is 12:36:51; the release cycle of data 2 is 20s, and the subscription time is 12:46: 45, the next release time of data 2 is 12:37:05.
  • the publishing time of data 1 and data 2 is different, so the two data cannot be packaged and sent together. If a subscribing device subscribes to these two data one after another, the publishing device needs to send the two data separately. Therefore, the existing technology mainly focuses on the alignment of a single data release time. For a single data, the release cycle is fixed, and different subscribing devices have different subscription times, resulting in different data release times.
  • a data transmission method 1000 as shown in Figure 10 is proposed. Determine the publishing benchmark time that is not affected by the time when the subscribing device receives the subscription message, so as to package and publish multiple data or multiple data sets as much as possible to improve publishing efficiency.
  • the following uses multiple data as an example to introduce the method 1000 in detail.
  • FIG 10 shows a schematic flow chart of another data transmission method 1000 proposed by the embodiment of the present application. This method can be applied to the scenario shown in Figure 1. The specific steps are as follows:
  • the publishing device receives the third subscription message, and accordingly, the subscribing device sends the third subscription message.
  • the publishing device receives a third subscription message from the subscribing device, and the third subscription message is used to subscribe to the third service.
  • the publishing end device determines the second publishing reference time.
  • the publishing device publishes the first data of the third service, and accordingly, the subscribing device receives the first data of the third service.
  • the publishing device publishes a third full package to the subscribing device, and the third full package includes the data of the third service and Information used to indicate the data format of the data of the third service.
  • the information used to indicate the data format of the data of the third service includes information used to indicate the data type of the data of the third service and information used to indicate the data of the third service.
  • the publishing end device sets the Prepare to publish the third simplified package, and the third simplified package includes the data of the third service; or when the data format of the third service data is a data format known by the subscribing terminal device, the publishing terminal device publishes the third simplified package to the subscribing terminal device. Bag.
  • the publishing device publishes a fourth full package to the subscribing device, and the fourth full package includes the fourth service.
  • Data and information used to indicate the data format of the data of the fourth service includes information used to indicate the data type of the data of the fourth service and information used to indicate the data format of the fourth service.
  • the publisher device publishes a fourth simplified package to the subscriber device, and the fourth simplified package includes the fourth service data; or when the data format of the fourth service data is a data format known to the subscriber device, the publisher device publishes the fourth simplified package to the subscriber device.
  • the publisher device when there is one subscriber device, publishes data of the third service or data of the fourth service to the subscriber device through unicast; or when there are multiple subscriber devices, the publisher The device publishes data of the third service or data of the fourth service to multiple subscriber devices through multicast.
  • the publishing device can package the multiple data into one message through unicast. published to the subscriber device.
  • the publishing device can package the multiple data in one message and publish it to the publishing device through multicast. Multiple subscriber devices.
  • the information used to indicate the data type of the third service data includes a string, an integer, or a floating point;
  • the data type of the fourth data includes a string, an integer, or a floating point, and is used to indicate the fourth Information on the data type of the service data is used to decode the fourth data.
  • the information used to indicate the data meaning of the data of the third service includes any of the following: temperature, humidity, speed or methane concentration, etc.
  • the information used to indicate the data meaning of the data of the fourth service includes the following. Any one: temperature, humidity, speed, or methane concentration, etc.
  • the first service, the second service, the third service and the fourth service may be different services.
  • the publishing end device can determine the publishing reference time based on the reception time of the subscription message. Therefore, for a single piece of data, no matter what time the subscribing device subscribes, a fixed publishing time can be determined; for multiple data, the publishing time of the data can also be unified, and the publishing time of multiple data can be aligned as much as possible. This method can also achieve simultaneous transmission of as much data as possible and improve transmission efficiency.
  • FIG. 11 shows a schematic structural diagram of a communication device 1100 according to an embodiment of the present application.
  • the communication device 1100 may be a publishing device, a device in the publishing device, or a device that can be used in conjunction with the publishing device.
  • the communication device 1100 may include a module or unit that performs one-to-one correspondence with the methods/operations/steps/actions performed by the issuing device in the above method embodiment.
  • the unit may be a hardware circuit or software. , or it can be implemented by hardware circuit combined with software.
  • the communication device 1100 includes: a processing unit 1110 and a transceiver unit 1120. It should be understood that the communication device shown in FIG. 11 is only an example, and may also include other units, or units with similar functions to each unit in FIG. 11 , or does not need to include all units in FIG. 11 .
  • processing unit in the embodiment of the present application may also be called a processing module
  • transceiver unit may also be called a transceiver module
  • FIG. 12 shows a communication device 1200 provided by an embodiment of the present application.
  • the communication device 1200 can be a publishing terminal device.
  • the device may include a processor 1210 and a transceiver 1230.
  • the transceiver may include a transmitter and/or a receiver.
  • the device may further include a memory 1220, and the processor 1210, the transceiver 1230 and the memory 1220 communicate with each other through internal connection paths.
  • the related functions implemented by the processing unit 1110 in Figure 11 can be implemented by the processor 1210, and the related functions implemented by the transceiver unit 1120 can be implemented by the processor 1210 controlling the transceiver 1230.
  • the processor 1210 may be a CPU, a microprocessor, an ASIC, a special-purpose processor, or one or more integrated circuits for executing the technical solutions of the embodiments of the present application.
  • a processor may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
  • it can be a baseband processor or a central processing unit.
  • the baseband processor can be used to process communication protocols and communication data
  • the central processor can be used to control communication devices (such as network equipment, terminals, or chips, etc.), execute software programs, and process data of software programs.
  • the processor 1210 may include one or more processors, such as one or more CPUs.
  • the processor is a CPU
  • the CPU may be a single-core CPU or a multi-core CPU. .
  • the transceiver 1230 is used to transmit and receive data and/or signals, and to receive data and/or signals.
  • the transceiver may include a transmitter for transmitting data and/or signals and a receiver for receiving data and/or signals.
  • the memory 1220 includes, but is not limited to, random access memory (random access memory, RAM), read-only memory (read-only memory, ROM), erasable programmable memory (erasable programmable read only memory, EPROM), read-only memory Compact disc (compact disc read-only memory, CD-ROM), the memory 1520 is used to store related instructions and data.
  • Memory 1220 may be a separate device or integrated into processor 1210.
  • the communication device 1200 may also include an output device and an input device.
  • Output devices communicate with processor 1210 and can display information in a variety of ways.
  • the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc.
  • Input devices communicate with processor 1210 and can receive user input in a variety of ways.
  • the input device may be a mouse, a keyboard, a touch screen device, or a sensing device.
  • Figure 12 only shows a simplified design of the communication device.
  • the device can also include other necessary components, including but not limited to any number of transceivers, processors, controllers, memories, etc., and all terminal equipment that can implement this application are protected by this application. within the range.
  • the device 1200 may be a chip, for example, it may be a communication chip that can be used in a publishing device to implement related functions of the processor 1210 in the publishing device.
  • the chip can be a thread programmable gate array, a dedicated integrated chip, a system chip, a central processing unit, a network processor, a digital signal processing circuit, a microcontroller, or a programmable controller or other integrated chip that implements related functions.
  • the chip may optionally include one or more memories for storing computer programs or instructions, which when executed, enable the processor to implement corresponding functions.
  • this embodiment of the present application also provides a device 1300, which can be used to implement the function of the publishing end device in the above method.
  • the device 1300 can be a communication device or a chip in the communication device.
  • the communication device includes:
  • the input/output interface 1310 may be an input/output circuit, an input interface, an output interface, etc.
  • the logic circuit 1320 may be a signal processor, a chip, or other integrated circuit that can implement the method of the present application.
  • At least one input and output interface 1310 is used for input or output of signals or data.
  • the logic circuit 1320 is used to execute some or all steps of any method provided by the embodiments of this application.
  • the embodiment of the present application also provides a device, which may be a publishing device or a logic circuit.
  • the device may be used to perform the actions performed by the publishing end device in the above method embodiment.
  • Embodiments of the present application also provide a computer-readable storage medium that stores one or more programs or instructions. When the program or instructions are run on a computer, the computer executes the method of the above-mentioned embodiments. .
  • An embodiment of the present application also proposes a computer program.
  • the computer program includes a program or an instruction.
  • the computer program or instruction is executed by a computer, the computer can execute the corresponding process of the method of the above embodiment.
  • At least one refers to one or more, and “plurality” refers to two or more.
  • “And/or” describes the association of associated objects, indicating that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B can be singular or plural.
  • the character “/” generally indicates that the related objects are in an “or” relationship.
  • “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items).
  • At least one of a, b, or c can mean: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple .
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated.
  • the components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple networks. on the unit. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method in various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

Abstract

本申请实施例提供了一种传输数据的方法和装置,该方法包括:发布端设备接收来自至少一个订阅端设备的第一订阅消息,第一订阅消息用于订阅第一业务,第一业务的数据的数据格式为订阅端设备未知的;发布端设备向订阅端设备发布第一全量包,第一全量包包括第一业务的数据和用于指示第一业务的数据的数据格式的信息。本申请提供的传输数据的方法和装置,发布端设备可以在传输数据的同时,也传输数据类型和数据含义,在节约了交互次数的同时,订阅端设备也能够正确解析该数据,能够有效提升传输效率。

Description

传输数据的方法和装置
本申请要求于2022年05月30提交中国专利局、申请号为202210601368.8、申请名称为“传输数据的方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及通信技术领域,尤其涉及一种传输数据的方法和装置。
背景技术
发布订阅是目前应用较为广泛的一种数据传输模式。在发布订阅的场景下,订阅端设备和发布端设备在数据交互时,需要订阅端设备已知发布端设备所发布数据的数据格式,这样,订阅端设备才可以正确解析相应数据,而数据格式一般是预先已经约定好的。对于订阅端设备未知数据格式的数据,订阅端设备无法正确解析。同时,由于不同数据的订阅时刻和发布周期不同,多个数据难以通过一个消息发布至订阅端设备。
因此,订阅端设备如何正确解析未知数据格式的数据,以及如何尽可能在一个消息中承载多个数据,进而能够进一步地节约信令开销是目前亟待解决的问题。
发明内容
本申请实施例提供一种传输数据的方法,该方法可以提升数据传输的效率。
第一方面,提供了一种传输数据的方法,包括:发布端设备接收来自订阅端设备的第一订阅消息,该第一订阅消息用于订阅第一业务,该第一业务的数据的数据格式为该订阅端设备未知的数据格式,该订阅端设备包括一个或多个设备;该发布端设备向该订阅端设备发布第一全量包,该第一全量包包括该第一业务的第一数据和用于指示该第一业务的第一数据的数据格式的信息,该用于指示该第一业务的第一数据的数据格式的信息包括用于指示该第一业务的第一数据的数据类型的信息和用于指示该第一业务的第一数据的数据含义的信息。
本申请实施例中,订阅端设备预先未知第一业务的数据的数据格式,因此,在发布端设备首次发布第一业务的数据时,以第一全量包的形式发布。因为第一全量包中包含有第一业务的数据和用于指示第一业务的数据的数据格式的信息,订阅端设备能够正确解析第一业务的数据并获取其含义。该方法同时传输数据以及对应的数据格式,能够节省订阅端设备和发布端设备的交互次数。可以通过预先在标准中规定上述类型的全量包,订阅端设备便可以在接收到厂商扩展的数据时,对该数据正确解析并获取其含义。
结合第一方面,在第一方面的某些实现方式中,该发布端设备根据该第一订阅消息确定第一简化包,该第一简化包包括该第一业务的第二数据;在该发布端设备向该订阅端设备发布该第一全量包之后,该发布端设备向该订阅端设备发布该第一简化包,该发布端设 备发布该第一简化包的时刻与该发布端设备发布该第一全量包的时刻相差N个第一发布周期,该第一发布周期为该第一业务的发布周期,N为大于或等于1的整数。
本申请实施例中,对于订阅端设备未知数据格式的数据,在发布端首次通过全量包形式发布该数据之后的任意发布时刻,可以采用简化包的传输方式,这能够减少数据的传输量。
结合第一方面,在第一方面的某些实现方式中,该第一订阅消息包括该第一业务的标识,该发布端设备根据该第一订阅消息中的该第一业务的标识确定该第一全量包。
本申请实施例中,订阅消息中携带有订阅端设备所要订阅的数据的标识,因此发布端设备可以根据该数据的标识确定订阅端设备所订阅的数据,以便于发布端设备根据订阅端消息进一步确定发布数据的方式。
结合第一方面,在第一方面的某些实现方式中,该发布端设备向该订阅端设备发布第一全量包,包括:该发布端设备根据该第一订阅消息的接收时刻确定第一发布基准时刻;该发布端设备在该第一发布基准时刻发布该第一全量包。
应理解,发布端设备可以根据第一个订阅消息(例如第一订阅消息)的接收时刻确定第一发布基准时刻。第一发布基准时刻是第一业务的数据(第一业务的第一数据)首次发布的时刻。此后,第一业务的数据(第一业务的第二数据)的任一发布时刻都可以根据第一发布基准时刻和第一业务的发布周期确定。
结合第一方面,在第一方面的某些实现方式中,在该发布端设备接收来自订阅端设备的第一订阅消息之后,该方法还包括:该发布端设备接收来自该订阅端设备的第二订阅消息,该第二订阅消息用于订阅第二业务,该第二业务的数据的数据格式为对该订阅端设备已知的数据格式的数据;该发布端设备根据该第二订阅消息确定第二简化包,该第二简化包包括第二业务的数据;该发布端设备向该订阅端设备发布该第二简化包,该发布端设备发布该第二简化包的时刻与该第一发布基准时刻相差M个第二发布周期,该第二发布周期为该第二业务的发布周期,M为大于或等于0的整数。
应理解,发布端设备接收第二订阅消息的时刻可以是接收第一订阅消息之后的任一时刻。当发布端设备发布第一全量包之后,发布端设备才接收到第二订阅消息,则发布端设备可以根据第一发布基准时刻和第二业务的发布周期确定第二业务的发布时刻(包括第二业务的数据的首次发布时刻),这种情况下,第二业务的数据的首次发布时刻与第一业务的数据的首次发布时刻(第一发布基准时刻)不同,也就是M大于0的情况。当发布端设备发布第一全量包之前,发布端设备已经接收到了第二订阅消息,则发布端设备可以根据第一发布基准时刻和第二业务的发布周期确定第二业务的数据的发布时刻(包括第二业务的数据的首次发布时刻),这种情况下,第二业务的数据的首次发布时刻与第一业务的数据的首次发布时刻(第一发布基准时刻)可以相同,也就是M等于0的情况。也可以理解为,第一业务的数据和第二业务的数据不一定会在第一发布基准时刻同时发布。
本申请实施例中,发布端设备确定第一发布基准时刻。当发布端设备在接收第一订阅消息之后的任意时刻,接收其他数据的订阅消息(例如第二订阅消息)时,能够进一步根据第一发布基准时刻与其他数据的发布周期确定发布时刻。也就是说,可以将其他数据的首次发布时刻与第一业务的数据的任一发布时刻(包括第一发布基准时刻)对齐,由于每个业务的数据的发布周期可能不同,进而能够尽可能将多个数据的后续发布时刻对齐。该 方法能够实现多个数据打包发送,从而提高发布数据的效率。
结合第一方面,在第一方面的某些实现方式中,该发布端设备向该订阅端设备发布第一全量包,包括:当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第一全量包;或者当该订阅端设备为多个时,该发布端设备通过组播向多个该订阅端设备发布该第一全量包。
结合第一方面,在第一方面的某些实现方式中,该发布端设备向该订阅端设备发布该第一简化包,包括:当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第一简化包;或者当该订阅端设备为多个时,该发布端设备通过组播向该订阅端设备发布该第一简化包。
结合第一方面,在第一方面的某些实现方式中,该发布端设备向该订阅端设备发布该第二简化包,包括:当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第二简化包;或者当该订阅端设备为多个时,该发布端设备通过组播向该订阅端设备发布该第二简化包。
本申请实施例中,发布端设备可以根据不同数量的订阅端设备,采用单播或者组播的方式发送订阅端设备所订阅的数据,能够进一步提升传输效率。
结合第一方面,在第一方面的某些实现方式中,该用于指示该第一业务的第一数据的数据类型的信息包括字符串、整型或浮点。
结合第一方面,在第一方面的某些实现方式中,该用于指示该第一业务的第一数据的数据含义的信息包括以下任意一项:湿度、温度、甲烷浓度或温度等。
第二方面,提供了一种传输数据的方法,包括:订阅端设备向发布端设备发送第一订阅消息,该第一订阅消息用于订阅第一业务,该第一业务的数据的数据格式为该订阅端设备未知的数据格式,该订阅端设备包括一个或多个设备;该订阅端设备接收来自该发布端设备的第一全量包,该第一全量包包括该第一业务的第一数据和用于指示该第一业务的第一数据的数据格式的信息,该用于指示该第一业务的第一数据的数据格式的信息包括用于指示该第一业务的第一数据的数据类型的信息和用于指示该第一业务的第一数据的数据含义的信息。
结合第二方面,第二方面的某些实现方式中,在该订阅端设备接收来自该发布端设备的第一全量包之后,该方法还包括:该订阅端设备接收来自该发布端设备的第一简化包,该第一简化包包括该第一业务的第二数据,该订阅端设备接收该第一简化包的时刻与该订阅端设备接收该第一全量包的时刻相差N个第一发布周期,该第一发布周期为该第一业务的发布周期,N为大于或等于1的整数。
结合第二方面,第二方面的某些实现方式中,该第一订阅消息包括该第一业务的标识。
结合第二方面,第二方面的某些实现方式中,该订阅端设备接收来自该发布端设备的第一全量包,包括:该订阅端设备接收该发布端设备在第一发布基准时刻发布的该第一全量包。
结合第二方面,第二方面的某些实现方式中,在该订阅端设备向发布端设备发送第一订阅消息之后,该方法还包括:该订阅端设备向该发布端设备发送第二订阅消息,该第二订阅消息用于订阅第二业务,该第二业务的数据的数据格式为该订阅端设备已知的数据格式;该订阅端设备接收来自该发布端设备的第二简化包,该第二简化包包括该第二业务的 数据,该订阅端设备接收该第二简化包的时刻与该第一发布基准时刻相差M个第二发布周期,该第二发布周期为该第二业务的发布周期,M为大于或等于0的整数。
结合第二方面,第二方面的某些实现方式中,该订阅端设备接收来自该发布端设备的第一全量包,包括:当该订阅端设备为一个时,该订阅端设备接收该发布端设备通过单播发布的该第一全量包;或者当该订阅端设备为多个时,该订阅端设备接收该发布端设备通过组播发布的该第一全量包。
结合第二方面,第二方面的某些实现方式中,该订阅端设备接收来自该发布端设备的第一简化包,包括:当该订阅端设备为一个时,该订阅端设备接收该发布端设备通过单播发布的该第一简化包;或者当该订阅端设备为多个时,该订阅端设备接收该发布端设备通过组播发布的该第一简化包。
结合第二方面,第二方面的某些实现方式中,该订阅端设备接收来自该发布端设备的第二简化包,包括:当该订阅端设备为一个时,该订阅端设备接收该发布端设备通过单播发布的该第二简化包;或者当该订阅端设备为多个时,该订阅端设备接收该发布端设备通过组播发布的该第二简化包。
结合第二方面,第二方面的某些实现方式中,该用于指示该第一业务的第一数据的数据类型的信息包括字符串、整型或浮点。
结合第二方面,在第二方面的某些实现方式中,该用于指示该第一业务的第一数据的数据含义的信息包括以下任意一项:湿度、温度、甲烷浓度或温度等。
第三方面,提供了一种传输数据的方法,包括:发布端设备接收来自订阅端设备的第三订阅消息,该第三订阅消息用于订阅第三业务,该订阅端设备包括一个或多个设备;该发布端设备根据该第三订阅消息的接收时刻确定第二发布基准时刻;该发布端设备在该第二发布基准时刻向该订阅端设备发布该第三业务的第一数据。
本申请实施例中,发布端设备可以根据接收到的第一个订阅消息(第三订阅消息)的时刻确定发布基准时刻(第二发布基准时刻),得到了数据发布的准确时刻。以便后续发布端设备需要发布多个数据时,能够基于发布基准时刻分别确定多个数据的发布时刻,尽量使得多个数据被打包发送,提升数据传输效率。
结合第三方面,在第三方面的某些实现方式中,在该发布端设备接收来自该订阅端设备的第三订阅消息之后,该方法还包括:该发布端设备接收来自该订阅端设备的第四订阅消息,该第四订阅消息用于订阅第四业务;该发布端设备向该订阅端设备发布该第四业务的数据,该发布端设备发布该第四业务的数据的时刻与该第二发布基准时刻相差M个第四发布周期,该第四发布周期为该第四业务的发布周期,M为大于或等于0的整数。
本申请实施例中,发布端设备可以根据订阅消息的接收时刻,确定发布基准时刻。从而对于单个数据,无论订阅端设备时什么时刻订阅的,能够确定出固定的发布时刻;对于多个数据,也能将数据的发布时间统一,尽量使得多个数据的发布时刻对齐。该方法在还能够尽可能实现多数据的同时传输,提升传输效率。
结合第三方面,在第三方面的某些实现方式中,该发布端设备在该第二发布基准时刻向该订阅端设备发布该第三业务的第一数据,包括:当该第三业务的数据的数据格式为该订阅端设备未知的数据格式时,该发布端设备在该第二发布基准时刻向该订阅端设备发布第三全量包,该第三全量包包括该第三业务的第一数据和用于指示第三业务的第一数据的 数据格式的信息,该用于指示第三业务的第一数据的数据格式的信息包括用于指示该第三业务的第一数据的数据类型的信息和用于指示该第三业务的第一数据的数据含义的信息;或者当该第三业务的数据的数据格式为该订阅端设备已知的数据格式时,该发布端设备在该第二发布基准时刻向该订阅端设备发布该第三简化包,该第三简化包包括该第三业务的第一数据。
结合第三方面,在第三方面的某些实现方式中,该发布端设备向该订阅端设备发布该第四业务的数据,包括:当该第四业务的数据的数据格式为该订阅端设备未知的数据格式时,该发布端设备向该订阅端设备发布第四全量包,该第四全量包包括该第四业务的数据和用于指示该第四业务的数据的数据格式的信息,该用于指示该第四业务的数据的数据格式的信息包括用于指示该第四业务的数据的数据类型的信息和用于指示该第四业务的书的数据含义的信息;或者当该第四业务的数据的数据格式为该订阅端设备未知的数据格式时,该发布端设备向该订阅端设备发布第四简化包,该第四简化包包括该第四业务的数据;或者当该第四业务的数据的数据格式为该订阅端设备已知的数据格式时,该发布端设备向该订阅端设备发布该第四简化包。
本申请实施例中,当发布端设备首次发布订阅端设备未知数据格式的数据时,需要以全量包的形式发布该数据,之后的任意发布时刻可以以简化包的形式发布该数据;当发布端设备发布订阅端设备已知数据格式的数据时,可以以简化包的形式发布该数据。这样能够保证订阅端设备正确解析数据的同时,还能够尽可能减少传输的数据量。
结合第三方面,在第三方面的某些实现方式中,该发布端设备在该第二发布基准时刻向该订阅端设备发布该第三业务的第一数据,包括:当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第三业务的第一数据;或者当该订阅端设备为多个时,该发布端设备通过组播向多个该订阅端设备发布该第三业务的第一数据。
结合第三方面,在第三方面的某些实现方式中,该发布端设备向该订阅端设备发布该第四业务的数据,包括:当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第四业务的数据;或者当该订阅端设备为多个时,该发布端设备通过组播向多个该订阅端设备发布该第四业务的数据。
本申请实施例中,发布端设备可以根据不同数量的订阅端设备,采用单播或者组播的方式发送订阅端设备所订阅的数据,能够进一步提升传输效率。
结合第三方面,在第三方面的某些实现方式中,该用于指示该第三业务的第一数据的数据类型的信息包括字符串、整型或浮点;该用于指示该第四业务的数据的数据类型的信息包括字符串、整型或浮点。
结合第三方面,在第三方面的某些实现方式中,该第三业务的第一数据的数据含义信息包括以下任意一项:湿度、温度、速度或甲烷浓度等;或者该第四业务的数据的数据含义信息包括以下任意一项:湿度、温度、速度或甲烷浓度等。
第四方面,提供了一种传输数据的方法,包括:订阅端设备向发布端设备发送第三订阅消息,该第三订阅消息用于订阅第三业务,该订阅端设备包括一个或多个设备;该订阅端设备接收该发布端设备在第二发布基准时刻发布的该第三业务的第一数据。
结合第四方面,在第四方面的某些实现方式中,在该订阅端设备向发布端设备发送第三订阅消息之后,该方法还包括:该订阅端设备向该发布端设备发送第四订阅消息,该第 四订阅消息用于订阅第四业务;该订阅端设备接收来自该发布端设备的该第四业务的数据,该订阅端设备接收该第四业务的数据的时刻与该第二发布基准时刻相差M个第四发布周期,该第四发布周期为该第四业务的发布周期,M为大于或等于0的整数。
结合第四方面,在第四方面的某些实现方式中,该订阅端设备接收该发布端设备在第二发布基准时刻发布的该第三业务的第一数据,包括:当该第三业务的数据的数据格式为该订阅端设备未知的数据格式时,该订阅端设备接收该发布端设备在第二发布基准时刻发布的第三全量包,该第三全量包包括该第三业务的第一数据和用于指示第三业务的第一数据的数据格式的信息,该用于指示第三业务的第一数据的数据格式的信息包括用于指示该第三业务的第一数据的数据类型的信息和用于指示该第三业务的第一数据的数据含义的信息;或者当该第三业务的数据的数据格式为该订阅端设备已知的数据格式时,该订阅端设备接收该发布端设备在第二发布基准时刻发布的第三简化包,该第三简化包包括该第三业务的第一数据。
结合第四方面,在第四方面的某些实现方式中,该订阅端设备接收来自该发布端设备的该第四业务的数据,包括:当该第四业务的数据的数据格式为该订阅端设备未知的数据格式时,该订阅端设备接收来自该发布端设备的第四全量包,该第四全量包包括该第四业务的数据和用于指示该第四业务的数据的数据格式的信息,该用于指示该第四业务的数据的数据格式的信息包括用于指示该第四业务的数据的数据类型的信息和用于指示该第四业务的数据含义的信息;或者当该第四业务的数据的数据格式为该订阅端设备未知的数据格式时,该订阅端设备接收来自该发布端设备的第四简化包,该第四简化包包括该第四业务的数据;或者当该第四业务的数据的数据格式为该订阅端设备已知的数据格式时,该订阅端设备接收来自该发布端设备的该第四简化包。
结合第四方面,在第四方面的某些实现方式中,该订阅端设备接收该发布端设备在第二发布基准时刻发布的该第三业务的第一数据,包括:当该订阅端设备为一个时,该订阅端设备接收该发布端设备通过单播发布的该第三业务的第一数据;或者当该订阅端设备为多个时,该订阅端设备接收该发布端设备通过组播发布的该第三业务的第一数据。
结合第四方面,在第四方面的某些实现方式中,该订阅端设备接收来自该发布端设备的该第四业务的数据,包括:当该订阅端设备为一个时,该订阅端设备接收该发布端设备通过单播发布的该第四业务的数据;或者当该订阅端设备为多个时,该订阅端设备接收该发布端设备通过组播发布的该第四业务的数据。
结合第四方面,在第四方面的某些实现方式中,该用于指示该第三业务的第一数据的数据类型的信息包括字符串、整型或浮点;该用于指示该第四业务的数据的数据类型的信息包括字符串、整型或浮点。
结合第四方面,在第四方面的某些实现方式中,该用于指示该第三业务的数据的数据含义的信息包括以下任意一项:湿度、温度、速度或甲烷浓度等;或者该用于指示该第四业务的数据的数据含义的信息包括以下任意一项:湿度、温度、速度或甲烷浓度等。
第五方面,提供了一种传输数据的装置,包括收发单元,用于接收来自订阅端设备的第一订阅消息,该第一订阅消息用于订阅第一业务,该第一业务的数据的数据格式为该订阅端设备未知的数据格式,该订阅端设备包括一个或多个设备;该收发单元,还用于向该订阅端设备发布第一全量包,该第一全量包包括该第一业务的第一数据和用于指示该第一 业务的第一数据的数据格式的信息,该用于指示该第一业务的第一数据的数据格式的信息包括用于指示该第一业务的第一数据的数据类型的信息和用于指示该第一业务的第一数据的数据含义的信息。
结合第五方面,在第五方面的某些实现方式中,该装置还包括处理单元,该方法还包括:该处理单元,用于根据该第一订阅消息确定第一简化包,该第一简化包包括该第一业务的第二数据;该收发单元,还用于在向该订阅端设备发布该第一全量包之后,该订阅端设备发布该第一简化包,该发布该第一简化包的时刻与该发布该第一全量包的时刻相差N个第一发布周期,该第一发布周期为该第一业务的发布周期,N为大于或等于1的整数。
结合第五方面,在第五方面的某些实现方式中,该第一订阅消息包括该第一业务的标识,该方法还包括:该处理单元,还用于根据该第一订阅消息中的该第一业务的标识确定该第一全量包。
结合第五方面,在第五方面的某些实现方式中,该处理单元,还用于设备根据该第一订阅消息的接收时刻确定第一发布基准时刻;该收发单元,具体用于在该第一发布基准时刻发布该第一全量包。
结合第五方面,在第五方面的某些实现方式中,该收发单元,还用于接收来自该订阅端设备的第二订阅消息,该第二订阅消息用于订阅第二业务,该第二业务的数据格式为该订阅端设备已知的数据格式;该处理单元,还用于根据该第二订阅消息确定第二简化包,该第二简化包包括该第二业务的数据;该收发单元,还用于向该订阅端设备发布该第二简化包,该发布该第二简化包的时刻与该第一发布基准时刻相差M个第二发布周期,该第二发布周期为该第二业务的发布周期,M为大于或等于0的整数。
结合第五方面,在第五方面的某些实现方式中,该收单元,具体用于当该订阅端设备为一个时,通过单播向该订阅端设备发布该第一全量包;或者该收单元,具体用于当该订阅端设备为多个时,通过组播向多个该订阅端设备发布该第一全量包。
结合第五方面,在第五方面的某些实现方式中,该收单元,具体用于当该订阅端设备为一个时,通过单播向该订阅端设备发布该第一简化包;或者该收单元,具体用于当该订阅端设备为多个时,通过组播向该订阅端设备发布该第一简化包。
结合第五方面,在第五方面的某些实现方式中,该收单元,具体用于当该订阅端设备为一个时,通过单播向该订阅端设备发布该第二简化包;或者该收单元,具体用于当该订阅端设备为多个时,通过组播向该订阅端设备发布该第二简化包。
结合第五方面,在第五方面的某些实现方式中,该用于指示该第一业务的第一数据的数据类型的信息包括字符串、整型或浮点。
结合第五方面,在第五方面的某些实现方式中,该用于指示该第一业务的第一数据的数据含义的信息包括以下任意一项:湿度、温度、甲烷浓度或温度等。
第六方面,提供了一种传输数据的装置,包括:收发单元,用于向发布端设备发送第一订阅消息,该第一订阅消息用于订阅第一业务,该第一业务的数据的数据格式为该装置未知的数据格式,该装置包括一个或多个;该收发单元,还用于接收来自该发布端设备的第一全量包,该第一全量包包括该第一业务的第一数据和用于指示该第一业务的第一数据的数据格式的信息,该用于指示该第一业务的第一数据的数据格式的信息包括用于指示该第一业务的第一数据的数据类型的信息和用于指示该第一业务的第一数据的数据含义的 信息。
结合第六方面,在第六方面的某些实现方式中,该收发单元,还用于接收来自该发布端设备的第一简化包,该第一简化包包括该第一业务的第二数据,该接收该第一简化包的时刻与该接收该第一全量包的时刻相差N个第一发布周期,该第一发布周期为该第一业务的发布周期,N为大于或等于1的整数。
结合第六方面,在第六方面的某些实现方式中,该第一订阅消息包括该第一业务的标识。
结合第六方面,在第六方面的某些实现方式中,该收发单元,具体用于接收该发布端设备在第一发布基准时刻发布的该第一全量包。
结合第六方面,在第六方面的某些实现方式中,该收发单元,还用于向该发布端设备发送第二订阅消息,该第二订阅消息用于订阅第二业务,该第二业务的数据的数据格式为该装置已知的数据格式;该收发单元,还用于接收来自该发布端设备的第二简化包,该第二简化包包括该第二业务的数据,该接收该第二简化包的时刻与该第一发布基准时刻相差M个第二发布周期,该第二发布周期为该第二业务的发布周期,M为大于或等于0的整数。
结合第六方面,在第六方面的某些实现方式中,该收发单元,具体用于当该装置为一个时,接收该发布端设备通过单播发布的该第一全量包;或者该收发单元,具体用于当该装置为多个时,接收该发布端设备通过组播发布的该第一全量包。
结合第六方面,在第六方面的某些实现方式中,该收发单元,具体用于当该装置为一个时,接收该发布端设备通过单播发布的该第一简化包;或者该收发单元,具体用于当该装置为多个时,接收该发布端设备通过组播发布的该第一简化包。
结合第六方面,在第六方面的某些实现方式中,该收发单元,具体用于当该装置为一个时,接收该发布端设备通过单播发布的该第二简化包;或者该收发单元,具体用于当该装置为多个时,接收该发布端设备通过组播发布的该第二简化包。
结合第六方面,在第六方面的某些实现方式中,该用于指示该第一业务的第一数据的数据类型的信息包括字符串、整型或浮点。
结合第六方面,在第六方面的某些实现方式中,该用于指示该第一业务的第一数据的数据含义的信息包括以下任意一项:湿度、温度、甲烷浓度或温度等。
第七方面,提供了一种传输数据的装置,包括:收发单元,用于接收来自订阅端设备的第三订阅消息,该第三订阅消息用于订阅第三业务,该订阅端设备包括一个或多个设备;确定单元,用于根据该第三订阅消息的接收时刻确定第二发布基准时刻;该收发单元,还用于在该第二发布基准时刻向该订阅端设备发布该第三业务的第一数据。
结合第七方面,在第七方面的某些实现方式中,该收发单元,还用于接收来自该订阅端设备的第四订阅消息,该第四订阅消息用于订阅第四业务;该收发单元,还用于向该订阅端设备发布该第四业务的数据,该发布该第四业务的数据的时刻与该第二发布基准时刻相差M个第四发布周期,该第四发布周期为该第四业务的发布周期,M为大于或等于0的整数。
结合第七方面,在第七方面的某些实现方式中,该收发单元,具体用于当该第三业务的数据的数据格式为该订阅端设备未知的数据格式时,在该第二发布基准时刻向该订阅端 设备发布第三全量包,该第三全量包包括该第三业务的第一数据和用于指示第三业务的第一数据的数据格式的信息,该用于指示第三业务的第一数据的数据格式的信息包括用于指示该第三业务的第一数据的数据类型的信息和用于指示该第三业务的第一数据的数据含义的信息;或者该收发单元,具体用于当该第三业务的数据的数据格式为该订阅端设备已知的数据格式时,在该第二发布基准时刻向该订阅端设备发布该第三简化包,该第三简化包包括该第三业务的第一数据。
结合第七方面,在第七方面的某些实现方式中,该收发单元,具体用于当该第四业务的数据的数据格式为该订阅端设备未知的数据格式时,向该订阅端设备发布第四全量包,该第四全量包包括该第四业务的数据和用于指示该第四业务的数据的数据格式的信息,该用于指示该第四业务的数据的数据格式的信息包括用于指示该第四业务的数据的数据类型的信息和用于指示该第四业务的书的数据含义的信息;或者该收发单元,具体用于当该第四业务的数据的数据格式为该订阅端设备未知的数据格式时,向该订阅端设备发布第四简化包,该第四简化包包括该第四业务的数据;或者该收发单元,具体用于当该第四数据的数据格式为该订阅端设备已知的数据格式时,向该订阅端设备发布该第四简化包。
结合第七方面,在第七方面的某些实现方式中,该收发单元,具体用于当该订阅端设备为一个时,通过单播向该订阅端设备发布该第三业务的第一数据;或者该收发单元,具体用于当该订阅端设备为多个时,通过组播向多个该订阅端设备发布该第三业务的第一数据。
结合第七方面,在第七方面的某些实现方式中,该收发单元,具体用于当该订阅端设备为一个时,通过单播向该订阅端设备发布该第四业务的数据;或者该收发单元,具体用于当该订阅端设备为多个时,通过组播向多个该订阅端设备发布该第四业务的数据。
结合第七方面,在第七方面的某些实现方式中,该用于指示该第三业务的第一数据的数据类型的信息包括字符串、整型或浮点;该用于指示该第四业务的数据的数据类型的信息包括字符串、整型或浮点。
结合第七方面,在第七方面的某些实现方式中,该第三业务的第一数据的数据含义信息包括以下任意一项:湿度、温度、速度或甲烷浓度等;或者该第四业务的数据的数据含义信息包括以下任意一项:湿度、温度、速度或甲烷浓度等。
第八方面,提供了一种传输数据的装置,包括:收发单元,用于向发布端设备发送第三订阅消息,该第三订阅消息用于订阅第三业务,该装置包括一个或多个;该收发单元,还用于接收该发布端设备在第二发布基准时刻发布的该第三业务的第一数据。
结合第八方面,在第八方面的某些实现方式中,该收发单元,还用于向该发布端设备发送第四订阅消息,该第四订阅消息用于订阅第四业务;该收发单元,还用于接收来自该发布端设备的该第四业务的数据,该接收该第四业务的数据的时刻与该第二发布基准时刻相差M个第四发布周期,该第四发布周期为该第四业务的发布周期,M为大于或等于0的整数。
结合第八方面,在第八方面的某些实现方式中,该收发单元,具体用于当该第三业务的数据的数据格式为该装置未知的数据格式时,接收该发布端设备在第二发布基准时刻发布的第三全量包,该第三全量包包括该第三业务的第一数据和用于指示第三业务的第一数据的数据格式的信息,该用于指示第三业务的第一数据的数据格式的信息包括用于指示该 第三业务的第一数据的数据类型的信息和用于指示该第三业务的第一数据的数据含义的信息;或者该收发单元,具体用于当该第三业务的数据的数据格式为该装置已知的数据格式时,接收该发布端设备在第二发布基准时刻发布的第三简化包,该第三简化包包括该第三业务的第一数据。
结合第八方面,在第八方面的某些实现方式中,该收发单元,具体用于当该第四业务的数据的数据格式为该装置未知的数据格式时,接收来自该发布端设备的第四全量包,该第四全量包包括该第四业务的数据和用于指示该第四业务的数据的数据格式的信息,该用于指示该第四业务的数据的数据格式的信息包括用于指示该第四业务的数据的数据类型的信息和用于指示该第四业务的书的数据含义的信息;或者该收发单元,具体用于当该第四业务的数据的数据格式为该装置未知的数据格式时,接收来自该发布端设备的第四简化包,该第四简化包包括该第四业务的数据;或者该收发单元,具体用于当该第四业务的数据的数据格式为该装置已知的数据格式时,接收来自该发布端设备的该第四简化包。
结合第八方面,在第八方面的某些实现方式中,该收发单元,具体用于当该装置为一个时,接收该发布端设备通过单播发布的该第三业务的第一数据;或者该收发单元,具体用于当该装置为多个时,接收该发布端设备通过组播发布的该第三业务的第一数据。
结合第八方面,在第八方面的某些实现方式中,该收发单元,具体用于当该装置为一个时,接收该发布端设备通过单播发布的该第四业务的数据;或者该收发单元,具体用于当该装置为多个时,接收该发布端设备通过组播发布的该第四业务的数据。
结合第八方面,在第八方面的某些实现方式中,该用于指示该第三业务的第一数据的数据类型的信息包括字符串、整型或浮点;该用于指示该第四业务的数据的数据类型的信息包括字符串、整型或浮点。
结合第八方面,在第八方面的某些实现方式中,该用于指示该第三业务的数据的数据含义的信息包括以下任意一项:湿度、温度、速度或甲烷浓度等;或者该用于指示该第四业务的数据的数据含义的信息包括以下任意一项:湿度、温度、速度或甲烷浓度等。
第九方面,提供了一种通信装置,包括:与存储器耦合的处理器,该存储器用于存储计算机程序,该处理器用于运行该计算机程序,使得该通信装置执行如上述第一方面及其任一种可能的实现方式中的方法,或者,使得执行如上述第二方面及其任一种可能实现方式中的方法,或者使得执行如上述第三方面及其任一种可能实现方式中的方法,或者,使得执行如上述第四方面及其任一种可能实现方式中的方法。
第十方面,提供了一种计算机可读存储介质,该计算机可读存储介质包括计算机程序或指令,当该计算机程序或指令在计算机上运行时,使得如第一方面及其任一种可能的实现方式中的方法被执行,或者,使得如第二方面及其任一种可能的实现方式中的方法被执行,或者,使得如第三方面及其任一种可能的实现方式中的方法被执行,或者,使得如第四方面及其任一种可能的实现方式中的方法被执行。
第十一方面,提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,当该计算机程序或指令在计算机上运行时,使得如第一方面及其任一种可能的实现方式中的方法被执行,或者,使得如第二方面及其任一种可能的实现方式中的方法被执行或者,使得如第三方面及其任一种可能的实现方式中的方法被执行,或者,使得如第四方面及其任一种可能的实现方式中的方法被执行。
第十二方面,提供了一种计算机程序,当其在计算机上运行时,使得如第一方面及其任一种可能的实现方式中的方法被执行,或者,使得如第二方面及其任一种可能的实现方式中的方法被执行或者,使得如第三方面及其任一种可能的实现方式中的方法被执行,或者,使得如第四方面及其任一种可能的实现方式中的方法被执行。
附图说明
图1是本申请实施例提供的一种发布订阅系统示意图。
图2是本申请实施例提供的一种发布订阅场景示意图。
图3是本申请实施例提供的一种传输数据的方法示意性流程图。
图4是本申请实施例提供的全量包字段信息示意图。
图5是本申请实施例提供的全量包的示意图。
图6是本申请实施例提供的另一种传输数据的方法示意性流程图。
图7是本申请实施例提供的简化包的示意图。
图8是本申请实施例提供的发布订阅模式中的传输数据方法示意图。
图9是本申请实施例提供的数据发布时刻对齐示意图。
图10是本申请实施例提供的另一种传输数据的方法示意性流程图。
图11是本申请一个实施例的通信装置的示例性结构图。
图12是本申请另一个实施例的通信装置的示例性结构图。
图13是本申请实施例提供的一种装置示意性结构图
具体实施方式
下面将结合附图,对本申请实施例中的技术方案进行描述。
本申请实施例的技术方案可以应用于各种通信系统,例如:长期演进(long term evolution,LTE)系统、LTE频分双工(frequency division duplex,FDD)系统、LTE时分双工(time division duplex,TDD)、第五代(5th generation,5G)系统或新无线(new radio,NR),或者5G之后演进的通信系统(例如,6G通信系统)或者以太网系统等。本申请对此不作限定。
本申请实施例中的终端设备,可以是用于实现无线通信功能的设备,例如终端或者可用于终端中的芯片等。其中,终端设备可以指用户设备(User equipment,UE)、接入终端、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。终端设备还可以工业控制(industrial control)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等。或者,终端可以是车联网(vehicle-to-everything,V2X)中的终端(例如车联网设备)、设备到设备(Device to Device)通信中的终端、或者机器到机器(machine to machine,M2M)通信中的终端、5G网络中的终端设备、5G之后演进的通信系统中的终端设备或者未来演进的公用陆地移动通信网络(public land mobile network,PLMN)中的终端设备等,本申请实施例对此并不限定。
在本申请提供的实施例中,发布端设备可以是发布者,订阅端设备可以是订阅者。发布端设备和订阅端设备可以应用于如图1示出的发布订阅系统中实现消息交互。发布订阅 系统是分布式系统中各参与者(参与设备)以发布订阅的方式进行交互的中间件系统。在发布订阅系统中,信息的生产者和消费者之间所交互的信息被称为事件。其中,信息的生产者称为发布端设备(publisher),信息的消费者称为订阅端设备(subscriber)。发布端设备和订阅端设备都可以被称为客户端。
图2示出了一种发布订阅场景示意图。当发布端设备和订阅端设备在交换数据时,通常订阅端设备对发布者发布的数据的数据格式是已知的。当订阅端设备接收发布的数据时,订阅端设备可以正确解析该数据,并确定该数据的正确含义。示例性的,标准中可以预先设定好数据的数据格式,例如图2中的数据集合1和数据集合2。但是,对于没有写入标准中的数据格式所对应的数据,订阅端设备对这类数据的数据格式是未知的,因此,订阅端设备在接收到发布端设备发布的此类数据后,无法正确解析并知晓此类数据的含义,例如图2中的扩展数据集合3。订阅端设备预先未知数据格式的数据可以是厂商扩展的数据,标准中并未记录。另外,发布端设备可以将数据划分成数据集合,可以依据数据类型或者数据含义划分数据集合,划分数据结合的具体方法不作限定。
针对订阅端设备订阅未知数据格式数据的情况,现有技术中存在三种做法。其一,发布端设备扩展未知数据格式的数据后,订阅端设备也同步进行扩展,以保证订阅端设备可以正确解析数据。该方法需要订阅端设备的同步修改,但订阅端设备和发布端可能不是一个厂家实现,不是同一厂家导致上述同步扩展的难度较大。其二,在标准中增加订阅端设备和发布端设备之间的一次数据格式查询流程,订阅端设备在订阅该扩展数据时,需要先查询该扩展数据的数据格式。该方法增加了交互次数。其三,在标准中增加一次交互,发布端设备在发布扩展数据时,先传输数据格式,再传输数据。该方法增加了交互次数。综上,现有的方法不能在原有的交互次数,或者实现较为简单的情况下解决订阅端设备正确解析未知数据格式数据的问题。因此,为了使得扩展数据也能被订阅端设备正确解析,本申请提供了一种传输数据的方法,在发布订阅的场景下,通过对传输数据过程的改进,使得订阅端设备可以正确且便捷地解析扩展数据。
图3示出了本申请实施例提供的一种传输数据的方法300示意性流程图。该方法可以适用于如图1所示的场景中,具体步骤如下:
S301,发布端设备接收第一订阅消息,相应地,订阅端设备发送第一订阅消息。
应理解,第一订阅消息用于订阅第一业务,第一业务的数据的数据格式为订阅端设备未知的数据格式。其中第一业务的数据也可以是数据集合。也可以理解为,第一业务的数据是标准中未预先定义的,是厂商扩展的数据。
S302,发布端设备发布第一全量包,相应地,订阅端设备接收第一全量包。
需要说明的是,发布端设备在第一业务的第一数据的首次发布时刻向订阅端设备发布第一全量包。第一全量包包括第一业务的第一数据和用于指示第一业务的第一数据的数据格式的信息,用于指示第一业务的第一数据的数据格式的信息包括用于指示第一业务的第一数据类型的信息和用于指示第一业务的第一数据的数据含义的信息。全量包是数据传输的一种方式。
为了方便理解,图4示出了全量包内字段信息的示意图。具体地,全量包字段信息包括字段类型、字段值和字段含义。图5示出了全量包的示意图。当数据为多个时,可以表现为数据集合。数据集合可以是一个字段列表,是由多个字段组成的。其中,字段类型和 字段含义属于辅助信息,用于帮助解析字段,并获取字段值所对应的含义。例如,图5中字段值为第一业务的第一数据、字段类型为用于指示第一业务的第一数据的数据类型的信息、字段含义为用于指示第一业务的第一数据的数据含义的信息。
具体的,字段类型,可以指示字段值所对应的类型,例如字符串、整型或浮点等,可以用于正确解析字段值;字段含义,可以指示字段值所对应通信设备的属性,例如该字段值表示湿度、温度、速度或者甲烷浓度等,可以用于获取字段值所对应的含义。可以理解为,以上两种信息用于表示数据格式。通过以上两种字段信息即可正确解析数据并获取数据含义。
在一些实施例中,第一订阅消息中包括第一业务的标识,发布端设备根据第一订阅消息中的第一业务的标识确定第一全量包。
本申请实施例提供的传输数据的方法中,订阅端设备预先未知第一业务的数据的数据格式,因此,在发布端设备首次发布第一业务的数据(第一业务的第一数据)时,以第一全量包的形式发布。因为第一全量包中包含有用于指示数据格式的信息,订阅端设备能够正确解析该数据并获取其含义。该方法同时传输数据以及对应的数据格式,能够节省订阅端设备和发布端设备的交互次数。可以通过预先在标准中规定上述类型的全量包,订阅端设备便可以在接收到厂商扩展的数据时,对该数据正确解析并获取其含义。
图6示出了本申请实施例提供的另一种传输数据的方法600示意性流程图。该方法可以适用于如图1所示的场景中,具体步骤如下:
S601,发布端设备接收第一订阅消息,相应地,订阅端设备发送第一订阅消息。
应理解,第一订阅消息用于订阅第一业务,第一业务的数据的数据格式为订阅端设备未知的数据格式。
S602,发布端设备接收第二订阅消息,相应地,订阅端设备发送第二订阅消息。
应理解,第二订阅消息用于订阅第二业务,第二业务的数据的数据格式为订阅端设备已知的数据格式,也可以理解为,第二业务的数据是标准中预先定义的。
S603,发布端确定第一全量包。
在一些实施例中,第一订阅消息包括第一业务的标识,发布端设备可以根据第一订阅消息中的第一业务的标识确定第一全量包。
S604,发布端设备确定第一简化包。
应理解,第一简化包包括第一业务的第二数据。如果订阅端设备对该数据的数据格式未知,发布端设备首次发布该数据时,可以采用全量包的形式发布。全量包中包含字段值、字段类型和字段含义,上述三种信息可以通过全量包同时传输给订阅端设备,不会产生额外的多次交互。然而,订阅端设备订阅的业务的数据通常会被不断的发布,发布的时间间隔为相应业务的发布周期。发布端设备可以在首次通过全量包的形式发布该业务之后的任意发布时刻,采用简化包的传输方式,以能够减少数据的传输量。也就是说,全量包和简化包可以交替传输,当数据格式发生变化或有新的订阅时,需要传输全量包。
应理解,本申请实施例中的第一数据指的是某一业务首次发布的数据,第二数据指的是某一业务首次发布之后的任一发布时刻发布的数据。
为了方便理解,图7示出了简化包的示意图。简化包中仅携带有字段值。当订阅端设备订阅已知数据格式的数据时,发布端设备可以发布仅携带字段值的简化包,订阅端设备 即可正确解析该数据并获知该数据含义。
S605,发布端设备确定第二简化包。
在一些实施例中,发布端设备根据第二订阅消息中的第二业务的数据的标识确定第二简化包。
应理解,第二简化包与第一简化包类似。在第二业务的数据的数据格式为订阅端设备已知的数据格式时,无需确定包含用于指示第二业务的数据的数据格式的信息的全量包。第二简化包仅包括第二业务的数据,不包括用于指示第二业务的数据的数据格式的信息。。
更进一步地,发布端设备首次发布第一业务的数据或者第二业务的数据的时刻是不确定的,数据发布的基准时刻与该数据首次被订阅的时刻有关。因此,发布端设备可以执行下列步骤,以确定发布基准时刻。
S604,发布端设备确定第一发布基准时刻。
应理解,发布端设备根据第一订阅消息的接收时刻确定第一发布基准时刻。发布端设备在接收了第一个订阅消息(第一订阅消息)之后,便可以根据该订阅消息的接收时刻确定第一发布基准时刻。发布基准时刻与订阅时刻存在以下数值关系:
发布基准时刻=订阅时刻+随机值
为了便于理解,下面对发布端设备如何确定第一发布基准时刻举例说明。示例性的,随机值可以是0-10s内的随机数。第一业务的数据的订阅时刻为12:36:41,在该订阅时刻的基础上增加4s,则第一发布基准时刻为12:36:45。
S607,发布端设备发布第一全量包,相应地,订阅端设备接收第一全量包。
S608,发布端设备发布第一简化包,相应地,订阅端设备接收第一简化包。
应理解,发布端设备在向订阅端设备发布第一全量包之后,发布端设备向订阅端设备发布第一简化包。发布端发布第一简化包的时刻与发布第一全量包的时刻相差N个第一发布周期,该第一发布周期为该第一业务的发布周期,其中N为大于或等于1的整数。也就是说,在第一业务的数据(第一业务的第一数据)首次发布时刻的之后任一发布时刻,发布端设备都可以向订阅端设备发布第一简化包。其中,第一业务的数据的任一发布时刻之间相差N个第一业务的发布周期。
S609,发布端设备发布第二简化包,相应地,订阅端设备接收第二简化包。
应理解,发布端设备在第二业务的数据的首次发布时刻向订阅端设备发布第二简化包。第二简化包仅包括第二业务的数据,不包括用于指示第二业务的数据的数据格式的信息。在之后的第二业务的数据的任一发布时刻,发布端设备向订阅端设备发布第二简化包。其中,第二业务的数据的任一发布时刻之间相差N个第二发布周期,该第二发布周期为该第二业务的发布周期。也就是说,当订阅端设备订阅的数据为已知数据格式的数据时,为减少每次的传输量,可以在该数据的任意发布时刻,以简化包的方式发布该数据。
以上第一业务的发布周期和第二业务的发布周期可以相同,也可以不同,本申请实施例对此不作限定。
为了方便理解图8示出了本申请实施例提供的发布订阅模式中的传输数据方法示意图。示例性的,图8中示出一个发布端设备和一个订阅端设备,发布端设备包括数据集合1、数据集合2、扩展数据集合3和扩展数据集合4。其中,数据集合1和数据集合2为订阅端设备预先已知数据格式的数据(例如上文中的第二业务的数据);扩展数据集合3和 扩展数据集合4为订阅端设备预先未知数据格式的数据(例如上文中的第一业务的数据)。当订阅端设备订阅数据集合1或数据集合2时,发布端设备通过简化包的方式,在相应的数据集合发布周期,向订阅端设备发布数据集合1或数据集合2。当订阅端设备订阅扩展数据集合3或扩展数据集合4时,发布端设备在相应扩展数据的首次发布时刻,通过全量包的方式发布相应的数据集合,发布端设备在相应扩展数据之后的发布时刻,通过简化包的方式发布相应的数据集合。
在一些实施例中,发布端设备向订阅端设备发布第二简化包,发布端设备发布第二简化包的时刻与第一发布基准时刻相差M个第二发布周期,该第二发布周期为该第二业务的发布周期,M为大于或等于0的整数。
应理解,在发布端设备确定了第一发布基准时刻之后,发布端设备会在第一发布基准时刻首次发布第一业务的第一数据,也就是在第一发布基准时刻发布第一全量包。而对于第二业务的数据发布时刻需要根据下列表达式进行确定:
发布时刻=发布基准时刻+发布周期×M
其中,M为大于或等于0的整数。对于某一数据而言,无论订阅端设备的是何时订阅的,根据上述表达式,可以确定出该数据每次发布的时刻,可见,该数据每次发布时刻与订阅时刻无关。示例性的,当第二业务的数据首次发布时刻与第一业务的数据的首次发布时刻(第一发布基准时刻)相同时,发布端设备在第一发布基准时刻发布第一全量包和第二简化包。当第二业务的数据首次发布时刻与第一业务的数据后续某次发布时刻相同时,发布端设备在该发布时刻发布第一简化包和第二简化包。当第二业务的数据后续某次发布时刻与第一业务的数据后续某次发布时刻相同时,发布端设备在该发布时刻同时发布第一简化包和第二简化包。
为了便于理解,下面对确定第一发布基准时刻之后,发布端设备如何发布数据进行举例说明。
示例性的,第一种情况:发布端设备在12:09:55接收第一订阅消息,确定第一发布基准时刻为12:10:00,则发布端设备在12:10:00首次发布第一业务的数据(第一业务的第一数据),由于第一业务的周期为10s,则第一业务的数据(第一业务的第二数据)下一次的发布时刻为12:10:10。发布端设备在12:09:57接收第二订阅消息,由于已经确定的第一发布基准时刻为12:10:00,则发布端设备在12:10:00首次发布第二业务的数据,由于第二业务的周期为5s,则第二业务的数据下一次发布的时刻为12:10:05。这种情况为,发布端设备在第一发布基准时刻12:10:00首次发布第一业务的数据和第二业务的数据。
第二种情况:发布端设备在12:09:55接收第一订阅消息,确定第一发布基准时刻为12:10:00,则发布端设备在12:10:00首次发布第一业务的数据(第一业务的第一数据),由于第一业务的周期为10s,则第一业务的数据(第一业务的第二数据)下一次的发布时刻为12:10:10。发布端设备在12:10:03接收第二订阅消息,由于已经确定的第一发布基准时刻为12:10:00,则发布端设备在12:10:05首次发布第二业务的数据,由于第二业务的周期为5s,则第二业务的数据下一次发布的时刻为12:10:10。这种情况为,发布端设备在第一发布基准时刻仅发布第一业务的数据,在后续发布时刻12:10:10可能同时发布第一业务的数据和第二业务的数据。
为了便于理解,图9示出了上文第一种情况下数据发布时刻对齐示意图。发布端设备 需要发布的数据包括数据1、数据2和数据3。订阅端设备是否预先已知上述数据的数据格式不作限定。其中,数据1的发布周期为1s,数据2的发布周期为2s,数据3的发布周期为3s。其中,数据1发布周期、数据2发布周期和数据3发布周期的最小公倍数为3。数据1、数据2和数据3的首次订阅时刻为发布基准时刻之前的任一时刻。首先,发布端设备根据接收的首个数据的订阅时刻确定发布基准时刻为0s。其次,发布端设备计算数据1、数据2和数据3后续的8次发布时刻。由于,不同数据的发布周期不同,发布端设备确定的数据1的发布时刻分别为0s、1s、2s、3s、4s、5s、6s和7s;发布端设备确定的数据2的发布时刻分别为0s、2s、4s和6s;发布端设备确定的数据3的发布时刻分别为0s、3s和6s。可以看出,在部分发布时刻,发布端设备可以将多个数据打包一起发布至订阅端设备。例如,在发布时刻0s或6s,发布端设备可以同时发布数据1、数据2和数据3;在发布时刻2s或4s,发布端设备可以同时发布数据1和数据2;在发布时刻3s,发布端设备可以同时发布数据1和数据3。
在一些实施例中,当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第一全量包或该第二简化包;或者当该订阅端设备为一个时,该发布端设备通过单播向该订阅端设备发布该第一简化包或该第二简化包;或者当该订阅端设备为多个时,该发布端设备通过组播在向多个该订阅端设备发布该第一全量包或该第二简化包;或者当该订阅端设备为多个时,该发布端设备通过组播向多个该订阅端设备发布该第一简化包或该第二简化包。
在一些实施例中,第一数据的数据类型包括字符串、整型或浮点。
在一些实施例中,第一数据的数据含义包括以下任意一项:温度、湿度、速度或甲烷浓度等。
需要说明的是,上述步骤S607和步骤S609的执行顺序不作限定,可先执行步骤S607,再执行步骤S609;也可以同时执行步骤S607和S609。上述步骤S608和步骤S609的执行顺序不作限定,可先执行步骤S608,再执行步骤S609;可先执行步骤S609,再执行步骤S608;也可以同时执行步骤S608和S609。上述步骤S603、S604、S605和S606的执行顺序不作限定。上述步骤S606的执行顺序在步骤S601之后的任一时刻都可以。上述步骤S602的执行顺序在步骤S601之后,且在步骤S605之前任一时刻都可以,步骤S602具体执行的顺序不作限定。
本申请实施例提供的传输数据的方法,对于订阅端设备预先未知数据格式的第一业务的数据,在发布端设备首次发布第一业务的数据时,以第一全量包的形式发布。因为第一全量包中包含有第一业务的数据和用于指示第一业务的数据的数据格式的信息,订阅端设备能够正确解析第一业务的数据并获取其含义。发布端设备在下一次发布第一业务的数据时,以第一简化包的形式发布,订阅端设备便可以根据第一简化包中的字段值正确解析第一业务的数据并获取其含义。对于订阅端设备预先已知数据格式的第二业务的数据,在发布端设备首次发布第二业务的数据,以及发布端设备下一次发布第二业务的数据时,以第二简化包的形式发布,订阅端设备便可以根据第二简化包中的字段值正确解析第二业务的数据并获取其含义。该方法在支持订阅端设备正确解析预先未知数据格式的数据的同时,能够简化发布端设备和订阅端设备之间的交互流程,从而节约交互信令的开销。
此外,发布端设备还可以根据第一个订阅消息(第一订阅消息)的接收时刻,确定发 布基准时刻(第一发布基准时刻)。从而对于单个业务的数据,无论订阅端设备时什么时刻订阅的,能够确定出固定的发布时刻;对于多个业务的数据,也能将数据的发布时间统一,尽量使得多个数据的发布时刻对齐。该方法在还能够尽可能实现多数据的同时传输,提升传输效率。
由上文对方法600的描述可知,发布端设备向订阅端设备首次发布第一业务的数据和第二业务的数据的时刻是不确定的,现有的业务的数据发布时刻与业务首次被订阅的时刻有关。当发布端设备需要向某一订阅端设备发布多个数据或多个数据集合时,往往会因为每个数据或数据集合发布时刻不同,而不能将多个数据或多个数据集合打包发送。
示例性的,数据1的发布周期为10s,订阅时刻为12:36:41,数据1的下一次发布时刻为12:36:51;数据2的发布周期为20s,订阅时刻为12:46:45,数据2的下一次发布时刻是12:37:05。可以看出,数据1和数据2的发布时刻不同,导致两个数据不能打包一起发送,如果一个订阅端设备先后订阅了这两个数据,则发布端设备需要发送分别发送这两个数据。因此,现有技术中主要关注于单个数据发布时刻的对齐,对于单个数据而言,发布周期固定,不同订阅端设备订阅时刻不同,导致数据的发布时刻不同。如何尽量将多个数据的发布时刻对齐是本申请进一步需要解决的问题。针对上述技术问题,在不限定多个数据或多个数据集合的数据格式是否为订阅端设备已知的情况下,提出如图10所示的传输数据的方法1000。确定不受订阅端设备接收订阅消息时刻影响的发布基准时刻,从而尽可能实现多个数据或多个数据集合打包发布,提升发布效率。下面以多个数据为例,对该方法1000进行详细介绍。
图10示出了本申请实施例提出的另一种传输数据的方法1000示意性流程图。该方法可以适用于如图1所示的场景中,具体步骤如下:
S1001,发布端设备接收第三订阅消息,相应地,订阅端设备发送第三订阅消息。
应理解,发布端设备接收来自订阅端设备的第三订阅消息,第三订阅消息用于订阅第三业务。
S1002,发布端设备确定第二发布基准时刻。
S1003,发布端设备发布第三业务的第一数据,相应地,订阅端设备接收第三业务的第一数据。
上述步骤与上文方法600中步骤S601、S606、S607、S608和S609类似,此处不再赘述。
在一些实施例中,在发布端设备接收来自订阅端设备的第三订阅消息之后,发布端设备接收来自订阅端设备的第四订阅消息,第四订阅消息用于订阅第四业务。发布端设备向订阅端设备发布第四业务的数据,发布端设备发布第四业务的数据的时刻与第二发布基准时刻相差M个第四发布周期,第四发布周期为第四业务的发布周期,M为大于或等于0的整数。
在一些实施例中,当第三业务的数据的数据格式为订阅端设备未知的数据格式时,该发布端设备向订阅端设备发布第三全量包,第三全量包包括第三业务的数据和用于指示第三业务的数据的数据格式的信息,用于指示第三业务的数据的数据格式的信息包括用于指示第三业务的数据的数据类型的信息和用于指示第三业务的数据的数据含义的信息;或者当第三业务的数据的数据格式为订阅端设备未知的数据格式时,该发布端设备向订阅端设 备发布第三简化包,第三简化包包括第三业务的数据;或者当第三业务的数据的数据格式为订阅端设备已知的数据格式时,发布端设备向订阅端设备发布第三简化包。
在一些实施例中,当第四业务的数据的数据格式为订阅端设备未知的数据格式的数据时,该发布端设备向订阅端设备发布第四全量包,第四全量包包括第四业务的数据和用于指示第四业务的数据的数据格式的信息,用于指示第四业务的数据的数据格式的信息包括用于指示第四业务的数据的数据类型的信息和用于指示第四业务的数据的数据含义的信息;或者当第四业务的数据的数据格式为订阅端设备未知的数据格式时,该发布端设备向订阅端设备发布第四简化包,第四简化包包括第四业务的数据;或者当第四业务的数据的数据格式为订阅端设备已知的数据格式时,发布端设备向订阅端设备发布第四简化包。
在一些实施例中,当订阅端设备为一个时,发布端设备通过单播向订阅端设备发布第三业务的数据或第四业务的数据;或者当订阅端设备为多个时,该发布端设备通过组播向多个订阅端设备发布第三业务的数据或第四业务的数据。
应理解,当仅有一个订阅端设备订阅了多个数据时,在发布端设备对齐发布基准时刻后,发布端设备可以通过单播的方式,将该多个数据几个可以被打包在一个消息中发布给该订阅端设备。当多个订阅端设备订阅了多个数据时,在发布端设备对齐发布基准时刻后,发布端设备可以通过组播的方式,将该多个数据几个可以被打包在一个消息中发布给该多个订阅端设备。
在一些实施例中,用于指示第三业务的数据的数据类型的信息包括字符串、整型或浮点;第四数据的数据类型包括字符串、整型或浮点,用于指示第四业务的数据的数据类型的信息用于解码第四数据。
在一些实施例中,用于指示第三业务的数据的数据含义的信息包括以下任意一项:温度、湿度、速度或甲烷浓度等;用于指示第四业务的数据的数据含义的信息包括以下任意一项:温度、湿度、速度或甲烷浓度等。
应理解,本申请实施例中,第一业务、第二业务、第三业务和第四业务可以是不同的业务。
本申请提供的传输数据的方法,发布端设备可以根据订阅消息的接收时刻,确定发布基准时刻。从而对于单个数据,无论订阅端设备时什么时刻订阅的,能够确定出固定的发布时刻;对于多个数据,也能将数据的发布时间统一,尽量使得多个数据的发布时刻对齐。该方法在还能够尽可能实现多数据的同时传输,提升传输效率。
图11示出了本申请一个实施例的通信装置1100的结构示意图。该通信装置1100可以是发布端设备,也可以是发布端设备中的装置,或者是能够和发布端设备匹配使用的装置。一种可能的实现中,该通信装置1100可以包括执行上述方法实施例中发布端设备执行的方法/操作/步骤/动作所一一对应的模块或单元,该单元可以是硬件电路,也可是软件,也可以是硬件电路结合软件实现。一种可能的实现中,该通信装置1100包括:处理单元1110和收发单元1120。应理解,图11所示的通信装置仅是示例,还可以包括其他单元,或者包括与图11中各个单元功能相似的单元,或者并非需要包括图11中所有的单元。
需要说明的是,本申请实施例中的处理单元也可以称为处理模块,收发单元也可以称为收发模块。
图12示出了本申请实施例提供的通信装置1200,该通信装置1200可以为发布端设 备。该装置可以包括处理器1210和收发器1230。该收发器可以包括发送器和/或接收器。
一些实施例中,该装置还可以包括存储器1220,该处理器1210、收发器1230和存储器1220通过内部连接通路互相通。图11中的处理单元1110所实现的相关功能可以由处理器1210来实现,收发单元1120所实现的相关功能可以由处理器1210控制收发器1230来实现。
一些实施例中,处理器1210可以是一个可以是CPU,微处理器,ASIC,专用处理器,或一个或多个用于执行本申请实施例技术方案的集成电路。或者,处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。例如可以是基带处理器、或中央处理器。基带处理器可以用于对通信协议以及通信数据进行处理,中央处理器可以用于对通信装置(如,网络设备、终端、或芯片等)进行控制,执行软件程序,处理软件程序的数据。
一些实施例中,该处理器1210可以包括是一个或多个处理器,例如包括一个或多个CPU,在处理器是一个CPU的情况下,该CPU可以是单核CPU,也可以是多核CPU。
该收发器1230用于发送和接收数据和/或信号,以及接收数据和/或信号。该收发器可以包括发射器和接收器,发射器用于发送数据和/或信号,接收器用于接收数据和/或信号。
该存储器1220包括但不限于是随机存取存储器(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程存储器(erasable programmable read only memory,EPROM)、只读光盘(compact disc read-only memory,CD-ROM),该存储器1520用于存储相关指令及数据。存储器1220可以为单独的器件或集成在处理器1210中。
一些实施例中,通信装置1200还可以包括输出设备和输入设备。输出设备和处理器1210通信,可以以多种方式来显示信息。例如,输出设备可以是液晶显示器(liquid crystal display,LCD),发光二极管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪等。输入设备和处理器1210通信,可以以多种方式接收用户的输入。例如,输入设备可以书鼠标、键盘、触摸屏设备或传感设备等。
可以理解的是,图12仅仅示出了通信装置的简化设计。在实际应用中,该装置还可以分别包含必要的其他元件,包含但不限于任意数量的收发器、处理器、控制器、存储器等,而所有可以实现本申请的终端设备都在本申请的保护范围之内。
在一种可能的设计中,该装置1200可以是芯片,例如可以为可用于发布端设备中的通信芯片,用于实现发布端设备中处理器1210的相关功能。该芯片可以为实现相关功能的线程可编程门阵列,专用集成芯片,系统芯片,中央处理器,网络处理器,数字信号处理电路,微控制器,还可以采用可编程控制器或其他集成芯片。该芯片中,可选的可以包括一个或多个存储器,用于存储计算机程序或指令,当该程序或指令被执行时,使得处理器实现相应的功能。
如图13所示,本申请实施例还提供一种装置1300,可用于实现上述方法中发布端设备的功能,该装置1300可以是通信装置或者通信装置中的芯片。该通信装置包括:
至少一个输入输出接口1310和逻辑电路1320。输入输出接口1310可以是输入输出电路、输入接口、输出接口等。逻辑电路1320可以是信号处理器、芯片,或其他可以实现本申请方法的集成电路。
其中,至少一个输入输出接口1310用于信号或数据的输入或输出。其中,逻辑电路1320用于执行本申请实施例提供的任意一种方法的部分或全部步骤。
本申请实施例还提供一种装置,该装置可以是发布端设备,也可以是逻辑电路。该装置可以用于执行上述方法实施例中由发布端设备所执行的动作。
本申请实施例还提出了一种计算机可读存储介质,该计算机可读存储介质存储一个或多个程序或指令,该程序或指令在计算机上运行时,使得该计算机执行上述实施例该的方法。
本申请实施例还提出了一种计算机程序,该计算机程序包括程序或指令,当该计算机程序或指令被计算机执行时,使得计算机可以执行上述实施例的方法的相应流程。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
还应理解,本文中涉及的第一、第二以及各种数字编号仅为描述方便进行的区分,并不用来限定本申请实施例的范围。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,该单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络 单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例该方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以该权利要求的保护范围为准。

Claims (39)

  1. 一种传输数据的方法,其特征在于,包括:
    发布端设备接收来自订阅端设备的第一订阅消息,所述第一订阅消息用于订阅第一业务,所述第一业务的数据的数据格式为所述订阅端设备未知的数据格式,所述订阅端设备包括一个或多个设备;
    所述发布端设备向所述订阅端设备发布第一全量包,所述第一全量包包括所述第一业务的第一数据和用于指示所述第一业务的第一数据的数据格式的信息,所述用于指示所述第一业务的第一数据的数据格式的信息包括用于指示所述第一业务的第一数据的数据类型的信息和用于指示所述第一业务的第一数据的数据含义的信息。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    所述发布端设备根据所述第一订阅消息确定第一简化包,所述第一简化包包括所述第一业务的第二数据;
    在所述发布端设备向所述订阅端设备发布所述第一全量包之后,所述发布端设备向所述订阅端设备发布所述第一简化包,所述发布端设备发布所述第一简化包的时刻与所述发布端设备发布所述第一全量包的时刻相差N个第一发布周期,所述第一发布周期为所述第一业务的发布周期,N为大于或等于1的整数。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第一订阅消息包括所述第一业务的标识,所述方法还包括:
    所述发布端设备根据所述第一订阅消息中的所述第一业务的标识确定所述第一全量包。
  4. 根据权利要求所述1至3中任一项的方法,其特征在于,所述发布端设备向所述订阅端设备发布第一全量包,包括:
    所述发布端设备根据所述第一订阅消息的接收时刻确定第一发布基准时刻;
    所述发布端设备在所述第一发布基准时刻发布所述第一全量包。
  5. 根据权利要求4所述的方法,其特征在于,在所述发布端设备接收来自订阅端设备的第一订阅消息之后,所述方法还包括:
    所述发布端设备接收来自所述订阅端设备的第二订阅消息,所述第二订阅消息用于订阅第二业务,所述第二业务的数据的数据格式为所述订阅端设备已知的数据格式;
    所述发布端设备根据所述第二订阅消息确定第二简化包,所述第二简化包包括所述第二业务的数据;
    所述发布端设备向所述订阅端设备发布所述第二简化包,所述发布端设备发布所述第二简化包的时刻与所述第一发布基准时刻相差M个第二发布周期,所述第二发布周期为所述第二业务的发布周期,M为大于或等于0的整数。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述发布端设备向所述订阅端设备发布第一全量包,包括:
    当所述订阅端设备为一个时,所述发布端设备通过单播向所述订阅端设备发布所述第一全量包;或者
    当所述订阅端设备为多个时,所述发布端设备通过组播向多个所述订阅端设备发布所述第一全量包。
  7. 根据权利要求2所述的方法,其特征在于,所述发布端设备向所述订阅端设备发布所述第一简化包,包括:
    当所述订阅端设备为一个时,所述发布端设备通过单播向所述订阅端设备发布所述第一简化包;或者
    当所述订阅端设备为多个时,所述发布端设备通过组播向所述订阅端设备发布所述第一简化包。
  8. 根据权利要求5所述的方法,其特征在于,所述发布端设备向所述订阅端设备发布所述第二简化包,包括:
    当所述订阅端设备为一个时,所述发布端设备通过单播向所述订阅端设备发布所述第二简化包;或者
    当所述订阅端设备为多个时,所述发布端设备通过组播向所述订阅端设备发布所述第二简化包。
  9. 根据权利要求1至8中任一项所述的方法,其特征在于,所述用于指示所述第一业务的第一数据的数据类型的信息包括字符串、整型或浮点。
  10. 一种传输数据的方法,其特征在于,包括:
    订阅端设备向发布端设备发送第一订阅消息,所述第一订阅消息用于订阅第一业务,所述第一业务的数据的数据格式为所述订阅端设备未知的数据格式,所述订阅端设备包括一个或多个设备;
    所述订阅端设备接收来自所述发布端设备的第一全量包,所述第一全量包包括所述第一业务的第一数据和用于指示所述第一业务的第一数据的数据格式的信息,所述用于指示所述第一业务的第一数据的数据格式的信息包括用于指示所述第一业务的第一数据的数据类型的信息和用于指示所述第一业务的第一数据的数据含义的信息。
  11. 根据权利要求10所述的方法,其特征在于,在所述订阅端设备接收来自所述发布端设备的第一全量包之后,所述方法还包括:
    所述订阅端设备接收来自所述发布端设备的第一简化包,所述第一简化包包括所述第一业务的第二数据,所述订阅端设备接收所述第一简化包的时刻与所述订阅端设备接收所述第一全量包的时刻相差N个第一发布周期,所述第一发布周期为所述第一业务的发布周期,N为大于或等于1的整数。
  12. 根据权利要求10或11所述的方法,其特征在于,所述第一订阅消息包括所述第一业务的标识。
  13. 根据权利要求所述10至12中任一项的方法,其特征在于,所述订阅端设备接收来自所述发布端设备的第一全量包,包括:
    所述订阅端设备接收所述发布端设备在第一发布基准时刻发布的所述第一全量包。
  14. 根据权利要求13所述的方法,其特征在于,在所述订阅端设备向发布端设备发送第一订阅消息之后,所述方法还包括:
    所述订阅端设备向所述发布端设备发送第二订阅消息,所述第二订阅消息用于订阅第二业务,所述第二业务的数据的数据格式为所述订阅端设备已知的数据格式;
    所述订阅端设备接收来自所述发布端设备的第二简化包,所述第二简化包包括所述第二业务的数据,所述订阅端设备接收所述第二简化包的时刻与所述第一发布基准时刻相差M个第二发布周期,所述第二发布周期为所述第二业务的发布周期,M为大于或等于0的整数。
  15. 根据权利要求10至14中任一项所述的方法,其特征在于,所述订阅端设备接收来自所述发布端设备的第一全量包,包括:
    当所述订阅端设备为一个时,所述订阅端设备接收所述发布端设备通过单播发布的所述第一全量包;或者
    当所述订阅端设备为多个时,所述订阅端设备接收所述发布端设备通过组播发布的所述第一全量包。
  16. 根据权利要求11所述的方法,其特征在于,所述订阅端设备接收来自所述发布端设备的第一简化包,包括:
    当所述订阅端设备为一个时,所述订阅端设备接收所述发布端设备通过单播发布的所述第一简化包;或者
    当所述订阅端设备为多个时,所述订阅端设备接收所述发布端设备通过组播发布的所述第一简化包。
  17. 根据权利要求14所述的方法,其特征在于,所述订阅端设备接收来自所述发布端设备的第二简化包,包括:
    当所述订阅端设备为一个时,所述订阅端设备接收所述发布端设备通过单播发布的所述第二简化包;或者
    当所述订阅端设备为多个时,所述订阅端设备接收所述发布端设备通过组播发布的所述第二简化包。
  18. 根据权利要求1至17中任一项所述的方法,其特征在于,所述用于指示所述第一业务的第一数据的数据类型的信息包括字符串、整型或浮点。
  19. 一种传输数据的方法,其特征在于,包括:
    发布端设备接收来自订阅端设备的第三订阅消息,所述第三订阅消息用于订阅第三业务,所述订阅端设备包括一个或多个设备;
    所述发布端设备根据所述第三订阅消息的接收时刻确定第二发布基准时刻;
    所述发布端设备在所述第二发布基准时刻向所述订阅端设备发布所述第三业务的第一数据。
  20. 根据权利要求19所述的方法,其特征在于,在所述发布端设备接收来自所述订阅端设备的第三订阅消息之后,所述方法还包括:
    所述发布端设备接收来自所述订阅端设备的第四订阅消息,所述第四订阅消息用于订阅第四业务;
    所述发布端设备向所述订阅端设备发布所述第四业务的数据,所述发布端设备发布所述第四业务的数据的时刻与所述第二发布基准时刻相差M个第四发布周期,所述第四发布周期为所述第四业务的发布周期,M为大于或等于0的整数。
  21. 根据权利要求19或20所述的方法,其特征在于,所述发布端设备在所述第二发布基准时刻向所述订阅端设备发布所述第三业务的第一数据,包括:
    当所述第三业务的数据的数据格式为所述订阅端设备未知的数据格式时,所述发布端设备在所述第二发布基准时刻向所述订阅端设备发布第三全量包,所述第三全量包包括所述第三业务的第一数据和用于指示第三业务的第一数据的数据格式的信息,所述用于指示第三业务的第一数据的数据格式的信息包括用于指示所述第三业务的第一数据的数据类型的信息和用于指示所述第三业务的第一数据的数据含义的信息;或者
    当所述第三业务的数据的数据格式为所述订阅端设备已知的数据格式时,所述发布端设备在所述第二发布基准时刻向所述订阅端设备发布所述第三简化包,所述第三简化包包括所述第三业务的第一数据。
  22. 根据权利要求20所述的方法,其特征在于,所述发布端设备向所述订阅端设备发布所述第四业务的数据,包括:
    当所述第四业务的数据的数据格式为所述订阅端设备未知的数据格式时,所述发布端设备向所述订阅端设备发布第四全量包,所述第四全量包包括所述第四业务的数据和用于指示所述第四业务的数据的数据格式的信息,所述用于指示所述第四业务的数据的数据格式的信息包括用于指示所述第四业务的数据的数据类型的信息和用于指示所述第四业务的书的数据含义的信息;或者
    当所述第四业务的数据的数据格式为所述订阅端设备未知的数据格式时,所述发布端设备向所述订阅端设备发布第四简化包,所述第四简化包包括所述第四业务的数据;或者
    当所述第四业务的数据的数据格式为所述订阅端设备已知的数据格式时,所述发布端设备向所述订阅端设备发布所述第四简化包。
  23. 根据权利要求19或20所述的方法,其特征在于,所述发布端设备在所述第二发布基准时刻向所述订阅端设备发布所述第三业务的第一数据,包括:
    当所述订阅端设备为一个时,所述发布端设备通过单播向所述订阅端设备发布所述第三业务的第一数据;或者
    当所述订阅端设备为多个时,所述发布端设备通过组播向多个所述订阅端设备发布所述第三业务的第一数据。
  24. 根据权利要求20所述的方法,其特征在于,所述发布端设备向所述订阅端设备发布所述第四业务的数据,包括:
    当所述订阅端设备为一个时,所述发布端设备通过单播向所述订阅端设备发布所述第四业务的数据;或者
    当所述订阅端设备为多个时,所述发布端设备通过组播向多个所述订阅端设备发布所述第四业务的数据。
  25. 根据权利要求19至24中任一项所述的方法,其特征在于,所述用于指示所述第三业务的第一数据的数据类型的信息包括字符串、整型或浮点;
    所述用于指示所述第四业务的数据的数据类型的信息包括字符串、整型或浮点。
  26. 一种传输数据的方法,其特征在于,包括:
    订阅端设备向发布端设备发送第三订阅消息,所述第三订阅消息用于订阅第三业务,所述订阅端设备包括一个或多个设备;
    所述订阅端设备接收所述发布端设备在第二发布基准时刻发布的所述第三业务的第一数据。
  27. 根据权利要求26所述的方法,其特征在于,在所述订阅端设备向发布端设备发送第三订阅消息之后,所述方法还包括:
    所述订阅端设备向所述发布端设备发送第四订阅消息,所述第四订阅消息用于订阅第四业务;
    所述订阅端设备接收来自所述发布端设备的所述第四业务的数据,所述订阅端设备接收所述第四业务的数据的时刻与所述第二发布基准时刻相差M个第四发布周期,所述第四发布周期为所述第四业务的发布周期,M为大于或等于0的整数。
  28. 根据权利要求26或27所述的方法,其特征在于,所述订阅端设备接收所述发布端设备在第二发布基准时刻发布的所述第三业务的第一数据,包括:
    当所述第三业务的数据的数据格式为所述订阅端设备未知的数据格式时,所述订阅端设备接收所述发布端设备在第二发布基准时刻发布的第三全量包,所述第三全量包包括所述第三业务的第一数据和用于指示第三业务的第一数据的数据格式的信息,所述用于指示第三业务的第一数据的数据格式的信息包括用于指示所述第三业务的第一数据的数据类型的信息和用于指示所述第三业务的第一数据的数据含义的信息;或者
    当所述第三业务的数据的数据格式为所述订阅端设备已知的数据格式时,所述订阅端设备接收所述发布端设备在第二发布基准时刻发布的第三简化包,所述第三简化包包括所述第三业务的第一数据。
  29. 根据权利要求27所述的方法,其特征在于,所述订阅端设备接收来自所述发布端设备的所述第四业务的数据,包括:
    当所述第四业务的数据的数据格式为所述订阅端设备未知的数据格式时,所述订阅端设备接收来自所述发布端设备的第四全量包,所述第四全量包包括所述第四业务的数据和用于指示所述第四业务的数据的数据格式的信息,所述用于指示所述第四业务的数据的数据格式的信息包括用于指示所述第四业务的数据的数据类型的信息和用于指示所述第四业务的书的数据含义的信息;或者
    当所述第四业务的数据的数据格式为所述订阅端设备未知的数据格式时,所述订阅端设备接收来自所述发布端设备的第四简化包,所述第四简化包包括所述第四业务的数据;或者
    当所述第四业务的数据的数据格式为所述订阅端设备已知的数据格式时,所述订阅端设备接收来自所述发布端设备的所述第四简化包。
  30. 根据权利要求26或27所述的方法,其特征在于,所述订阅端设备接收所述发布端设备在第二发布基准时刻发布的所述第三业务的第一数据,包括:
    当所述订阅端设备为一个时,所述订阅端设备接收所述发布端设备通过单播发布的所述第三业务的第一数据;或者
    当所述订阅端设备为多个时,所述订阅端设备接收所述发布端设备通过组播发布的所述第三业务的第一数据。
  31. 根据权利要求27所述的方法,其特征在于,所述订阅端设备接收来自所述发布端设备的所述第四业务的数据,包括:
    当所述订阅端设备为一个时,所述订阅端设备接收所述发布端设备通过单播发布的所述第四业务的数据;或者
    当所述订阅端设备为多个时,所述订阅端设备接收所述发布端设备通过组播发布的所述第四业务的数据。
  32. 根据权利要求26至31中任一项所述的方法,其特征在于,所述用于指示所述第三业务的第一数据的数据类型的信息包括字符串、整型或浮点;
    所述用于指示所述第四业务的数据的数据类型的信息包括字符串、整型或浮点。
  33. 一种传输数据的装置,其特征在于,包括用于执行如权利要求1至9中任一项或执行如权利要求19至25中任一项所述方法的模块。
  34. 一种传输数据的装置,其特征在于,包括用于执行如权利要求10至18中任一项或执行如权利要求26至32中任一项所述方法的模块。
  35. 一种通信装置,其特征在于,包括:与存储器耦合的处理器,所述存储器用于存储计算机程序,所述处理器用于运行所述计算机程序,使得所述通信装置执行如权利要求1至9、19至25中任一项所述的方法。
  36. 一种通信装置,其特征在于,包括:与存储器耦合的处理器,所述存储器用于存储计算机程序,所述处理器用于运行所述计算机程序,使得所述通信装置执行如权利要求10至18、26至32中任一项所述的方法。
  37. 根据权利要求35或36所述的通信装置,其特征在于,所述通信装置还包括所述存储器和收发器中的一项或多项,所述收发器用于接收信号和/或发送信号。
  38. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序或指令,当所述计算机程序或指令在计算机上运行时,使得如权利要求1至9、10至18、19至25、26至32中任一项所述的方法被执行。
  39. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序或指令,当所述计算机程序或指令在计算机上运行时,使得如权利要求1至9、10至18、19至25、26至32中任一项所述的方法被执行。
PCT/CN2023/096274 2022-05-30 2023-05-25 传输数据的方法和装置 WO2023231892A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210601368.8A CN117201623A (zh) 2022-05-30 2022-05-30 传输数据的方法和装置
CN202210601368.8 2022-05-30

Publications (1)

Publication Number Publication Date
WO2023231892A1 true WO2023231892A1 (zh) 2023-12-07

Family

ID=88994760

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/096274 WO2023231892A1 (zh) 2022-05-30 2023-05-25 传输数据的方法和装置

Country Status (2)

Country Link
CN (1) CN117201623A (zh)
WO (1) WO2023231892A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599895A (zh) * 2008-06-04 2009-12-09 华为技术有限公司 数据处理方法及宽带网络网关、策略控制器装置和接入节点设备
WO2017028062A1 (zh) * 2015-08-14 2017-02-23 郭子明 基于时间开通频道时的信息提示方法
WO2017028061A1 (zh) * 2015-08-14 2017-02-23 郭子明 基于时间开通频道的方法
KR20170036634A (ko) * 2015-09-23 2017-04-03 주식회사 케이티 M2m 시스템에서 구독 데이터를 제공하기 위한 방법 및 장치
CN109525625A (zh) * 2017-09-20 2019-03-26 华为技术有限公司 一种信息订阅方法及装置
US20190268808A1 (en) * 2018-02-27 2019-08-29 Verizon Patent And Licensing Inc. Method and system for carrier-initiated traffic tuning and communication of subscriber parameters
CN114598567A (zh) * 2022-03-03 2022-06-07 深圳市元征科技股份有限公司 通信方法、设备及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599895A (zh) * 2008-06-04 2009-12-09 华为技术有限公司 数据处理方法及宽带网络网关、策略控制器装置和接入节点设备
WO2017028062A1 (zh) * 2015-08-14 2017-02-23 郭子明 基于时间开通频道时的信息提示方法
WO2017028061A1 (zh) * 2015-08-14 2017-02-23 郭子明 基于时间开通频道的方法
KR20170036634A (ko) * 2015-09-23 2017-04-03 주식회사 케이티 M2m 시스템에서 구독 데이터를 제공하기 위한 방법 및 장치
CN109525625A (zh) * 2017-09-20 2019-03-26 华为技术有限公司 一种信息订阅方法及装置
US20190268808A1 (en) * 2018-02-27 2019-08-29 Verizon Patent And Licensing Inc. Method and system for carrier-initiated traffic tuning and communication of subscriber parameters
CN114598567A (zh) * 2022-03-03 2022-06-07 深圳市元征科技股份有限公司 通信方法、设备及存储介质

Also Published As

Publication number Publication date
CN117201623A (zh) 2023-12-08

Similar Documents

Publication Publication Date Title
US11677812B2 (en) Lightweight IoT information model
JP5703416B2 (ja) パーソナルエリアネットワーク(pan)のワイヤレス技術を使用したマルチキャストを実装するためのシステムおよび方法
WO2023097870A1 (zh) 一种无线通信人工智能处理方法和设备
JP7163995B2 (ja) 通信装置、通信方法、及びプログラム
TW202106072A (zh) 路由器的ssid獲取方法、裝置、設備和系統
CN109996325B (zh) 一种无线传感器网络的时钟同步系统及方法
WO2017092394A1 (zh) 数据传输方法及装置
TW202021405A (zh) 基於藍牙廣播進行數據傳輸的方法、裝置及藍牙設備
US10070273B2 (en) Multicast group management technique
WO2016206195A1 (zh) 一种信息处理方法、终端、系统及计算机存储介质
CN110557321B (zh) 一种信息传输方法、网络设备及终端
CN112583822B (zh) 通信设备及通信方法
WO2023231892A1 (zh) 传输数据的方法和装置
US10440543B2 (en) Blue-tooth communication system and broadcasting method thereof
CN113518333A (zh) 数据透传方法、装置、蓝牙装置和ble芯片
US20230308926A1 (en) Method and apparatus for obtaining and sending physical layer measurement data
WO2023051082A1 (zh) 基于无线网络Wi-Fi的数据传输方法及电子设备
WO2022078183A1 (zh) 用于确定传输时延的方法和电子设备
WO2022057454A1 (zh) 距离差确定方法、数据帧传输方法及相关产品
WO2021062778A1 (zh) 一种数据传输方法以及相关设备
WO2023011261A1 (zh) 数据传输方法和装置
TW201943240A (zh) 提升智慧電錶至伺服器間效能的方法及裝置
CN113556399B (zh) 消息推送装置、系统、方法、电子设备、存储介质
WO2023016285A1 (zh) 通信方法及装置
WO2023197223A1 (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: 23815075

Country of ref document: EP

Kind code of ref document: A1