[go: up one dir, main page]

WO2024092379A1 - Data transmission method and apparatus, device, and storage medium - Google Patents

Data transmission method and apparatus, device, and storage medium Download PDF

Info

Publication number
WO2024092379A1
WO2024092379A1 PCT/CN2022/128501 CN2022128501W WO2024092379A1 WO 2024092379 A1 WO2024092379 A1 WO 2024092379A1 CN 2022128501 W CN2022128501 W CN 2022128501W WO 2024092379 A1 WO2024092379 A1 WO 2024092379A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
subscription
reporting
time field
interval time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/128501
Other languages
French (fr)
Chinese (zh)
Inventor
包永明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202280097885.4A priority Critical patent/CN119487803A/en
Priority to PCT/CN2022/128501 priority patent/WO2024092379A1/en
Publication of WO2024092379A1 publication Critical patent/WO2024092379A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L27/00Modulated-carrier systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/18Processing of user or subscriber data, e.g. subscribed services, user preferences or user profiles; Transfer of user or subscriber data

Definitions

  • the present application relates to the field of communication technology, and in particular to a data transmission method, device, equipment and storage medium.
  • the subscribing device can initiate a subscription request to the subscribed device and wait for the subscription response from the subscribed device to activate or cancel the subscription. After activating the subscription, the subscribed device needs to report the subscription data to the subscribing device.
  • the timing of reporting subscription data is limited according to the subscription request and subscription response.
  • the minimum interval for reporting subscription data is requested by the subscribing device, and the maximum interval for reporting subscription data is negotiated and determined by the subscribing device and the subscribed device.
  • the subscribed device will report subscription data at a fixed frequency within the minimum interval and the maximum interval.
  • the subscription device will automatically cancel the subscription; if the subscription device wants to obtain the subscription data again, it needs to re-initiate the subscription. Based on the above subscription data reporting method, on the one hand, it may lead to invalid reporting of the subscribed device (for example, the subscription device does not need to obtain the subscription data at a certain moment), and on the other hand, it will also lead to multiple repeated subscription requests for the same subscription data, which makes the reporting efficiency of subscription data low.
  • the embodiments of the present application provide a data transmission method, apparatus, device and storage medium, which provide at least two reporting modes for subscription data to improve the reporting efficiency of subscription data.
  • the technical solution is as follows:
  • a data transmission method is provided, the method being executed by a subscribed device, the method comprising:
  • reporting mode There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • a data transmission method is provided, the method being executed by a subscription device, the method comprising:
  • reporting mode There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • a data transmission device comprising:
  • Reporting module used to report subscription data to the subscription device
  • reporting mode There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • a data transmission device comprising:
  • a receiving module used to receive subscription data reported by the subscribed device
  • reporting mode There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • a subscribed device which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data transmission method as described above.
  • a subscription device which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data transmission method as described above.
  • a computer-readable storage medium in which a computer program is stored.
  • the computer program is used to be executed by a processor to implement the data transmission method as described above.
  • a chip which includes a programmable logic circuit and/or program instructions, and is used to implement the data transmission method as described above when an electronic device equipped with the chip is running.
  • a computer program product includes computer instructions.
  • the computer instructions are stored in a computer-readable storage medium.
  • a processor reads and executes the computer instructions from the computer-readable storage medium to implement the data transmission method as described above.
  • At least two reporting modes are provided for subscription data, thereby providing multiple options for the subscribed device, so as to improve the reporting efficiency of subscription data and meet different subscription requirements of both parties regarding subscription data.
  • the reporting mode of subscription data is determined at least according to the minimum time interval field carried in the subscription request, such as the reporting mode is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request, so as to avoid the negotiation process between the subscribing device and the subscribed device regarding the maximum time interval of subscription data.
  • FIG1 is a schematic diagram of a subscription process provided by an exemplary embodiment of the present application.
  • FIG2 is a schematic diagram of a data model of a terminal provided by an exemplary embodiment of the present application.
  • FIG3 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG4 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG5 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG6 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG7 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG8 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG9 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • FIG10 is a schematic diagram of a subscription request apparatus provided by an exemplary embodiment of the present application.
  • FIG11 is a schematic diagram of a subscription request apparatus provided by an exemplary embodiment of the present application.
  • FIG. 12 is a block diagram of a communication device provided by an exemplary embodiment of the present application.
  • GSM Global System of Mobile communication
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • GPRS General Packet Radio Service
  • LTE Long Term Evolution
  • LTE-A Advanced Long Term Evolution
  • NR New Radio
  • LTE-based access to unlicensed spectrum (LTE-U) systems LTE-based access to unlicensed spectrum (LTE-U) systems
  • NR-based access to unlicensed spectrum (NR-U) systems NTN-based access to unlicensed spectrum (NR-U) systems
  • NTN non-terrestrial communication networks
  • UMTS universal mobile telecommunication systems
  • WLAN wireless local area networks
  • WiFi wireless fidelity
  • 5G fifth-generation communication
  • IoT Internet of Things
  • the IoT communication system includes multiple terminals (or devices), and information exchange and communication can be achieved between every two terminals.
  • the terminal may also be referred to as User Equipment (UE).
  • the terminal may be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a next-generation communication system such as an NR network, or a terminal device in a future-evolved Public Land Mobile Network (PLMN) network, etc.
  • PLMN Public Land Mobile Network
  • the terminal can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted; it can also be deployed on the water surface (such as ships, etc.); it can also be deployed in the air (for example, on airplanes, balloons and satellites, etc.).
  • the terminal may be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self-driving, a wireless terminal device in remote medical, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, or a wireless terminal device in a smart home, etc.
  • VR virtual reality
  • AR augmented reality
  • the terminal may also be a wearable device.
  • Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction.
  • wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.
  • the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship.
  • a indicates B which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.
  • corresponding may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship of indication and being indicated, configuration and being configured, etc.
  • pre-definition can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including subscribing devices and subscribed devices), and the present application does not limit the specific implementation method.
  • pre-definition can refer to what is defined in the protocol.
  • FIG. 1 is a schematic diagram of a subscription process provided by an exemplary embodiment of the present application.
  • the subscribing device can initiate a subscription request to the subscribed device and wait for the subscription response from the subscribed device to activate or cancel the subscription.
  • the subscription process includes the following steps:
  • Step 1 The subscription initiator initiates a subscription request to the subscription responder.
  • the subscription request is used to request the subscription responder to subscribe to the target resource
  • the target resource may specifically include attributes and/or events
  • the requested attributes and/or events may be one or more.
  • the subscription request carries at least one field, and the at least one field is used to indicate the resource information of this subscription.
  • the minimum interval time (MinIntervalFloor) field is used to indicate the lower limit (lowest) minimum interval value of the request. It can also be understood that the value of the minimum interval time field is used to indicate the boundary value of the minimum reporting time interval of the request, and the boundary value is in seconds (s). According to this field, when the subscription responder needs to report multiple data, if the reporting time interval defined by the subscription responder for multiple data is less than the minimum interval time, the multiple data will be cached and reported once after the minimum interval time is reached.
  • the MaxIntervalCeil field is used to indicate the upper limit (highest) maximum interval value of the request. It can also be understood that the value of the MaxInterval field is used to indicate the boundary value of the maximum reporting timeout of the request, which is in seconds (s). According to this field, the subscription responder should report data at least once within a time that does not exceed the boundary value.
  • the AttributeRequests field is used to indicate a list of zero or more request paths for cluster attribute data.
  • the cluster optionally includes two roles: the client and the server. The client belongs to the control end, and the server belongs to the controlled end.
  • the DataVersionFilters field is used to indicate a list of zero or more cluster instance data versions.
  • the DataVersionFilters field is optional when the attribute request list exists. If the data version (DataVersion) of the data reported twice is the same, only the DataVersion is reported the second time, and the attribute value does not need to be reported.
  • the EventRequests field is used to indicate a list of zero or more request paths for cluster events.
  • the EventFilters field is used to indicate a list of zero or more minimum event numbers for each specific node, which can also be understood as the filtering conditions for requesting event reporting.
  • the data read from the FabricScope list is limited to the accessed FabricDomain.
  • the subscription process is based on the Matter protocol.
  • the Matter protocol also known as Project Connected Home over IP
  • Project Connected Home over IP is an open source standard project for smart homes that aims to develop and promote a new connection protocol to simplify the development costs of smart home device vendors and improve the compatibility between smart home products from different manufacturers.
  • the Matter protocol will support communication between smart home devices, mobile applications, and cloud services, defining a specific set of Internet Protocol-based network technologies for devices.
  • Node represents a device node and belongs to a logical device
  • Endpoint A node contains multiple endpoints, each of which represents a service instance or a virtual device.
  • the device type corresponding to the endpoint can be indicated by device_type;
  • Cluster An endpoint contains multiple clusters. Clusters are elements for building a functional set. Clusters can optionally include two roles: user side and service side. The user side belongs to the control side, and the service side belongs to the controlled side.
  • a cluster contains 0 or more attributes, which are used to describe the functional units in the functional set;
  • a cluster contains 0 or more commands, which are used to describe the control of functional units
  • Event A cluster contains 0 or more events. Events are used to describe the records of specific behaviors that have occurred in the past of a functional unit.
  • the data model of the device is described as follows.
  • the device type of the root node (RootNode) of the car device is stored under Endpoint 0 (Endpoint0), and the air conditioning device type of the car device is stored under Endpoint 5 (Endpoint5).
  • the clusters included in endpoint 5 include a temperature control cluster and a fan cluster.
  • the attributes included in the temperature control cluster may optionally include temperature attribute values
  • the commands included in the temperature control cluster may optionally include temperature increase commands and temperature decrease commands
  • the events included in the temperature control cluster may optionally include temperature abnormality alarm events.
  • the attribute request field can be expressed as follows: AttributeRequests[endpoint-id/cluster-id/attribute-id, endpoint-id/cluster-id/attribute-id,...];
  • the event request field can be expressed as follows: EventRequests[endpoint-id/cluster-id/event-id, endpoint-id/cluster-id/event-id,...].
  • Step 2 The subscription responder sends the first data report to the subscription initiator.
  • the subscription responder After receiving the subscription request initiated by the subscription initiator, the subscription responder needs to report the data once.
  • the subscription responder may report the resource information to be subscribed according to the attribute request field and the event request field carried in the subscription request.
  • Step 3 The subscription initiator reports the success or failure status to the subscription responder.
  • step 3 can be implemented as follows: the subscription initiator sends a success status message to the subscription responder.
  • Step 4 The subscription responder confirms whether to return a subscription response based on the status information returned by the subscription initiator.
  • the subscription responder can determine whether to return a subscription response to the subscription initiator based on the received status information.
  • the subscription responder determines that a subscription response needs to be returned to the subscription initiator and generates parameter data of the subscription response.
  • Step 5 After receiving the success status sent by the subscription initiator, the subscription responder returns the subscription response.
  • the subscription responder sends the generated parameter data to the subscription initiator via a subscription response message.
  • the parameter fields carried in the subscription response are shown in Table 2:
  • the Subscription ID field is used to identify a subscription.
  • the Subscription ID field is generated based on a subscription request sent by a subscription initiator to a subscription responder.
  • the MaxInterval field is used to indicate the maximum time interval finally determined by the subscription initiator and the subscription responder after negotiation. It can also be understood that the value of the MaxInterval field is used to indicate the boundary value of the negotiated maximum reporting timeout, which is in seconds (s). According to this field, the subscription responder should make the second data report within a time not exceeding the boundary value.
  • Step 6 The subscription responder sends a second data report to the subscription initiator.
  • the subscription responder after confirming the subscription response is returned to the subscription initiator, the subscription responder sends a second data report to the subscription initiator.
  • the second data report should be completed within a time not exceeding the boundary value indicated by the maximum interval field.
  • Step 7 The subscription initiator sends a status response to the subscription responder.
  • the subscription initiator will return a status response to the subscription responder to achieve the purpose of keeping the subscription connection alive.
  • the reporting time of the second data report needs to be determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response.
  • the maximum time interval for the second data report is determined by negotiation between the subscription initiator and the subscription responder, and shall not exceed the maximum value of 60 minutes and the duration indicated by the maximum interval field carried in the subscription request. For example, if the duration indicated by the maximum interval field is 120 minutes, the negotiated maximum time interval shall not exceed 120 minutes; for another example, if the duration indicated by the maximum interval field is 30 minutes, the negotiated maximum time interval shall not exceed 60 minutes.
  • the subscription responder will report data at a fixed frequency within the maximum interval and the maximum interval. If the report information is not received within the maximum interval, the subscription initiator will automatically cancel the subscription. Exemplarily, the subscription initiator sends a subscription request to the subscription responder, and the keep subscription field carried in the subscription request is false, thereby canceling the subscription.
  • the subscription initiator wishes to obtain the reported information again, it needs to re-initiate the subscription request.
  • invalid reporting may be caused by the subscription responder, such as the subscription initiator does not need to obtain the subscription data at a certain moment.
  • the subscription initiator may be some special subscription requirements of the subscription initiator, and the reporting method of reporting data at a fixed frequency in the related technology cannot meet its needs. For example, the subscription initiator only hopes to obtain the reported data when the subscription data changes, thereby reducing the frequency of data reporting and reducing the power consumption of both parties.
  • the subscription responder if the subscription responder is unable to report data within the maximum interval, or the subscription initiator fails to receive the reported data within the maximum time interval due to any reason, the subscription will be cancelled, resulting in multiple repeated subscription requests for the same subscription data, which will also make the reporting efficiency of subscription data low.
  • An embodiment of the present application provides a data transmission method, wherein the subscription data involved can also be understood as the second data reporting performed by the subscription responder in FIG. 1 to the subscription initiator.
  • FIG3 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. The method is executed by a subscribed device and includes the following steps:
  • Step 102 Report subscription data to the subscription device.
  • reporting mode there are at least two reporting modes corresponding to subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • the subscription data is data corresponding to the subscription relationship established between the subscribing device and the subscribed device. Referring to the above content, before executing step 102, a subscription process needs to be performed between the subscribing device and the subscribed device.
  • the subscribing device sends a subscription request to the subscribed device, the subscription request is used to request a new subscription relationship; the subscribed device sends a subscription response to the subscribing device, the subscription response is used to inform the subscribing device that the subscription relationship indicated by the subscription request has been established.
  • the subscription data is the data corresponding to the subscription relationship indicated in the above subscription request and subscription response.
  • the subscribed device can report subscription data to the subscribing device.
  • the reporting methods for subscription data include the following:
  • the subscribed device reports the subscription data only when the state of the subscribed attribute and/or event changes.
  • the subscribed device is an induction lamp
  • the subscribing device is a mobile terminal
  • the subscribed attribute is a switch attribute.
  • the induction lamp lights up when a person passes by and turns off after the person leaves for a period of time.
  • the induction lamp reports the subscription data to the mobile terminal only when the lamp lights up or turns off.
  • the subscribed device does not need to report at a fixed frequency, and the subscribing device does not need to subscribe to the same subscription data multiple times, which will reduce the reporting frequency of subscription data, avoid invalid reporting of subscription data, and thus improve the reporting efficiency of subscription data.
  • the specified duration may be determined according to a minimum interval field carried in a subscription request, or according to a maximum interval field carried in a subscription request, or according to a maximum interval field carried in a subscription response corresponding to the subscription request.
  • the subscription data is reported after a first time interval, and the first time interval is determined according to the minimum time interval field. In other embodiments, the subscription data is reported after a second time interval, and the second time interval is determined according to the maximum time interval field carried in the subscription request, or the second time interval is determined according to the maximum time interval field carried in the subscription response corresponding to the subscription request.
  • the reporting method of subscription data is determined at least according to the minimum interval field carried in the subscription request.
  • the reporting method is determined according to the minimum interval field and the maximum interval field carried in the subscription request; or, the reporting method is determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the two subscribers when determining the subscription relationship, can determine the specific reporting method of the subscription data according to the subscription request, or according to the values of the fields in the subscription request and the subscription response. That is, the two subscribers can determine the reporting method based only on the subscription request, or the two subscribers can determine the reporting method based on the subscription request and the subscription response. These two determination methods will be described in detail later, and are omitted here.
  • the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.
  • the first value is 0 and the second value is 0 ⁇ FFFF.
  • the subscribing device sends a subscription request to the subscribed device, and the subscription request carries a minimum interval field and a maximum interval field.
  • the minimum interval field is assumed to be the first value and the maximum interval field is assumed to be the second value.
  • the subscribed device reports subscription data when the status of the attributes and/or events subscribed by the subscribing device changes;
  • the subscribed device reports the subscription data at the frequency set by MinIntervalFloor; if the subscription data is not reported within the set MaxIntervalCeil or MinIntervalFloor time, the subscribing device can wait for the subscribed device to report the subscription data when the status of the subscribed attributes and/or events changes;
  • the subscribed device only needs to report the subscription data within the MaxInterval time range. If the subscribed device does not report the subscription data or the subscribing device does not receive the subscription data after MaxIntervalCeil or MaxInterval time, the subscribing device automatically cancels the subscription;
  • the subscribed device reports the subscription data at the frequency set by MinIntervalFloor; if the subscribed device does not report the subscription data or the subscribing device does not receive the subscription data within the set MinIntervalFloor time, and the subscribed device does not report the subscription data or the subscribing device does not receive the subscription data beyond the time defined by MaxIntervalCeil, the subscribing device automatically cancels the subscription.
  • the reporting method of subscription data is determined at least according to the minimum time interval field carried in the subscription request, such as the reporting method is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request, so as to avoid the negotiation process between the subscribing device and the subscribed device regarding the maximum time interval of the subscription data.
  • FIG4 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • the method is executed by a subscription device and includes the following steps:
  • Step 202 Receive subscription data reported by the subscribed device.
  • reporting mode there are at least two reporting modes corresponding to subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • the subscription data is data corresponding to the subscription relationship established between the subscribing device and the subscribed device. Schematically, before executing step 202, a subscription process needs to be performed between the subscribing device and the subscribed device. The specific description can refer to the above content and will not be repeated here.
  • the subscription data may be reported in the following ways: reporting when the state of the attribute and/or event subscribed by the subscribing device changes; reporting at intervals of a specified duration.
  • the specified duration may be determined based on the minimum interval field carried in the subscription request, or based on the maximum interval field carried in the subscription request, or based on the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the reporting method of subscription data is determined at least according to the minimum interval field carried in the subscription request.
  • the reporting method is determined according to the minimum interval field and the maximum interval field carried in the subscription request; or, the reporting method is determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the two subscribers when determining the subscription relationship, can determine the specific reporting method of the subscription data according to the subscription request, or according to the values of the fields in the subscription request and the subscription response. That is, the two subscribers can determine the reporting method based only on the subscription request, or the two subscribers can determine the reporting method based on the subscription request and the subscription response. These two determination methods will be described in detail later, and are omitted here.
  • the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.
  • the first value is 0 and the second value is 0 ⁇ FFFF.
  • the subscribing device sends a subscription request to the subscribed device, and the subscription request carries a minimum interval field and a maximum interval field.
  • the minimum interval field is assumed to be the first value and the maximum interval field is assumed to be the second value.
  • the reporting method of subscription data is determined at least according to the minimum time interval field carried in the subscription request, such as the reporting method is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request, so as to avoid the negotiation process between the subscribing device and the subscribed device regarding the maximum time interval of the subscription data.
  • FIG. 5 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • the subscription data is the data corresponding to the subscription relationship established between the subscribing device and the subscribed device. Based on this, in order to realize the transmission of subscription data, the subscribing device and the subscribed device need to first perform the subscription process to clarify the subscription attributes and/or events, so that the subscribed device can report the subscription data based on the established subscription relationship.
  • the subscription process between the subscribing device and the subscribed device includes the following:
  • the subscribing device sends a subscription request to the subscribed device, where the subscription request is used to request a new subscription relationship; the subscribed device sends a subscription response to the subscribing device, where the subscription response is used to inform the subscribing device that the subscription relationship indicated by the subscription request has been established.
  • the subscribed device may report the data corresponding to the subscription relationship according to the reporting method determined in the at least two reporting methods.
  • the data transmission method provided in the embodiment of the present application includes the following steps:
  • Step 302 The subscribed device reports subscription data to the subscribing device.
  • reporting mode there are at least two reporting modes corresponding to subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • the subscription data may be reported in the following ways: reporting when the state of the attribute and/or event subscribed by the subscribing device changes; reporting at intervals of a specified duration.
  • the reporting method of subscription data is determined at least according to the minimum interval field carried in the subscription request.
  • the reporting method is determined according to the minimum interval field and the maximum interval field carried in the subscription request; or, the reporting method is determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the two subscribers when determining the subscription relationship, can determine the specific reporting method of the subscription data according to the subscription request, or according to the values of the fields in the subscription request and the subscription response. That is, the two subscribers can determine the reporting method based only on the subscription request, or the two subscribers can determine the reporting method based on the subscription request and the subscription response, which will be described in detail after the embodiments of this application.
  • the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.
  • the first value is 0 and the second value is 0 ⁇ FFFF.
  • a subscribing device sends a subscription request to a subscribed device, and the subscription request carries a minimum interval field and a maximum interval field. If no specific values are assigned to these two fields, the minimum interval field is assumed to be the first value, and the maximum interval field is assumed to be the second value.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • At least two reporting methods are provided for subscription data, thereby providing multiple options for the subscribed device to improve the reporting efficiency of subscription data and meet the different subscription requirements of the subscribers regarding subscription data.
  • the reporting method of the subscription data is determined at least according to the minimum time interval field carried in the subscription request.
  • the reporting method is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request; or, the reporting method is determined according to the minimum time interval field carried in the subscription request and the maximum time interval field carried in the subscription response corresponding to the subscription request.
  • the subscribers can determine the reporting method based only on the subscription request, or the subscribers can determine the reporting method based on the subscription request and the subscription response, as follows:
  • the subscribers determine the reporting method based on the subscription request.
  • the data transmission method provided in the embodiment of the present application further includes:
  • the subscribing device sends a subscription request to the subscribed device.
  • the subscription request carries a minimum interval time field and a maximum interval time field.
  • the reporting method of the subscription data is determined according to the minimum interval time field and the maximum interval time field.
  • the subscription request may also specify that the minimum interval time field is the first value and the maximum interval time field is the second value.
  • the reporting method is still determined as: reporting when the status of the attributes and/or events subscribed by the subscribing device changes.
  • the minimum interval time field is the third value
  • the maximum interval time field is the second value.
  • MinIntervalFloor! 0
  • MaxIntervalCeil 0 ⁇ FFFF
  • the reporting method is determined as: reporting after the first interval, and the first interval is indicated by the third value.
  • the reporting method also includes: in the case where the subscription data is not reported after the first time interval, reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. That is, if the subscription data is not reported after the first time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device can continue to wait, and the reporting of the subscription data by the subscribed device will change from reporting after the first time interval (fixed interval reporting) to reporting when the state of the subscribed attribute and/or event changes (non-fixed interval reporting).
  • the minimum interval time field is the first value
  • the maximum interval time field is the fourth value.
  • the reporting method is determined as: reporting after the second interval, and the second interval is indicated by the fourth value.
  • the subscribing device may automatically cancel the subscription.
  • the subscribing device sends a first indication message to the subscribed device, and the first indication message is used to instruct the subscribing device to cancel the subscription of the subscription data of the subscribed device.
  • the minimum interval time field is the fifth value
  • the maximum interval time field is the sixth value.
  • the reporting method is determined as: reporting after the third interval, and the third duration is indicated by the fifth value.
  • the subscribing device may automatically cancel the subscription.
  • the fourth time interval is indicated by the sixth value.
  • the subscribing device sends a second indication message to the subscribed device, and the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data.
  • the subscription response sent by the subscribed device to the subscribing device may not carry the maximum interval field; or, the maximum interval field carried in the subscription response does not limit the reporting method.
  • the subscribers determine the reporting method based on the subscription request and subscription response.
  • the data transmission method provided in the embodiment of the present application further includes:
  • the subscribing device sends a subscription request to the subscribed device, and the subscription request carries a minimum interval time field and a maximum interval time field;
  • the subscribed device sends a subscription response to the subscribing device, and the subscription response carries a maximum interval field;
  • the reporting method of the subscription data is determined according to the minimum interval time field and the maximum interval field.
  • the minimum interval time field is the third value
  • the maximum interval field is the second value.
  • MinIntervalFloor! 0
  • MaxInterval 0 ⁇ FFFF
  • the reporting method is determined as: reporting after the first interval, and the first interval is indicated by the third value.
  • the reporting method also includes: in the case where the subscription data is not reported after the first time interval, reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. That is, if the subscription data is not reported after the first time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device can continue to wait, and the reporting of the subscription data by the subscribed device will change from reporting after the first time interval (fixed interval reporting) to reporting when the state of the subscribed attribute and/or event changes (non-fixed interval reporting).
  • the minimum interval time field is the first value
  • the maximum interval field is the fourth value.
  • the reporting method is determined as: reporting after the second interval, and the second interval is indicated by the fourth value.
  • the subscribing device may automatically cancel the subscription.
  • the subscribing device sends a first indication message to the subscribed device, and the first indication message is used to instruct the subscribing device to cancel the subscription of the subscription data of the subscribed device.
  • the methods for reporting subscription data include: reporting when the status of the attributes and/or events subscribed by the subscribing device changes; reporting at intervals of a specified duration.
  • Implementation method 1 Report when the status of the attributes and/or events subscribed by the subscribing device changes.
  • FIG6 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • Step 302 can be implemented as step 3021, which is as follows:
  • Step 3021 The subscribed device reports subscription data to the subscribing device.
  • the method of reporting subscription data includes: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.
  • the reporting method is determined according to the first value and the second value
  • the first value is the value of the minimum interval time field
  • the second value is the value of the maximum interval time field carried in the subscription request
  • the first value is the value of the minimum interval time field
  • the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the first value is 0, and the second value is 0 ⁇ FFFF.
  • the first value and the second value may be default values, or may be assigned by the subscribing device or the subscribed device.
  • the reporting mode is determined as: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.
  • the reporting mode of subscription data can be set to report only when the subscribed attributes and/or event status changes, that is, the subscribed device only reports when the subscription data changes.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the reporting method of the subscription data can be determined as: reporting when the state of the attribute and/or event subscribed by the subscribing device changes. Based on this, the subscribed device does not need to report data according to a fixed frequency, thereby avoiding invalid reporting of data, reducing the reporting frequency of subscription data, and improving data reporting efficiency.
  • Implementation method 2 reporting after a first period of time.
  • FIG. 7 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • Step 302 can be implemented as step 3022, which is as follows:
  • Step 3022 The subscribed device reports subscription data to the subscribing device.
  • the reporting method of the subscription data includes: reporting after a first time interval, and the first time interval is determined according to the minimum interval time field carried in the subscription request.
  • the reporting method is determined according to a third value and a second value, and the third value is used to indicate the first duration; wherein the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the second value is 0 ⁇ FFFF.
  • the second value may be a default value or may be assigned by the subscribing device or the subscribed device.
  • MinIntervalFloor! 0 can be understood as the value of the minimum interval time field being any value not equal to 0.
  • the reporting method is determined as: reporting after the first interval, and the first interval is indicated by the third value.
  • the reporting method further includes: in the case where no subscription data is reported after a first period of time, reporting is performed when a state of an attribute and/or event subscribed by the subscribing device changes.
  • the subscribing device may continue to wait, and the subscribed device will report the subscription data from after the first time period (fixed interval reporting) to when the status of the subscribed attributes and/or events changes (non-fixed interval reporting).
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the reporting method of the subscription data can be determined as: reporting after a first time interval; if the subscription data is not reported after the first time interval, the subscribed device reports the subscription data when the status of the attributes and/or events subscribed by the subscribing device changes.
  • the subscribed device can first report data according to a fixed frequency to ensure the transmission of the subscribed data; then, if the subscribed data is not reported after a certain first period of time, the subscribed device can adjust the reporting method to avoid the subscribing device directly canceling the subscription relationship.
  • This reporting method can avoid repeated requests for the same subscribed data while ensuring the transmission of the subscribed data, thereby indirectly improving the reporting efficiency of the subscribed data.
  • Implementation method three reporting after a second period of time.
  • FIG8 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • Step 302 can be implemented as step 3023, which is as follows:
  • Step 3023 The subscribed device reports subscription data to the subscribing device.
  • the reporting method of subscription data includes: reporting after a second time interval, the second time interval is determined according to the maximum interval time field carried in the subscription request, or the second time interval is determined according to the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the reporting method is determined based on the first value and the fourth value, and the fourth value is used to indicate the second duration; wherein the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the first value is 0.
  • the first value may be a default value or may be assigned by the subscribing device or the subscribed device.
  • the reporting method is determined as: reporting after the second interval, and the second interval is indicated by the fourth value.
  • the subscribing device may automatically cancel the subscription to avoid long waiting.
  • the data transmission method provided in the embodiment of the present application further includes:
  • Step 3041 When no subscription data is received after a second period of time, the subscribing device sends first indication information to the subscribed device.
  • the first indication information is used to instruct the subscribing device to cancel the subscription of the subscribed device to the subscription data.
  • the first indication information may be implemented through a subscription request sent by a subscription device. For example, when no subscription data is received after a second interval, the subscription device sends a subscription request to the subscribed device, and the keep subscription field carried in the subscription request is false. Based on the definition of the keep subscription field in the related art, the existing subscription from the subscription device may be terminated, thereby canceling the subscription of the subscription device to the subscribed device regarding the subscription data.
  • the subscribed device may not receive the first indication information, and the subscribed device still reports the subscription data to the subscribing device. Based on this, the data transmission method provided in the embodiment of the present application also includes:
  • Step 305 The subscribing device sends a status code to the subscribed device.
  • the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.
  • a canceled or inactive subscription relationship refers to a subscription relationship that the subscribing device has informed of the need to cancel.
  • a canceled or inactive subscription relationship can be indicated by a special subscription identifier (such as inactive Subscription ID). Based on the status code, the subscribed device can cancel the subscription relationship corresponding to the subscription data, thereby avoiding reporting the subscription data to the subscribing device again.
  • the status code is an INACTIVE_SUBSCRIBE status code.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the reporting method of the subscription data can be determined as: reporting after a second time interval; if the subscription data is not received after the second time interval, the subscribing device sends a first indication information for canceling the subscription to the subscribed device.
  • the time interval for reporting subscription data can be extended, which relatively reduces the reporting frequency of subscription data, thereby avoiding invalid reporting of data and improving the reporting efficiency of subscription data.
  • Implementation method 4 reporting after a third period of time.
  • FIG. 9 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.
  • Step 302 can be implemented as step 3024, which is as follows:
  • Step 3024 The subscribed device reports subscription data to the subscribing device.
  • the reporting method of the subscription data includes: reporting after a third time interval, and the third time interval is determined according to the minimum interval time field carried in the subscription request.
  • the reporting method is determined according to the fifth value and the sixth value, and the fifth value is used to indicate the third duration; wherein the fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request.
  • the fifth value and the sixth value are both different from the first value and the second value, and the fifth value is not equal to the first value, and the sixth value is not equal to the second value.
  • the fifth value may be equal to the third value, and the sixth value may be equal to the fourth value.
  • the first value is 0 and the second value is 0 ⁇ FFFF.
  • the first value and the second value may be default or assigned by the subscribing device or the subscribed device.
  • the reporting method is determined as: reporting after the third interval, and the third interval is indicated by the fifth value.
  • the subscribing device may automatically cancel the subscription.
  • the fourth time interval is indicated by the sixth value.
  • the data transmission method provided in the embodiment of the present application further includes:
  • Step 3042 When no subscription data is received after a fourth period of time, the subscribing device sends second indication information to the subscribed device.
  • the second indication information is used to instruct the subscribing device to cancel the subscription of the subscribed device to the subscription data.
  • the second indication information may be implemented through a subscription request sent by the subscription device. For example, when the subscription data is not received after the fourth time interval, the subscription device sends a subscription request to the subscribed device, and the keep subscription field carried in the subscription request is false. Based on the definition of the keep subscription field in the related art, the existing subscription from the subscription device may be terminated, thereby canceling the subscription of the subscription device to the subscription data of the subscribed device.
  • the subscribed device may not receive the second indication information, and the subscribed device still reports the subscription data to the subscribing device. Based on this, the data transmission method provided in the embodiment of the present application also includes:
  • Step 305 The subscribing device sends a status code to the subscribed device.
  • the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.
  • a canceled or inactive subscription relationship refers to a subscription relationship that the subscribing device has informed of the need to cancel.
  • a canceled or inactive subscription relationship can be indicated by a special subscription identifier (such as inactive Subscription ID). Based on the status code, the subscribed device can cancel the subscription relationship corresponding to the subscription data, thereby avoiding reporting the subscription data to the subscribing device again.
  • the status code is an INACTIVE_SUBSCRIBE status code.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method.
  • the reporting method of the subscription data can be determined as: reporting after a third time interval; if the subscription data is not received after a fourth time interval, the subscribing device sends a second indication message for canceling the subscription to the subscribed device.
  • the time interval for reporting the subscription data can be expanded, and the reporting frequency of the subscription data can be relatively reduced, thereby avoiding invalid reporting of data to improve the reporting efficiency of the subscription data.
  • the negotiation of the maximum interval time between the subscribing device and the subscribed device is omitted, thereby making the determination of the reporting method of the subscription data more simple and clear.
  • the data transmission method provided in the embodiment of the present application can be implemented as follows:
  • the subscribed device after receiving the subscription request sent by the subscribing device, the subscribed device (data publisher) must report data to the subscribing device at a frequency that cannot be lower than MinIntervalFloor (default value 0, unit s) and cannot exceed MaxIntervalCeil or MaxInterval (default value 0xFFFF, unit s).
  • MinIntervalFloor and MaxIntervalCeil Based on this, according to MinIntervalFloor and MaxIntervalCeil, or MinIntervalFloor and MaxInterval, there are several optional reporting methods for subscription data:
  • MinIntervalFloor! 0
  • the subscribing device receives a data report of a canceled or inactive subscription, it sends an INACTIVE_SUBSCRIBE status code to the subscribed device.
  • FIG10 shows a schematic diagram of a subscription request device provided by an exemplary embodiment of the present application, the device comprising:
  • a reporting module 1020 used to report subscription data to a subscription device
  • reporting mode There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • the reporting method is determined according to the following information: the minimum interval time field; the maximum interval time field carried in the subscription request.
  • the reporting method is determined according to the following information: the minimum interval time field; and the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.
  • the reporting method is determined according to a first value and a second value; wherein the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting after a first time interval, and the first time interval is determined according to a minimum interval time field.
  • the reporting method further includes: when no subscription data is reported after a first period of time, when a state of an attribute and/or event subscribed by the subscription device changes, reporting the subscription data to the subscription device.
  • the reporting method is determined according to a third value and a second value, and the third value is used to indicate the first duration; wherein the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting after a second time interval, the second time interval is determined according to the maximum interval time field carried in the subscription request, or the second time interval is determined according to the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the device also includes: a receiving module 1040, used to receive a first indication message sent by a subscribing device; wherein the first indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the first indication message is sent when no subscription data is received after a second time interval.
  • a receiving module 1040 used to receive a first indication message sent by a subscribing device; wherein the first indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the first indication message is sent when no subscription data is received after a second time interval.
  • the reporting method is determined based on the first value and the fourth value, and the fourth value is used to indicate the second duration; wherein the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting after a third time interval, and the third time interval is determined according to the minimum interval time field.
  • the device also includes: a receiving module 1040, used to receive a second indication message sent by the subscribing device; wherein the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the second indication message is sent when no subscription data is received after a fourth time interval, and the fourth time interval is greater than the third time interval.
  • a receiving module 1040 used to receive a second indication message sent by the subscribing device; wherein the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the second indication message is sent when no subscription data is received after a fourth time interval, and the fourth time interval is greater than the third time interval.
  • the reporting method is determined according to the fifth value and the sixth value, and the fifth value is used to indicate the third duration; wherein the fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request.
  • the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.
  • the apparatus further includes: a receiving module 1040, configured to receive a status code sent by a subscription device; wherein the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.
  • a receiving module 1040 configured to receive a status code sent by a subscription device; wherein the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.
  • FIG11 shows a schematic diagram of a subscription request device provided by an exemplary embodiment of the present application, the device comprising:
  • the receiving module 1120 is used to receive subscription data reported by the subscribed device
  • reporting mode There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.
  • the reporting method is determined according to the following information: the minimum interval time field; the maximum interval time field carried in the subscription request.
  • the reporting method is determined according to the following information: the minimum interval time field; and the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.
  • the reporting method is determined according to a first value and a second value; wherein the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting after a first time interval, the first time interval is determined according to the minimum interval time field; or, if no subscription data is reported after the first time interval, reporting is performed when the status of the attributes and/or events subscribed by the subscribing device changes.
  • the reporting method is determined according to a third value and a second value, and the third value is used to indicate the first duration; wherein the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting after a second time interval, the second time interval is determined according to the maximum interval time field carried in the subscription request, or the second time interval is determined according to the maximum interval field carried in the subscription response corresponding to the subscription request.
  • the apparatus further includes: a sending module 1140, configured to send a first indication message to the subscribed device when no subscription data is received after a second time interval; wherein the first indication message is used to indicate cancellation of the subscription of the subscribing device to the subscription data of the subscribed device.
  • a sending module 1140 configured to send a first indication message to the subscribed device when no subscription data is received after a second time interval; wherein the first indication message is used to indicate cancellation of the subscription of the subscribing device to the subscription data of the subscribed device.
  • the reporting method is determined based on the first value and the fourth value, and the fourth value is used to indicate the second duration; wherein the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.
  • the reporting method includes: reporting after a third time interval, and the third time interval is determined according to the minimum interval time field.
  • the device also includes: a sending module 1140, used to send a second indication message to the subscribing device when no subscription data is received after a fourth time interval; wherein the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the fourth time interval is greater than the third time interval.
  • a sending module 1140 used to send a second indication message to the subscribing device when no subscription data is received after a fourth time interval; wherein the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the fourth time interval is greater than the third time interval.
  • the reporting method is determined according to the fifth value and the sixth value, and the fifth value is used to indicate the third duration; wherein the fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request.
  • the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.
  • the apparatus further includes: a sending module 1140, configured to send a status code to the subscribed device; wherein the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.
  • a sending module 1140 configured to send a status code to the subscribed device; wherein the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.
  • FIG12 shows a schematic diagram of the structure of a communication device (subscribing device or subscribed device) provided by an exemplary embodiment of the present application.
  • the communication device includes: a processor 1201 , a receiver 1202 , a transmitter 1203 , a memory 1204 and a bus 1205 .
  • the processor 1201 includes one or more processing cores.
  • the processor 1201 executes various functional applications and information processing by running software programs and modules.
  • the receiver 1202 and the transmitter 1203 may be implemented as a communication component, which may be a communication chip.
  • the memory 1204 is connected to the processor 1201 via a bus 1205 .
  • the memory 1204 may be used to store at least one instruction, and the processor 1201 may be used to execute the at least one instruction to implement each step of the data transmission method mentioned in the above method embodiment.
  • memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof.
  • Volatile or non-volatile storage devices include but are not limited to: magnetic disks or optical disks, electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, and programmable read-only memory (PROM).
  • the present application also provides a subscribed device, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the aforementioned data transmission method.
  • the present application also provides a subscription device, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the aforementioned data transmission method.
  • the present application also provides a computer-readable storage medium, in which a computer program is stored.
  • the computer program is used to be executed by a processor to implement the aforementioned data transmission method.
  • the present application also provides a chip, which includes a programmable logic circuit and/or program instructions, and is used to implement the aforementioned data transmission method when an electronic device equipped with the chip is running.
  • the present application also provides a computer program product, which includes computer instructions.
  • the computer instructions are stored in a computer-readable storage medium.
  • a processor reads and executes the computer instructions from the computer-readable storage medium to implement the aforementioned data transmission method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to the field of communications. Disclosed are a data transmission method and apparatus, a device, and a storage medium. The method comprises: reporting subscription data to a subscription device, wherein the subscription data corresponds to at least two reporting modes, and the reporting modes are determined at least according to the minimum interval time field carried in a subscription request sent by the subscription device.

Description

数据传输方法、装置、设备及存储介质Data transmission method, device, equipment and storage medium 技术领域Technical Field

本申请涉及通信技术领域,特别涉及一种数据传输方法、装置、设备及存储介质。The present application relates to the field of communication technology, and in particular to a data transmission method, device, equipment and storage medium.

背景技术Background technique

物联网通信系统中,订阅设备可向被订阅设备发起订阅请求,等待被订阅设备的订阅响应,以实现订阅的激活或取消。在激活订阅后,被订阅设备需要向订阅设备上报订阅数据。In the IoT communication system, the subscribing device can initiate a subscription request to the subscribed device and wait for the subscription response from the subscribed device to activate or cancel the subscription. After activating the subscription, the subscribed device needs to report the subscription data to the subscribing device.

其中,订阅数据的上报时机根据订阅请求和订阅响应来加以限定,订阅数据上报的最小间隔时间由订阅设备请求,订阅数据上报的最大间隔时间由订阅设备和被订阅设备协商确定,被订阅设备将在最小间隔时间和最大间隔时间之内按照固定频率进行订阅数据的上报。The timing of reporting subscription data is limited according to the subscription request and subscription response. The minimum interval for reporting subscription data is requested by the subscribing device, and the maximum interval for reporting subscription data is negotiated and determined by the subscribing device and the subscribed device. The subscribed device will report subscription data at a fixed frequency within the minimum interval and the maximum interval.

在间隔最大间隔时间尚未接收到订阅数据时,订阅设备将自动取消该订阅;若订阅设备希望再次获取订阅数据,则需要重新发起订阅。基于上述订阅数据的上报方式,一方面可能导致被订阅设备的无效上报(如订阅设备不需要获取某一时刻的订阅数据),另一方面也将导致对于同一订阅数据的多次重复订阅请求,从而使得订阅数据的上报效率较低。If the subscription data is not received within the maximum interval, the subscription device will automatically cancel the subscription; if the subscription device wants to obtain the subscription data again, it needs to re-initiate the subscription. Based on the above subscription data reporting method, on the one hand, it may lead to invalid reporting of the subscribed device (for example, the subscription device does not need to obtain the subscription data at a certain moment), and on the other hand, it will also lead to multiple repeated subscription requests for the same subscription data, which makes the reporting efficiency of subscription data low.

发明内容Summary of the invention

本申请实施例提供了一种数据传输方法、装置、设备及存储介质,为订阅数据提供了至少两种上报方式,以提高订阅数据的上报效率,技术方案如下:The embodiments of the present application provide a data transmission method, apparatus, device and storage medium, which provide at least two reporting modes for subscription data to improve the reporting efficiency of subscription data. The technical solution is as follows:

根据本申请的一个方面,提供了一种数据传输方法,该方法由被订阅设备执行,该方法包括:According to one aspect of the present application, a data transmission method is provided, the method being executed by a subscribed device, the method comprising:

向订阅设备上报订阅数据;Report subscription data to the subscription device;

其中,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

根据本申请的一个方面,提供了一种数据传输方法,该方法由订阅设备执行,该方法包括:According to one aspect of the present application, a data transmission method is provided, the method being executed by a subscription device, the method comprising:

接收被订阅设备上报的订阅数据;Receive subscription data reported by the subscribed device;

其中,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

根据本申请的一个方面,提供了一种数据传输装置,该装置包括:According to one aspect of the present application, a data transmission device is provided, the device comprising:

上报模块,用于向订阅设备上报订阅数据;Reporting module, used to report subscription data to the subscription device;

其中,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

根据本申请的一个方面,提供了一种数据传输装置,该装置包括:According to one aspect of the present application, a data transmission device is provided, the device comprising:

接收模块,用于接收被订阅设备上报的订阅数据;A receiving module, used to receive subscription data reported by the subscribed device;

其中,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

根据本申请的一个方面,提供了一种被订阅设备,该被订阅设备包括存储器和处理器;存储器中存储有至少一条程序代码,程序代码由处理器加载并执行以实现如上所述的数据传输方法。According to one aspect of the present application, a subscribed device is provided, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data transmission method as described above.

根据本申请的一个方面,提供了一种订阅设备,该订阅设备包括存储器和处理器;存储器中存储有至少一条程序代码,程序代码由处理器加载并执行以实现如上所述的数据传输方法。According to one aspect of the present application, a subscription device is provided, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data transmission method as described above.

根据本申请的一个方面,提供了一种计算机可读存储介质,存储介质中存储有计算机程序,所述计算机程序用于被处理器执行,以实现如上所述的数据传输方法。According to one aspect of the present application, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is used to be executed by a processor to implement the data transmission method as described above.

根据本申请的一个方面,提供了一种芯片,芯片包括可编程逻辑电路和/或程序指令,当安装有芯片的电子设备运行时,用于实现如上所述的数据传输方法。According to one aspect of the present application, a chip is provided, which includes a programmable logic circuit and/or program instructions, and is used to implement the data transmission method as described above when an electronic device equipped with the chip is running.

根据本申请的一个方面,提供了一种计算机程序产品,计算机程序产品包括计算机指令,计算机指令存储在计算机可读存储介质中,处理器从计算机可读存储介质读取并执行计算机指令,以实现如上所述的数据传输方法。According to one aspect of the present application, a computer program product is provided. The computer program product includes computer instructions. The computer instructions are stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the data transmission method as described above.

本申请实施例提供的技术方案至少包括如下有益效果:The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:

为订阅数据提供了至少两种上报方式,从而为被订阅设备提供多种选择,以提高订阅数据的上报效率,满足订阅双方关于订阅数据的不同订阅需求。其中,订阅数据的上报方式至少根据订阅请求中所携带的最小时间间隔字段确定,如上报方式根据订阅请求中所携带的最小时间间隔字段和最大时间间隔字段确定, 以避免订阅设备和被订阅设备关于订阅数据的最大时间间隔的协商过程。At least two reporting modes are provided for subscription data, thereby providing multiple options for the subscribed device, so as to improve the reporting efficiency of subscription data and meet different subscription requirements of both parties regarding subscription data. Among them, the reporting mode of subscription data is determined at least according to the minimum time interval field carried in the subscription request, such as the reporting mode is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request, so as to avoid the negotiation process between the subscribing device and the subscribed device regarding the maximum time interval of subscription data.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

图1是本申请一个示例性实施例提供的订阅流程的示意图;FIG1 is a schematic diagram of a subscription process provided by an exemplary embodiment of the present application;

图2是本申请一个示例性实施例提供的终端的数据模型的示意图;FIG2 is a schematic diagram of a data model of a terminal provided by an exemplary embodiment of the present application;

图3是本申请一个示例性实施例提供的数据传输方法的流程图;FIG3 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图4是本申请一个示例性实施例提供的数据传输方法的流程图;FIG4 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图5是本申请一个示例性实施例提供的数据传输方法的流程图;FIG5 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图6是本申请一个示例性实施例提供的数据传输方法的流程图;FIG6 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图7是本申请一个示例性实施例提供的数据传输方法的流程图;FIG7 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图8是本申请一个示例性实施例提供的数据传输方法的流程图;FIG8 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图9是本申请一个示例性实施例提供的数据传输方法的流程图;FIG9 is a flow chart of a data transmission method provided by an exemplary embodiment of the present application;

图10是本申请一个示例性实施例提供的订阅请求装置的示意图;FIG10 is a schematic diagram of a subscription request apparatus provided by an exemplary embodiment of the present application;

图11是本申请一个示例性实施例提供的订阅请求装置的示意图;FIG11 is a schematic diagram of a subscription request apparatus provided by an exemplary embodiment of the present application;

图12是本申请一个示例性实施例提供的通信设备的框图。FIG. 12 is a block diagram of a communication device provided by an exemplary embodiment of the present application.

具体实施方式Detailed ways

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application more clear, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

本申请实施例的技术方案可以应用于各种通信系统,例如:全球移动通讯(Global System of Mobile communication,GSM)系统、码分多址(Code Division Multiple Access,CDMA)系统、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)系统、通用分组无线业务(General Packet Radio Service,GPRS)、长期演进(Long Term Evolution,LTE)系统、先进的长期演进(Advanced Long Term Evolution,LTE-A)系统、新空口(New Radio,NR)系统、NR系统的演进系统、非授权频谱上的LTE(LTE-based access to unlicensed spectrum,LTE-U)系统、非授权频谱上的NR(NR-based access to unlicensed spectrum,NR-U)系统、非地面通信网络(Non-Terrestrial Networks,NTN)系统、通用移动通信系统(Universal Mobile Telecommunication System,UMTS)、无线局域网(Wireless Local Area Networks,WLAN)、无线保真(Wireless Fidelity,WiFi)、第五代通信(5th-Generation,5G)系统或其他通信系统等。The technical solutions of the embodiments of the present application can be applied to various communication systems, such as: Global System of Mobile communication (GSM) system, Code Division Multiple Access (CDMA) system, Wideband Code Division Multiple Access (WCDMA) system, General Packet Radio Service (GPRS), Long Term Evolution (LTE) system, Advanced Long Term Evolution (LTE-A) system, New Radio (NR) system, and NR system. Evolved systems, LTE-based access to unlicensed spectrum (LTE-U) systems, NR-based access to unlicensed spectrum (NR-U) systems, non-terrestrial communication networks (NTN) systems, universal mobile telecommunication systems (UMTS), wireless local area networks (WLAN), wireless fidelity (WiFi), fifth-generation communication (5th-Generation, 5G) systems or other communication systems, etc.

随着通信技术的发展,移动通信系统将不仅支持传统的通信,还将支持例如物联网(Internet of Things,IoT)通信等,本申请实施例可应用于物联网通信系统中。With the development of communication technology, mobile communication systems will not only support traditional communications, but also support communications such as the Internet of Things (IoT). The embodiments of the present application can be applied to IoT communication systems.

IoT通信系统中包括多个终端(或可称为设备),每两个终端之间可实现信息交换和通信。The IoT communication system includes multiple terminals (or devices), and information exchange and communication can be achieved between every two terminals.

其中,终端也可以称为用户设备(User Equipment,UE)。终端可以是蜂窝电话、无绳电话、会话启动协议(Session Initiation Protocol,SIP)电话、无线本地环路(Wireless Local Loop,WLL)站、个人数字助理(Personal Digital Assistant,PDA)设备、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备、下一代通信系统例如NR网络中的终端设备,或者未来演进的公共陆地移动网络(Public Land Mobile Network,PLMN)网络中的终端设备等。The terminal may also be referred to as User Equipment (UE). The terminal may be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, a terminal device in a next-generation communication system such as an NR network, or a terminal device in a future-evolved Public Land Mobile Network (PLMN) network, etc.

在本申请实施例中,终端可以部署在陆地上,包括室内或室外、手持、穿戴或车载;也可以部署在水面上(如轮船等);还可以部署在空中(例如飞机、气球和卫星上等)。In the embodiments of the present application, the terminal can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted; it can also be deployed on the water surface (such as ships, etc.); it can also be deployed in the air (for example, on airplanes, balloons and satellites, etc.).

在本申请实施例中,终端可以是手机(Mobile Phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(Virtual Reality,VR)终端设备、增强现实(Augmented Reality,AR)终端设备、工业控制(industrial control)中的无线终端设备、无人驾驶(self driving)中的无线终端设备、远程医疗(remote medical)中的无线终端设备、智能电网(smart grid)中的无线终端设备、运输安全(transportation safety)中的无线终端设备、智慧城市(smart city)中的无线终端设备或智慧家庭(smart home)中的无线终端设备等。In the embodiments of the present application, the terminal may be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal device in industrial control, a wireless terminal device in self-driving, a wireless terminal device in remote medical, a wireless terminal device in smart grid, a wireless terminal device in transportation safety, a wireless terminal device in a smart city, or a wireless terminal device in a smart home, etc.

作为示例而非限定,在本申请实施例中,该终端还可以是可穿戴设备。可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼 镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。As an example but not limitation, in the embodiments of the present application, the terminal may also be a wearable device. Wearable devices may also be referred to as wearable smart devices, which are a general term for wearable devices that are intelligently designed and developed using wearable technology for daily wear, such as glasses, gloves, watches, clothing, and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not only hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are fully functional, large in size, and can achieve complete or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various types of smart bracelets and smart jewelry for vital sign monitoring.

应理解,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the terms "system" and "network" are often used interchangeably in this article. The term "and/or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character "/" in this article generally indicates that the associated objects before and after are in an "or" relationship.

本申请的实施方式部分使用的术语仅用于对本申请的具体实施例进行解释,而非旨在限定本申请。本申请的说明书和权利要求书及所述附图中的术语“第一”、“第二”、“第三”和“第四”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。The terms used in the implementation mode of this application are only used to explain the specific embodiments of this application, and are not intended to limit this application. The terms "first", "second", "third" and "fourth" in the specification and claims of this application and the drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.

应理解,在本申请的实施例中提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, and B can be obtained through C; it can also mean that there is an association relationship between A and B.

在本申请实施例的描述中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship of indication and being indicated, configuration and being configured, etc.

本申请实施例中,“预定义”可以通过在设备(例如,包括订阅设备和被订阅设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。In the embodiments of the present application, "pre-definition" can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in devices (for example, including subscribing devices and subscribed devices), and the present application does not limit the specific implementation method. For example, pre-definition can refer to what is defined in the protocol.

图1是本申请一个示例性实施例提供的订阅流程的示意图。FIG. 1 is a schematic diagram of a subscription process provided by an exemplary embodiment of the present application.

物联网通信系统中,订阅设备可向被订阅设备发起订阅请求,等待被订阅设备的订阅响应,以实现订阅的激活或取消。以订阅设备是订阅发起方,被订阅设备是订阅响应方为例,订阅流程包括如下步骤:In the IoT communication system, the subscribing device can initiate a subscription request to the subscribed device and wait for the subscription response from the subscribed device to activate or cancel the subscription. Taking the subscribing device as the subscription initiator and the subscribed device as the subscription responder as an example, the subscription process includes the following steps:

步骤1:订阅发起方向订阅响应方发起订阅请求。Step 1: The subscription initiator initiates a subscription request to the subscription responder.

示意性的,订阅请求用于向订阅响应方请求订阅目标资源,目标资源具体可以包括属性和/或事件,请求的属性和/或事件可以是一个或多个。可选的,订阅请求中携带有至少一个字段,至少一个字段用于指示本次订阅的资源信息。Illustratively, the subscription request is used to request the subscription responder to subscribe to the target resource, the target resource may specifically include attributes and/or events, and the requested attributes and/or events may be one or more. Optionally, the subscription request carries at least one field, and the at least one field is used to indicate the resource information of this subscription.

订阅请求中携带的参数字段如表1所示:The parameter fields carried in the subscription request are shown in Table 1:

表1Table 1

Figure PCTCN2022128501-appb-000001
Figure PCTCN2022128501-appb-000001

其中:in:

在保持订阅(KeepSubscriptions)字段的取值为False时,终止来自订阅发起方的现有的所有订阅。When the value of the KeepSubscriptions field is False, all existing subscriptions from the subscription initiator are terminated.

最小间隔时间(MinIntervalFloor)字段用于指示请求的下限(最低)最小间隔值。也可理解为,最小间隔时间字段的取值用于指示请求的最小上报时间间隔的边界值,该边界值以秒(s)为单位。根据该字段,订阅响应方需要上报多个数据时,若订阅响应方对于多个数据定义的上报时间间隔小于最小间隔时间,则将多个数据进行缓存,在达到最小间隔时间后将多个数据进行一次上报。The minimum interval time (MinIntervalFloor) field is used to indicate the lower limit (lowest) minimum interval value of the request. It can also be understood that the value of the minimum interval time field is used to indicate the boundary value of the minimum reporting time interval of the request, and the boundary value is in seconds (s). According to this field, when the subscription responder needs to report multiple data, if the reporting time interval defined by the subscription responder for multiple data is less than the minimum interval time, the multiple data will be cached and reported once after the minimum interval time is reached.

最大间隔时间(MaxIntervalCeil)字段用于指示请求的上限(最高)最大间隔值。也可理解为,最大间隔时间字段的取值用于指示请求的最大上报超时时间的边界值,该边界值以秒(s)为单位。根据该字段,订阅响应方应当在不超过该边界值的时间内至少进行一次数据上报。The MaxIntervalCeil field is used to indicate the upper limit (highest) maximum interval value of the request. It can also be understood that the value of the MaxInterval field is used to indicate the boundary value of the maximum reporting timeout of the request, which is in seconds (s). According to this field, the subscription responder should report data at least once within a time that does not exceed the boundary value.

属性请求(AttributeRequests)字段用于指示集群(Cluster)属性数据的零或多个请求路径列表。其中, 集群可选地包括两种角色:用户方(Client)和服务方(Server),用户方属于控制端,服务方属于被控端。The AttributeRequests field is used to indicate a list of zero or more request paths for cluster attribute data. The cluster optionally includes two roles: the client and the server. The client belongs to the control end, and the server belongs to the controlled end.

数据版本过滤(DataVersionFilters)字段用于指示零个或多个集群实例数据版本的列表。可选的,数据版本过滤字段在属性请求列表存在时可选存在。其中,若两次上报的数据的数据版本(DataVersion)相同,则第二次只上报DataVersion,不必上报属性值。The DataVersionFilters field is used to indicate a list of zero or more cluster instance data versions. Optionally, the DataVersionFilters field is optional when the attribute request list exists. If the data version (DataVersion) of the data reported twice is the same, only the DataVersion is reported the second time, and the attribute value does not need to be reported.

事件请求(EventRequests)字段用于指示集群事件的零个或多个请求路径列表。The EventRequests field is used to indicate a list of zero or more request paths for cluster events.

事件过滤(EventFilters)字段用于指示每个特定节点的零个或多个最小事件数的列表,也可理解为请求事件上报的过滤条件。The EventFilters field is used to indicate a list of zero or more minimum event numbers for each specific node, which can also be understood as the filtering conditions for requesting event reporting.

在网络结构域过滤(FabricFilters)字段的取值为true时,将网络结构域范围列表中读取的数据限制为访问的网络结构域。When the value of the FabricFilters field is true, the data read from the FabricScope list is limited to the accessed FabricDomain.

在一些实施例中,订阅流程基于Matter协议进行。In some embodiments, the subscription process is based on the Matter protocol.

其中,Matter协议,又称IP互联家庭项目(Project Connected Home over IP),是一个智能家居开源标准项目,旨在开发并推广一项新连接协议,以简化智能家居设备商的开发成本,提高不同厂商智能家居产品之间的兼容性。通过建立在互联网协议商,Matter协议将支持智能家居设备、移动应用程序和云服务之间的通信,为设备定义一组特定的基于互联网协议的网络技术。Among them, the Matter protocol, also known as Project Connected Home over IP, is an open source standard project for smart homes that aims to develop and promote a new connection protocol to simplify the development costs of smart home device vendors and improve the compatibility between smart home products from different manufacturers. By building on the Internet Protocol, the Matter protocol will support communication between smart home devices, mobile applications, and cloud services, defining a specific set of Internet Protocol-based network technologies for devices.

在Matter协议中,设备的数据模型可参考图2,具体如下:In the Matter protocol, the data model of the device can be referred to Figure 2, as follows:

节点(Node):代表一个设备节点,属于逻辑设备;Node: represents a device node and belongs to a logical device;

端点(Endpoint):一个节点包含多个端点,每个端点代表一个服务实例或一个虚拟设备,端点对应的设备类型可以由device_type进行指示;Endpoint: A node contains multiple endpoints, each of which represents a service instance or a virtual device. The device type corresponding to the endpoint can be indicated by device_type;

集群:一个端点下包含多个集群,集群属于构建功能集合的元素,集群可选地包括两种角色:用户方和服务方,用户方属于控制端,服务方属于被控端;Cluster: An endpoint contains multiple clusters. Clusters are elements for building a functional set. Clusters can optionally include two roles: user side and service side. The user side belongs to the control side, and the service side belongs to the controlled side.

属性(Attribute):一个集群下包含0或多个属性,属性用于描述功能集合中的功能单元;Attribute: A cluster contains 0 or more attributes, which are used to describe the functional units in the functional set;

命令(Command):一个集群下包含0或多个命令,命令用于描述对功能单元的控制;Command: A cluster contains 0 or more commands, which are used to describe the control of functional units;

事件(Event):一个集群下包含0或者多个事件,事件用于描述对功能单元过去发生过的具体行为的记录;Event: A cluster contains 0 or more events. Events are used to describe the records of specific behaviors that have occurred in the past of a functional unit.

以节点表示一个车设备为例,对设备的数据模型进行举例说明。其中,车设备的根节点(RootNode)的设备类型存储于端点0(Endpoint0)下,车设备的空调设备类型存储于端点5(Endpoint5)下。Taking a node representing a car device as an example, the data model of the device is described as follows. The device type of the root node (RootNode) of the car device is stored under Endpoint 0 (Endpoint0), and the air conditioning device type of the car device is stored under Endpoint 5 (Endpoint5).

在一些实施例中,端点5下包含的集群有温控集群、风扇集群。其中温控集群下包含的属性可选地包括温度属性值,温控集群下包含的命令可选地包括调高温度命令、降低温度命令,温控集群下包含的事件可选地包括温度异常告警事件。In some embodiments, the clusters included in endpoint 5 include a temperature control cluster and a fan cluster. The attributes included in the temperature control cluster may optionally include temperature attribute values, the commands included in the temperature control cluster may optionally include temperature increase commands and temperature decrease commands, and the events included in the temperature control cluster may optionally include temperature abnormality alarm events.

示例性的,属性请求字段可表示为如下:AttributeRequests[endpoint-id/cluster-id/attribute-id,endpoint-id/cluster-id/attribute-id,…];事件请求字段可表示为如下:EventRequests[endpoint-id/cluster-id/event-id,endpoint-id/cluster-id/event-id,…]。Exemplarily, the attribute request field can be expressed as follows: AttributeRequests[endpoint-id/cluster-id/attribute-id, endpoint-id/cluster-id/attribute-id,…]; the event request field can be expressed as follows: EventRequests[endpoint-id/cluster-id/event-id, endpoint-id/cluster-id/event-id,…].

应当理解的是,上述仅为示意性举例,不对本申请造成限定。针对不同类型的设备或者同一类型的不同设备,能够形成不同的数据模型,该数据模型可根据实际需要进行设置。It should be understood that the above is only an illustrative example and does not limit the present application. Different data models can be formed for different types of devices or different devices of the same type, and the data model can be set according to actual needs.

步骤2:订阅响应方向订阅发起方发送第一次数据上报。Step 2: The subscription responder sends the first data report to the subscription initiator.

订阅响应方收到订阅发起方发起的订阅请求后,需要进行一次数据上报。After receiving the subscription request initiated by the subscription initiator, the subscription responder needs to report the data once.

可选的,在第一次数据上报中,订阅响应方可根据订阅请求中携带的属性请求字段和事件请求字段中所要订阅的资源信息进行上报。Optionally, in the first data reporting, the subscription responder may report the resource information to be subscribed according to the attribute request field and the event request field carried in the subscription request.

步骤3:订阅发起方向订阅响应方进行成功与否的状态上报。Step 3: The subscription initiator reports the success or failure status to the subscription responder.

订阅发起方收到来自订阅响应方上报的数据后,可根据第一次数据上报进行状态成功与否的判定。可选的,步骤3可实现为:订阅发起方向订阅响应方发送成功状态信息。After receiving the data reported by the subscription responder, the subscription initiator can determine whether the status is successful or not based on the first data report. Optionally, step 3 can be implemented as follows: the subscription initiator sends a success status message to the subscription responder.

步骤4:订阅响应方根据订阅发起方返回的状态信息,确认是否返回订阅响应。Step 4: The subscription responder confirms whether to return a subscription response based on the status information returned by the subscription initiator.

示意性的,订阅响应方根据收到的状态信息,可确定是否需要向订阅发起方返回订阅响应。可选的,在接收到订阅发起方返回的成功状态信息后,订阅响应方确定需要向订阅发起方返回订阅响应,且生成订阅响应的参数数据。Illustratively, the subscription responder can determine whether to return a subscription response to the subscription initiator based on the received status information. Optionally, after receiving the success status information returned by the subscription initiator, the subscription responder determines that a subscription response needs to be returned to the subscription initiator and generates parameter data of the subscription response.

步骤5:订阅响应方在接收到订阅发起方发送的成功状态后,返回订阅响应。Step 5: After receiving the success status sent by the subscription initiator, the subscription responder returns the subscription response.

示意性的,订阅响应方将生成的参数数据通过订阅响应消息发送给订阅发起方。订阅响应中携带的参数字段如表2所示:Indicatively, the subscription responder sends the generated parameter data to the subscription initiator via a subscription response message. The parameter fields carried in the subscription response are shown in Table 2:

表2Table 2

参数字段Parameter fields 字段类型Field Type 强制/可选Mandatory/Optional 描述describe 订阅标识Subscription ID uint32uint32 强制Enforcement 用于标识一个订阅Used to identify a subscription 最大间隔Maximum interval uint16uint16 强制Enforcement 最终决定的订阅的最大上报超时时间Maximum reporting timeout for the final subscription decision

其中:in:

订阅标识(SubscriptionID)字段用于标识一个订阅,该订阅标识字段是根据订阅发起方向订阅响应方发送的订阅请求生成的。The Subscription ID field is used to identify a subscription. The Subscription ID field is generated based on a subscription request sent by a subscription initiator to a subscription responder.

最大间隔(MaxInterval)字段用于指示订阅发起方和订阅响应方协商后最终确定的最大时间间隔。也可理解为,最大间隔字段的取值用于指示协商确定的最大上报超时时间的边界值,该边界值以秒(s)为单位。根据该字段,订阅响应方应当在不超过该边界值的时间内进行第二次数据上报。The MaxInterval field is used to indicate the maximum time interval finally determined by the subscription initiator and the subscription responder after negotiation. It can also be understood that the value of the MaxInterval field is used to indicate the boundary value of the negotiated maximum reporting timeout, which is in seconds (s). According to this field, the subscription responder should make the second data report within a time not exceeding the boundary value.

步骤6:订阅响应方向订阅发起方发送第二次数据上报。Step 6: The subscription responder sends a second data report to the subscription initiator.

根据前述内容,在确认向订阅发起方返回订阅响应后,订阅响应方向订阅发起方发送第二次数据上报。其中,第二次数据上报应当在不超过最大间隔字段指示的边界值的时间内完成。According to the above content, after confirming the subscription response is returned to the subscription initiator, the subscription responder sends a second data report to the subscription initiator. The second data report should be completed within a time not exceeding the boundary value indicated by the maximum interval field.

步骤7:订阅发起方向订阅响应方发送状态响应。Step 7: The subscription initiator sends a status response to the subscription responder.

示意性的,在接收到订阅响应方发送的第二次数据上报后,订阅发起方将向订阅响应方返回状态响应,以达到订阅连接保活的目的。Indicatively, after receiving the second data report sent by the subscription responder, the subscription initiator will return a status response to the subscription responder to achieve the purpose of keeping the subscription connection alive.

参考前述内容,基于步骤1和步骤5,第二次数据上报的上报时机,需要根据订阅请求中所携带的最小间隔时间字段和订阅响应中所携带的最大间隔字段确定。相关技术中,最小间隔时间字段所指示的时长≤最大间隔字段所指示的时长≤MAX(60min,最大间隔时间字段所指示的时长),即MinIntervalFloor=<MaxInterval<=MAX(60min,MaxIntervalCeil)。Referring to the above content, based on step 1 and step 5, the reporting time of the second data report needs to be determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response. In the related art, the duration indicated by the minimum interval field ≤ the duration indicated by the maximum interval field ≤ MAX (60min, the duration indicated by the maximum interval field), that is, MinIntervalFloor = <MaxInterval < = MAX (60min, MaxIntervalCeil).

其中,第二次数据上报的最大时间间隔由订阅发起方和订阅响应方协商确定,且不超过60min和订阅请求中所携带的最大间隔时间字段所指示的时长中的最大值。比如,最大间隔时间字段所指示的时长是120min,则协商的最大时间间隔不超过120min;又如,最大间隔时间字段所指示的时长是30min,则协商的最大时间间隔不超过60min。The maximum time interval for the second data report is determined by negotiation between the subscription initiator and the subscription responder, and shall not exceed the maximum value of 60 minutes and the duration indicated by the maximum interval field carried in the subscription request. For example, if the duration indicated by the maximum interval field is 120 minutes, the negotiated maximum time interval shall not exceed 120 minutes; for another example, if the duration indicated by the maximum interval field is 30 minutes, the negotiated maximum time interval shall not exceed 60 minutes.

基于此,订阅响应方将在最大间隔时间和最大间隔时间之内按照固定频率进行数据上报。在间隔最大间隔时间尚未接收到上报信息时,订阅发起方将自动取消该订阅。示例性的,订阅发起方向订阅响应方发送订阅请求,且订阅请求中所携带的保持订阅字段为false,从而取消该订阅。Based on this, the subscription responder will report data at a fixed frequency within the maximum interval and the maximum interval. If the report information is not received within the maximum interval, the subscription initiator will automatically cancel the subscription. Exemplarily, the subscription initiator sends a subscription request to the subscription responder, and the keep subscription field carried in the subscription request is false, thereby canceling the subscription.

此时,若订阅发起方希望再次获取上报信息,则需要重新发起订阅请求。At this point, if the subscription initiator wishes to obtain the reported information again, it needs to re-initiate the subscription request.

基于上述上报方式,一方面可能导致订阅响应方的无效上报,如订阅发起方不需要获取某一时刻的订阅数据。应当理解的是,在一些实施例中,还可能存在订阅发起方有一些特殊订阅需求,相关技术中的按照固定频率进行数据上报的上报方式并不能满足其需求。如,订阅发起方仅希望在订阅数据发生变化时获得上报数据,从而减少数据上报频率,降低双方功耗。Based on the above reporting method, on the one hand, invalid reporting may be caused by the subscription responder, such as the subscription initiator does not need to obtain the subscription data at a certain moment. It should be understood that in some embodiments, there may be some special subscription requirements of the subscription initiator, and the reporting method of reporting data at a fixed frequency in the related technology cannot meet its needs. For example, the subscription initiator only hopes to obtain the reported data when the subscription data changes, thereby reducing the frequency of data reporting and reducing the power consumption of both parties.

另一方面,基于上述上报方式,若订阅响应方无法在最大间隔时间内上报数据,或者订阅发起方在最大时间间隔内基于任意原因未接收到上报数据,将导致该订阅的取消,从而导致存在针对同一订阅数据的多次重复订阅请求,这也将使得订阅数据的上报效率较低。On the other hand, based on the above reporting method, if the subscription responder is unable to report data within the maximum interval, or the subscription initiator fails to receive the reported data within the maximum time interval due to any reason, the subscription will be cancelled, resulting in multiple repeated subscription requests for the same subscription data, which will also make the reporting efficiency of subscription data low.

本申请实施例提供了一种数据传输方法,其中所涉及的订阅数据,也可以理解为图1中的订阅响应方向订阅发起方进行的第二次数据上报。An embodiment of the present application provides a data transmission method, wherein the subscription data involved can also be understood as the second data reporting performed by the subscription responder in FIG. 1 to the subscription initiator.

图3示出了本申请一个示例性实施例提供的数据传输方法的流程图,该方法由被订阅设备执行,该方法包括如下步骤:FIG3 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. The method is executed by a subscribed device and includes the following steps:

步骤102:向订阅设备上报订阅数据。Step 102: Report subscription data to the subscription device.

示意性的,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。Illustratively, there are at least two reporting modes corresponding to subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

其中,订阅数据是订阅设备与被订阅设备之间已经建立的订阅关系所对应的数据。参考前述内容,在执行步骤102之前,订阅设备与被订阅设备之间还需要进行订阅流程。The subscription data is data corresponding to the subscription relationship established between the subscribing device and the subscribed device. Referring to the above content, before executing step 102, a subscription process needs to be performed between the subscribing device and the subscribed device.

可以理解为,在步骤102之前:订阅设备向被订阅设备发送订阅请求,该订阅请求用于请求一个新的订阅关系;被订阅设备向订阅设备发送订阅响应,该订阅响应用于告知订阅设备已建立订阅请求所指示的订阅关系。基于此,订阅数据是上述订阅请求和订阅响应中所指示的订阅关系所对应的数据。It can be understood that before step 102: the subscribing device sends a subscription request to the subscribed device, the subscription request is used to request a new subscription relationship; the subscribed device sends a subscription response to the subscribing device, the subscription response is used to inform the subscribing device that the subscription relationship indicated by the subscription request has been established. Based on this, the subscription data is the data corresponding to the subscription relationship indicated in the above subscription request and subscription response.

在建立订阅关系后,被订阅设备可向订阅设备上报订阅数据。其中,订阅数据对应有至少两种上报方式。可选的,订阅数据的上报方式包括如下:After establishing a subscription relationship, the subscribed device can report subscription data to the subscribing device. There are at least two reporting methods for subscription data. Optionally, the reporting methods for subscription data include the following:

·在订阅设备订阅的属性和/或事件的状态发生变化时进行上报;Report when the state of the attributes and/or events subscribed to by the subscribing device changes;

在该种上报方式下,被订阅设备仅在被订阅的属性和/或事件的状态发生变化时进行订阅数据的上报。比如,被订阅设备是感应台灯,订阅设备是移动终端,订阅的属性为开关属性。感应台灯在人经过时亮起,在人离开一段时间后熄灭,则感应台灯仅在台灯亮起或熄灭时向移动终端上报订阅数据。In this reporting mode, the subscribed device reports the subscription data only when the state of the subscribed attribute and/or event changes. For example, the subscribed device is an induction lamp, the subscribing device is a mobile terminal, and the subscribed attribute is a switch attribute. The induction lamp lights up when a person passes by and turns off after the person leaves for a period of time. In this case, the induction lamp reports the subscription data to the mobile terminal only when the lamp lights up or turns off.

基于此,被订阅设备无需按照固定频率进行上报,订阅设备也无需对同一订阅数据进行多次重复订阅, 这将减少订阅数据的上报频率,避免订阅数据的无效上报,从而提高订阅数据的上报效率。Based on this, the subscribed device does not need to report at a fixed frequency, and the subscribing device does not need to subscribe to the same subscription data multiple times, which will reduce the reporting frequency of subscription data, avoid invalid reporting of subscription data, and thus improve the reporting efficiency of subscription data.

·间隔指定时长进行上报。Report at specified intervals.

示意性的,指定时长可根据订阅请求中所携带的最小间隔时间字段确定,或者根据订阅请求中所携带的最大间隔时间字段确定,或者根据与订阅请求对应的订阅响应中所携带的最大间隔字段确定。Illustratively, the specified duration may be determined according to a minimum interval field carried in a subscription request, or according to a maximum interval field carried in a subscription request, or according to a maximum interval field carried in a subscription response corresponding to the subscription request.

在一些实施例中,订阅数据在间隔第一时长后进行上报,第一时长根据最小间隔时间字段确定。在另一些实施例中,订阅数据在间隔第二时长后进行上报,第二时长根据订阅请求中所携带的最大间隔时间字段确定,或者,第二时长根据与订阅请求对应的订阅响应中所携带的最大间隔字段确定。In some embodiments, the subscription data is reported after a first time interval, and the first time interval is determined according to the minimum time interval field. In other embodiments, the subscription data is reported after a second time interval, and the second time interval is determined according to the maximum time interval field carried in the subscription request, or the second time interval is determined according to the maximum time interval field carried in the subscription response corresponding to the subscription request.

根据前述内容,订阅数据的上报方式至少根据订阅请求中所携带的最小间隔时间字段确定。可选的,上报方式根据订阅请求中所携带的最小间隔时间字段和最大间隔时间字段确定;或者,上报方式根据订阅请求中所携带的最小间隔时间字段和与订阅请求对应的订阅响应中所携带的最大间隔字段确定。According to the foregoing, the reporting method of subscription data is determined at least according to the minimum interval field carried in the subscription request. Optionally, the reporting method is determined according to the minimum interval field and the maximum interval field carried in the subscription request; or, the reporting method is determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response corresponding to the subscription request.

其中,在确定订阅关系时,订阅双方可根据订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来确定订阅数据的具体上报方式。也即,订阅双方可仅基于订阅请求来确定上报方式,或者,订阅双方可基于订阅请求和订阅响应来确定上报方式。后文将对这两种确定方式展开描述,此处略过。Among them, when determining the subscription relationship, the two subscribers can determine the specific reporting method of the subscription data according to the subscription request, or according to the values of the fields in the subscription request and the subscription response. That is, the two subscribers can determine the reporting method based only on the subscription request, or the two subscribers can determine the reporting method based on the subscription request and the subscription response. These two determination methods will be described in detail later, and are omitted here.

可选的,最小间隔时间字段的默认值为第一取值,订阅请求中所携带的最大间隔时间字段的默认值为第二取值;或者,最小间隔时间字段的默认值为第一取值,订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为第二取值。Optionally, the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.

在一些实施例中,第一取值为0,第二取值为0×FFFF。In some embodiments, the first value is 0 and the second value is 0×FFFF.

例如,订阅设备向被订阅设备发送订阅请求,订阅请求中携带有最小间隔时间字段和最大间隔时间字段。在未赋予这两个字段以具体取值的情况下,默认最小间隔时间字段为第一取值、最大间隔时间字段为第二取值。For example, the subscribing device sends a subscription request to the subscribed device, and the subscription request carries a minimum interval field and a maximum interval field. In the case where no specific values are assigned to these two fields, the minimum interval field is assumed to be the first value and the maximum interval field is assumed to be the second value.

参考前述内容,以下将给出多种数据传输方法的实现方式:With reference to the above content, the following are the implementation methods of various data transmission methods:

·当MinIntervalFloor=0,MaxIntervalCeil或MaxInterval=0×FFFF时,被订阅设备在订阅设备订阅的属性和/或事件的状态发生变化时上报订阅数据;When MinIntervalFloor = 0, MaxIntervalCeil or MaxInterval = 0×FFFF, the subscribed device reports subscription data when the status of the attributes and/or events subscribed by the subscribing device changes;

·当MinIntervalFloor!=0,MaxIntervalCeil或MaxInterval=0×FFFF时,被订阅设备按照MinIntervalFloor设定的频率上报订阅数据;若在设定的MaxIntervalCeil或MinIntervalFloor时间内没有上报订阅数据,订阅设备可等待被订阅设备在订阅的属性和/或事件的状态发生变化时上报订阅数据;When MinIntervalFloor!=0, MaxIntervalCeil or MaxInterval=0×FFFF, the subscribed device reports the subscription data at the frequency set by MinIntervalFloor; if the subscription data is not reported within the set MaxIntervalCeil or MinIntervalFloor time, the subscribing device can wait for the subscribed device to report the subscription data when the status of the subscribed attributes and/or events changes;

·当MinIntervalFloor=0,MaxIntervalCeil或MaxInterval!=0×FFFF时,被订阅设备只要在MaxInterval时间范围内上报订阅数据即可,若超过MaxIntervalCeil或MaxInterval时间后被订阅设备未上报订阅数据或订阅设备未接收到订阅数据,订阅设备自动取消订阅;When MinIntervalFloor = 0, MaxIntervalCeil or MaxInterval! = 0×FFFF, the subscribed device only needs to report the subscription data within the MaxInterval time range. If the subscribed device does not report the subscription data or the subscribing device does not receive the subscription data after MaxIntervalCeil or MaxInterval time, the subscribing device automatically cancels the subscription;

·当MinIntervalFloor!=0,MaxIntervalCeil!=0×FFFF时,被订阅设备按照MinIntervalFloor设定的频率上报订阅数据;若在设定的MinIntervalFloor时间内被订阅设备未上报订阅数据或订阅设备未接收到订阅数据,并且超过MaxIntervalCeil定义的时间被订阅设备未上报订阅数据或订阅设备未接收到订阅数据,订阅设备自动取消订阅。When MinIntervalFloor! = 0, MaxIntervalCeil! = 0×FFFF, the subscribed device reports the subscription data at the frequency set by MinIntervalFloor; if the subscribed device does not report the subscription data or the subscribing device does not receive the subscription data within the set MinIntervalFloor time, and the subscribed device does not report the subscription data or the subscribing device does not receive the subscription data beyond the time defined by MaxIntervalCeil, the subscribing device automatically cancels the subscription.

应当理解的是,上述举例仅为示例性举例,不对本申请造成具体限定;其他能够根据订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来提供至少两种上报方式的实现方式,均在本申请保护范围之列,不再赘述。It should be understood that the above examples are merely illustrative examples and do not constitute a specific limitation on the present application; other implementation methods that can provide at least two reporting methods based on a subscription request, or based on the values of fields in a subscription request and a subscription response are all within the scope of protection of the present application and will not be described in detail.

综上所述,本申请实施例提供的数据传输方法中,为订阅数据提供了至少两种上报方式,从而为被订阅设备提供多种选择,以提高订阅数据的上报效率,满足订阅双方关于订阅数据的不同订阅需求。其中,订阅数据的上报方式至少根据订阅请求中所携带的最小时间间隔字段确定,如上报方式根据订阅请求中所携带的最小时间间隔字段和最大时间间隔字段确定,以避免订阅设备和被订阅设备关于订阅数据的最大时间间隔的协商过程。In summary, in the data transmission method provided in the embodiment of the present application, at least two reporting methods are provided for subscription data, thereby providing multiple options for the subscribed device to improve the reporting efficiency of subscription data and meet the different subscription requirements of the subscribing parties regarding subscription data. Among them, the reporting method of subscription data is determined at least according to the minimum time interval field carried in the subscription request, such as the reporting method is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request, so as to avoid the negotiation process between the subscribing device and the subscribed device regarding the maximum time interval of the subscription data.

图4示出了本申请一个示例性实施例提供的数据传输方法的流程图,该方法由订阅设备执行,该方法包括如下步骤:FIG4 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. The method is executed by a subscription device and includes the following steps:

步骤202:接收被订阅设备上报的订阅数据。Step 202: Receive subscription data reported by the subscribed device.

示意性的,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。Illustratively, there are at least two reporting modes corresponding to subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

其中,订阅数据是订阅设备与被订阅设备之间已经建立的订阅关系所对应的数据。示意性的,在执行步骤202之前,订阅设备与被订阅设备之间还需要进行订阅流程,具体描述可参考前述内容,不再赘述。The subscription data is data corresponding to the subscription relationship established between the subscribing device and the subscribed device. Schematically, before executing step 202, a subscription process needs to be performed between the subscribing device and the subscribed device. The specific description can refer to the above content and will not be repeated here.

可选的,订阅数据的上报方式包括如下:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报;间隔指定时长进行上报。Optionally, the subscription data may be reported in the following ways: reporting when the state of the attribute and/or event subscribed by the subscribing device changes; reporting at intervals of a specified duration.

其中,指定时长可根据订阅请求中所携带的最小间隔时间字段确定,或者根据订阅请求中所携带的最 大间隔时间字段确定,或者根据与订阅请求对应的订阅响应中所携带的最大间隔字段确定。The specified duration may be determined based on the minimum interval field carried in the subscription request, or based on the maximum interval field carried in the subscription request, or based on the maximum interval field carried in the subscription response corresponding to the subscription request.

根据前述内容,订阅数据的上报方式至少根据订阅请求中所携带的最小间隔时间字段确定。可选的,上报方式根据订阅请求中所携带的最小间隔时间字段和最大间隔时间字段确定;或者,上报方式根据订阅请求中所携带的最小间隔时间字段和与订阅请求对应的订阅响应中所携带的最大间隔字段确定。According to the foregoing, the reporting method of subscription data is determined at least according to the minimum interval field carried in the subscription request. Optionally, the reporting method is determined according to the minimum interval field and the maximum interval field carried in the subscription request; or, the reporting method is determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response corresponding to the subscription request.

其中,在确定订阅关系时,订阅双方可根据订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来确定订阅数据的具体上报方式。也即,订阅双方可仅基于订阅请求来确定上报方式,或者,订阅双方可基于订阅请求和订阅响应来确定上报方式。后文将对这两种确定方式展开描述,此处略过。Among them, when determining the subscription relationship, the two subscribers can determine the specific reporting method of the subscription data according to the subscription request, or according to the values of the fields in the subscription request and the subscription response. That is, the two subscribers can determine the reporting method based only on the subscription request, or the two subscribers can determine the reporting method based on the subscription request and the subscription response. These two determination methods will be described in detail later, and are omitted here.

可选的,最小间隔时间字段的默认值为第一取值,订阅请求中所携带的最大间隔时间字段的默认值为第二取值;或者,最小间隔时间字段的默认值为第一取值,订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为第二取值。Optionally, the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.

在一些实施例中,第一取值为0,第二取值为0×FFFF。In some embodiments, the first value is 0 and the second value is 0×FFFF.

例如,订阅设备向被订阅设备发送订阅请求,订阅请求中携带有最小间隔时间字段和最大间隔时间字段。在未赋予这两个字段以具体取值的情况下,默认最小间隔时间字段为第一取值、最大间隔时间字段为第二取值。For example, the subscribing device sends a subscription request to the subscribed device, and the subscription request carries a minimum interval field and a maximum interval field. In the case where no specific values are assigned to these two fields, the minimum interval field is assumed to be the first value and the maximum interval field is assumed to be the second value.

基于订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来确定订阅数据的具体上报方式的举例可参考前述内容,不再赘述。For examples of determining a specific reporting method for subscription data based on a subscription request, or based on the values of fields in a subscription request and a subscription response, please refer to the aforementioned content and will not be repeated here.

应当理解的是,上述举例仅为示例性举例,不对本申请造成具体限定;其他能够根据订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来提供至少两种上报方式的实现方式,均在本申请保护范围之列,不再赘述。It should be understood that the above examples are merely illustrative examples and do not constitute a specific limitation on the present application; other implementation methods that can provide at least two reporting methods based on a subscription request, or based on the values of fields in a subscription request and a subscription response are all within the scope of protection of the present application and will not be described in detail.

综上所述,本申请实施例提供的数据传输方法中,为订阅数据提供了至少两种上报方式,从而为被订阅设备提供多种选择,以提高订阅数据的上报效率,满足订阅双方关于订阅数据的不同订阅需求。其中,订阅数据的上报方式至少根据订阅请求中所携带的最小时间间隔字段确定,如上报方式根据订阅请求中所携带的最小时间间隔字段和最大时间间隔字段确定,以避免订阅设备和被订阅设备关于订阅数据的最大时间间隔的协商过程。In summary, in the data transmission method provided in the embodiment of the present application, at least two reporting methods are provided for subscription data, thereby providing multiple options for the subscribed device to improve the reporting efficiency of subscription data and meet the different subscription requirements of the subscribing parties regarding subscription data. Among them, the reporting method of subscription data is determined at least according to the minimum time interval field carried in the subscription request, such as the reporting method is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request, so as to avoid the negotiation process between the subscribing device and the subscribed device regarding the maximum time interval of the subscription data.

图5示出了本申请一个示例性实施例提供的数据传输方法的流程图。FIG. 5 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application.

其中,订阅数据是订阅设备与被订阅设备之间已经建立的订阅关系所对应的数据。基于此,为实现订阅数据的传输,订阅设备和被订阅设备需要先进行订阅流程,以明确订阅的属性和/或事件,从而使得被订阅设备能够基于建立的订阅关系进行订阅数据的上报。The subscription data is the data corresponding to the subscription relationship established between the subscribing device and the subscribed device. Based on this, in order to realize the transmission of subscription data, the subscribing device and the subscribed device need to first perform the subscription process to clarify the subscription attributes and/or events, so that the subscribed device can report the subscription data based on the established subscription relationship.

示意性的,订阅设备与被订阅设备之间的订阅流程包括如下:Schematically, the subscription process between the subscribing device and the subscribed device includes the following:

订阅设备向被订阅设备发送订阅请求,该订阅请求用于请求一个新的订阅关系;被订阅设备向订阅设备发送订阅响应,该订阅响应用于告知订阅设备已建立订阅请求所指示的订阅关系。The subscribing device sends a subscription request to the subscribed device, where the subscription request is used to request a new subscription relationship; the subscribed device sends a subscription response to the subscribing device, where the subscription response is used to inform the subscribing device that the subscription relationship indicated by the subscription request has been established.

随后,被订阅设备可根据至少两种上报方式中所确定的上报方式,进行上述订阅关系所对应的数据的上报。Subsequently, the subscribed device may report the data corresponding to the subscription relationship according to the reporting method determined in the at least two reporting methods.

示意性的,本申请实施例提供的数据传输方法包括如下步骤:Illustratively, the data transmission method provided in the embodiment of the present application includes the following steps:

步骤302:被订阅设备向订阅设备上报订阅数据。Step 302: The subscribed device reports subscription data to the subscribing device.

示意性的,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。Illustratively, there are at least two reporting modes corresponding to subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

可选的,订阅数据的上报方式包括如下:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报;间隔指定时长进行上报。Optionally, the subscription data may be reported in the following ways: reporting when the state of the attribute and/or event subscribed by the subscribing device changes; reporting at intervals of a specified duration.

关于上报方式的描述可参考前述内容,不再赘述。For the description of the reporting method, please refer to the above content and will not be repeated here.

根据前述内容,订阅数据的上报方式至少根据订阅请求中所携带的最小间隔时间字段确定。可选的,上报方式根据订阅请求中所携带的最小间隔时间字段和最大间隔时间字段确定;或者,上报方式根据订阅请求中所携带的最小间隔时间字段和与订阅请求对应的订阅响应中所携带的最大间隔字段确定。According to the foregoing, the reporting method of subscription data is determined at least according to the minimum interval field carried in the subscription request. Optionally, the reporting method is determined according to the minimum interval field and the maximum interval field carried in the subscription request; or, the reporting method is determined according to the minimum interval field carried in the subscription request and the maximum interval field carried in the subscription response corresponding to the subscription request.

其中,在确定订阅关系时,订阅双方可根据订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来确定订阅数据的具体上报方式。也即,订阅双方可仅基于订阅请求来确定上报方式,或者,订阅双方可基于订阅请求和订阅响应来确定上报方式,具体将在本申请实施例后展开描述。Among them, when determining the subscription relationship, the two subscribers can determine the specific reporting method of the subscription data according to the subscription request, or according to the values of the fields in the subscription request and the subscription response. That is, the two subscribers can determine the reporting method based only on the subscription request, or the two subscribers can determine the reporting method based on the subscription request and the subscription response, which will be described in detail after the embodiments of this application.

可选的,最小间隔时间字段的默认值为第一取值,订阅请求中所携带的最大间隔时间字段的默认值为第二取值;或者,最小间隔时间字段的默认值为第一取值,订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为第二取值。Optionally, the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.

在一些实施例中,第一取值为0,第二取值为0×FFFF。In some embodiments, the first value is 0 and the second value is 0×FFFF.

例如,订阅设备向被订阅设备发送订阅请求,订阅请求中携带有最小间隔时间字段和最大间隔时间字 段。在未赋予这两个字段以具体取值的情况下,默认最小间隔时间字段为第一取值、最大间隔时间字段为第二取值。For example, a subscribing device sends a subscription request to a subscribed device, and the subscription request carries a minimum interval field and a maximum interval field. If no specific values are assigned to these two fields, the minimum interval field is assumed to be the first value, and the maximum interval field is assumed to be the second value.

基于订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来确定订阅数据的具体上报方式的举例可参考前述内容,不再赘述。For examples of determining a specific reporting method for subscription data based on a subscription request, or based on the values of fields in a subscription request and a subscription response, please refer to the aforementioned content and will not be repeated here.

应当理解的是,上述举例仅为示例性举例,不对本申请造成具体限定;其他能够根据订阅请求、或者根据订阅请求和订阅响应中的字段的取值,来提供至少两种上报方式的实现方式,均在本申请保护范围之列,不再赘述。It should be understood that the above examples are merely illustrative examples and do not constitute a specific limitation on the present application; other implementation methods that can provide at least two reporting methods based on a subscription request, or based on the values of fields in a subscription request and a subscription response are all within the scope of protection of the present application and will not be described in detail.

应当理解的是,上述实施例中,订阅设备一侧的步骤和被订阅设备一侧的步骤均可单独实现为数据传输方法的一个实施例,具体阐释可参考前述内容。It should be understood that in the above embodiment, the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method. For specific explanations, please refer to the above content.

综上所述,本申请实施例提供的数据传输方法中,为订阅数据提供了至少两种上报方式,从而为被订阅设备提供多种选择,以提高订阅数据的上报效率,满足订阅双方关于订阅数据的不同订阅需求。To sum up, in the data transmission method provided in the embodiment of the present application, at least two reporting methods are provided for subscription data, thereby providing multiple options for the subscribed device to improve the reporting efficiency of subscription data and meet the different subscription requirements of the subscribers regarding subscription data.

其中,订阅数据的上报方式至少根据订阅请求中所携带的最小时间间隔字段确定。可选的,上报方式根据订阅请求中所携带的最小间隔时间字段和最大间隔时间字段确定;或者,上报方式根据订阅请求中所携带的最小间隔时间字段和与订阅请求对应的订阅响应中所携带的最大间隔字段确定。The reporting method of the subscription data is determined at least according to the minimum time interval field carried in the subscription request. Optionally, the reporting method is determined according to the minimum time interval field and the maximum time interval field carried in the subscription request; or, the reporting method is determined according to the minimum time interval field carried in the subscription request and the maximum time interval field carried in the subscription response corresponding to the subscription request.

可以理解为,订阅双方可仅基于订阅请求来确定上报方式,或者,订阅双方可基于订阅请求和订阅响应来确定上报方式,具体如下:It can be understood that the subscribers can determine the reporting method based only on the subscription request, or the subscribers can determine the reporting method based on the subscription request and the subscription response, as follows:

(1)订阅双方基于订阅请求来确定上报方式。(1) The subscribers determine the reporting method based on the subscription request.

可选的,在该种方式下,本申请实施例提供的数据传输方法还包括:Optionally, in this manner, the data transmission method provided in the embodiment of the present application further includes:

订阅设备向被订阅设备发送订阅请求,订阅请求中携带有最小间隔时间字段和最大间隔时间字段,订阅数据的上报方式根据最小间隔时间字段和最大间隔时间字段确定。The subscribing device sends a subscription request to the subscribed device. The subscription request carries a minimum interval time field and a maximum interval time field. The reporting method of the subscription data is determined according to the minimum interval time field and the maximum interval time field.

在一些实施例中,订阅请求中未明确最小间隔时间字段和最大间隔时间字段,则默认最小间隔时间字段为第一取值(如0)、最大间隔时间字段为第二取值(如0×FFFF)。也即,MinIntervalFloor=0,MaxIntervalCei=0×FFFF,确定上报方式为:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。In some embodiments, if the minimum interval time field and the maximum interval time field are not specified in the subscription request, the minimum interval time field is assumed to be the first value (such as 0) and the maximum interval time field is assumed to be the second value (such as 0×FFFF). That is, MinIntervalFloor = 0, MaxIntervalCei = 0×FFFF, and the reporting method is determined as: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.

应当理解的是,订阅请求中也可明确最小间隔时间字段为第一取值、最大间隔时间字段为第二取值,此时确定的上报方式仍然为:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。It should be understood that the subscription request may also specify that the minimum interval time field is the first value and the maximum interval time field is the second value. In this case, the reporting method is still determined as: reporting when the status of the attributes and/or events subscribed by the subscribing device changes.

在另一些实施例中,最小间隔时间字段为第三取值、最大间隔时间字段为第二取值。其中,第三取值是区别于第一取值和第二取值的数值,且第三取值不等于第一取值,可以理解为MinIntervalFloor!=0。示例性的,MinIntervalFloor!=0,MaxIntervalCeil=0×FFFF,确定上报方式为:间隔第一时长后进行上报,第一时长由第三取值指示。In some other embodiments, the minimum interval time field is the third value, and the maximum interval time field is the second value. The third value is a value different from the first value and the second value, and the third value is not equal to the first value, which can be understood as MinIntervalFloor! = 0. Exemplarily, MinIntervalFloor! = 0, MaxIntervalCeil = 0×FFFF, and the reporting method is determined as: reporting after the first interval, and the first interval is indicated by the third value.

在该种情况下,上报方式还包括:在间隔第一时长后未进行订阅数据的上报的情况下,在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。也即,若间隔第一时长后未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可继续等待,被订阅设备对于订阅数据的上报将从间隔第一时长后进行上报(固定间隔上报)、变化为在订阅的属性和/或事件的状态发生变化时进行上报(不固定间隔上报)。In this case, the reporting method also includes: in the case where the subscription data is not reported after the first time interval, reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. That is, if the subscription data is not reported after the first time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device can continue to wait, and the reporting of the subscription data by the subscribed device will change from reporting after the first time interval (fixed interval reporting) to reporting when the state of the subscribed attribute and/or event changes (non-fixed interval reporting).

在另一些实施例中,最小间隔时间字段为第一取值、最大间隔时间字段为第四取值。其中,第四取值是区别于第一取值和第二取值的数值,且第四取值不等于第二取值,可以理解为MaxIntervalCeil!=0。示例性的,MinIntervalFloor=0,MaxIntervalCeil!=0×FFFF,确定上报方式为:间隔第二时长后进行上报,第二时长由第四取值指示。In some other embodiments, the minimum interval time field is the first value, and the maximum interval time field is the fourth value. The fourth value is a value different from the first value and the second value, and the fourth value is not equal to the second value, which can be understood as MaxIntervalCeil! = 0. Exemplarily, MinIntervalFloor = 0, MaxIntervalCeil! = 0×FFFF, and the reporting method is determined as: reporting after the second interval, and the second interval is indicated by the fourth value.

在该种情况下,若间隔第二时长后仍然未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可自动取消该订阅。可选的,在间隔第二时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送第一指示信息,第一指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅。In this case, if the subscription data report is still not received after the second time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device may automatically cancel the subscription. Optionally, if the subscription data is not received after the second time interval, the subscribing device sends a first indication message to the subscribed device, and the first indication message is used to instruct the subscribing device to cancel the subscription of the subscription data of the subscribed device.

在另一些实施例中,最小间隔时间字段为第五取值、最大间隔时间字段为第六取值。其中,第五取值、第六取值均是区别于第一取值和第二取值的数值,且第五取值不等于第一取值,第六取值不等于第二取值,可以理解为MinIntervalFloor!=0,MaxIntervalCeil!=0×FFFF。应当理解的是,第五取值可等于第三取值,第六取值可等于第四取值。此时,确定上报方式为:间隔第三时长后进行上报,第三时长由第五取值指示。In some other embodiments, the minimum interval time field is the fifth value, and the maximum interval time field is the sixth value. Among them, the fifth value and the sixth value are both values different from the first value and the second value, and the fifth value is not equal to the first value, and the sixth value is not equal to the second value, which can be understood as MinIntervalFloor! = 0, MaxIntervalCeil! = 0×FFFF. It should be understood that the fifth value can be equal to the third value, and the sixth value can be equal to the fourth value. At this time, the reporting method is determined as: reporting after the third interval, and the third duration is indicated by the fifth value.

在该种情况下,若间隔第四时长后仍然未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可自动取消该订阅。其中,第四时长由第六取值指示。可选的,在间隔第四时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送第二指示信息,第二指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅。In this case, if the subscription data report is still not received after the fourth time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device may automatically cancel the subscription. The fourth time interval is indicated by the sixth value. Optionally, if the subscription data is not received after the fourth time interval, the subscribing device sends a second indication message to the subscribed device, and the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data.

可选的,在订阅双方基于订阅请求来确定上报方式的情况下,被订阅设备向订阅设备发送的订阅响应中可不携带最大间隔字段;或者,订阅响应中所携带的最大间隔字段不对上报方式造成限定。Optionally, when both parties determine the reporting method based on the subscription request, the subscription response sent by the subscribed device to the subscribing device may not carry the maximum interval field; or, the maximum interval field carried in the subscription response does not limit the reporting method.

(2)订阅双方基于订阅请求和订阅响应来确定上报方式。(2) The subscribers determine the reporting method based on the subscription request and subscription response.

可选的,在该种方式下,本申请实施例提供的数据传输方法还包括:Optionally, in this manner, the data transmission method provided in the embodiment of the present application further includes:

订阅设备向被订阅设备发送订阅请求,订阅请求中携带有最小间隔时间字段和最大间隔时间字段;The subscribing device sends a subscription request to the subscribed device, and the subscription request carries a minimum interval time field and a maximum interval time field;

被订阅设备向订阅设备发送订阅响应,订阅响应中携带有最大间隔字段;The subscribed device sends a subscription response to the subscribing device, and the subscription response carries a maximum interval field;

其中,订阅数据的上报方式根据最小间隔时间字段和最大间隔字段确定。The reporting method of the subscription data is determined according to the minimum interval time field and the maximum interval field.

在一些实施例中,订阅请求中未明确最小间隔时间字段,则默认最小间隔时间字段为第一取值(如0)。也即,MinIntervalFloor=0。应当理解的是,订阅请求中也可明确最小间隔时间字段为第一取值。随后,基于订阅响应中的最大间隔字段为第二取值(如0×FFFF),也即,MinIntervalFloor=0,MaxInterval=0×FFFF。此时,确定上报方式为:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。In some embodiments, if the minimum interval time field is not specified in the subscription request, the default minimum interval time field is the first value (such as 0). That is, MinIntervalFloor = 0. It should be understood that the minimum interval time field can also be specified as the first value in the subscription request. Subsequently, based on the maximum interval field in the subscription response being the second value (such as 0×FFFF), that is, MinIntervalFloor = 0, MaxInterval = 0×FFFF. At this time, the reporting method is determined as: reporting when the status of the attributes and/or events subscribed by the subscribing device changes.

在另一些实施例中,最小间隔时间字段为第三取值、最大间隔字段为第二取值。其中,第三取值是区别于第一取值和第二取值的数值,且第三取值不等于第一取值,可以理解为MinIntervalFloor!=0。示例性的,MinIntervalFloor!=0,MaxInterval=0×FFFF,确定上报方式为:间隔第一时长后进行上报,第一时长由第三取值指示。In some other embodiments, the minimum interval time field is the third value, and the maximum interval field is the second value. The third value is a value different from the first value and the second value, and the third value is not equal to the first value, which can be understood as MinIntervalFloor! = 0. Exemplarily, MinIntervalFloor! = 0, MaxInterval = 0×FFFF, and the reporting method is determined as: reporting after the first interval, and the first interval is indicated by the third value.

在该种情况下,上报方式还包括:在间隔第一时长后未进行订阅数据的上报的情况下,在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。也即,若间隔第一时长后未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可继续等待,被订阅设备对于订阅数据的上报将从间隔第一时长后进行上报(固定间隔上报)、变化为在订阅的属性和/或事件的状态发生变化时进行上报(不固定间隔上报)。In this case, the reporting method also includes: in the case where the subscription data is not reported after the first time interval, reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. That is, if the subscription data is not reported after the first time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device can continue to wait, and the reporting of the subscription data by the subscribed device will change from reporting after the first time interval (fixed interval reporting) to reporting when the state of the subscribed attribute and/or event changes (non-fixed interval reporting).

在另一些实施例中,最小间隔时间字段为第一取值、最大间隔字段为第四取值。其中,第四取值是区别于第一取值和第二取值的数值,且第四取值不等于第二取值,可以理解为MaxInterval!=0。示例性的,MinIntervalFloor=0,MaxInterval!=0×FFFF,确定上报方式为:间隔第二时长后进行上报,第二时长由第四取值指示。In some other embodiments, the minimum interval time field is the first value, and the maximum interval field is the fourth value. The fourth value is a value different from the first value and the second value, and the fourth value is not equal to the second value, which can be understood as MaxInterval! = 0. Exemplarily, MinIntervalFloor = 0, MaxInterval! = 0×FFFF, and the reporting method is determined as: reporting after the second interval, and the second interval is indicated by the fourth value.

在该种情况下,若间隔第二时长后仍然未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可自动取消该订阅。可选的,在间隔第二时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送第一指示信息,第一指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅。In this case, if the subscription data report is still not received after the second time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device may automatically cancel the subscription. Optionally, if the subscription data is not received after the second time interval, the subscribing device sends a first indication message to the subscribed device, and the first indication message is used to instruct the subscribing device to cancel the subscription of the subscription data of the subscribed device.

参考前述内容,订阅数据的上报方式包括如下:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报;间隔指定时长进行上报。With reference to the foregoing, the methods for reporting subscription data include: reporting when the status of the attributes and/or events subscribed by the subscribing device changes; reporting at intervals of a specified duration.

以下将给出订阅数据的上报方式的多种实现方式:The following are several ways to report subscription data:

实现方式一:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Implementation method 1: Report when the status of the attributes and/or events subscribed by the subscribing device changes.

图6示出了本申请一个示例性实施例提供的数据传输方法的流程图,步骤302可实现为步骤3021,具体如下:FIG6 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. Step 302 can be implemented as step 3021, which is as follows:

步骤3021:被订阅设备向订阅设备上报订阅数据。Step 3021: The subscribed device reports subscription data to the subscribing device.

其中,订阅数据的上报方式包括:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。The method of reporting subscription data includes: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.

可选的,上报方式根据第一取值和第二取值确定;Optionally, the reporting method is determined according to the first value and the second value;

其中,第一取值是最小间隔时间字段的取值,第二取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第一取值是最小间隔时间字段的取值,第二取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

在一些实施例中,第一取值为0,第二取值为0×FFFF。参考前述内容,第一取值和第二取值可以是默认的,也可以是订阅设备或被订阅设备赋予的。In some embodiments, the first value is 0, and the second value is 0×FFFF. Referring to the foregoing content, the first value and the second value may be default values, or may be assigned by the subscribing device or the subscribed device.

例如,在MinIntervalFloor=0,MaxIntervalCeil或MaxInterval=0×FFFF的情况下,将上报方式确定为:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。For example, when MinIntervalFloor=0, MaxIntervalCeil or MaxInterval=0×FFFF, the reporting mode is determined as: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.

可以理解为,根据第一取值和第二取值,可将订阅数据的上报方式设置为仅在订阅的属性和/或事件的状态发生变化时进行上报,也即,被订阅设备仅在订阅数据出现变化时进行上报。It can be understood that, according to the first value and the second value, the reporting mode of subscription data can be set to report only when the subscribed attributes and/or event status changes, that is, the subscribed device only reports when the subscription data changes.

应当理解的是,上述实施例中,订阅设备一侧的步骤和被订阅设备一侧的步骤均可单独实现为数据传输方法的一个实施例,具体阐释可参考前述内容。It should be understood that in the above embodiment, the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method. For specific explanations, please refer to the above content.

综上所述,本申请实施例提供的数据传输方法中,根据第一取值和第二取值,可将订阅数据的上报方式确定为:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。基于此,被订阅设备无需根据固定频率进行数据上报,从而能够避免数据的无效上报,减少订阅数据的上报频次,提高数据上报效率。In summary, in the data transmission method provided in the embodiment of the present application, according to the first value and the second value, the reporting method of the subscription data can be determined as: reporting when the state of the attribute and/or event subscribed by the subscribing device changes. Based on this, the subscribed device does not need to report data according to a fixed frequency, thereby avoiding invalid reporting of data, reducing the reporting frequency of subscription data, and improving data reporting efficiency.

实现方式二:间隔第一时长后进行上报。Implementation method 2: reporting after a first period of time.

图7示出了本申请一个示例性实施例提供的数据传输方法的流程图,步骤302可实现为步骤3022,具体如下:FIG. 7 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. Step 302 can be implemented as step 3022, which is as follows:

步骤3022:被订阅设备向订阅设备上报订阅数据。Step 3022: The subscribed device reports subscription data to the subscribing device.

其中,订阅数据的上报方式包括:间隔第一时长后进行上报,第一时长根据订阅请求中所携带的最小间隔时间字段确定。The reporting method of the subscription data includes: reporting after a first time interval, and the first time interval is determined according to the minimum interval time field carried in the subscription request.

可选的,上报方式根据第三取值和第二取值确定,第三取值用于指示第一时长;其中,第三取值是最小间隔时间字段的取值,第二取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第三取值是最小间隔时间字段的取值,第二取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to a third value and a second value, and the third value is used to indicate the first duration; wherein the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

在一些实施例中,第二取值为0×FFFF。In some embodiments, the second value is 0×FFFF.

参考前述内容,第二取值可以是默认的,也可以是订阅设备或被订阅设备赋予的。其中,第三取值是区别于第一取值和第二取值的数值,且第三取值不等于第一取值,可以理解为MinIntervalFloor!=0,MaxIntervalCeil或MaxInterval=0×FFFF。MinIntervalFloor!=0可理解为最小间隔时间字段的取值为不等于0的任意数值。此时,确定上报方式为:间隔第一时长后进行上报,第一时长由第三取值指示。Referring to the foregoing, the second value may be a default value or may be assigned by the subscribing device or the subscribed device. The third value is a value different from the first value and the second value, and the third value is not equal to the first value, which can be understood as MinIntervalFloor! = 0, MaxIntervalCeil or MaxInterval = 0×FFFF. MinIntervalFloor! = 0 can be understood as the value of the minimum interval time field being any value not equal to 0. At this time, the reporting method is determined as: reporting after the first interval, and the first interval is indicated by the third value.

可选的,上报方式还包括:在间隔第一时长后未进行订阅数据的上报的情况下,在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Optionally, the reporting method further includes: in the case where no subscription data is reported after a first period of time, reporting is performed when a state of an attribute and/or event subscribed by the subscribing device changes.

也即,若间隔第一时长后未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可继续等待,被订阅设备对于订阅数据的上报将从间隔第一时长后进行上报(固定间隔上报)、变化为在订阅的属性和/或事件的状态发生变化时进行上报(不固定间隔上报)。That is, if no report of subscription data is received after the first time period (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device may continue to wait, and the subscribed device will report the subscription data from after the first time period (fixed interval reporting) to when the status of the subscribed attributes and/or events changes (non-fixed interval reporting).

应当理解的是,上述实施例中,订阅设备一侧的步骤和被订阅设备一侧的步骤均可单独实现为数据传输方法的一个实施例,具体阐释可参考前述内容。It should be understood that in the above embodiment, the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method. For specific explanations, please refer to the above content.

综上所述,本申请实施例提供的数据传输方法中,根据第三取值和第二取值,可将订阅数据的上报方式确定为:间隔第一时长后进行上报;在间隔第一时长后未上报订阅数据的情况下,被订阅设备在订阅设备订阅的属性和/或事件的状态发生变化时上报订阅数据。To sum up, in the data transmission method provided in the embodiment of the present application, according to the third value and the second value, the reporting method of the subscription data can be determined as: reporting after a first time interval; if the subscription data is not reported after the first time interval, the subscribed device reports the subscription data when the status of the attributes and/or events subscribed by the subscribing device changes.

基于此,被订阅设备可首先根据固定频率进行数据上报,以保证订阅数据的传输;随后,在某一个第一时长后未上报订阅数据的情况下,被订阅设备可对上报方式进行调整,以避免订阅设备直接取消该订阅关系。采用这种上报方式,能够在保证订阅数据传输的情况下,避免对同一订阅数据的多次重复请求,从而间接地提高了订阅数据的上报效率。Based on this, the subscribed device can first report data according to a fixed frequency to ensure the transmission of the subscribed data; then, if the subscribed data is not reported after a certain first period of time, the subscribed device can adjust the reporting method to avoid the subscribing device directly canceling the subscription relationship. This reporting method can avoid repeated requests for the same subscribed data while ensuring the transmission of the subscribed data, thereby indirectly improving the reporting efficiency of the subscribed data.

实现方式三:间隔第二时长后进行上报。Implementation method three: reporting after a second period of time.

图8示出了本申请一个示例性实施例提供的数据传输方法的流程图,步骤302可实现为步骤3023,具体如下:FIG8 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. Step 302 can be implemented as step 3023, which is as follows:

步骤3023:被订阅设备向订阅设备上报订阅数据。Step 3023: The subscribed device reports subscription data to the subscribing device.

其中,订阅数据的上报方式包括:间隔第二时长后进行上报,第二时长根据订阅请求中所携带的最大间隔时间字段确定,或者,第二时长根据与订阅请求对应的订阅响应中所携带的最大间隔字段确定。Among them, the reporting method of subscription data includes: reporting after a second time interval, the second time interval is determined according to the maximum interval time field carried in the subscription request, or the second time interval is determined according to the maximum interval field carried in the subscription response corresponding to the subscription request.

可选的,上报方式根据第一取值和第四取值确定,第四取值用于指示第二时长;其中,第一取值是最小间隔时间字段的取值,第四取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第一取值是最小间隔时间字段的取值,第四取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined based on the first value and the fourth value, and the fourth value is used to indicate the second duration; wherein the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

在一些实施例中,第一取值为0。In some embodiments, the first value is 0.

参考前述内容,第一取值可以是默认的,也可以是订阅设备或被订阅设备赋予的。其中,第四取值是区别于第一取值和第二取值的数值,且第四取值不等于第二取值,可以理解为MinIntervalFloor=0,MaxIntervalCeil或MaxInterval!=0×FFFF。MaxIntervalCeil或MaxInterval!=0×FFFF可以理解为,最大间隔时间字段或最大间隔字段的取值为不等于0×FFFF的任意数值。此时,确定上报方式为:间隔第二时长后进行上报,第二时长由第四取值指示。With reference to the foregoing, the first value may be a default value or may be assigned by the subscribing device or the subscribed device. Among them, the fourth value is a value different from the first value and the second value, and the fourth value is not equal to the second value, which can be understood as MinIntervalFloor = 0, MaxIntervalCeil or MaxInterval! = 0×FFFF. MaxIntervalCeil or MaxInterval! = 0×FFFF can be understood as that the value of the maximum interval time field or the maximum interval field is any value not equal to 0×FFFF. At this time, the reporting method is determined as: reporting after the second interval, and the second interval is indicated by the fourth value.

在该种情况下,若间隔第二时长后仍然未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可自动取消该订阅,以避免长时间的等待。In this case, if no subscription data report is received after the second time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device may automatically cancel the subscription to avoid long waiting.

可选的,本申请实施例提供的数据传输方法还包括:Optionally, the data transmission method provided in the embodiment of the present application further includes:

步骤3041:在间隔第二时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送第一指示信息。Step 3041: When no subscription data is received after a second period of time, the subscribing device sends first indication information to the subscribed device.

示意性的,第一指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅。Illustratively, the first indication information is used to instruct the subscribing device to cancel the subscription of the subscribed device to the subscription data.

在一些实施例中,第一指示信息可通过订阅设备发送的订阅请求实现。例如,在间隔第二时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送订阅请求,订阅请求中所携带的保持订阅字段为false。基于相关技术中对于保持订阅字段的限定,可终止来自订阅设备的现有订阅,从而取消订阅设备对被订阅设备关于订阅数据的订阅。In some embodiments, the first indication information may be implemented through a subscription request sent by a subscription device. For example, when no subscription data is received after a second interval, the subscription device sends a subscription request to the subscribed device, and the keep subscription field carried in the subscription request is false. Based on the definition of the keep subscription field in the related art, the existing subscription from the subscription device may be terminated, thereby canceling the subscription of the subscription device to the subscribed device regarding the subscription data.

在一些实施例中,被订阅设备存在未接收到第一指示信息的情况,此时被订阅设备仍然向订阅设备上报订阅数据。基于此,本申请实施例提供的数据传输方法还包括:In some embodiments, the subscribed device may not receive the first indication information, and the subscribed device still reports the subscription data to the subscribing device. Based on this, the data transmission method provided in the embodiment of the present application also includes:

步骤305:订阅设备向被订阅设备发送状态码。Step 305: The subscribing device sends a status code to the subscribed device.

示意性的,状态码用于指示订阅数据是已取消或非活跃的订阅关系所对应的数据。Illustratively, the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.

其中,已取消或非活跃的订阅关系是指订阅设备已经告知需要取消的订阅关系。在一些实施例中,已取消或非活跃的订阅关系可通过特殊的订阅标识(如inactive Subscription ID)进行指示。基于状态码,被订阅设备可取消订阅数据所对应的订阅关系,从而避免向订阅设备再次上报订阅数据。Among them, a canceled or inactive subscription relationship refers to a subscription relationship that the subscribing device has informed of the need to cancel. In some embodiments, a canceled or inactive subscription relationship can be indicated by a special subscription identifier (such as inactive Subscription ID). Based on the status code, the subscribed device can cancel the subscription relationship corresponding to the subscription data, thereby avoiding reporting the subscription data to the subscribing device again.

示例性的,状态码为INACTIVE_SUBSCRIBE状态码。Exemplarily, the status code is an INACTIVE_SUBSCRIBE status code.

应当理解的是,上述实施例中,订阅设备一侧的步骤和被订阅设备一侧的步骤均可单独实现为数据传输方法的一个实施例,具体阐释可参考前述内容。It should be understood that in the above embodiment, the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method. For specific explanations, please refer to the above content.

综上所述,本申请实施例提供的数据传输方法中,根据第一取值和第四取值,可将订阅数据的上报方式确定为:间隔第二时长后进行上报;在间隔第二时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送用于取消订阅的第一指示信息。To sum up, in the data transmission method provided in the embodiment of the present application, according to the first value and the fourth value, the reporting method of the subscription data can be determined as: reporting after a second time interval; if the subscription data is not received after the second time interval, the subscribing device sends a first indication information for canceling the subscription to the subscribed device.

基于第二时长由第四取值指示,可扩大上报订阅数据的时间间隔,相对减少了订阅数据的上报频次,从而能够避免数据的无效上报,以提高订阅数据的上报效率。Based on the second duration indicated by the fourth value, the time interval for reporting subscription data can be extended, which relatively reduces the reporting frequency of subscription data, thereby avoiding invalid reporting of data and improving the reporting efficiency of subscription data.

实现方式四:间隔第三时长后进行上报。Implementation method 4: reporting after a third period of time.

图9示出了本申请一个示例性实施例提供的数据传输方法的流程图,步骤302可实现为步骤3024,具体如下:FIG. 9 shows a flow chart of a data transmission method provided by an exemplary embodiment of the present application. Step 302 can be implemented as step 3024, which is as follows:

步骤3024:被订阅设备向订阅设备上报订阅数据。Step 3024: The subscribed device reports subscription data to the subscribing device.

其中,订阅数据的上报方式包括:间隔第三时长后进行上报,第三时长根据订阅请求中所携带的最小间隔时间字段确定。The reporting method of the subscription data includes: reporting after a third time interval, and the third time interval is determined according to the minimum interval time field carried in the subscription request.

可选的,上报方式根据第五取值和第六取值确定,第五取值用于指示第三时长;其中,第五取值是最小间隔时间字段的取值,第六取值是订阅请求中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to the fifth value and the sixth value, and the fifth value is used to indicate the third duration; wherein the fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request.

应当理解的是,第五取值、第六取值均是区别于第一取值和第二取值的数值,且第五取值不等于第一取值,第六取值不等于第二取值。另外,第五取值可等于第三取值,第六取值可等于第四取值。It should be understood that the fifth value and the sixth value are both different from the first value and the second value, and the fifth value is not equal to the first value, and the sixth value is not equal to the second value. In addition, the fifth value may be equal to the third value, and the sixth value may be equal to the fourth value.

在一些实施例中,第一取值为0,第二取值为0×FFFF。In some embodiments, the first value is 0 and the second value is 0×FFFF.

参考前述内容,第一取值和第二取值可以是默认的,也可以是订阅设备或被订阅设备赋予的。示例性的,MinIntervalFloor!=0,MaxIntervalCeil!=0×FFFF。其中,MinIntervalFloor!=0可以理解为,最小间隔时间字段的取值为不等于0的任意数值;MaxIntervalCeil!=0×FFFF可以理解为,最大间隔字段的取值为不等于0×FFFF的任意数值。此时,确定上报方式为:间隔第三时长后进行上报,第三时长由第五取值指示。Referring to the foregoing content, the first value and the second value may be default or assigned by the subscribing device or the subscribed device. Exemplarily, MinIntervalFloor! = 0, MaxIntervalCeil! = 0×FFFF. Among them, MinIntervalFloor! = 0 can be understood as the value of the minimum interval time field is any value not equal to 0; MaxIntervalCeil! = 0×FFFF can be understood as the value of the maximum interval field is any value not equal to 0×FFFF. At this time, the reporting method is determined as: reporting after the third interval, and the third interval is indicated by the fifth value.

在该种情况下,若间隔第四时长后仍然未接收到订阅数据的上报(订阅设备未接收到订阅数据、或被订阅设备未进行上报),订阅设备可自动取消该订阅。其中,第四时长由第六取值指示。In this case, if the subscription data is still not reported after the fourth time interval (the subscribing device does not receive the subscription data, or the subscribed device does not report), the subscribing device may automatically cancel the subscription. The fourth time interval is indicated by the sixth value.

可选的,本申请实施例提供的数据传输方法还包括:Optionally, the data transmission method provided in the embodiment of the present application further includes:

步骤3042:在间隔第四时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送第二指示信息。Step 3042: When no subscription data is received after a fourth period of time, the subscribing device sends second indication information to the subscribed device.

示意性的,第二指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅。Illustratively, the second indication information is used to instruct the subscribing device to cancel the subscription of the subscribed device to the subscription data.

在一些实施例中,第二指示信息可通过订阅设备发送的订阅请求实现。例如,在间隔第四时长后未接收到订阅数据的情况下,订阅设备向被订阅设备发送订阅请求,订阅请求中所携带的保持订阅字段为false。基于相关技术中对于保持订阅字段的限定,可终止来自订阅设备的现有订阅,从而取消订阅设备对被订阅设备关于订阅数据的订阅。In some embodiments, the second indication information may be implemented through a subscription request sent by the subscription device. For example, when the subscription data is not received after the fourth time interval, the subscription device sends a subscription request to the subscribed device, and the keep subscription field carried in the subscription request is false. Based on the definition of the keep subscription field in the related art, the existing subscription from the subscription device may be terminated, thereby canceling the subscription of the subscription device to the subscription data of the subscribed device.

在一些实施例中,被订阅设备存在未接收到第二指示信息的情况,此时被订阅设备仍然向订阅设备上报订阅数据。基于此,本申请实施例提供的数据传输方法还包括:In some embodiments, the subscribed device may not receive the second indication information, and the subscribed device still reports the subscription data to the subscribing device. Based on this, the data transmission method provided in the embodiment of the present application also includes:

步骤305:订阅设备向被订阅设备发送状态码。Step 305: The subscribing device sends a status code to the subscribed device.

示意性的,状态码用于指示订阅数据是已取消或非活跃的订阅关系所对应的数据。Illustratively, the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.

其中,已取消或非活跃的订阅关系是指订阅设备已经告知需要取消的订阅关系。在一些实施例中,已取消或非活跃的订阅关系可通过特殊的订阅标识(如inactive Subscription ID)进行指示。基于状态码,被订阅设备可取消订阅数据所对应的订阅关系,从而避免向订阅设备再次上报订阅数据。Among them, a canceled or inactive subscription relationship refers to a subscription relationship that the subscribing device has informed of the need to cancel. In some embodiments, a canceled or inactive subscription relationship can be indicated by a special subscription identifier (such as inactive Subscription ID). Based on the status code, the subscribed device can cancel the subscription relationship corresponding to the subscription data, thereby avoiding reporting the subscription data to the subscribing device again.

示例性的,状态码为INACTIVE_SUBSCRIBE状态码。Exemplarily, the status code is an INACTIVE_SUBSCRIBE status code.

应当理解的是,上述实施例中,订阅设备一侧的步骤和被订阅设备一侧的步骤均可单独实现为数据传输方法的一个实施例,具体阐释可参考前述内容。It should be understood that in the above embodiment, the steps on the subscription device side and the steps on the subscribed device side can be independently implemented as an embodiment of the data transmission method. For specific explanations, please refer to the above content.

综上所述,本申请实施例提供的数据传输方法中,根据第五取值和第六取值,可将订阅数据的上报方式确定为:间隔第三时长后进行上报;在间隔第四时长后未接收到订阅数据的情况下,订阅设备向被订阅 设备发送用于取消订阅的第二指示信息。To sum up, in the data transmission method provided in the embodiment of the present application, according to the fifth value and the sixth value, the reporting method of the subscription data can be determined as: reporting after a third time interval; if the subscription data is not received after a fourth time interval, the subscribing device sends a second indication message for canceling the subscription to the subscribed device.

基于第三时长由第五取值指示,可扩大上报订阅数据的时间间隔,相对减少了订阅数据的上报频次,从而能够避免数据的无效上报,以提高订阅数据的上报效率。另外,基于第五取值和第六取值均包括在订阅请求中,将省去了订阅设备与被订阅设备对最大间隔时间的协商,从而使得订阅数据的上报方式的确定更加简便明了。Based on the third duration indicated by the fifth value, the time interval for reporting the subscription data can be expanded, and the reporting frequency of the subscription data can be relatively reduced, thereby avoiding invalid reporting of data to improve the reporting efficiency of the subscription data. In addition, based on the fifth value and the sixth value are both included in the subscription request, the negotiation of the maximum interval time between the subscribing device and the subscribed device is omitted, thereby making the determination of the reporting method of the subscription data more simple and clear.

应当理解的是,前述多个实施例中给出了订阅数据的不同上报方式的示例,上述多个实施例可单独实现,也可组合实现,本申请在此不做限定。It should be understood that the aforementioned multiple embodiments provide examples of different ways of reporting subscription data, and the aforementioned multiple embodiments may be implemented individually or in combination, and the present application does not limit this.

示例性的,本申请实施例提供的数据传输方法可实现为如下:Exemplarily, the data transmission method provided in the embodiment of the present application can be implemented as follows:

其中,被订阅设备(数据发布方)在收到订阅设备发送的订阅请求后,其上报数据给订阅设备的频率最低不能低于MinIntervalFloor(默认值0,单位s),最大不能超过MaxIntervalCeil或MaxInterval(默认值为0xFFFF,单位s)。Among them, after receiving the subscription request sent by the subscribing device, the subscribed device (data publisher) must report data to the subscribing device at a frequency that cannot be lower than MinIntervalFloor (default value 0, unit s) and cannot exceed MaxIntervalCeil or MaxInterval (default value 0xFFFF, unit s).

基于此,根据MinIntervalFloor和MaxIntervalCeil、或者MinIntervalFloor和MaxInterval,订阅数据有如下几种可选的上报方式:Based on this, according to MinIntervalFloor and MaxIntervalCeil, or MinIntervalFloor and MaxInterval, there are several optional reporting methods for subscription data:

(1)当MinIntervalFloor=0,MaxIntervalCeil或MaxInterval=0×FFFF时,表示被订阅设备允许只有在状态变化时上报数据;(1) When MinIntervalFloor = 0, MaxIntervalCeil or MaxInterval = 0×FFFF, it means that the subscribed device is allowed to report data only when the state changes;

(2)当MinIntervalFloor!=0,MaxIntervalCeil或MaxInterval=0×FFFF时,表示被订阅设备按照MinIntervalFloor设定的频率上报数据,如果在设定的MaxIntervalCeil或MinIntervalFloor时间内没有上报数据,订阅设备等待被订阅设备在数据发生变化时上报数据;(2) When MinIntervalFloor!=0, MaxIntervalCeil or MaxInterval=0×FFFF, it means that the subscribed device reports data according to the frequency set by MinIntervalFloor. If no data is reported within the set MaxIntervalCeil or MinIntervalFloor time, the subscribing device waits for the subscribed device to report data when the data changes;

(3)当MinIntervalFloor=0,MaxIntervalCeil或MaxInterval!=0×FFFF时,表示被订阅设备只要在MaxInterval时间范围内上报数据即可,如果超过MaxIntervalCeil或MaxInterval时间未上报,订阅方自动取消订阅;(3) When MinIntervalFloor = 0, MaxIntervalCeil or MaxInterval! = 0×FFFF, it means that the subscribed device only needs to report data within the MaxInterval time range. If it fails to report within the MaxIntervalCeil or MaxInterval time, the subscriber will automatically cancel the subscription;

(4)当MinIntervalFloor!=0,MaxIntervalCeil!=0×FFFF时,表示被订阅设备按照MinIntervalFloor设定的频率上报数据,如果在设定的MinIntervalFloor时间内没有上报数据,并且超过MaxIntervalCeil定义的时间未上报数据,订阅设备取消订阅。(4) When MinIntervalFloor!=0, MaxIntervalCeil!=0×FFFF, it means that the subscribed device reports data at the frequency set by MinIntervalFloor. If no data is reported within the set MinIntervalFloor time, and no data is reported beyond the time defined by MaxIntervalCeil, the subscribing device cancels the subscription.

可选的,若订阅设备收到已取消或者非活跃的订阅的数据上报,则发送INACTIVE_SUBSCRIBE状态码给被订阅设备。Optionally, if the subscribing device receives a data report of a canceled or inactive subscription, it sends an INACTIVE_SUBSCRIBE status code to the subscribed device.

以下为本申请的装置实施例,对于装置实施例中未详细描述的细节,可以结合参考上述方法实施例中相应的记载,本文不再赘述。The following is an embodiment of the device of the present application. For details not described in detail in the embodiment of the device, reference can be made to the corresponding records in the above method embodiment, and they will not be repeated herein.

图10示出了本申请一个示例性实施例提供的订阅请求装置的示意图,该装置包括:FIG10 shows a schematic diagram of a subscription request device provided by an exemplary embodiment of the present application, the device comprising:

上报模块1020,用于向订阅设备上报订阅数据;A reporting module 1020, used to report subscription data to a subscription device;

其中,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

可选的,上报方式根据如下信息确定:最小间隔时间字段;订阅请求中所携带的最大间隔时间字段。Optionally, the reporting method is determined according to the following information: the minimum interval time field; the maximum interval time field carried in the subscription request.

可选的,上报方式根据如下信息确定:最小间隔时间字段;与订阅请求对应的订阅响应中所携带的最大间隔字段。Optionally, the reporting method is determined according to the following information: the minimum interval time field; and the maximum interval field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Optionally, the reporting method includes: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.

可选的,上报方式根据第一取值和第二取值确定;其中,第一取值是最小间隔时间字段的取值,第二取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第一取值是最小间隔时间字段的取值,第二取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to a first value and a second value; wherein the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:间隔第一时长后进行上报,第一时长根据最小间隔时间字段确定。Optionally, the reporting method includes: reporting after a first time interval, and the first time interval is determined according to a minimum interval time field.

可选的,上报方式还包括:在间隔第一时长后未进行订阅数据的上报的情况下,在订阅设备订阅的属性和/或事件的状态发生变化时,向订阅设备上报订阅数据。Optionally, the reporting method further includes: when no subscription data is reported after a first period of time, when a state of an attribute and/or event subscribed by the subscription device changes, reporting the subscription data to the subscription device.

可选的,上报方式根据第三取值和第二取值确定,第三取值用于指示第一时长;其中,第三取值是最小间隔时间字段的取值,第二取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第三取值是最小间隔时间字段的取值,第二取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to a third value and a second value, and the third value is used to indicate the first duration; wherein the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:间隔第二时长后进行上报,第二时长根据订阅请求中所携带的最大间隔时间字段确定,或者,第二时长根据与订阅请求对应的订阅响应中所携带的最大间隔字段确定。Optionally, the reporting method includes: reporting after a second time interval, the second time interval is determined according to the maximum interval time field carried in the subscription request, or the second time interval is determined according to the maximum interval field carried in the subscription response corresponding to the subscription request.

可选的,装置还包括:接收模块1040,用于接收订阅设备发送的第一指示信息;其中,第一指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅,第一指示信息是在间隔第二时长后未接收到订阅数据的情况下发送的。Optionally, the device also includes: a receiving module 1040, used to receive a first indication message sent by a subscribing device; wherein the first indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the first indication message is sent when no subscription data is received after a second time interval.

可选的,上报方式根据第一取值和第四取值确定,第四取值用于指示第二时长;其中,第一取值是最 小间隔时间字段的取值,第四取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第一取值是最小间隔时间字段的取值,第四取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined based on the first value and the fourth value, and the fourth value is used to indicate the second duration; wherein the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:间隔第三时长后进行上报,第三时长根据最小间隔时间字段确定。Optionally, the reporting method includes: reporting after a third time interval, and the third time interval is determined according to the minimum interval time field.

可选的,装置还包括:接收模块1040,用于接收订阅设备发送的第二指示信息;其中,第二指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅,第二指示信息是在间隔第四时长后未接收到订阅数据的情况下发送的,第四时长大于第三时长。Optionally, the device also includes: a receiving module 1040, used to receive a second indication message sent by the subscribing device; wherein the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the second indication message is sent when no subscription data is received after a fourth time interval, and the fourth time interval is greater than the third time interval.

可选的,上报方式根据第五取值和第六取值确定,第五取值用于指示第三时长;其中,第五取值是最小间隔时间字段的取值,第六取值是订阅请求中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to the fifth value and the sixth value, and the fifth value is used to indicate the third duration; wherein the fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request.

可选的,最小间隔时间字段的默认值为第一取值,订阅请求中所携带的最大间隔时间字段的默认值为第二取值;或者,最小间隔时间字段的默认值为第一取值,订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为第二取值。Optionally, the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.

可选的,装置还包括:接收模块1040,用于接收订阅设备发送的状态码;其中,状态码用于指示订阅数据是已取消或非活跃的订阅关系所对应的数据。Optionally, the apparatus further includes: a receiving module 1040, configured to receive a status code sent by a subscription device; wherein the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.

图11示出了本申请一个示例性实施例提供的订阅请求装置的示意图,该装置包括:FIG11 shows a schematic diagram of a subscription request device provided by an exemplary embodiment of the present application, the device comprising:

接收模块1120,用于接收被订阅设备上报的订阅数据;The receiving module 1120 is used to receive subscription data reported by the subscribed device;

其中,订阅数据对应有至少两种上报方式,上报方式至少根据订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device.

可选的,上报方式根据如下信息确定:最小间隔时间字段;订阅请求中所携带的最大间隔时间字段。Optionally, the reporting method is determined according to the following information: the minimum interval time field; the maximum interval time field carried in the subscription request.

可选的,上报方式根据如下信息确定:最小间隔时间字段;与订阅请求对应的订阅响应中所携带的最大间隔字段。Optionally, the reporting method is determined according to the following information: the minimum interval time field; and the maximum interval field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Optionally, the reporting method includes: reporting when the state of the attribute and/or event subscribed by the subscribing device changes.

可选的,上报方式根据第一取值和第二取值确定;其中,第一取值是最小间隔时间字段的取值,第二取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第一取值是最小间隔时间字段的取值,第二取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to a first value and a second value; wherein the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:间隔第一时长后进行上报,第一时长根据最小间隔时间字段确定;或者,在间隔第一时长后未进行订阅数据的上报的情况下,在订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Optionally, the reporting method includes: reporting after a first time interval, the first time interval is determined according to the minimum interval time field; or, if no subscription data is reported after the first time interval, reporting is performed when the status of the attributes and/or events subscribed by the subscribing device changes.

可选的,上报方式根据第三取值和第二取值确定,第三取值用于指示第一时长;其中,第三取值是最小间隔时间字段的取值,第二取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第三取值是最小间隔时间字段的取值,第二取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to a third value and a second value, and the third value is used to indicate the first duration; wherein the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:间隔第二时长后进行上报,第二时长根据订阅请求中所携带的最大间隔时间字段确定,或者,第二时长根据与订阅请求对应的订阅响应中所携带的最大间隔字段确定。Optionally, the reporting method includes: reporting after a second time interval, the second time interval is determined according to the maximum interval time field carried in the subscription request, or the second time interval is determined according to the maximum interval field carried in the subscription response corresponding to the subscription request.

可选的,装置还包括:发送模块1140,用于在间隔第二时长后未接收到订阅数据的情况下,向被订阅设备发送第一指示信息;其中,第一指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅。Optionally, the apparatus further includes: a sending module 1140, configured to send a first indication message to the subscribed device when no subscription data is received after a second time interval; wherein the first indication message is used to indicate cancellation of the subscription of the subscribing device to the subscription data of the subscribed device.

可选的,上报方式根据第一取值和第四取值确定,第四取值用于指示第二时长;其中,第一取值是最小间隔时间字段的取值,第四取值是订阅请求中所携带的最大间隔时间字段的取值;或者,第一取值是最小间隔时间字段的取值,第四取值是与订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined based on the first value and the fourth value, and the fourth value is used to indicate the second duration; wherein the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request.

可选的,上报方式包括:间隔第三时长后进行上报,第三时长根据最小间隔时间字段确定。Optionally, the reporting method includes: reporting after a third time interval, and the third time interval is determined according to the minimum interval time field.

可选的,装置还包括:发送模块1140,用于在间隔第四时长后未接收到订阅数据的情况下,向订阅设备发送第二指示信息;其中,第二指示信息用于指示取消订阅设备对被订阅设备关于订阅数据的订阅,第四时长大于第三时长。Optionally, the device also includes: a sending module 1140, used to send a second indication message to the subscribing device when no subscription data is received after a fourth time interval; wherein the second indication message is used to indicate the cancellation of the subscription of the subscribing device to the subscription data of the subscribed device, and the fourth time interval is greater than the third time interval.

可选的,上报方式根据第五取值和第六取值确定,第五取值用于指示第三时长;其中,第五取值是最小间隔时间字段的取值,第六取值是订阅请求中所携带的最大间隔时间字段的取值。Optionally, the reporting method is determined according to the fifth value and the sixth value, and the fifth value is used to indicate the third duration; wherein the fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request.

可选的,最小间隔时间字段的默认值为第一取值,订阅请求中所携带的最大间隔时间字段的默认值为第二取值;或者,最小间隔时间字段的默认值为第一取值,订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为第二取值。Optionally, the default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; or, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value.

可选的,装置还包括:发送模块1140,用于向被订阅设备发送状态码;其中,状态码用于指示订阅数据是已取消或非活跃的订阅关系所对应的数据。Optionally, the apparatus further includes: a sending module 1140, configured to send a status code to the subscribed device; wherein the status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship.

图12示出了本申请一个示例性实施例提供的通信设备(订阅设备或被订阅设备)的结构示意图,该通信设备包括:处理器1201、接收器1202、发射器1203、存储器1204和总线1205。FIG12 shows a schematic diagram of the structure of a communication device (subscribing device or subscribed device) provided by an exemplary embodiment of the present application. The communication device includes: a processor 1201 , a receiver 1202 , a transmitter 1203 , a memory 1204 and a bus 1205 .

处理器1201包括一个或者一个以上处理核心,处理器1201通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。The processor 1201 includes one or more processing cores. The processor 1201 executes various functional applications and information processing by running software programs and modules.

接收器1202和发射器1203可以实现为一个通信组件,该通信组件可以是一块通信芯片。The receiver 1202 and the transmitter 1203 may be implemented as a communication component, which may be a communication chip.

存储器1204通过总线1205与处理器1201相连。The memory 1204 is connected to the processor 1201 via a bus 1205 .

存储器1204可用于存储至少一个指令,处理器1201用于执行该至少一个指令,以实现上述方法实施例中提到的数据传输方法的各个步骤。The memory 1204 may be used to store at least one instruction, and the processor 1201 may be used to execute the at least one instruction to implement each step of the data transmission method mentioned in the above method embodiment.

此外,存储器1204可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器(Electrically-Erasable Programmable Read Only Memory,EEPROM),可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM),静态随时存取存储器(Static Random Access Memory,SRAM),只读存储器(Read-Only Memory,ROM),磁存储器,快闪存储器,可编程只读存储器(Programmable Read-Only Memory,PROM)。In addition, memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof. Volatile or non-volatile storage devices include but are not limited to: magnetic disks or optical disks, electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), read-only memory (ROM), magnetic memory, flash memory, and programmable read-only memory (PROM).

本申请还提供了一种被订阅设备,被订阅设备包括存储器和处理器;存储器中存储有至少一条程序代码,程序代码由处理器加载并执行以实现前述的数据传输方法。The present application also provides a subscribed device, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the aforementioned data transmission method.

本申请还提供了一种订阅设备,订阅设备包括存储器和处理器;存储器中存储有至少一条程序代码,程序代码由处理器加载并执行以实现前述的数据传输方法。The present application also provides a subscription device, which includes a memory and a processor; at least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the aforementioned data transmission method.

本申请还提供了一种计算机可读存储介质,存储介质中存储有计算机程序,计算机程序用于被处理器执行,以实现前述的数据传输方法。The present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program is used to be executed by a processor to implement the aforementioned data transmission method.

本申请还提供了一种芯片,芯片包括可编程逻辑电路和/或程序指令,当安装有芯片的电子设备运行时,用于实现前述的数据传输方法。The present application also provides a chip, which includes a programmable logic circuit and/or program instructions, and is used to implement the aforementioned data transmission method when an electronic device equipped with the chip is running.

本申请还提供了一种计算机程序产品,计算机程序产品包括计算机指令,计算机指令存储在计算机可读存储介质中,处理器从计算机可读存储介质读取并执行计算机指令,以实现前述的数据传输方法。The present application also provides a computer program product, which includes computer instructions. The computer instructions are stored in a computer-readable storage medium. A processor reads and executes the computer instructions from the computer-readable storage medium to implement the aforementioned data transmission method.

以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims (67)

一种数据传输方法,其特征在于,所述方法由被订阅设备执行,所述方法包括:A data transmission method, characterized in that the method is executed by a subscribed device, and the method comprises: 向订阅设备上报订阅数据;Report subscription data to the subscription device; 其中,所述订阅数据对应有至少两种上报方式,所述上报方式至少根据所述订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device. 根据权利要求1所述的方法,其特征在于,所述上报方式根据如下信息确定:The method according to claim 1, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 所述订阅请求中所携带的最大间隔时间字段。The maximum interval time field carried in the subscription request. 根据权利要求1所述的方法,其特征在于,所述上报方式根据如下信息确定:The method according to claim 1, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 与所述订阅请求对应的订阅响应中所携带的最大间隔字段。The maximum interval field carried in the subscription response corresponding to the subscription request. 根据权利要求1至3任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 1 to 3, characterized in that the reporting method includes: 在所述订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. 根据权利要求4所述的方法,其特征在于,The method according to claim 4, characterized in that 所述上报方式根据第一取值和第二取值确定;The reporting method is determined according to the first value and the second value; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求1至3任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 1 to 3, characterized in that the reporting method includes: 间隔第一时长后进行上报,所述第一时长根据所述最小间隔时间字段确定。The reporting is performed after a first time interval, where the first time interval is determined according to the minimum interval time field. 根据权利要求6所述的方法,其特征在于,所述上报方式还包括:The method according to claim 6, characterized in that the reporting method further comprises: 在间隔所述第一时长后未进行所述订阅数据的上报的情况下,在所述订阅设备订阅的属性和/或事件的状态发生变化时,向所述订阅设备上报所述订阅数据。In the case that the subscription data is not reported after the first period of time, the subscription data is reported to the subscription device when the state of the attribute and/or event subscribed by the subscription device changes. 根据权利要求6或7所述的方法,其特征在于,The method according to claim 6 or 7, characterized in that 所述上报方式根据第三取值和第二取值确定,所述第三取值用于指示所述第一时长;The reporting mode is determined according to a third value and a second value, and the third value is used to indicate the first duration; 其中,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求1至3任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 1 to 3, characterized in that the reporting method includes: 间隔第二时长后进行上报,所述第二时长根据所述订阅请求中所携带的最大间隔时间字段确定,或者,所述第二时长根据与所述订阅请求对应的订阅响应中所携带的最大间隔字段确定。The reporting is performed after a second time interval, where the second time interval is determined according to a maximum interval time field carried in the subscription request, or the second time interval is determined according to a maximum interval field carried in a subscription response corresponding to the subscription request. 根据权利要求9所述的方法,其特征在于,所述方法还包括:The method according to claim 9, characterized in that the method further comprises: 接收所述订阅设备发送的第一指示信息;Receiving first indication information sent by the subscription device; 其中,所述第一指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅,所述第一指示信息是在间隔所述第二时长后未接收到所述订阅数据的情况下发送的。The first indication information is used to indicate cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data, and the first indication information is sent when the subscription data is not received after the second time interval. 根据权利要求9或10所述的方法,其特征在于,The method according to claim 9 or 10, characterized in that 所述上报方式根据第一取值和第四取值确定,所述第四取值用于指示所述第二时长;The reporting mode is determined according to the first value and the fourth value, and the fourth value is used to indicate the second duration; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求1至3任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 1 to 3, characterized in that the reporting method includes: 间隔第三时长后进行上报,所述第三时长根据所述最小间隔时间字段确定。The report is performed after a third time interval, where the third time interval is determined according to the minimum interval time field. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method according to claim 12, characterized in that the method further comprises: 接收所述订阅设备发送的第二指示信息;Receiving second indication information sent by the subscription device; 其中,所述第二指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅,所述第二指示信息是在间隔第四时长后未接收到所述订阅数据的情况下发送的,所述第四时长大于所述第三时长。The second indication information is used to indicate cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data, and the second indication information is sent when the subscription data is not received after a fourth time period, and the fourth time period is greater than the third time period. 根据权利要求12所述的方法,其特征在于,The method according to claim 12, characterized in that 所述上报方式根据第五取值和第六取值确定,所述第五取值用于指示所述第三时长;The reporting mode is determined according to a fifth value and a sixth value, wherein the fifth value is used to indicate the third duration; 其中,所述第五取值是所述最小间隔时间字段的取值,所述第六取值是所述订阅请求中所携带的最大间隔时间字段的取值。The fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request. 根据权利要求1至14任一所述的方法,其特征在于,The method according to any one of claims 1 to 14, characterized in that 所述最小间隔时间字段的默认值为第一取值,所述订阅请求中所携带的最大间隔时间字段的默认值为第二取值;The default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; 或者,所述最小间隔时间字段的默认值为所述第一取值,所述订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为所述第二取值。Alternatively, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value. 根据权利要求1至15任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 15, characterized in that the method further comprises: 接收所述订阅设备发送的状态码;Receiving a status code sent by the subscription device; 其中,所述状态码用于指示所述订阅数据是已取消或非活跃的订阅关系所对应的数据。The status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship. 一种数据传输方法,其特征在于,所述方法由订阅设备执行,所述方法包括:A data transmission method, characterized in that the method is executed by a subscription device, and the method comprises: 接收被订阅设备上报的订阅数据;Receive subscription data reported by the subscribed device; 其中,所述订阅数据对应有至少两种上报方式,所述上报方式至少根据所述订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device. 根据权利要求17所述的方法,其特征在于,所述上报方式根据如下信息确定:The method according to claim 17, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 所述订阅请求中所携带的最大间隔时间字段。The maximum interval time field carried in the subscription request. 根据权利要求17所述的方法,其特征在于,所述上报方式根据如下信息确定:The method according to claim 17, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 与所述订阅请求对应的订阅响应中所携带的最大间隔字段。The maximum interval field carried in the subscription response corresponding to the subscription request. 根据权利要求17至19任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 17 to 19, characterized in that the reporting method comprises: 在所述订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Reporting is performed when the status of the attribute and/or event subscribed by the subscribing device changes. 根据权利要求20所述的方法,其特征在于,The method according to claim 20, characterized in that 所述上报方式根据第一取值和第二取值确定;The reporting method is determined according to the first value and the second value; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求17至19任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 17 to 19, characterized in that the reporting method comprises: 间隔第一时长后进行上报,所述第一时长根据所述最小间隔时间字段确定;Reporting after a first time interval, where the first time interval is determined according to the minimum interval time field; 或者,在间隔所述第一时长后未进行所述订阅数据的上报的情况下,在所述订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Alternatively, in the case where the subscription data is not reported after the first time period, reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. 根据权利要求22所述的方法,其特征在于,The method according to claim 22, characterized in that 所述上报方式根据第三取值和第二取值确定,所述第三取值用于指示所述第一时长;The reporting mode is determined according to a third value and a second value, and the third value is used to indicate the first duration; 其中,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅 请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求17至19任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 17 to 19, characterized in that the reporting method comprises: 间隔第二时长后进行上报,所述第二时长根据所述订阅请求中所携带的最大间隔时间字段确定,或者,所述第二时长根据与所述订阅请求对应的订阅响应中所携带的最大间隔字段确定。The reporting is performed after a second time interval, where the second time interval is determined according to a maximum interval time field carried in the subscription request, or the second time interval is determined according to a maximum interval field carried in a subscription response corresponding to the subscription request. 根据权利要求24所述的方法,其特征在于,所述方法还包括:The method according to claim 24, characterized in that the method further comprises: 在间隔所述第二时长后未接收到所述订阅数据的情况下,向所述被订阅设备发送第一指示信息;If the subscription data is not received after the second time interval, sending first indication information to the subscribed device; 其中,所述第一指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅。The first indication information is used to instruct to cancel the subscription of the subscribing device to the subscribed device regarding the subscription data. 根据权利要求24或25所述的方法,其特征在于,The method according to claim 24 or 25, characterized in that 所述上报方式根据第一取值和第四取值确定,所述第四取值用于指示所述第二时长;The reporting mode is determined according to the first value and the fourth value, and the fourth value is used to indicate the second duration; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求17至19任一所述的方法,其特征在于,所述上报方式包括:The method according to any one of claims 17 to 19, characterized in that the reporting method comprises: 间隔第三时长后进行上报,所述第三时长根据所述最小间隔时间字段确定。The report is performed after a third time interval, where the third time interval is determined according to the minimum interval time field. 根据权利要求27所述的方法,其特征在于,所述方法还包括:The method according to claim 27, characterized in that the method further comprises: 在间隔所述第四时长后未接收到所述订阅数据的情况下,向所述订阅设备发送第二指示信息;If the subscription data is not received after the fourth time interval, sending second indication information to the subscription device; 其中,所述第二指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅,所述第四时长大于所述第三时长。The second indication information is used to indicate cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data, and the fourth time period is greater than the third time period. 根据权利要求27所述的方法,其特征在于,The method according to claim 27, characterized in that 所述上报方式根据第五取值和第六取值确定,所述第五取值用于指示所述第三时长;The reporting mode is determined according to a fifth value and a sixth value, wherein the fifth value is used to indicate the third duration; 其中,所述第五取值是所述最小间隔时间字段的取值,所述第六取值是所述订阅请求中所携带的最大间隔时间字段的取值。The fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request. 根据权利要求17至29任一所述的方法,其特征在于,The method according to any one of claims 17 to 29, characterized in that 所述最小间隔时间字段的默认值为第一取值,所述订阅请求中所携带的最大间隔时间字段的默认值为第二取值;The default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; 或者,所述最小间隔时间字段的默认值为第一取值,所述订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为所述第二取值。Alternatively, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value. 根据权利要求17至30任一所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 17 to 30, characterized in that the method further comprises: 向被订阅设备发送状态码;Send a status code to the subscribed device; 其中,所述状态码用于指示所述订阅数据是已取消或非活跃的订阅关系所对应的数据。The status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship. 一种数据传输装置,其特征在于,所述装置包括:A data transmission device, characterized in that the device comprises: 上报模块,用于向订阅设备上报订阅数据;Reporting module, used to report subscription data to the subscription device; 其中,所述订阅数据对应有至少两种上报方式,所述上报方式至少根据所述订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device. 根据权利要求32所述的装置,其特征在于,所述上报方式根据如下信息确定:The device according to claim 32, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 所述订阅请求中所携带的最大间隔时间字段。The maximum interval time field carried in the subscription request. 根据权利要求32所述的装置,其特征在于,所述上报方式根据如下信息确定:The device according to claim 32, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 与所述订阅请求对应的订阅响应中所携带的最大间隔字段。The maximum interval field carried in the subscription response corresponding to the subscription request. 根据权利要求32至34任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 32 to 34, characterized in that the reporting method includes: 在所述订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. 根据权利要求35所述的装置,其特征在于,The device according to claim 35, characterized in that 所述上报方式根据第一取值和第二取值确定;The reporting method is determined according to the first value and the second value; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求32至34任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 32 to 34, characterized in that the reporting method includes: 间隔第一时长后进行上报,所述第一时长根据所述最小间隔时间字段确定。The reporting is performed after a first time interval, where the first time interval is determined according to the minimum interval time field. 根据权利要求37所述的装置,其特征在于,所述上报方式还包括:The device according to claim 37, characterized in that the reporting method further comprises: 在间隔所述第一时长后未进行所述订阅数据的上报的情况下,在所述订阅设备订阅的属性和/或事件的状态发生变化时,向所述订阅设备上报所述订阅数据。In the case that the subscription data is not reported after the first period of time, the subscription data is reported to the subscription device when the state of the attribute and/or event subscribed by the subscription device changes. 根据权利要求37或38所述的装置,其特征在于,The device according to claim 37 or 38, characterized in that 所述上报方式根据第三取值和第二取值确定,所述第三取值用于指示所述第一时长;The reporting mode is determined according to a third value and a second value, and the third value is used to indicate the first duration; 其中,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求32至34任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 32 to 34, characterized in that the reporting method includes: 间隔第二时长后进行上报,所述第二时长根据所述订阅请求中所携带的最大间隔时间字段确定,或者,所述第二时长根据与所述订阅请求对应的订阅响应中所携带的最大间隔字段确定。The reporting is performed after a second time interval, where the second time interval is determined according to a maximum interval time field carried in the subscription request, or the second time interval is determined according to a maximum interval field carried in a subscription response corresponding to the subscription request. 根据权利要求40所述的装置,其特征在于,所述装置还包括:The device according to claim 40, characterized in that the device further comprises: 接收模块,用于接收所述订阅设备发送的第一指示信息;A receiving module, configured to receive first indication information sent by the subscription device; 其中,所述第一指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅,所述第一指示信息是在间隔所述第二时长后未接收到所述订阅数据的情况下发送的。The first indication information is used to indicate cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data, and the first indication information is sent when the subscription data is not received after the second time interval. 根据权利要求40或41所述的装置,其特征在于,The device according to claim 40 or 41, characterized in that 所述上报方式根据第一取值和第四取值确定,所述第四取值用于指示所述第二时长;The reporting mode is determined according to the first value and the fourth value, and the fourth value is used to indicate the second duration; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求32至34任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 32 to 34, characterized in that the reporting method includes: 间隔第三时长后进行上报,所述第三时长根据所述最小间隔时间字段确定。The report is performed after a third time interval, where the third time interval is determined according to the minimum interval time field. 根据权利要求43所述的装置,其特征在于,所述装置还包括:The device according to claim 43, characterized in that the device further comprises: 接收模块,用于接收所述订阅设备发送的第二指示信息;A receiving module, configured to receive second indication information sent by the subscription device; 其中,所述第二指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅,所述第二指示信息是在间隔第四时长后未接收到所述订阅数据的情况下发送的,所述第四时长大于所述第三时长。The second indication information is used to indicate cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data, and the second indication information is sent when the subscription data is not received after a fourth time period, and the fourth time period is greater than the third time period. 根据权利要求43所述的装置,其特征在于,The device according to claim 43, characterized in that 所述上报方式根据第五取值和第六取值确定,所述第五取值用于指示所述第三时长;The reporting mode is determined according to a fifth value and a sixth value, wherein the fifth value is used to indicate the third duration; 其中,所述第五取值是所述最小间隔时间字段的取值,所述第六取值是所述订阅请求中所携带的最大间隔时间字段的取值。The fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request. 根据权利要求32至45任一所述的装置,其特征在于,The device according to any one of claims 32 to 45, characterized in that 所述最小间隔时间字段的默认值为第一取值,所述订阅请求中所携带的最大间隔时间字段的默认值为第二取值;The default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; 或者,所述最小间隔时间字段的默认值为所述第一取值,所述订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为所述第二取值。Alternatively, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value. 根据权利要求32至46任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 32 to 46, characterized in that the device further comprises: 接收模块,用于接收所述订阅设备发送的状态码;A receiving module, used for receiving a status code sent by the subscription device; 其中,所述状态码用于指示所述订阅数据是已取消或非活跃的订阅关系所对应的数据。The status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship. 一种数据传输装置,其特征在于,所述装置由订阅设备执行,所述装置包括:A data transmission device, characterized in that the device is executed by a subscription device, and the device comprises: 接收模块,用于接收被订阅设备上报的订阅数据;A receiving module, used to receive subscription data reported by the subscribed device; 其中,所述订阅数据对应有至少两种上报方式,所述上报方式至少根据所述订阅设备发送的订阅请求中所携带的最小间隔时间字段确定。There are at least two reporting modes corresponding to the subscription data, and the reporting mode is determined at least according to the minimum interval time field carried in the subscription request sent by the subscription device. 根据权利要求48所述的装置,其特征在于,所述上报方式根据如下信息确定:The device according to claim 48, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 所述订阅请求中所携带的最大间隔时间字段。The maximum interval time field carried in the subscription request. 根据权利要求48所述的装置,其特征在于,所述上报方式根据如下信息确定:The device according to claim 48, characterized in that the reporting method is determined according to the following information: 所述最小间隔时间字段;The minimum interval time field; 与所述订阅请求对应的订阅响应中所携带的最大间隔字段。The maximum interval field carried in the subscription response corresponding to the subscription request. 根据权利要求48至50任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 48 to 50, characterized in that the reporting method includes: 在所述订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Reporting is performed when the state of the attribute and/or event subscribed by the subscribing device changes. 根据权利要求51所述的装置,其特征在于,The device according to claim 51, characterized in that 所述上报方式根据第一取值和第二取值确定;The reporting method is determined according to the first value and the second value; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求48至50任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 48 to 50, characterized in that the reporting method includes: 间隔第一时长后进行上报,所述第一时长根据所述最小间隔时间字段确定;Reporting after a first time interval, where the first time interval is determined according to the minimum interval time field; 或者,在间隔所述第一时长后未进行所述订阅数据的上报的情况下,在所述订阅设备订阅的属性和/或事件的状态发生变化时进行上报。Alternatively, in the case where the subscription data is not reported after the first time period, reporting is performed when the state of the attribute and/or event subscribed by the subscription device changes. 根据权利要求53所述的装置,其特征在于,The device according to claim 53, characterized in that 所述上报方式根据第三取值和第二取值确定,所述第三取值用于指示所述第一时长;The reporting mode is determined according to a third value and a second value, and the third value is used to indicate the first duration; 其中,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第三取值是所述最小间隔时间字段的取值,所述第二取值是与所述订阅请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription request; or, the third value is the value of the minimum interval time field, and the second value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求48至50任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 48 to 50, characterized in that the reporting method includes: 间隔第二时长后进行上报,所述第二时长根据所述订阅请求中所携带的最大间隔时间字段确定,或者,所述第二时长根据与所述订阅请求对应的订阅响应中所携带的最大间隔字段确定。The reporting is performed after a second time interval, where the second time interval is determined according to a maximum interval time field carried in the subscription request, or the second time interval is determined according to a maximum interval field carried in a subscription response corresponding to the subscription request. 根据权利要求55所述的装置,其特征在于,所述装置还包括:The device according to claim 55, characterized in that the device further comprises: 发送模块,用于在间隔所述第二时长后未接收到所述订阅数据的情况下,向所述被订阅设备发送第一指示信息;A sending module, configured to send first indication information to the subscribed device if the subscription data is not received after the second time interval; 其中,所述第一指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅。The first indication information is used to instruct to cancel the subscription of the subscribing device to the subscribed device regarding the subscription data. 根据权利要求55或56所述的装置,其特征在于,The device according to claim 55 or 56, characterized in that 所述上报方式根据第一取值和第四取值确定,所述第四取值用于指示所述第二时长;The reporting mode is determined according to the first value and the fourth value, and the fourth value is used to indicate the second duration; 其中,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是所述订阅请求中所携带的最大间隔时间字段的取值;或者,所述第一取值是所述最小间隔时间字段的取值,所述第四取值是与所述订阅 请求对应的订阅响应中所携带的最大间隔时间字段的取值。Among them, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription request; or, the first value is the value of the minimum interval time field, and the fourth value is the value of the maximum interval time field carried in the subscription response corresponding to the subscription request. 根据权利要求48至50任一所述的装置,其特征在于,所述上报方式包括:The device according to any one of claims 48 to 50, characterized in that the reporting method includes: 间隔第三时长后进行上报,所述第三时长根据所述最小间隔时间字段确定。The report is performed after a third time interval, where the third time interval is determined according to the minimum interval time field. 根据权利要求58所述的装置,其特征在于,所述装置还包括:The device according to claim 58, characterized in that the device further comprises: 发送模块,用于在间隔所述第四时长后未接收到所述订阅数据的情况下,向所述订阅设备发送第二指示信息;A sending module, configured to send second indication information to the subscription device if the subscription data is not received after the fourth time interval; 其中,所述第二指示信息用于指示取消所述订阅设备对所述被订阅设备关于所述订阅数据的订阅,所述第四时长大于所述第三时长。The second indication information is used to indicate cancellation of the subscription of the subscribing device to the subscribed device regarding the subscription data, and the fourth time period is greater than the third time period. 根据权利要求58所述的装置,其特征在于,The device according to claim 58, characterized in that 所述上报方式根据第五取值和第六取值确定,所述第五取值用于指示所述第三时长;The reporting mode is determined according to a fifth value and a sixth value, wherein the fifth value is used to indicate the third duration; 其中,所述第五取值是所述最小间隔时间字段的取值,所述第六取值是所述订阅请求中所携带的最大间隔时间字段的取值。The fifth value is the value of the minimum interval time field, and the sixth value is the value of the maximum interval time field carried in the subscription request. 根据权利要求48至60任一所述的装置,其特征在于,The device according to any one of claims 48 to 60, characterized in that 所述最小间隔时间字段的默认值为第一取值,所述订阅请求中所携带的最大间隔时间字段的默认值为第二取值;The default value of the minimum interval time field is the first value, and the default value of the maximum interval time field carried in the subscription request is the second value; 或者,所述最小间隔时间字段的默认值为第一取值,所述订阅请求对应的订阅响应中所携带的最大间隔字段的默认值为所述第二取值。Alternatively, the default value of the minimum interval time field is the first value, and the default value of the maximum interval field carried in the subscription response corresponding to the subscription request is the second value. 根据权利要求48至61任一所述的装置,其特征在于,所述装置还包括:The device according to any one of claims 48 to 61, characterized in that the device further comprises: 发送模块,用于向被订阅设备发送状态码;A sending module, used to send a status code to a subscribed device; 其中,所述状态码用于指示所述订阅数据是已取消或非活跃的订阅关系所对应的数据。The status code is used to indicate that the subscription data is data corresponding to a canceled or inactive subscription relationship. 一种被订阅设备,其特征在于,所述被订阅设备包括存储器和处理器;A subscribed device, characterized in that the subscribed device includes a memory and a processor; 所述存储器中存储有至少一条程序代码,所述程序代码由所述处理器加载并执行以实现如权利要求1至16中任一项所述的数据传输方法。At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data transmission method according to any one of claims 1 to 16. 一种订阅设备,其特征在于,所述订阅设备包括存储器和处理器;A subscription device, characterized in that the subscription device comprises a memory and a processor; 所述存储器中存储有至少一条程序代码,所述程序代码由所述处理器加载并执行以实现如权利要求17至31中任一项所述的数据传输方法。At least one program code is stored in the memory, and the program code is loaded and executed by the processor to implement the data transmission method according to any one of claims 17 to 31. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有计算机程序,所述计算机程序用于被处理器执行,以实现如权利要求1至31中任一项所述的数据传输方法。A computer-readable storage medium, characterized in that a computer program is stored in the storage medium, and the computer program is used to be executed by a processor to implement the data transmission method described in any one of claims 1 to 31. 一种芯片,其特征在于,所述芯片包括可编程逻辑电路和/或程序指令,当安装有所述芯片的电子设备运行时,用于实现如权利要求1至31中任一项所述的数据传输方法。A chip, characterized in that the chip includes a programmable logic circuit and/or program instructions, and when an electronic device equipped with the chip is running, it is used to implement the data transmission method described in any one of claims 1 to 31. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中,处理器从所述计算机可读存储介质读取并执行所述计算机指令,以实现如权利要求1至31中任一项所述的数据传输方法。A computer program product, characterized in that the computer program product includes computer instructions, the computer instructions are stored in a computer-readable storage medium, and a processor reads and executes the computer instructions from the computer-readable storage medium to implement the data transmission method described in any one of claims 1 to 31.
PCT/CN2022/128501 2022-10-31 2022-10-31 Data transmission method and apparatus, device, and storage medium Ceased WO2024092379A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202280097885.4A CN119487803A (en) 2022-10-31 2022-10-31 Data transmission method, device, equipment and storage medium
PCT/CN2022/128501 WO2024092379A1 (en) 2022-10-31 2022-10-31 Data transmission method and apparatus, device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/128501 WO2024092379A1 (en) 2022-10-31 2022-10-31 Data transmission method and apparatus, device, and storage medium

Publications (1)

Publication Number Publication Date
WO2024092379A1 true WO2024092379A1 (en) 2024-05-10

Family

ID=90929175

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/128501 Ceased WO2024092379A1 (en) 2022-10-31 2022-10-31 Data transmission method and apparatus, device, and storage medium

Country Status (2)

Country Link
CN (1) CN119487803A (en)
WO (1) WO2024092379A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266042A1 (en) * 2006-05-11 2007-11-15 Ming-Ta Hsu Methods and systems for report retrieval and presentation
CN105210345A (en) * 2013-08-30 2015-12-30 华为技术有限公司 Network capability information transmitting method and device
CN111182568A (en) * 2020-01-07 2020-05-19 腾讯科技(深圳)有限公司 Communication method, communication device, computer readable medium and electronic equipment
US20200322775A1 (en) * 2019-04-02 2020-10-08 Electronics And Telecommunications Research Institute Network data collection method from network function device for network data analytic function
CN112188533A (en) * 2019-07-03 2021-01-05 华为技术有限公司 Method and device for reporting network performance
CN113825191A (en) * 2021-08-27 2021-12-21 青岛海尔科技有限公司 Subscription method and device for equipment information

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266042A1 (en) * 2006-05-11 2007-11-15 Ming-Ta Hsu Methods and systems for report retrieval and presentation
CN105210345A (en) * 2013-08-30 2015-12-30 华为技术有限公司 Network capability information transmitting method and device
US20200322775A1 (en) * 2019-04-02 2020-10-08 Electronics And Telecommunications Research Institute Network data collection method from network function device for network data analytic function
CN112188533A (en) * 2019-07-03 2021-01-05 华为技术有限公司 Method and device for reporting network performance
CN111182568A (en) * 2020-01-07 2020-05-19 腾讯科技(深圳)有限公司 Communication method, communication device, computer readable medium and electronic equipment
CN113825191A (en) * 2021-08-27 2021-12-21 青岛海尔科技有限公司 Subscription method and device for equipment information

Also Published As

Publication number Publication date
CN119487803A (en) 2025-02-18

Similar Documents

Publication Publication Date Title
CN107995215B (en) Control method and device of intelligent household equipment and cloud platform server
AU2017427437B2 (en) Pdu type setting method, ue policy setting method, and related entity
EP3968702B1 (en) Determining a network function to perform service communication with another network function
CN114285683B (en) Method and equipment for configuring household equipment in batches
WO2022022584A1 (en) Hashrate sharing method and related device
WO2023198068A1 (en) Mobility management method and apparatus, terminal, network side device and medium
CN107409270A (en) Method and apparatus for establishing a connection between devices
CN110519761A (en) Verification method, device, electronic equipment and the storage medium of subscriber identification card
CN109451481A (en) The configuration method of network performance parameter and the method for determining province&#39;s electrical parameter
CN108322557B (en) Application equipment discovery method and device, computer equipment and storage medium
CN111586716B (en) Network slice deployment method and device
CN113259928A (en) OTA (over the air) upgrading method and device, electronic equipment, storage medium and program product
JP2014143461A (en) Radio base station, radio communication system using the same, and radio communication connection method
CN112787828A (en) Application flow statistical method and device and mobile electronic device
WO2024092379A1 (en) Data transmission method and apparatus, device, and storage medium
CN114616899A (en) Terminal control apparatus and method
WO2024050698A1 (en) Subscription request methods and apparatuses, device, and storage medium
CN107257586B (en) Mobile network connection method and system when smart terminal is connected to WiFi
CN116567656A (en) Information acquisition and storage, reporting method, device, terminal and network function
CN115054161A (en) Floor sweeping robot and base station communication method, communication system, equipment and storage medium
CN116847330A (en) Negotiation method, terminal and network side equipment during terminal unavailability period
CN116418474A (en) Communication method, device, communication device and readable storage medium
CN113382458A (en) Equipment network-resident dialing method, computer equipment and storage medium
CN111885570B (en) Network access method, electronic equipment and storage medium
CN116112925B (en) Methods, devices, network elements and media for contract renewal

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: 22963702

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202280097885.4

Country of ref document: CN

WWP Wipo information: published in national office

Ref document number: 202280097885.4

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22963702

Country of ref document: EP

Kind code of ref document: A1