Data processing

更新时间:
复制 MD 格式

Data processing nodes include the Page Navigation node, Parallel Data Processing node, Serial Data Processing node, Sequence Execution node, and WebSocket node. You can configure these nodes in the blueprint editor to navigate between pages, transform data, control execution order, and communicate across screens.

Page Navigation node

The Page Navigation node redirects to another page in a new browser tab or the current tab. You can include custom parameters in the redirection URL.

Scenario: The Page Navigation node is commonly used to redirect users to a new page. For example, clicking an area on a map can jump to a pre-configured sub-page for that area. When you click the map area, use a Serial Data Processing node to retrieve the adcode field value of the current area. The returned parameter data is return {adcode: data.area_id};. Then, in the configuration panel of the Page Navigation node, set the sub-page URL to https://www.other-page.com. Define a custom parameter variable named adcode. Finally, connect the output from the serial data processing node to the Open Page input of the Page Navigation node.

Add the Page Navigation node to the canvas to view its supported events, actions, and configuration parameters. For more information about how to add the node, see Use logic nodes.

Page Navigation processing panel

Parameter

Description

URL

The URL of the target page.

Open in new tab

Turn on this switch to open the URL in a new browser tab. Turn off to open it in the current tab.

Request parameters

You can customize the Parameter Name and Parameter Value for the request when redirecting.

Click the 加号图标 or 垃圾桶图标 icon to add or delete a request parameter. Click the 横排列图标 or 竖排列图标 icon to arrange multiple request parameters. Click the 复制图标 icon to copy the current request parameter configuration and add a new one with the same settings.

This table describes only the parameters under Other Configurations. For more information about other parameters, see Common parameter description.

Outputs: None.

Parallel Data Processing node

The Parallel Data Processing node processes multiple events in parallel. The events are independent and do not affect each other.

Scenario: The Parallel Data Processing node is commonly used for data distribution. For example, a widget's API returns {name: 'Blueprint Editor', version: 'v1.0' }. To distribute this data to two general title widgets — one using the name field and the other using the version field — add two processing methods: return [{value: data.name}] and return [{value: data.version}].

Add the Parallel Data Processing node to the canvas to view its supported events, actions, and configuration parameters. For more information about how to add nodes, see Use Logical Nodes.

Parallel data processing panel

Event or action

Description

Processing method

A parallel data processing method. You can add multiple processing methods in the configuration panel. After you add them, the Parallel Data Processing node displays the added methods. Each method can connect to a different ancestor node to process data in parallel.

Parameter

Description

Processing method

Write a JavaScript function body. The return value can be of any type.

This table describes only the parameters under Other Configurations. For more information about other parameters, see Common parameter description.

Outputs: The result of each processing method applied to the output from its corresponding ancestor node.

Serial Data Processing node

The Serial Data Processing node processes data through a series of sequential operations.

Scenario: For example, to convert the decimal 0.835 to the integer percentage 83%, perform a series of serial operations: unit conversion (83.5) -> rounding (83) -> adding a string suffix (83%).

Add the Serial data processing node to the canvas to view its supported events, actions, and configuration parameters. For more information, see Use logic nodes.

Serial data processing panel

Event or action

Description

Processing method

A serial data processing method. You can add multiple processing methods in the configuration panel. After you add them, the Serial Data Processing node displays the added methods. The methods are applied sequentially to process the data.

Parameter

Description

Processing method

Write a JavaScript function body. The return value can be of any type.

This table describes only the parameters under Other Configurations. For more information about other parameters, see Common parameter description.

Outputs: The result of all processing methods sequentially applied to the output from the ancestor node.

Sequence Execution node

The Sequence Execution node executes actions on descendant nodes in a specified order, from top to bottom.

Scenario: For example, to switch between data panels for different scenarios where each scenario has many panels, first hide the panels for Scenario A and then show the panels for Scenario B. Use the Sequence Execution node to group the data panels by scenario and execute them in order.

Add the Sequence Execution node to the canvas to view its supported events, actions, and configuration parameters. For more information about how to add nodes, see Use logic nodes.

Sequence execution panel

Event or action

Description

Execute

Receives the output from the ancestor node for processing.

Data processing

The data processing methods for the sequence execution node. You can add multiple processing methods in the configuration panel. After you add them, the Sequence Execution node displays the added methods. The methods process data in the specified order.

Parameter

Description

Processing method

Write a JavaScript function body. The return value can be of any type. You can add multiple methods. Each method calculates independently, using the output from the previous node as input. The output of each method does not affect the others.

This table describes only the parameters under Other Configurations. For more information about other parameters, see Common parameter description.

Outputs: The result of each processing method sequentially applied to the output from the ancestor node.

WebSocket node

The WebSocket node enables communication between screens. Each message consists of a message name and data. The message name is defined in the configuration, and the data is the output from the previous node.

Scenario: The WebSocket node supports command and data transmission between multiple terminals, such as a large screen and a mobile device, or a large screen and a touch screen.

Add the WebSocket node to the canvas to view its configuration parameters. For more information about how to add nodes, see Use logical nodes.

websocket

Parameter

Description

Socket service endpoint

The endpoint of the socket backend service. We provide the DataV-WS toolkit for you to use. For more information, see How to use the DataV-WS service.

Screen ID

The ID of the screen where this WebSocket node is located. Enter a custom ID.

Screen name

The name of the screen where this WebSocket node is located. Enter a custom name.

Group

WebSocket node messages are broadcast only within the same group under the same socket service. Typically, a single group name is agreed upon for the same project.

Receive message

The name of the message that this WebSocket node receives from other terminals.

Click the 加号图标 or 垃圾桶图标 icon to add or delete a received message. Click the 横排列图标 or 竖排列图标 icon to arrange multiple received messages. Click the 复制图标 icon to copy the current received message configuration and add a new one with the same settings.

Send message

The name of the message that this WebSocket node sends to other terminals.

Click the 加号图标 or 垃圾桶图标 icon to add or delete a sent message. Click the 横排列图标 or 竖排列图标 icon to arrange multiple sent messages. Click the 复制图标 icon to copy the current sent message configuration and add a new one with the same settings.

This table describes only the parameters under Other Configurations. For more information about other parameters, see Common parameter description.

Outputs: None.

Notes on self-built WebSocket node services

If you have a self-built WebSocket service, you can register it with the DataV WebSocket node without writing frontend code. Your WebSocket service must conform to the following format.

Configuration exampleConfiguration example

  • Register message

    The WebSocket node sends messages in the following format.

    {
      event: "register",
      data: {
        sid: 407194,                                      // Screen ID
        name: "Data source controlled mode test",         // Screen name
        group: "Default group"                            // Default group
      },
      callback: "callback_15832235175585251131307383912" // Current registration timestamp, automatically generated
    }

    After your WebSocket service receives the registration message, it must return the following message to complete the registration.

    {
      event: "callback_15832235175585251131307383912",   // Return the same registration timestamp
      data: {
        isError: false,                                  // Set to false
        data: "ok"
      }
    }
  • Send message

    The WebSocket node sends messages in the following format.

    {
      event: 'broadcast',
      data: {
        event: "Message to send 1",                      // Name of the message to send
        data: {}                                         // data can be in any format
      }
    }
  • Receive message

    The WebSocket node receives messages in the following format.

    {
      event: "broadcast_Received message 1",             // broadcast_${Received message name}
      data: {}                                          // data can be in any format
    }

Troubleshoot WebSocket server connection issues

  1. A WS service cannot be accessed directly over the HTTPS protocol. You must use a WSS service. Configure a proxy for the WS service endpoint using your own SSL certificate to enable access over HTTPS.

  2. Press F12 to open the browser's developer tools. On the Network tab, check the connection information on the WS tab. Check whether the cross-domain settings are misconfigured and whether Sec-WebSocket-Protocol is set to echo-protocol in the header of the response.

  3. After a successful connection, pass the parameters in the message format described in this document.