Syncs
|
Collect
1. Overview
Data Management > Data Import > Syncs module primarily offers configuration capabilities for data synchronization in general data access scenarios, supporting the synchronization of external data sources to the Sensor system via a visual interface.
1.1. Syncs Type
Type | Description | Scope of Application |
---|---|---|
Synchronization Task | Select the required fields and configure mapping relationships visually. | Low threshold for use, suitable for simple data synchronization tasks. |
SQL Task | Read the required data from the data source by writing SQL, then configure field mapping and synchronization strategies. | Requires basic SQL knowledge; data can be processed through SQL before synchronization. |
1.2. Syncs Usage Scenarios
Task Management supports synchronizing External Data Sources and Sensor Data Tables to Sensor Data Tables or Event Tables (events) or User Tables (users), meeting various scenarios:
Synchronization Path | Applicable Scenario | |
---|---|---|
1 | External Data Sources synchronize to Sensor Data Tables |
|
2 | External Data Source synchronized to event table (events) or user table (users) |
|
2. Create Sync
2.1. Create Sync
- Select Data Fusion > General Data Ingestion > Task Management.
- Click the Create Task button at the top right, and select Create Sync Task.
- Fill in Basic Task Information.
- Fill in Task Name.
- Fill in Description. Optional.
- Set Data Source and Target.
- Set Data Sync Source
- Select Source Connection. You can select External Data Source or Sensor Data Table. External data sources support Hive, MySQL, ClickHouse, and FTP.
- Select Source Data.
- Set Data Sync Target
- Select Target Type.
- Entity
- Existing tables: support primary key tables andnon primary key tables.
- Create New Table
- Enter Table Name.
- Select Table Type: Supports creating primary key or non-primary key tables.
- Select Primary Key Field: When selecting primary key table type, choose a field from the source table as the primary key field.
- Select Target Data. When selecting new table as the target type, table name must be entered.
- Select Target Type.
- Set Data Sync Source
- Configure Field Mapping. When selecting new table as the target type, the system will automatically add all fields from the source table. You can manually modify the field names in the target table or delete unnecessary fields.
- Configure Task Execution Rules.
- Select Execution Frequency.
- Manual Execution: Tasks can be manually executed multiple times within the effective period in the Execution Records module.
- Execute Once Upon Effective Time: Sets whether the task will automatically execute once at the start of the effective period.
- Repeat Execution: Supports configuring task repeat execution frequency using Basic Configuration and Expression Configuration.
- Manual Execution: Tasks can be manually executed multiple times within the effective period in the Execution Records module.
- Select Effective Cycle.
- Configure Advanced Settings.
- Set Number of Retry Attempts. Optional.
- Set Retry Interval. Optional.
- Set Concurrency. Optional.
- Select Read Logic.
- Select Write Logic. For different types of synchronization targets, the optional write logic varies.
- When writing data tables with a primary key and a target entity user table, onlyupdates or inserts are supported.
- When writing to an entity event table, only support Incremental Write.
- When writing to a data table without a primary key, support for selection Full coverage or Incremental Write. When writing to a partitioned table, you need to first select the partition field and then select the write logic.
- Set Alarm monitoring.When the data import task encounters operational problems, it supports the function of alerting maintenance personnel through email, enterprise WeChat, DingTalk, and Feishu to facilitate timely problem investigation and handling.
- Turn on/off alarms: Turn on alarms, need in Platform Management > Inbox Management/Touch Channel Management complete the configuration of the corresponding notification channel, which can be referenced Mailing Box Management and Touch Channel Management, need in Platform Management > Alarm management complete notification method configuration, please refer to Alarm Management.
- Select Alarm conditions. Support Task execution failed Trigger alarms and Task timeout Trigger alarm.
- Notification method
- Select Execution Frequency.
- Click Data preview button.
- Click Submit button.
- When you use the Divine Strategy data table as a synchronization source or target, you can only view and choose to haveTable Data Permissions data table.
- Alarm records can be accessed inPlatform Management > Alarm management > Alarm History to view.
2.2. Create SQL Sync
- Select Data Fusion > Universal Data Access > Task Management.
- Click on the top right corner Create Task button, and selectCreate SQL task.
- Fill in Basic task information.
- Fill in Task Name.
- Fill in Description. optional.
- Set Read Logic. Support simultaneous reading of multiple databases from one data source. External data source supportHive, ClickHouse, MySQL, FTP.
- Select the data source and click on the right side of the table add button.
- Click Analysis SQL. After analysingData synchronization source will automatically fill in.
- Click Run SQLto view the running results.
- Set Data synchronization target
- Select target type.
- Entity
- Existing table: Support primary key table and non-primary key table.
- Create new table
- Enter table name.
- Select table type: Support creating primary key table or non-primary key table.
- Select primary key field: When the table type is selected as primary key table, you need to select a field from the source table as the primary key field.
- Select target data. When the target type is selected as a new table, the table name needs to be filled.
- Select target type.
- Configure task execution rules.
- Select execution frequency.
- Manual execution: Within the effective period, the task can be executed manually multiple times in the run record module.
- Immediately execute once after reaching the effective time: Set whether to automatically execute the task once when the effective period starts.
- Repeat execution: Support configuring the task repeat frequency through basic configuration and expression configuration methods.
- Manual execution: Within the effective period, the task can be executed manually multiple times in the run record module.
- Select effective period.
- Configure advanced settings.
- Set retry times when failure. Optional.
- Set Retry interval . Optional.
- Set Execution concurrency. Optional.
- Select Read Logic.
- Select Write Logic. For different types of synchronization targets, the optional write logic varies.
- When writing data tables with primary keys targeting entity user tables, onlyupdates or insertsare supported.
- When writing to an entity event table, only incremental writing is supported with.
- When writing to a data table without a primary key, support for selection Full coverage or Incremental write. When writing to a partitioned table, you need to first select the partition field and then select the write logic.
- Select execution frequency.
- Set Alarm monitoring.When the data import task encounters operational problems, it supports the function of alerting maintenance personnel through email, enterprise WeChat, DingTalk, and Feishu to facilitate timely problem investigation and handling.
- Turn on/off alarms: Turn on alarms, need in Platform Management > Inbox Management/Touch Channel Management Complete the configuration of the corresponding notification channel, which can be referenced Mailing Box Management and Touch Channel Management; need in Platform Management > Alarm management complete notification method configuration, please refer to Alarm Management.
- Select Alarm conditions. Support Task execution failed Trigger alarms and Task timeout Trigger alarm.
- Notification method
- Click Submit button.
2.3. cron expression
When create task configuration Task execution rules, if Execution frequency select Repeated execution, support cron expression collocation method.
The cron expression is a standard expression widely used to describe time and date information. The cron expression is a string consisting of 6 necessary settings and supports optional year settings. Usually, cron expressions are separated by spaces, and the main structure is: seconds, minutes, hours, dates, months, weeks (years, optional).
Currently, only hourly level execution tasks are supported at most.
Field | Allowable value | Special characters allowed | Is it necessary |
---|---|---|---|
Seconds | An integer between 0 and 59 | Not allowed | Yes |
Minutes | Integer between 0 - 59 | Not allowed | Yes |
Hours | Integer between 0 - 23 | , - * / Four characters | Yes |
DayofMonth | Integer between 1 - 31 (considering the number of days in the month) | , - * ? / Five characters | Yes |
Month | Integer between 1 - 12 or JAN - DEC | , - * / Four characters | Yes |
DayofWeek | Integer between 1 - 7 or SUN - SAT (1=SUN) | , - * ? / Five characters | Yes |
Year | Integer between 1970 and 2099 | , - * / Four characters | No |
Each field uses numbers, and special characters such as:
*
: matches any value. If used in sub fields*
, this means that it will be executed every minute.?
: indicates no specified field and can only be used in the date and week fields.-
: represents the matching range. For example, using the minute field5-20
, indicating execution every minute between 5 minutes and 20 minutes./
: Indicates execution starting from the start time and every fixed time. For example, using the minute field5/20
Starting from 5 minutes, execute every 20 minutes, that is, every 25 minutes and every 45 minutes.,
: Represents listing enumeration values. For example, using the minute field5,20
, indicating execution once at 5 and 20 respectively.
For example:
Expression | Explanation |
---|---|
0 0 12 * * ? | Execute once every day at 12:00 noon |
0 15 10 ? * * | Execute once every day at 10:15 am, including 0 15 10 ? * *、0 15 10 * * ?、0 15 10 * * ? * three expressions have the same effect |
0 15 10 * * ? 2020 | Execute once every day at 10:15 in 2020 |
0 15 10 ? * MON-FRI | Runs once at 10:15 AM from Monday to Friday every week |
0 15 10 15 * ? | Runs once at 10:15 AM on the 15th day of every month |
0 0 12 1/5 * ? | Runs once at 12:00 PM every 5 days starting from the 1st of each month |
0 11 11 11 11 ? | Runs once at 11:11 AM on the 11th of November every year |
3. Sync Management
3.1. Sync List
Select Data Integration > General Data Access > Task Management to view the task list.
In the task management list, you can perform the following operations:
- Run/Pause Task: Tasks can be paused and restarted multiple times.
- View Run Records: View run records and logs, and supplement data.
- View Tasks: Navigate to the task detail page.
- Edit Tasks: After pausing tasks, all tasks can be modified including task names, descriptions, field mapping, task execution rules, and alerts. SQL tasks can also modify SQL statements.
- Delete Tasks: After deleting tasks, the related sync data tables will not be deleted together.
3.2. Run Records
3.2.1. Run Record Details
In the task list, click View Run Records on the right side of the task to view the task's basic information and run records.
Also supports the following features:
- Execute immediately: Click to execute immediately once.
- Supplementary data: ForTasks with time macro parameters can be clickedSupplementary data Click the button to select the corresponding business date for data supplementation operation.
3.2.2. Running logs
Click on the operation column Running logs button, you can view the specific execution status of each task instance.
4. Permissions
- If you have the permission to view syncs, you can enter data fusion> Universal Data Access> View existing tasks and running records on the task management page.
- If you have the authority to manage syncs, you can enter data fusion> Universal Data Access> The task management page performs a series of management operations such as creation, editing, and deletion.
Note: The content of this document is a technical document that provides details on how to use the Sensors product and does not include sales terms; the specific content of enterprise procurement products and technical services shall be subject to the commercial procurement contract.