MathWorks - Mobile View
  • 碻形冰暨硞 MathWorks 帐憷碻形冰暨硞 MathWorks 帐憷
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
MathWorks
  • 产品
  • 解决方案
  • 学术
  • 支持
  • 社区
  • 活动
  • 获取 MATLAB
  • 碻形冰暨硞 MathWorks 帐憷碻形冰暨硞 MathWorks 帐憷
  • Access your MathWorks Account
    • 我的帐户
    • 我的社区资料
    • 关联许可证
    • 登出

视频与网上研讨会

  • MathWorks
  • 视频
  • 视频首页
  • 搜索
  • 视频首页
  • 搜索
  • 联系销售
  • 试用软件
  Register to watch video
  • Description
  • Full Transcript
  • Related Resources

Using the MATLAB Production Server REDIS Cache to Rapidly Store and Retrieve Data

Gabriel Ha, MathWorks

The REDIS high-speed cache shipped with MATLAB Production Server™ allows you to store data. This function is particularly useful to:

  • store transient data between calls
  • load a large data file that is required for execution, such as a machine learning model (.mat) file

See how REDIS works with an example that calculates the remaining useful life (RUL) of a machine.

This video highlights a feature of MATLAB Production Server introduced in R2018b: the ability to store persistent data in a high-speed in-memory cache.

MATLAB Production Server requests are stateless, meaning that each call is independent of the previous one. There are times when you will want to store data or a state between calls, and MATLAB Production Server implements this feature by utilizing a high-speed in-memory database called REDIS. REDIS is shipped with MATLAB Production Server for on-premise installations, and MATLAB Production Server on the cloud lets you call the cloud service provider’s implementation, for example, Azure REDIS cache.

There are 2 primary scenarios where you’ll want to use the REDIS persistent cache:

  1. Storing transient data between calls to MATLAB Production Server, like preference settings, or for calculating a moving average
  2. Loading a large data file required for execution, like a .mat file containing a machine learning model

The following example demonstrates both these scenarios. It uses incremental machine learning to predict the RUL—the remaining useful life of a motor.

The machine learning RUL algorithm has been deployed to MATLAB Production Server, and the predictive machine learning model required for the algorithm has been stored on REDIS.

The client application sends current samples of the motor to MATLAB Production Server, along with a request for the RUL given those samples. The RUL algorithm runs on a worker process which loads the predictive machine learning model from REDIS. This happens very quickly since REDIS is an in-memory database.

The predicted RUL is returned to the client application.

The model is also incrementally updated with the sample data and written back to REDIS to await the next invocation.

The results collected over time can be plotted on a chart in the client application.

Let’s see how this plays out.

We have data from a motor collected in sequence all the way to the end of its “Remaining Useful Life.” The 'monitorRUL' test script will perform an expedited simulation of the RUL for this motor by sending all those samples in sequence to MATLAB Production Server. It will also plot the RUL results as results are retrieved.

Line 6 of this code shows the syntax for connecting to a running REDIS cache. Lines 18 and 20 show how to use MATLAB 'put' and 'get' functions to write and read data to and from the cache.

Let’s now run the monitorRUL script, which will be sending the data to a MATLAB Production Server instance containing the deployed RUL algorithm and the corresponding predictive model stored in a REDIS cache.

We see that after about 2500 minutes of data, the model indicates a steep decline in the motor’s remaining useful life. A predictive maintenance application would use this information to alert someone to schedule maintenance for this particular motor.

To learn more about how to use persistence in MATLAB Production Server, visit the following website: https://www.mathworks.com/help/mps/ml_code/use-a-data-cache-to-persist-data.html

Related Products

  • MATLAB Production Server

Learn More

Request a trial of MATLAB Production Server
Related Information
Try it

Feedback

Featured Product

MATLAB Production Server

  • Request Trial
  • Get Pricing

Up Next:

38:28
MATLAB Production Server for Financial Applications

Related Videos:

20:17
Building a Big Engineering Data Analytics System with MATLAB
19:44
Access Data from Bloomberg Terminal, Server, and B-PIPE
53:22
Acquiring Data from Standalone Instruments and Data...
12:06
Setting Up MATLAB Parallel Server with MATLAB Job Scheduler

View more related videos

MathWorks - Domain Selector

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Select web site

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

  • América Latina (Español)
  • Canada (English)
  • United States (English)

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文Chinese
    • English
  • 日本Japanese (日本語)
  • 한국Korean (한국어)

Contact your local office

  • 联系销售
  • 试用软件

了解产品

  • MATLAB
  • Simulink
  • 学生版软件
  • 硬件支持
  • 文件交换

试用或购买

  • 下载
  • 试用软件
  • 联系销售
  • 定价和许可
  • 如何购买

如何使用

  • 文档
  • 教程
  • 示例
  • 视频与网上研讨会
  • 培训

获取支持

  • 安装帮助
  • MATLAB 问答社区
  • 咨询
  • 许可中心
  • 联系支持

关于 MathWorks

  • 招聘
  • 新闻室
  • 社会愿景
  • 联系销售
  • 关于 MathWorks

MathWorks

Accelerating the pace of engineering and science

MathWorks 公司是世界领先的为工程师和科学家提供数学计算软件的开发商。

发现…

  • Select a Web Site United States
  • 专利
  • 商标
  • 隐私权政策
  • 防盗版
  • 应用状态

京ICP备12052471号

© 1994-2021 The MathWorks, Inc.

  • Weibo
  • WeChat

    WeChat

  • Bilibili
  • Youku
  • Facebook
  • Twitter
  • LinkedIn
  • RSS

关注我们