هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.
- What's New
- Product Bulletin
- Service Overview
- Billing
-
Getting Started
-
Quick Device Access - Property Reporting and Command Receiving
- Subscribing to IoTDA
- Connecting a Smart Smoke Detector to the Platform (Quick Usage)
- Registering a Simulated Smart Street Light Device
- Using MQTT.fx to Simulate Communication Between the Smart Street Light and the Platform
- Using a Virtual Smart Street Light to Communicate with the Platform (Java SDK)
- Using a Virtual Smart Street Light to Communicate with the Platform (C SDK)
- Quick Device Access - Message Sending and Receiving
- Quick Application Access
-
Quick Device Access - Property Reporting and Command Receiving
-
User Guide
- Overview
- IoTDA Instances
- Resource Spaces
- Device Access
- Message Communications
- Device Management
-
Rules
- Overview
- Data Forwarding Process
- SQL Statements
- Connectivity Tests
- Data Forwarding to Huawei Cloud Services
- Data Forwarding to Third-Party Applications
- Data Forwarding Channel Details
- Data Forwarding Stack Policies
- Data Forwarding Flow Control Policies
- Abnormal Data Target
- Device Linkage
- Monitoring and O&M
- Granting Permissions Using IAM
-
Best Practices
- Introduction
-
Device Access
- Developing an MQTT-based Simulated Smart Street Light Online
- Developing a Smart Street Light Using NB-IoT BearPi
- Developing a Smart Smoke Detector Using NB-IoT BearPi
- Connecting and Debugging an NB-IoT Smart Street Light Using a Simulator
- Developing a Protocol Conversion Gateway for Access of Generic-Protocol Devices
- Connecting a Device That Uses the X.509 Certificate Based on MQTT.fx
- Connecting to IoTDA Based on the BearPi-HM_Nano Development Board and OpenHarmony 3.0
- Testing MQTT Performance Using JMeter
- Device Management
- Data Forwarding
- Device Linkage
-
Developer Guide
- Before You Start
- Obtaining Resources
- Product Development
- Development on the Device Side
- Development on the Application Side
-
API Reference
-
API Reference on the Application Side
- Before You Start
- Calling APIs
- API Overview
-
API
- Product Management
- Device Management
- Device Message
- Device Command APIs
- Device Property
- AMQP Queue Management
- Access Credential Management
- Data Forwarding Rule Management
-
Transition Data
- Push a Device Status Change Notification
- Push a Device Property Reporting Notification
- Push a Device Message Status Change Notification
- Push a Batch Task Status Change Notification
- Push a Device Message Reporting Notification
- Push a Device Addition Notification
- Push a Device Update Notification
- Push a Device Deletion Notification
- Push a Product Addition Notification
- Push a Product Update Notification
- Push a Product Deletion Notification
- Push an Asynchronous Device Command Status Change Notification
- Rule Management
- Device Shadow
- Group Management
- Tag Management
- Instance Management
- Resource Space Management
- Batch Task
- Device CA Certificate Management
- OTA Upgrade Package Management
- Message Broadcasting
- Device Tunnel Management
- Stack policy management
- Flow control policy management
- Device Proxy
- Device Policy Management
- Bridge Management
- Pre-provisioning Template Management
- Custom Authentication
- Codec Function Management
- Permissions and Supported Actions
- Examples
- Appendix
-
MQTT or MQTTS API Reference on the Device Side
- Before You Start
- Communication Modes
- Topics
- Device Connection Authentication
- Device Commands
- Device Messages
- Device Properties
-
Gateway and Child Device Management
- Platform Notifying a Gateway of New Child Device Connection
- Platform Notifying a Gateway of Child Device Deletion
- Gateway Synchronizing Child Device Information
- Gateway Updating Child Device Status
- Responding to a Request for Updating Child Device Statuses
- Gateway Requesting for Adding Child Devices
- Platform Responding to a Request for Adding Child Devices
- Gateway Requesting for Deleting Child Devices
- Platform Responding to a Request for Deleting Child Devices
- Software and Firmware Upgrade
- File Upload and Download
- Device Time Synchronization
- Device Reporting Information
- Device Log Collection
- Remote Configuration
- Device Tunnel Management
- HTTPS API Reference on the Device Side
- LwM2M API Reference on the Device Side
- Security Tunnel WebSocket API Reference
- Module AT Command Reference
- Change History
-
API Reference on the Application Side
- SDK Reference
-
FAQs
- Top FAQs
-
Solution Consulting
- In What Scenarios Can the IoT Platform Be Applied?
- What Are the Changes Brought by the Integration of IoT Device Management and IoTDA?
- Can I Enable IoTDA for IAM Users or Sub-Projects?
- Which Regions of Huawei Cloud Are Supported by the IoT Platform?
- Does Huawei Provide Modules, Hardware Devices, and Application Software?
- What Should I Do If I Want to Call an API But Have No Permissions to Do So as an IAM User? (Is It Edition-specific?)
- Why Was I Prompted to Grant Security Administrator Permissions When I Create a Rule or Set Resource File Storage?
- Which Resource Space Will Be Set As Default on the IoT Platform?
- How Does IoTDA Obtain Device Data?
- Is There Any Limitation on the Number of Resource Spaces and Devices I Can Add on the IoT Platform?
- Does the IoTDA Support Device Registration in Batches?
- Are There Any Limitations on the Use of the IoT Platform?
- What DTLS Encryption Algorithms Are Supported by the IoT Platform?
- Does the IoT Platform Support Conversion Between Big-Endian and Little-Endian for Binary Data?
- What Is NB-IoT?
- What Are the Components of the IoT Platform and What Hardware Architectures Does It Support?
- How Do I Obtain the Platform Access Address?
- Device Integration
- IoT Device SDKs
- LwM2M/CoAP Device Access
- MQTT-based Device Access
- Products Models
- Message Communications
- Subscription and Push
- Codecs
- OTA Upgrades
- Application Integration
- General Reference
Copied.
Forwarding Data to FunctionGraph
Scenarios
FunctionGraph processes the real-time stream data reported by devices to IoTDA. With FunctionGraph, you only need to upload your code and set running conditions to track device properties, message reporting, and status changes as well as analyze, sort out, and measure data flows.
In this example, all properties reported by devices are forwarded to FunctionGraph. The properties are pushed to different paths on your HTTP server based on the resource space ID. You need to deploy an HTTP server. In this example, the data forwarding capability of IoTDA triggers the event function. No additional trigger is required.
Building a Function Project
You can download and use the source code (including function dependencies) for converting the format of reported device properties and forwarding the data to a third-party application.
Creating a project
This example uses the Java language to implement device connection, data stream conversion, and data push. For details about function development, see Developing Functions in Java.
Download the sample source code, decompress it, and import it to IDEA. For details about the code, see Sample code. Transfer your server address through the function environment variable NA_MOCK_SERVER_ADDRESS.

Packaging the project
Package the project into a JAR file using Build Artifacts of IDEA. The following figure shows the IDEA configuration and packaging.


Uploading the Function to FunctionGraph
Create a function on the FunctionGraph console.
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click Create Function.
- Configure the function information, as shown in the following figure.
Click Create from scratch.
Enter IoTDA_FUNCTION_HTTPCLIENT_DEMO in Function Name.
Select Java 8 for Runtime.
Figure 4 Creating a function - Click Create Function. After the function is created, the function details page is displayed.
- Click the Code tab and click Upload > Local JAR to upload the code package FunctionGraphFun.jar.
Figure 5 Uploading the code
- Modify the function runtime parameters. Click the Configuration tab, choose Basic Settings, and set Handler to com.huawei.iot.function.gamma.IoTDataFlowHttpClientTrigger.funTest. Click Save to save the configuration.
Figure 6 Setting the handler
NOTICE:
The default function memory size is 512 MB, and the default timeout interval is 15s. This example is only for demonstration. For commercial use, optimize the function parameters based on the site requirements.
- Modify the environment variables transferred during function calling. Set the environment variable NA_MOCK_SERVER_ADDRESS to the target HTTP server address. Note that the server address in the example is not a real one. Replace it with your actual HTTP server address. Click Save to save the configuration.
Figure 7 Configuring environment variables for function calling
Adding an Event Source
After creating the function, you can add an event source. In this example, an HTTP push test event is configured to simulate device data forwarded by IoTDA. The procedure is as follows:
- On the IoTDA_FUNCTION_HTTPCLIENT_DEMO function page, click the Code tab and select Configure Test Event.
Figure 8 Configuring a test event
- In the Configure Test Event dialog box, enter the test event information.
Select Create new test event.
Event Templates: Select blank-template.
Event Name: Enter event-property.
The following is an example of the test parameters for reporting device properties:
{ "resource":"device.property", "event":"report", "event_time":"string", "notify_data":{ "header":{ "app_id":"********", "device_id":"********", "node_id":"ABC123456789", "product_id":"ABC123456789", "gateway_id":"********", "tags":[{ "tag_key":"testTagName", "tag_value":"testTagValue" }] }, "body":{ "services":[{ "service_id":"string", "properties":{ }, "event_time":"string" }] } } }
Figure 9 Configuring a test event - Click Save.
Testing Data
Perform the following steps to process the simulated data:
- On the function details page, select test event event-property, and click Test to test the function.
Figure 10 Configuring a test event
- After the function is executed, view the function execution status in the log on the right of the function details page.
Figure 11 Function execution result
Configuring IoTDA
You can set configure data forwarding rules in IoTDA to forward data reported by devices to FunctionGraph.
- Visit the IoTDA product page and click Try Now.
- In the navigation pane, choose Rules>Data Forwarding, and click Create Rule in the upper left corner.
- Set the parameters based on the table below. The following parameter values are only examples. You can create a rule by referring to Data Forwarding Overview and click Create Rule.
Parameter
Description
Rule Name
Customize a name, for example, iotda-functiongraph.
Description
Enter a rule description, for example, forwarding data to FunctionGraph.
Data Source
Select Device property.
Trigger
Device property reported is automatically populated.
Resource Spaces
Select All resource spaces.
Figure 12 Rules triggered by property reporting - Forwarding data to FunctionGraph - Click the Set Forwarding Target tab, click Add to set a forwarding target, and click OK.
Parameter
Description
Forwarding Target
Select FunctionGraph.
Region
Currently, you can only forward data to FunctionGraph in the same region. If IoTDA is not authorized to access the service in this region, configure cloud service access authorization as prompted.
Target Function
Select the function created in FunctionGraph.
Figure 13 Creating a forwarding target - to FunctionGraph - Click Enable Rule to activate the configured data forwarding rule.
Verifying the Configurations
- You can connect a physical device registered with IoTDA to the platform and report properties defined in the product model.
- You can also use a simulator to simulate device properties reporting. For details, see Developing an MQTT-based Smart Street Light Online.
Expected result: The data reported by the device is displayed in the server logs.

Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot