Offline Data Sources
Before using RES, you need to prepare five basic data packages and upload them to OBS. Currently, only the csv and json data formats are supported. Table 1 describes more details.
- You need to manually create these tables and store them on OBS.
- The table structure must meet the requirements of RES. The column names and field types must be the same as those specified in Data Format Standards. For more details, see the following tables.
- The data filled in each table must meet the requirements of RES.
- For fields that cannot be provided, set those parameters to NULL.
User Attribute Table
This table stores user attribute information, such as regions and hobbies. The attribute name and attribute value must be configured in pairs.
| Parameter | Type | Description | Mandatory |
|---|---|---|---|
| userId | String | Unique identifier of an end-user. For example, the user login account and International Mobile Equipment Identity (IMEI) number. | Yes |
| userProperties | String | User attribute key-value string. Different attributes are separated by \002(ASCII value). The key and value of an attribute are separated by \003(ASCII value). Different values of multiple enumeration attributes are separated by \004(ASCII value). Different key-value pairs of map attributes are separated by \004(ASCII value), each key value pair is separated by a colon (:). The basic format is k1\003v1\002k2\003v2\k3\003v1\004v2\004v3\002k4\003\k1:v1\004k2:v2\004k3:v3. For example, if a user has four tags, namely, age=18, gender=1, hobby=[read,gym,music], and profile={morality:0.8,iq:0.7,art:0.9}, the record can be encoded as age\00318\002gender\0031\002hobbies\003read\004gym\004music\002profile\003morality:0.8\004iq:0.7\004art:0.9. Value type in a key-value pair of field userProperties is provided in User Attribute Configuration Table. | No |
User Attribute Example (JSON)
{
"userId":"user1",
"userProperties":"provinceId\u00035147\u0002cityId\u00035148\u0002districtId\u00035154\u0002streetId\u0003130533\u0002payment_type\u00031\u0002payment_method\u0003CMBLIFE_CMBLIFE\u0002payment_channel\u000312"
} Item Attribute List
This list stores the item attribute information, such as the type and length. The attribute name and attribute value must be configured in pairs.
| Parameter | Type | Description | Mandatory |
|---|---|---|---|
| itemId | String | ID of an item | Yes |
| itemProperties | String | Key-value information of an item. The key indicates the item name and the value indicates the value. The basic format is the same as that of field userProperties in User Attribute Table. | No |
Item Attribute Example
{
"itemId":"item1",
"itemProperties":"product_name\u0003wyf-name\u0002order_price\u0003500.00\u0002weight\u0003130.00\0002volume\u0003v1"
} User Operation Behavior Table
| Parameter | Type | Description | Mandatory |
|---|---|---|---|
| userId | String | User ID | Yes |
| objectType | String | Name of an item. Items are objects that users have performed operations on. | Yes |
| actionObject | String | Object of behavior. If a user acts on an item, the value is the item ID. | Yes |
| actionType | String | Behavior types:
| Yes |
| actionMeasure | String | Measurement of a behavior, such as the amount paid, score rated, and how many times it happened (integer). Default value:
| Yes |
| actionContent | String | For the behavior Make comments, the content of comments needs to be recorded. For the behavior Click an item in search results, the search keywords need to be recorded. | No |
| actionDateTime | String | Time when a behavior occurs, in seconds and complied with Coordinated Universal Time (UTC). | No |
| actionLocation | String | Location, or latitude and longitude of an occurred behavior. The format is [latitude, longitude] | No |
| context | String | Contextual information about an action. The content is a JSON string and can function as an extended field in User Operation Behavior Table. For example, current device ID and IP address of a user are types of contextual information. | No |
| subSite | String | Location ID of an occurred behavior, for example, a homepage where you can click recommendation items to enter the item details page. | No |
| traceId | String | Unique ID used to trace each recommendation item. The ID is used in effect evaluation. | No |
| flowId | String | ID of a flow, which is used to evaluate effect of an online flow. The flow ID is returned by the RES API to users. You need to write the flow ID to the user behavior logs. | No |
User Operation Behavior Example
{
"userId":"user1",
"objectType":"item",
"actionObject":"item1",
"actionType":"collect",
"actionMeasure":"1.0",
"actionDateTime":"1512689700"
} Last Article: OBS Folder Specifications
Next Article: Realtime Logs
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.