Skip to content

Commit 54c5b17

Browse files
committed
update ainode in table model
1 parent 1153cae commit 54c5b17

14 files changed

Lines changed: 468 additions & 354 deletions

File tree

311 KB
Loading
79.2 KB
Loading
130 KB
Loading
169 KB
Loading
95.1 KB
Loading
112 KB
Loading

src/UserGuide/Master/Table/AI-capability/AINode_apache.md

Lines changed: 70 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,25 @@
2121

2222
# AINode
2323

24-
AINode is an IoTDB native node designed to support the registration, management, and invocation of large-scale time series models. It comes with industry-leading proprietary time series models such as Timer and Sundial. These models can be invoked through standard SQL statements, enabling real-time inference of time series data at the millisecond level, and supporting application scenarios such as trend forecasting, missing value imputation, and anomaly detection for time series data.
24+
AINode is a native IoTDB node that supports the registration, management, and invocation of time-series-related models. It comes with built-in industry-leading self-developed time-series large models, such as the Timer series developed by Tsinghua University. These models can be invoked through standard SQL statements, enabling real-time inference of time series data at the millisecond level, and supporting application scenarios such as trend forecasting, missing value imputation, and anomaly detection for time series data.
2525

2626
The system architecture is shown below:
2727
::: center
28-
<img src="/img/AInode.png" style="zoom:50 percent" />
28+
<img src="/img/AINode-0-en.png" style="zoom:50 percent" />
2929
:::
30+
3031
The responsibilities of the three nodes are as follows:
3132

32-
- **ConfigNode**: responsible for storing and managing the meta-information of the model; responsible for distributed node management.
33-
- **DataNode**: responsible for receiving and parsing SQL requests from users; responsible for storing time-series data; responsible for preprocessing computation of data.
34-
- **AINode**: responsible for model file import creation and model inference.
33+
- **ConfigNode:**
34+
- Manages distributed nodes and handles load balancing across the system.
35+
- **DataNode:**
36+
- Receives and parses user SQL queries.
37+
- Stores time-series data.
38+
- Performs preprocessing computations on raw data.
39+
- **AINode:**
40+
- Manages and utilizes time-series models (including training/inference).
41+
- Supports deep learning and machine learning workflows.
42+
3543

3644
## 1. Advantageous features
3745

@@ -55,11 +63,11 @@ Compared with building a machine learning service alone, it has the following ad
5563
- **Create**: Load externally designed or trained model files/algorithms into AINode for unified management and usage by IoTDB.
5664
- **Inference**: Use the created model to complete time series analysis tasks applicable to the model on specified time series data.
5765
- **Built-in Capabilities**: AINode comes with machine learning algorithms or self-developed models for common time series analysis scenarios (e.g., forecasting and anomaly detection).
58-
![](/img/h3.png)
66+
![](/img/AINode-en.png)
5967

6068
## 3. Installation and Deployment
6169

62-
The deployment of AINode can be found in the document [Deployment Guidelines](../Deployment-and-Maintenance/AINode_Deployment_apache.md#ainode-deployment) .
70+
The deployment of AINode can be found in the document [AINode Deployment](../Deployment-and-Maintenance/AINode_Deployment_apache.md).
6371

6472

6573
## 4. Usage Guide
@@ -80,12 +88,12 @@ Models that meet the following criteria can be registered with AINode:
8088
The SQL syntax for model registration is defined as follows:
8189

8290
```SQL
83-
create model <model_name> using uri <uri>
91+
create model <model_id> using uri <uri>
8492
```
8593

8694
Detailed meanings of SQL parameters:
8795

88-
- **model_name**: The global unique identifier for the model, non-repeating. Model names have the following constraints:
96+
- **model_id**: The global unique identifier for the model, non-repeating. Model names have the following constraints:
8997
- Allowed characters: [0-9 a-z A-Z _] (letters, numbers, underscores)
9098
- Length: 2-64 characters
9199
- Case-sensitive
@@ -117,7 +125,7 @@ In addition to registering local model files, remote resource paths can be speci
117125

118126
#### Example
119127

120-
The current example folder contains model.pt (trained model) and config.yaml with the following content:
128+
The [example folder](https://github.com/apache/iotdb/tree/master/integration-test/src/test/resources/ainode-example) contains model.pt (trained model) and config.yaml with the following content:
121129

122130
```YAML
123131
configs:
@@ -157,41 +165,56 @@ Registered models can be queried using the `show models` command. The SQL defini
157165
```SQL
158166
show models
159167

160-
show models <model_name>
168+
show models <model_id>
161169
```
162170

163171
In addition to displaying all models, specifying a `model_id` shows details of a specific model. The display includes:
164172

165-
| **ModelId** | **State** | **Configs** | **Attributes** |
166-
| ----------- | --------------------------------------------------------- | ------------------------------------------------ | -------------- |
167-
| Unique ID | Registration status (INACTIVE, LOADING, ACTIVE, DROPPING) | InputShape, outputShape, inputTypes, outputTypes | User notes |
173+
| **ModelId** | **ModelType** | **Category** | **State** |
174+
|-------------|---------------|----------------|-------------|
175+
| Model ID | Model Type | Model Category | Model State |
168176

169-
**State descriptions:**
177+
- Model State Transition Diagram
170178

171-
- **INACTIVE**: Model is unavailable.
172-
- **LOADING**: Model is being loaded.
173-
- **ACTIVE**: Model is available.
174-
- **DROPPING**: Model is being deleted.
179+
![](/img/AINode-State-en.png)
175180

176-
#### Example
181+
**Instructions:**
182+
183+
1. Initialization:
184+
- When AINode starts, show models only displays BUILT-IN models.
185+
2. Custom Model Import:
186+
- Users can import custom models (marked as USER-DEFINED).
187+
- The system attempts to parse the ModelTypefrom the config file.
188+
- If parsing fails, the field remains empty.
189+
3. Foundation Model Weights:
190+
- Time-series foundation model weights are not bundled with AINode.
191+
- AINode automatically downloads them during startup.
192+
- Download state: LOADING.
193+
4. Download Outcomes:
194+
- Success → State changes to ACTIVE.
195+
- Failure → State changes to INACTIVE.
196+
5. Fine-Tuning Process:
197+
- When fine-tuning starts: State becomes TRAINING.
198+
- Successful training → State transitions to ACTIVE.
199+
- Training failure → State changes to FAILED.
200+
201+
**Example**
177202

178203
```SQL
179204
IoTDB> show models
180-
181-
+---------------------+--------------------+--------+--------+
182-
| ModelId| ModelType|Category| State|
183-
+---------------------+--------------------+--------+--------+
184-
| arima| Arima|BUILT-IN| ACTIVE|
185-
| holtwinters| HoltWinters|BUILT-IN| ACTIVE|
186-
|exponential_smoothing|ExponentialSmoothing|BUILT-IN| ACTIVE|
187-
| naive_forecaster| NaiveForecaster|BUILT-IN| ACTIVE|
188-
| stl_forecaster| StlForecaster|BUILT-IN| ACTIVE|
189-
| gaussian_hmm| GaussianHmm|BUILT-IN| ACTIVE|
190-
| gmm_hmm| GmmHmm|BUILT-IN| ACTIVE|
191-
| stray| Stray|BUILT-IN| ACTIVE|
192-
| timer_xl| Timer-XL|BUILT-IN| ACTIVE|
193-
| sundial| Timer-Sundial|BUILT-IN| ACTIVE|
194-
+---------------------+--------------------+--------+--------+
205+
+---------------------+--------------------+--------------+---------+
206+
| ModelId| ModelType| Category| State|
207+
+---------------------+--------------------+--------------+---------+
208+
| arima| arima| BUILT-IN| ACTIVE|
209+
| custom| | USER-DEFINED| ACTIVE|
210+
| timerxl| timer-xl| BUILT-IN| LOADING|
211+
| sundial| timer-sundial| BUILT-IN| ACTIVE|
212+
| sundialx_1| timer-sundial| FINE-TUNED| ACTIVE|
213+
| sundialx_2| timer-sundial| FINE-TUNED| ACTIVE|
214+
| sundialx| timer-sundial| FINE-TUNED| ACTIVE|
215+
| sundialx_4| timer-sundial| FINE-TUNED| TRAINING|
216+
| sundialx_5| timer-sundial| FINE-TUNED| FAILED|
217+
+---------------------+--------------------+--------------+---------+
195218
```
196219

197220
### 4.3 Deleting Models
@@ -243,18 +266,24 @@ Parameter descriptions:
243266

244267
1. The `forecast` function predicts all columns in the input table by default (excluding the time column and columns specified in `partition by`).
245268
2. The `forecast` function does not require the input data to be in any specific order. It sorts the input data in ascending order by the timestamp (specified by the `TIMECOL` parameter) before invoking the model for prediction.
246-
3. Different models have different requirements for the number of input data rows:
247-
- If the input data has fewer rows than the minimum requirement, an error will be thrown.
248-
- If the input data exceeds the maximum row limit, the last rows that meet the requirement will be automatically truncated for processing.
249-
- Among the currently built-in models in AINode, only `sundial` has a row limit. It supports a maximum of 2880 input rows. If exceeded, the last 2880 rows will be automatically used.
269+
3. Different models have varying requirements for the number of input data rows. If the input data has fewer rows than the minimum requirement, an error will be reported.
270+
- Among the current built-in models in AINode:
271+
- Timer-XL requires at least 96 rows of input data.
272+
- Timer-Sundial requires at least 16 rows of input data.
250273
4. The result columns of the `forecast` function include all input columns from the input table, with their original data types preserved. If `preserve_input = true`, an additional `is_input` column will be included to indicate whether a row is from the input data.
251274
- Currently, only columns of type INT32, INT64, FLOAT, or DOUBLE are supported for prediction. Otherwise, an error will occur: "The type of the column [%s] is [%s], only INT32, INT64, FLOAT, DOUBLE is allowed."
252275
5. `output_start_time` and `output_interval` only affect the generation of the timestamp column in the output results. Both are optional parameters:
253276
- `output_start_time` defaults to the last timestamp of the input data plus `output_interval`.
254277
- `output_interval` defaults to the sampling interval of the input data, calculated as: (last timestamp - first timestamp) / (number of rows - 1).
255278
- The timestamp of the Nth output row is calculated as: `output_start_time + (N - 1) * output_interval`.
256279

257-
#### Example
280+
**Example: Database and table must be pre-created**
281+
282+
```sql
283+
create database etth
284+
create table eg (hufl FLOAT FIELD, hull FLOAT FIELD, mufl FLOAT FIELD, mull FLOAT FIELD, lufl FLOAT FIELD, lull FLOAT FIELD, ot FLOAT FIELD)
285+
```
286+
258287

259288
Using the ETTh1-tab dataset:[ETTh1-tab](/img/ETTh1-tab.csv)
260289

@@ -314,7 +343,7 @@ It costs 1.615s
314343
315344
### 4.5 Time Series Large Model Import Steps
316345
317-
AINode supports multiple time series large models. For deployment, refer to [Time Series Large Model](https://timecho.com/docs/zh/UserGuide/latest/AI-capability/TimeSeries-Large-Model.html)
346+
AINode supports multiple time series large models. For deployment, refer to [Time Series Large Model](../AI-capability/TimeSeries-Large-Model.md)
318347
319348
320349
## 5 Permission Management

0 commit comments

Comments
 (0)