Nearline Jobs

Overview

A nearline job provides the real-time computing function. It uses data stored in DIS as the data source and updates user profiles, item profiles, and recommendation candidate sets in real time. To use the nearline job, you need to transform formats of logs about tracing points in accordance with Realtime Logs and write the transformed logs into the DIS streams. For details, see Figure 1.

Figure 1 Nearline strategy

Types of the nearline strategy are as follows:

Data such as the real-time behavior logs, real-time user logs, and real-time item logs, can be uploaded to DIS, as shown in Realtime Logs.

Realtime behavior logs are required by the Update User Profile Based on Behavior Data strategy and Search for Candidate Sets Based on Tags strategy.

Realtime user logs are required by the Update User Profile Based on User Data strategy.

Realtime item logs are required by the Update Item Profile Based on Item Data strategy.

Creating a Nearline Job

To create a nearline job, perform the following steps:

  1. Log in to the RES management console and click Nearline Jobs in the navigation tree on the left.
  2. Click Create. The Create Nearline Job page is displayed.
  3. Specify Name, Scenario, and Description.
    • Name: Name of the nearline job to be created, which must start with Nearline- and consists of only letters, digits, hyphens (-), and underscores (_). The name must contain no more than 64 characters.
    • Scenario: You can select a scenario created on the Global Configurations page.
  4. In the Compute Engine area, enter values for Service Name, Cluster Name, Configuration File Path, and Name.
  5. Click Add Nearline Strategy and select a proper strategy from the drop-down list box. Move your cursor to the question mark next to the strategy name to view the help information.
  6. (Optional) Select a strategy you want to delete and click Delete to delete it.
  7. After configuring all parameters, click OK. It may take a few seconds to run the job. Please wait.

    You can switch to the nearline job list to view the basic information about nearline jobs. In the job list, the status of the newly created job is Computing. When the job status changes to Successful, the job execution is complete. If the status of a nearline job changes to Failed, click the job name. On the job details page that is displayed, view the job logs and troubleshoot the faults.

Update User Profile Based on Behavior Data

The Update User Profile Based on Behavior Data strategy can continuously update user profiles. The updating frequency is down to the second. Data stored in DIS functions as the source, which helps analyze the changing information of user profiles and updates those profiles as user behavior occurs.

Content of user profiles that can be updated includes dynamic information (user tags) and contextual information (user age, location, and contact information).

Table 1 Parameters

Parameter

Description

Default Value

Strategy Alias

Name of the selected strategy, which consists of Chinese characters, letters, digits, underscores (_), spaces, or hyphens (-) and cannot start or end with a space. The name can contain no more than 60 characters.

Update User Profile Based on Behavior Data

Service Name

Name of the selected service. Currently, only DIS is supported. Add the Real-Time Behavior Log data to DIS where RES can read these data to perform nearline computing tasks.

DIS

Stream Name

Name of a data stream. Different streams need to be created for different types of data.

N/A

Start Location

Location where RES starts reading data stored in DIS. latest indicates that the latest data is read first. earliest indicates that the earliest data is read first.

latest

Behavior Type

Types of behaviors are:

  • view: Indicates that an item/content is exposed to users.
  • click: Indicates a user clicks an item or content.
  • collect: Indicates a user adds an item or content to favorites.
  • uncollect: Indicates a user removes an item or content from favorites.
  • search_click: Indicates a user clicks an item in the search results.
  • comment: Indicates that a user makes comments on an item or content.
  • share: Indicates that a user shares an item/content with others.
  • like: Indicates a user gives an item or content a thumb-up.
  • dislike: Indicates a user gives an item or content a thumb-down.
  • grade: Indicates that a user rates an item/content.
  • consume: Indicates that a user buys an item (primarily refers to commodities).
  • use: Indicates that a user watches videos/listens to a kind of music/reads something (primarily refers to content)...

All behaviors selected

Window Interval (s)

Time interval for the running of nearline jobs, in seconds. For example, the value 10 indicates that the nearline strategy performs the computing tasks every 10 seconds,

10s

Result Save Path

Path to access the samples constructed based on user and item profiles that already reside in behavior logs and CloudTable clusters. These samples are available for other functions.

N/A

Context Updating

Contextual information updating. The field context in User Operation Behavior Table indicates the contextual information of an occurred behavior. The contextual information stored in the CloudTable clusters can be updated in real time if Context Updating is enabled.

Disabled

Item Popularity Updating

Whether to calculate the popularity of an item according to behavior logs. In all nearline strategies, for example, the Search for Candidate Sets Based on Tags strategy, candidate sets is re-ranked in a specified mode. If you want to re-rank the candidate sets by popularity, Item Popularity Updating must be enabled.

Disabled

Historical Records Saving

Whether to collect users' historical records according to behavior logs. In all nearline strategies, for example, the Search for Candidate Sets Based on Tags strategy, if you want to filter out the historical records of users from the candidate sets, Historical Records Saving must be enabled. This function can be enabled only in the condition that historical records are saved before.

Disabled

Weight Attenuation Parameter

Attenuation parameter of the interest tag. A smaller value indicates a stronger attenuation capability. A larger value indicates a weaker attenuation capability. If the value is 0, no attenuation occurs.

0.99

Max. Length of Interest Tag

Maximum length of the interest tag among all tag systems.

20

Global Feature File

File needed before you use the nearline strategy. The global feature file contains all feature fields and data types of users and items in the offline data. Global Feature Files describes details of the global feature file.

N/A

Output Path of Dirty Data

Path where the input data that meets no job requirements resides

N/A

User Profile Storage

Data of User Profile Storage that comes from the user profiles updated by the Update User Profile Based on User Data strategy

N/A

Item Profile Storage

Data of Item Profile Storage that comes from the item profiles updated by the Update Item Profile Based on Item Data strategy

N/A

Filtering Information Storage

Table where the filtered items on which you have performed operations reside, for example, filter out items that you have viewed and store them in this table.

N/A

Search for Candidate Sets Based on Tags

The Search for Candidate Sets Based on Tags strategy can continuously help you retrieve candidate sets. The retrieval frequency is down to the second. Data stored in DIS functions as the source and helps analyze user preferences based on the candidate sets are retrieved. Two retrieval modes are available:

  • Interest tag
  • Real-time tag
Table 2 Parameters

Parameter

Description

Default Value

Strategy Alias

Name of the selected strategy, which consists of Chinese characters, letters, digits, underscores (_), spaces, or hyphens (-) and cannot start or end with a space. The name can contain no more than 60 characters.

Search for Candidate Sets Based on Tags

Data Source

  • Service Name: Name of the selected service. Currently, only DIS is supported. Add data from Realtime Behavior Logs to DIS where RES can read these data to perform nearline computing tasks.
  • Stream Name: Name of a data stream. Different streams need to be created for different types of data.
  • Start Location: Location where RES starts reading data stored in DIS. latest indicates that the latest data is read first. earliest indicates that the earliest data is read first.

Service Name: DIS

Stream Name: N/A

Start Location: latest

Behavior Type

Types of behaviors are:

  • view: Indicates that an item/content is exposed to users.
  • click: Indicates a user clicks an item or content.
  • collect: Indicates a user adds an item or content to favorites.
  • uncollect: Indicates a user removes an item or content from favorites.
  • search_click: Indicates a user clicks an item in the search results.
  • comment: Indicates that a user makes comments on an item or content.
  • share: Indicates that a user shares an item/content with others.
  • like: Indicates a user gives an item or content a thumb-up.
  • dislike: Indicates a user gives an item or content a thumb-down.
  • grade: Indicates that a user rates an item/content.
  • consume: Indicates that a user buys an item (primarily refers to commodities).
  • use: Indicates that a user watches videos/listens to a kind of music/reads something (primarily refers to content)...

All behaviors selected

Window Interval (s)

Time interval for the running of nearline jobs, in seconds. For example, the value 10 indicates that the nearline strategy performs the computing tasks every 10 seconds,

10

Filter Historical Records

Whether to filter out historical records from the generated candidate sets. If yes, Filter Historical Records must be enabled.

Disabled

Ranking Rule for Candidate Sets

Ranking rule of the generated candidate sets, which includes:

  • Random: No ranking is performed on candidate sets.
  • Hot: Items are ranked in an item attribute list according to their popularity. Behavior data from user profiles conveys the popularity of items. A hotter item has a higher ranking in a list.
  • By time: Candidate sets are ranked by time. Feature Name and Recommended Days are required for By time.
    • Feature Name: Name of the feature whose value is a timestamp (10 bits). Candidate sets are ranked by the feature.
    • Recommended Days: Time range during which the recommendation data is collected. Generally. It refers to the latest N days. The default value is 15.

Hot

Maximum Length of Candidate Sets

Maximum length of the generated candidate sets. This value must be greater than that of the candidate sets updated by computing tasks.

50

Retrieval Rule for Candidate Sets

Retrieval rule for candidate sets.

  • Interest tag: Candidate sets can be retrieved based on the interest tags of user profiles.
  • Real-time tag: Candidate sets can be retrieved based on the item tags of real-time behaviors.

Interest tag

Number of Interest Tags

Number of interest tags in generated candidate sets. A smaller value indicates fewer types of candidate sets.

NOTE:

Select an appropriate quantity of interest tags at the highest weights to retrieve an item list that matches those tags.

3

Global Feature File

File needed before you use the nearline strategy. The global feature file contains all feature fields and data types of users and items in the offline data. Global Feature Files describes details of the global feature file.

N/A

Output Path of Dirty Data

Path where the input data that meets no job requirements resides

N/A

Custom Search

Replacement for the default search criteria. Custom Search allows you to search according to your custom criteria.

NOTE:

You can use this function only when different tag systems exist. In other cases, you are not advised to use it.

N/A

User Profile Storage

Platform for storing user profiles.

  • Service Name. CloudTable by default, used to store the updated user profiles.
  • Cluster Name
  • Table Name

N/A

Item Profile Storage

Platform for storing item profiles.

  • Service Name. CloudTable by default, used to store updated item profiles.
  • Cluster Name
  • Table Name

N/A

Filtering Information Storage

Platform for storing the filtering sets.

  • Service Name. CloudTable by default, used to store the updated filtering lists.
  • Cluster Name
  • Table Name

N/A

Candidate Set Storage

Platform for storing the candidate sets.

  • Service Name. CloudTable by default, used to store the updated candidate lists.
  • Cluster Name
  • Table Name

N/A

Update User Profile Based on User Data

The Update User Profile Based on User Data strategy can continuously update user profiles. The updating frequency is down to the second. Data stored in DIS functions as the source and helps capture user data nearline, which facilitates updating or adding data for user profiles to keep them in the latest state.

Table 3 Parameters

Parameter

Description

Default Value

Strategy Alias

Name of the selected strategy, which consists of Chinese characters, letters, digits, underscores (_), spaces, or hyphens (-) and cannot start or end with a space. The name can contain no more than 60 characters.

Update User Profile Based on User Data

Data Source

  • Service Name: Name of the selected service. Currently, only DIS is supported. Add data from Realtime Behavior Logs to DIS where RES can read these data to perform nearline computing tasks.
  • Stream Name: Name of data stream. Different streams need to be created for different types of data.
  • Start Location: Location where RES starts reading data stored in DIS. latest indicates that the latest data is read first. earliest indicates that the earliest data is read first.

Service Name: DIS

Stream Name: N/A

Start Location: latest

Window Interval (s)

Time interval for the running of nearline jobs, in seconds. For example, the value 10 indicates that the nearline strategy performs the computing tasks every 10 seconds,

10s

Global Feature File

File needed before you use the nearline strategy. The global feature file contains all feature fields and data types of users and items in the offline data. Global Feature Files describes details of the global feature file.

N/A

Output Path of Dirty Data

Path where the input data that meets no job requirements resides

N/A

User Profile Storage

Platform for storing user profiles.

  • Service Name. CloudTable by default, used to store the updated user profiles.
  • Cluster Name
  • Table Name

N/A

Update Item Profile Based on Item Data

The Update Item Profile Based on Item Data strategy can continuously update item profiles. The updating frequency is down to the second. Data stored in DIS functions as the source and continuously updates or adds data for item profiles to keep them in the latest state.

Table 4 Parameters

Parameter

Description

Default Value

Strategy Alias

Name of the selected strategy, which consists of Chinese characters, letters, digits, underscores (_), spaces, or hyphens (-) and cannot start or end with a space. The name can contain no more than 60 characters.

Update Item Profile Based on Item Data

Data Source

  • Service Name: Name of the selected service. Currently, only DIS is supported. Add data from Realtime Behavior Logs to DIS where RES can read these data to perform nearline computing tasks.
  • Stream Name: Name of a data stream. Different streams need to be created for different types of data.
  • Start Location: Location where RES starts reading data stored in DIS. latest indicates that the latest data is read first. earliest indicates that the earliest data is read first.

Service Name: DIS

Stream Name: N/A

Start Location: latest

Window Interval (s)

Time interval for the running of nearline jobs, in seconds. For example, the value 10 indicates that the nearline strategy performs the computing tasks every 10 seconds,

10s

Global Feature File

File needed before you use the nearline strategy. The global feature file contains all feature fields and data types of users and items in the offline data. Global Feature Files describes details of the global feature file.

N/A

Output Path of Dirty Data

Path where the input data that meets no job requirements resides

N/A

Update Candidate Set

Whether to update the candidate set to keep it up to date.

  • Feature Name: A 10-digit timestamp.
  • Max. Length of Candidate Set: Maximum length of an updated candidate set.
  • Retention Day: Number of days in which a candidate set can be retained. It usually refers to the latest N days.

false

Item Profile Storage

Platform for storing item profiles.

  • Service Name. CloudTable by default, used to store updated item profiles.
  • Cluster Name
  • Table Name

N/A