<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://peisong0109.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://peisong0109.github.io//" rel="alternate" type="text/html" /><updated>2025-02-27T23:15:08-08:00</updated><id>https://peisong0109.github.io//feed.xml</id><title type="html">Peisong Li’s Homepage</title><subtitle>personal description</subtitle><author><name>Peisong Li</name></author><entry><title type="html">Design an IM App using wildfire</title><link href="https://peisong0109.github.io//posts/2022/11/blog-post-7/" rel="alternate" type="text/html" title="Design an IM App using wildfire" /><published>2022-11-27T00:00:00-08:00</published><updated>2022-11-27T00:00:00-08:00</updated><id>https://peisong0109.github.io//posts/2022/11/IM-message-App</id><content type="html" xml:base="https://peisong0109.github.io//posts/2022/11/blog-post-7/"><![CDATA[<h2 id="tutorial">Tutorial</h2>
<p><a href="https://docs.wildfirechat.cn/">Tutorial of WildFire IM</a></p>

<h2 id="deployment-of-the-server">Deployment of the server</h2>
<h3 id="im-service">IM service</h3>
<h4 id="step1-download-the-source-code">Step1: Download the source code</h4>
<p>Download the latest version of release from:</p>

<p>https://github.com/wildfirechat/im-server</p>

<p>Here we download the latest version (tar), then unzip and copy it to the cloud server.</p>

<p><img src="/images/20221127/step1-1.png" alt="image" /></p>

<h4 id="step2-start-the-service">Step2: Start the service</h4>
<p>Then, just follow the <a href="https://docs.wildfirechat.cn/quick_start/server.html">tutorial</a>.</p>

<h3 id="demo-application-service">Demo application service</h3>
<h4 id="step1-download-the-source-code-1">Step1: Download the source code</h4>
<p>Download the latest version of release from:</p>

<p>https://github.com/wildfirechat/app-server</p>

<p>Here we download the latest version (tar), then unzip and copy it to the cloud server.</p>

<p><img src="/images/20221127/step2-1.png" alt="image" /></p>

<h4 id="step2-start-the-service-1">Step2: Start the service</h4>
<p>Then, just follow the <a href="https://docs.wildfirechat.cn/quick_start/server.html">tutorial</a>.</p>

<h2 id="deployment-of-the-android-app">Deployment of the Android app</h2>
<h4 id="step1--download-the-source-code-and-run-it-with-android-studio">Step1:  Download the source code and run it with Android Studio</h4>
<p>https://github.com/wildfirechat/android-chat</p>

<h4 id="step2-modify-the-config-file">Step2: Modify the config file</h4>
<p>https://docs.wildfirechat.cn/quick_start/android.html</p>

<h2 id="change-the-database">Change the database</h2>
<h4 id="change-the-database-to-mysql">Change the database to MySQL:</h4>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo docker run -p 3307:3306 --name mysql  -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latest
</code></pre></div></div>

<h4 id="modify-the-config-file">Modify the config file.</h4>

<p><img src="/images/20221127/step3.png" alt="image" /></p>]]></content><author><name>Peisong Li</name></author><category term="Knowledge" /><category term="IM" /><summary type="html"><![CDATA[Design an IM App using wildfire.]]></summary></entry><entry><title type="html">Edge computing frameworks</title><link href="https://peisong0109.github.io//posts/2022/07/blog-post-5/" rel="alternate" type="text/html" title="Edge computing frameworks" /><published>2022-07-24T00:00:00-07:00</published><updated>2022-07-24T00:00:00-07:00</updated><id>https://peisong0109.github.io//posts/2022/07/Edge-computing-frameworks</id><content type="html" xml:base="https://peisong0109.github.io//posts/2022/07/blog-post-5/"><![CDATA[<p>This is a collection of Edge computing frameworks. I shall test each framework and make a comparison in the future work.</p>

<h2 id="1-google-cloud-iot-solutions">1. Google Cloud IoT solutions</h2>
<p><a href="https://cloud.google.com/solutions/iot">Link:</a></p>

<p>Blog: <a href="https://cloud.google.com/blog/products/gcp/bringing-intelligence-edge-cloud-iot">Bringing intelligence to the edge with Cloud IoT</a></p>
<h3 id="bringing-machine-learning-to-the-edge">Bringing machine learning to the edge</h3>

<p>Today, we’re announcing two new products aimed at helping customers develop and deploy intelligent connected devices at scale: <a href="https://cloud.google.com/edge-tpu">Edge TPU</a>, a new hardware chip, and <a href="https://cloud.google.com/iot-edge">Cloud IoT Edge</a>, a software stack that extends Google Cloud’s powerful AI capability to gateways and connected devices. <strong>This lets you build and train ML models in the cloud, then run those models on the Cloud IoT Edge device through the power of the Edge TPU hardware accelerator.</strong></p>

<p><img src="/images/20220724/Edge_TPU.png" alt="Google Edge" /></p>

<h2 id="2-aws-iot-greengrass-amazon">2. AWS IoT Greengrass (Amazon)</h2>
<p><a href="https://aws.amazon.com/greengrass/">Link:</a></p>

<p>AWS IoT Greengrass makes it easy to bring intelligence to edge devices, such as for anomaly detection in precision agriculture or powering autonomous devices.</p>

<p><img src="/images/20220724/product-page-diagram_AWS-IoT-Greengrass.png" alt="AWS Edge" /></p>

<h2 id="3-nvidia-egx">3. NVIDIA EGX</h2>
<p><a href="https://www.nvidia.com/en-us/data-center/products/egx/">Link:</a></p>

<h4 id="powerful-secure-acceleration-from-data-center-to-edge">Powerful, Secure Acceleration from Data Center to Edge</h4>

<p>The NVIDIA EGX platform delivers the power of accelerated computing from data center to edge with a range of optimized hardware, an easy-to-deploy, application and management software, and a vast ecosystem of partners who offer EGX through their products and services.</p>

<h2 id="4-huawei-kubeedge">4. Huawei Kubeedge</h2>
<p><a href="https://kubeedge.io/en/">Link:</a></p>

<p><strong>KubeEdge</strong> is an open source system extending native containerized application orchestration and device management to hosts at the Edge. It is built upon Kubernetes and provides core infrastructure support for networking, application deployment and metadata synchronization between cloud and edge. It also supports MQTT and allows developers to author custom logic and enable resource constrained device communication at the Edge. KubeEdge consists of a cloud part and an edge part. Both edge and cloud parts are now open-sourced.</p>

<p><img src="/images/20220724/kubeedge_arch.png" alt="Kubeedge architecture" /></p>

<h2 id="5-azure-iot-edge-microsoft">5. Azure IoT Edge (Microsoft)</h2>
<p><a href="https://azure.microsoft.com/en-us/services/iot-edge/">Link:</a></p>

<h4 id="cloud-intelligence-deployed-locally-on-iot-edge-devices">Cloud intelligence deployed locally on IoT edge devices</h4>

<p>Deploy Azure IoT Edge on premises to break up data silos and consolidate operational data at scale in the Azure Cloud. Remotely and securely deploy and manage cloud-native workloads—such as AI, Azure services, or your own business logic—to run directly on your IoT devices. Optimize cloud spend and enable your devices to react faster to local changes and operate reliably even in extended offline periods.</p>

<h4 id="what-is-azure-iot-edge"><a href="https://docs.microsoft.com/en-us/azure/iot-edge/about-iot-edge?view=iotedge-2020-11">What is Azure IoT Edge?</a></h4>
<p>Azure IoT Edge is made up of three components:</p>

<ul>
  <li><strong>IoT Edge modules</strong>  are containers that run Azure services, third-party services, or your own code. Modules are deployed to IoT Edge devices and execute locally on those devices.</li>
  <li>The  <strong>IoT Edge runtime</strong>  runs on each IoT Edge device and manages the modules deployed to each device.</li>
  <li>A  <strong>cloud-based interface</strong>  enables you to remotely monitor and manage IoT Edge devices.</li>
  <li><img src="/images/20220724/Azure_runtime.png" alt="Azure runtime" /></li>
</ul>

<h2 id="6-baetyl-baidu">6. Baetyl (Baidu)</h2>
<p><a href="https://baetyl.io/en/">Link:</a></p>

<h2 id="7-link-iot-edge-aliyun">7. Link IoT edge (Aliyun)</h2>
<p><a href="https://www.alibabacloud.com/zh/product/linkiotedge">Link:</a></p>

<p>Link IoT Edge allows you to use TSL to convert devices of various protocols and data formats into standard TSL models. Link IoT Edge provides secure reliable low-latency cost-effective scalable weak-dependency local computing services. Link IoT Edge adopts Alibaba Cloud capabilities in several areas including security, storage, compute, and artificial intelligence (AI). You can deploy Link IoT Edge on intelligent devices and compute nodes at different levels of computing power. Link IoT Edge extends the boundary of Alibaba Cloud capability at the edge of your network.</p>

<p><img src="/images/20220724/Link%20IoT%20Edge.png" alt="Link IoT Edge" /></p>

<h2 id="8-k3s">8. k3s</h2>
<p><a href="https://k3s.io/">Link:</a></p>

<h3 id="lightweight-kubernetes">Lightweight Kubernetes</h3>
<p>The certified Kubernetes distribution built for IoT &amp; Edge computing.</p>

<h3 id="why-use-k3s">Why use k3s?</h3>
<h5 id="perfect-for-edge">Perfect for Edge</h5>
<p>K3s is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.</p>

<h5 id="simplified--secure">Simplified &amp; Secure</h5>
<p>K3s is packaged as a single &lt;50MB binary that reduces the dependencies and steps needed to install, run and auto-update a production Kubernetes cluster.</p>

<h5 id="optimized-for-arm">Optimized for ARM</h5>
<p>Both ARM64 and ARMv7 are supported with binaries and multiarch images available for both. K3s works great from something as small as a Raspberry Pi to an AWS a1.4xlarge 32GiB server.</p>]]></content><author><name>Peisong Li</name></author><category term="Edge computing" /><category term="Edge computing" /><summary type="html"><![CDATA[# Edge computing frameworks]]></summary></entry><entry><title type="html">Cloud Edge Collaboration Summit</title><link href="https://peisong0109.github.io//posts/2022/06/blog-post-4/" rel="alternate" type="text/html" title="Cloud Edge Collaboration Summit" /><published>2022-06-18T00:00:00-07:00</published><updated>2022-06-18T00:00:00-07:00</updated><id>https://peisong0109.github.io//posts/2022/06/Cloud-Edge-Collaboration-Summit</id><content type="html" xml:base="https://peisong0109.github.io//posts/2022/06/blog-post-4/"><![CDATA[<blockquote>
  <p>会议回放：
http://rongnuo-bj.com/forum/2022CEC/html/live.html</p>
</blockquote>

<h1 id="2022-云边协同大会-现状和挑战总结">2022 云边协同大会 现状和挑战总结</h1>
<h3 id="云边端一体化发展报告2022记录">《云边端一体化发展报告（2022）》记录</h3>

<h4 id="边缘计算">边缘计算</h4>
<p>目前主要效益体现在：</p>

<ul>
  <li>提升系统和业务敏捷部署</li>
  <li>降低计算时延</li>
  <li>节约带宽成本</li>
  <li>加强数据安全</li>
</ul>

<p>目前主要的应用挑战：</p>

<ul>
  <li>边缘系统管理复杂</li>
  <li>维护系统可靠性和稳定性挑战大</li>
  <li>成本较高</li>
  <li>部署边缘系统困难</li>
</ul>

<h4 id="云边端一体化">云边端一体化</h4>
<p>面临的5大挑战：</p>

<ul>
  <li>云边端大规模节点管理稳定性和性能仍有不足</li>
  <li>云边端分布式算力调度复杂性仍较大</li>
  <li>云边端分布式数据管理能力有待提升</li>
  <li>云边端一体化安全防护体系尚需构建</li>
  <li>云边端技术和应用落地缺乏标准化指引
<img src="/images/20220618/Challenges.png" alt="云边端一体化面临的挑战" /></li>
</ul>

<h3 id="面向分布式机器学习的边缘网络协同技术-北京邮电大学">面向分布式机器学习的边缘网络协同技术 （北京邮电大学）</h3>
<h4 id="背景">背景：</h4>
<p><img src="/images/20220618/Background.png" alt="研究背景" /></p>
<h4 id="挑战">挑战：</h4>
<p><img src="/images/20220618/Challenges_distri.png" alt="挑战" /></p>]]></content><author><name>Peisong Li</name></author><category term="Meeting record" /><category term="Edge computing" /><summary type="html"><![CDATA[# Cloud Edge Collaboration Summit]]></summary></entry><entry><title type="html">Wireless communication</title><link href="https://peisong0109.github.io//posts/2022/06/blog-post-3/" rel="alternate" type="text/html" title="Wireless communication" /><published>2022-06-04T00:00:00-07:00</published><updated>2022-06-04T00:00:00-07:00</updated><id>https://peisong0109.github.io//posts/2022/06/Wireless-Communication</id><content type="html" xml:base="https://peisong0109.github.io//posts/2022/06/blog-post-3/"><![CDATA[<h2 id="introduction">Introduction</h2>
<p>The term wireless refers to the communication or transmission of information over a distance without requiring wires, cables, or any other electrical conductors. Wireless communication is one of the important mediums of transmission of data or information to other devices. The Communication is set and the information is transmitted through the air, without requiring any cables, by using <strong>electromagnetic waves</strong> like radio frequencies, infrared, satellite, etc., in a wireless communication technology network.</p>

<p>Different types of signals are used in communication between the devices for wireless transmission of data. The following are the <strong>different electromagnetic signals</strong> used depending on their wavelength and frequency.
<img src="/images/20220604/ElectromagneticWaves.jpg" alt="Electromagnetic wave" /></p>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Extension: What is wavelength and frequency?
 Electromagnetic waves are measured using frequency.
<img src="/images/20220604/Frequency.jpg" alt="What is frequency?" /></li>
</ul>

<p>The wavelength and frequency are shown in the following figure.
 <img src="/images/20220604/Wavelength.jpg" alt="Wavelength" /></p>
<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Extension: What is radio?
<img src="/images/20220604/RadioWave.jpg" alt="Radio Wave" /></li>
</ul>

<h2 id="types-of-wireless-data-transmission">Types of Wireless Data Transmission</h2>
<ul>
  <li>Radio Frequency Transmission</li>
  <li>Infrared Transmission</li>
  <li>Microwave Transmission</li>
  <li>Lightwave Transmission
    <h3 id="radio-frequency-transmission">Radio Frequency Transmission</h3>
    <p>Radio Frequency (RF) is a form of electromagnetic transmission used in wireless communication. <strong>RF</strong> signals are easily generated, ranging 3kHz to 300GHz. <strong>These are used in wireless communication because of their property to penetrate through objects and travel long distances.</strong></p>
  </li>
</ul>

<p>Signal transmission and reception is via <strong>Antenna</strong>.
<img src="/images/20220604/Antenna.jpg" alt="Antenna" />
 <strong>Drawbacks</strong></p>

<ul>
  <li>These are frequency-dependent</li>
  <li>These have a relatively low bandwidth for data transmission.
<img src="/images/20220604/RF%20examples.jpg" alt="Examples" /></li>
</ul>

<h3 id="infrared-transmission">Infrared Transmission</h3>
<p>Infrared radiations are electromagnetic radiations with <strong>longer wavelengths than visible light</strong>. These are usually used for <strong>short-range</strong> communications. These signals <strong>do not pass through solid objects</strong>.</p>

<p>Infrared is a media transmission system that transmits data signals through light-emitting diodes (LEDs) or Lasers. Infrared is electromagnetic energy at a wavelength that is longer than that of red light. The information cannot be traveled through obstacles in an infrared system but can be inhibited by light. One type of infrared is the point-to-point system in which transmission is possible between two points limited to a range and line of sight.</p>

<p>The signal frequency to transmit in a point-to-point system is 100 GHz to 1,000 terahertz (THz), and the speed ranges from 100 Kbps to 16 Mbps. Another method of transmission of infrared includes the broadcast system – and, in this method, reflective material or a transmission unit amplifies and retransmits a data signal to several other units. The normal frequency of an infrared broadcast system is 100 GHz to 1,000 THz with a limited speed of 1 Mbps.</p>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />Extension: Frequency and speed?</li>
</ul>

<p>Example: Television remote control</p>

<h3 id="microwave-transmission">Microwave Transmission</h3>
<p>Microwaves are the form of electromagnetic transmission used in wireless communication systems. The wavelength of microwaves ranges from one meter to one millimeter. The frequency varies from 300MHz to 300GHz. These are widely used for <strong>long-distance communications and are relatively less expensive</strong>.</p>

<p>Microwave is an effective type of wireless data transmission that transfers information using two separate methods. One method which is used to transmit data through the wireless media of a microwave is the <strong>satellite method</strong> that transmits information via a satellite that orbits 22,300 miles above the Earth. Stations on the ground send and receive data signals to and from the satellite with a frequency ranging from 11 GHz to 14 GHz and with a transmission speed of 1 Mbps to 10 Mbps. Another method is a <strong>terrestrial method</strong>, in which two microwave towers with a clear line of sight between them are used ensuring no obstacles to disrupt that line of sight. For the purpose of privacy, it is used often. The frequency of data transmission for terrestrial systems is typically 4 GHz to 6 GHz or 21 GHz to 23 GHz, and the speed is usually 1 megabit per second (Mbps) to 10 Mbps.</p>

<p><strong>Drawbacks</strong></p>

<ul>
  <li>The microwave does not pass through buildings.</li>
  <li>Bad weather affects signal transmission.</li>
  <li>These are frequency-dependent.</li>
</ul>

<h3 id="lightwave-transmission">Lightwave Transmission</h3>
<p>Light is electromagnetic radiation with a wavelength ranging between infrared radiations and ultraviolet radiations. The wavelength ranges from 430 to 750THz. These are unguided optical signals such as lasers and are unidirectional.</p>

<p><strong>Drawbacks</strong></p>
<ul>
  <li>These signals cannot penetrate through rain and fog.</li>
  <li>The laser beam gets easily diverted by air.</li>
</ul>

<h2 id="types-of-wireless-communication-technologies">Types of Wireless Communication Technologies</h2>
<ul>
  <li>Radio and Television Broadcasting</li>
  <li>Radar Communication</li>
  <li>Satellite communication</li>
  <li>Cellular Communication</li>
  <li>Global Positioning System</li>
  <li>WiFi</li>
  <li>Bluetooth</li>
  <li>Radio Frequency Identification</li>
</ul>

<h3 id="radio">Radio</h3>
<p>Mostly radio broadcasts sound through the air as radio waves. Radio has a transmitter that transmits the data in the form of radio signals to the receiver antenna.</p>

<h3 id="cellular">Cellular</h3>

<h3 id="satellite">Satellite</h3>

<h3 id="wi-fi">Wi-Fi</h3>
<p>These networks are limited in range due to the low power transmission, allowing the user to connect only in close proximity.</p>

<h3 id="bluetooth-technology">Bluetooth Technology</h3>
<p>Cell phones are connected to hands-free earpieces, wireless keyboards, mouse and mike to laptops with the help of Bluetooth as it transmits information from one device to other devices.</p>

<p><strong>Features</strong></p>
<ul>
  <li>Bluetooth technology uses radio waves to communicate between devices. Most of these radio waves have <strong>a range of 15-50 feet</strong>.</li>
  <li>According to the official Bluetooth website, Bluetooth uses a low-power signal with a maximum range of 50 feet with sufficient speed to enable the transmission of data.</li>
  <li>The <strong>pairing process</strong> identifies and connects any two devices to each other. It also prevents interference from other non-paired Bluetooth devices in the area.</li>
  <li>It uses maximum power only when it is required, thus preserving battery life.</li>
</ul>

<h3 id="zigbee">ZigBee</h3>
<p>ZigBee is a wireless communication standard designed to address the unique needs of <strong>low-power, low-cost</strong> wireless sensor, and control networks. ZigBee can be used almost anywhere, as it is easy to implement and requires little power to operate. Zigbee has been developed looking into the needs of the communication of data with a simple structure like the data from the sensors.</p>

<p><strong>Features</strong></p>

<ul>
  <li>ZigBee devices are designed for low-power consumption.</li>
  <li>ZigBee is used in Commercial Applications like sensing and monitoring applications.</li>
  <li>ZigBee uses very low power and extremely long device battery life.</li>
  <li>ZigBee gives the flexibility to do more with reliable wireless performance and battery operation.</li>
</ul>

<h2 id="reference">Reference:</h2>
<p>[1] <a href="https://www.watelectronics.com/different-types-wireless-communication-technologies/">Different Types of Wireless Communication Technologies</a></p>

<p>[2] <a href="https://www.youtube.com/watch?v=5VdVn7Le0uw">Wireless principles : RF or radio frequency , Hertz explained in simple terms</a></p>

<p>[3] <a href="https://www.youtube.com/watch?v=1JpwDaOHppA">EM spectrum: radio wave, infrared, visible light, ultraviolet, X and Gamma ray</a></p>]]></content><author><name>Peisong Li</name></author><category term="Learning" /><category term="Wireless communication" /><summary type="html"><![CDATA[# Different Types of Wireless Communication Technologies]]></summary></entry><entry><title type="html">Fog Computing, Cloudlet and Mobile Edge Computing</title><link href="https://peisong0109.github.io//posts/2022/05/blog-post-2/" rel="alternate" type="text/html" title="Fog Computing, Cloudlet and Mobile Edge Computing" /><published>2022-05-29T00:00:00-07:00</published><updated>2022-05-29T00:00:00-07:00</updated><id>https://peisong0109.github.io//posts/2022/05/Fog%20&amp;%20Cloudlet%20&amp;%20Mobile%20edge</id><content type="html" xml:base="https://peisong0109.github.io//posts/2022/05/blog-post-2/"><![CDATA[<h1 id="abstract">Abstract</h1>
<p>Comparison of three Edge Computing (<strong>EC</strong>) Implementations: Fog Computing, Cloudlet and Mobile Edge Computing</p>

<h1 id="ec-implementation-architectures">EC implementation architectures</h1>
<h3 id="fog-computing">Fog Computing:</h3>
<p>The Fog Computing implementation is a decentralized Computing infrastructure based on <strong>Fog Computing Nodes (FCNs)</strong> placed at any point of the architecture between the end devices and the cloud. The FCNs are heterogeneous in nature and thus can be based on different kinds of <strong>elements including but not limited to routers, switches, access points, IoT gateways as well as set-top boxes</strong>.</p>

<h3 id="mobile-edge-computing">Mobile Edge Computing:</h3>
<p>MEC can be defined as an implementation of Edge Computing to bring computational and storage capacities to the edge of the network within the <strong>Radio Access Network</strong> to reduce latency and improve context awareness.
The MEC nodes or servers are usually co-located with the Radio Network Controller or a macro base-station.
Extension：<a href="https://en.wikipedia.org/wiki/Radio_access_network">What is a Radio Access Network?</a></p>

<h3 id="cloudlet-computing">Cloudlet Computing:</h3>
<p>A Cloudlet can be <strong>defined as a trusted cluster of computers</strong>, well connected to the Internet, with resources available to use for nearby mobile devices. A Cloudlet can be treated as <strong>”data center in a box”</strong> running a virtual machine capable of provisioning resources to enddevices and users in real time over a WLAN network.</p>

<h1 id="comparison">Comparison</h1>
<p>| | Fog Computing |  Mobile Edge Computing | Cloudlet Computing
|–|–|–|–
Node devices| Routers, Switches, Access Points, Gateways | Servers running in base stations | Data Center in a box 
Node location | Varying between End Devices and Cloud | Radio Network Controller/Macro Base Station | Local/Outdoor installation
Software Architecture |Fog Abstraction Layer based | Mobile Orchestrator based | Cloudlet Agent based
Proximity |One or Multiple Hops | One Hop | One Hop
Access Mechanisms |Bluetooth, Wi-Fi, Mobile Networks | Mobile Networks | Wi-Fi</p>

<h1 id="reference">Reference:</h1>
<p>[1] Dolui, Koustabh, and Soumya Kanti Datta. “Comparison of edge computing implementations: Fog computing, cloudlet and mobile edge computing.” <em>2017 Global Internet of Things Summit (GIoTS)</em>. IEEE, 2017.</p>]]></content><author><name>Peisong Li</name></author><category term="Research" /><category term="Edge computing" /><summary type="html"><![CDATA[Fog Computing, Cloudlet and Mobile Edge Computing]]></summary></entry><entry><title type="html">What is Edge Computing?</title><link href="https://peisong0109.github.io//posts/2022/04/blog-post-1/" rel="alternate" type="text/html" title="What is Edge Computing?" /><published>2022-04-05T00:00:00-07:00</published><updated>2022-04-05T00:00:00-07:00</updated><id>https://peisong0109.github.io//posts/2022/04/Edge-computing</id><content type="html" xml:base="https://peisong0109.github.io//posts/2022/04/blog-post-1/"><![CDATA[<h2 id="concept">Concept</h2>
<p>Industry investment and research interest in edge computing, in which computing and storage nodes are placed at the Internet’s edge in close proximity to mobile devices or sensors, have grown dramatically in recent years. This emerging technology promises to deliver highly responsive cloud services for mobile computing, scalability and privacy-policy enforcement for the Internet of Things, and the ability to mask transient cloud outages [1].</p>

<h2 id="origin-and-background">Origin and Background</h2>
<ol>
  <li><strong>1990s</strong>, when Akamai introduced content delivery networks (CDNs) to accelerate web performance. A CDN uses nodes at the edge close to users to prefetch and cache web content. These edge nodes can also perform some content customization, such as adding location-relevant advertising. CDNs are especially valuable for video content, because the bandwidth savings from caching can be substantial [2].</li>
  <li>In <strong>1997</strong>, Brian Noble and his colleagues first demonstrated edge computing’s potential value to mobile computing. They showed how speech recognition could be implemented with acceptable performance on a resource-limited mobile device by offloading computation to a nearby server [3]. In <strong>1999</strong>, Jason Flinn and Satyanarayanan extended this approach to improve battery life [4]. In a <strong>2001</strong> article that generalized these concepts, Satyanarayanan introduced the term cyber foraging for the amplification of a mobile device’s computing capabilities by leveraging nearby infrastructure  [5].</li>
  <li>Cloud computing’s emergence in the <strong>mid-2000s</strong> led to the cloud becoming the most obvious infrastructure to leverage from a mobile device.</li>
  <li>In <strong>2009</strong>, Satyanarayanan coauthored with Paramvir Bahl, Rámon Cáceres, and Nigel Davies that laid the conceptual foundation for edge computing. We advocated a two-level architecture: the first level is today’s unmodified cloud infrastructure; the second level consists of dispersed elements called <strong>cloudlets</strong> with state cached from the first level. Using persistent caching instead of hard state simplifies the management of cloudlets despite their physical dispersal at the Internet edge  [6].</li>
  <li>In <strong>2012</strong>, Flavio Bonomi and his colleagues introduced the term fog computing to refer to this dispersed cloud infrastructure [7].</li>
</ol>

<h3 id="research-directions">Research directions</h3>

<h3 id="my-current-work">My current work</h3>

<h2 id="reference">Reference</h2>
<p>[1] Satyanarayanan, Mahadev. “The emergence of edge computing.” <em>Computer</em> 50.1 (2017): 30-39.</p>

<p>[2] Dilley, John, et al. “Globally distributed content delivery.” <em>IEEE Internet Computing</em> 6.5 (2002): 50-58.</p>

<p>[3] Noble, Brian D., et al. “Agile application-aware adaptation for mobility.” <em>ACM SIGOPS Operating Systems Review</em> 31.5 (1997): 276-287.</p>

<p>[4] Flinn, Jason, and Mahadev Satyanarayanan. “Energy-aware adaptation for mobile applications.” <em>ACM SIGOPS Operating Systems Review</em> 33.5 (1999): 48-63.</p>

<p>[5] Satyanarayanan, Mahadev. “Pervasive computing: Vision and challenges.” <em>IEEE Personal communications</em> 8.4 (2001): 10-17.</p>

<p>[6] Satyanarayanan, Mahadev, et al. “The case for vm-based cloudlets in mobile computing.” <em>IEEE pervasive Computing</em> 8.4 (2009): 14-23.</p>

<p>[7] Bonomi, Flavio, et al. “Fog computing and its role in the internet of things.” <em>Proceedings of the first edition of the MCC workshop on Mobile cloud computing</em>. 2012.</p>

<p><img src="/images/20220405/Edge.jpg" alt="Edge computing" /></p>]]></content><author><name>Peisong Li</name></author><category term="Research" /><category term="Edge computing" /><summary type="html"><![CDATA[Intorduction to Edge Conputing]]></summary></entry><entry><title type="html">Gateway, Router, Modem, Switch and Hub</title><link href="https://peisong0109.github.io//posts/2021/12/blog-post-3/" rel="alternate" type="text/html" title="Gateway, Router, Modem, Switch and Hub" /><published>2021-12-11T00:00:00-08:00</published><updated>2021-12-11T00:00:00-08:00</updated><id>https://peisong0109.github.io//posts/2021/12/networking-concepts</id><content type="html" xml:base="https://peisong0109.github.io//posts/2021/12/blog-post-3/"><![CDATA[<p>Many people may confused with these concepts, here I would like to make a easy-understanding interpretation of each.</p>

<h1 id="hub-and-switch">Hub and Switch</h1>
<p><img src="/images/20211211/switch.jpg" alt="Hub and Switch" />
Each device connects one port of the hub. When one device sends data to the hub, the hub will transfer the data to all of other connected devices.</p>

<p>Compared to the hub, in switch the data will be directed only to intended port, this based on the <strong>MAC address</strong> of each device.</p>

<p>Switches and Hubs are used to exchange data with a Local Area Network (LAN). They cannot be used to exchange data outside their own network.
To exchange data outside their own network, a device needs to be able to read IP addresses. Here we need <strong>Router</strong>.</p>

<h1 id="router">Router</h1>
<p><img src="/images/20211211/router%20modem.jpg" alt="Router" />
The router routes data from one network to another based on their <strong>IP address</strong>. When a data packet is received from the router, the router inspects the data’s IP address and determines if the packet was meant for its own network or if it’s meant for another network. 
So, a router is essentially the gateway of a network.</p>

<h1 id="gateway">Gateway</h1>
<p>Gateway also forwords data packets between networks, but where some conversion is required because the networks are running <strong>different, incompatible protocals</strong>.</p>

<h1 id="modem">Modem</h1>
<p><img src="/images/20211211/Modem.jpg" alt="Modem" /></p>

<h1 id="single-hop-and-multi-hop">Single hop and multi hop</h1>
<p>A hop means number of different networks a packet has to go through in order to reach its final destination address.
In other word, a hop is the term for the jump from one router to another.</p>

<p>The main difference between <strong>single &amp; multi-hop</strong> network is the number of hops a packet takes to reach the final destination .</p>

<h3 id="single-hop-network-">Single hop network :</h3>
<p>In a single hop network , when a packet leaves the source it just takes a single hop (goes through another network or you can say it passes through another router from a different network) before reaching its destination address.</p>

<h3 id="multi-hop-network-">Multi-hop network :</h3>
<p>In a multi-hop network a packet has to go through two or more networks in order to reach its destination address.</p>

<p><img src="/images/20211211/hop.jpg" alt="Four hops from SOURCE to DESTINATION" /></p>

<h1 id="bandwidth">Bandwidth</h1>

<p><strong>Definition:</strong>
The maximum amount of data transmitted over an internet connection in a given amount of time.</p>

<p><strong>Unit:</strong>
Megabits per second (Mbps)</p>

<p>Megabytes per second (MB/s)</p>

<p><strong>Conversion:</strong>
K = kilo = 1000 bits</p>

<p>M = mage = 1000 kilo</p>

<p>G = giga = 1000 mega</p>

<p>T = tera = 1000 giga</p>

<p>1 byte = 8 bits, so 10 MB/s = 80 Mbps</p>]]></content><author><name>Peisong Li</name></author><category term="Knowledge" /><category term="Networking" /><summary type="html"><![CDATA[What's the differences among Gateway, Router, Modem, Switch and Hub]]></summary></entry><entry><title type="html">Common-used library in my Android project</title><link href="https://peisong0109.github.io//posts/2021/12/blog-post-1/" rel="alternate" type="text/html" title="Common-used library in my Android project" /><published>2021-12-04T00:00:00-08:00</published><updated>2021-12-04T00:00:00-08:00</updated><id>https://peisong0109.github.io//posts/2021/12/Android-development-experience</id><content type="html" xml:base="https://peisong0109.github.io//posts/2021/12/blog-post-1/"><![CDATA[<h3 id="the-records-of-the-development-of-the-android-app">The records of the development of the Android app</h3>

<h2 id="thread">Thread</h2>

<h3 id="eventbus">Eventbus</h3>
<p><a href="https://github.com/greenrobot/EventBus">EventBus</a>
Step1:
Start a new class, here defines the message type and content:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>public class MessageEvent {  
  
    private String message;  
    private int type;  
  
    public MessageEvent(int type, String message) {  
        this.type = type;  
        this.message = message;  
    }  
  
    public String getMessage() {  
        return message;  
    }  
  
    public void setMessage(String message) {  
        this.message = message;  
    }  
  
    public int getType() {  
        return type;  
    }  
  
    public void setType(int type) {  
        this.type = type;  
    }   } Step2: In BaseActivity, register and unregister the EventBus:

    @Override  
  protected void onCreate(Bundle savedInstanceState){  
        super.onCreate(savedInstanceState);  
    
  EventBus.getDefault().register(this);  
}
@Override  
protected void onRestart() {  
    super.onRestart();  
    if (!EventBus.getDefault().isRegistered(this)){  
        EventBus.getDefault().register(this);  
        Log.d("BaseState","Event true");  
    }  
}  
@Override  
protected void onDestroy() {  
    EventBus.getDefault().unregister(this);  
    Log.d("BaseState","Event false");  
    super.onDestroy();  
  
} Step3: Listener

@Subscribe(threadMode = ThreadMode.MAIN)  
public void onMessageEvent(MessageEvent event) {  
    switch (event.getType()){  
        case 0:  
            FancyToast.makeText(this,"Failed to upload. "+event.getMessage(),FancyToast.LENGTH_SHORT, FancyToast.ERROR,false).show();  
  
            break;  
        case 1:  
            FancyToast.makeText(this, event.getMessage(),FancyToast.LENGTH_SHORT, FancyToast.SUCCESS,false).show();  
            break;  
        case 2:  
            FancyToast.makeText(this, getString(R.string.toast_login), FancyToast.LENGTH_LONG, FancyToast.WARNING, false).show();  
            break;  
    }  
};
</code></pre></div></div>

<h2 id="toast">Toast</h2>
<p><a href="https://github.com/Shashank02051997/FancyToast-Android">FancyToast</a></p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> FancyToast.makeText(this,"Failed to upload. "+event.getMessage(),FancyToast.LENGTH_SHORT, FancyToast.ERROR,false).show();
</code></pre></div></div>

<h2 id="dialog">Dialog</h2>
<p><a href="https://github.com/searchy2/CustomAlertViewDialogue">Dialogue</a></p>

<h2 id="data-transmission">Data transmission</h2>
<p><a href="https://github.com/square/okhttp">OKHTTP</a></p>

<p>Step1:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>implementation 'com.squareup.okhttp3:okhttp:4.9.0' Step2: An example class which transmits audio to the backend server.

    public class AudioUploading {  
      
        private static final String IMGUR_CLIENT_ID = "123";  
        private static final MediaType MEDIA_TYPE_WAV = MediaType.parse("audio/wav");  
        private static final OkHttpClient client = new OkHttpClient();  
      
        public static void run(File f, String pro, String phone) throws Exception {  
            final File file=f;  
            new Thread() {  
                @Override  
      public void run() {  
                    //Thread  
      RequestBody requestBody = new MultipartBody.Builder()  
                            .setType(MultipartBody.FORM)  
                            .addFormDataPart("pro", pro)  
                            .addFormDataPart("phone", phone)  
                            .addFormDataPart("file", file.getName(),  
                                    RequestBody.create(file, MEDIA_TYPE_WAV))  
                            .build();  
                    //Your IP  
      Request request = new Request.Builder()  
                            .header("Authorization", "Client-ID " + IMGUR_CLIENT_ID)  
                            .url("http://XXX.XXX.XX.XX:5000/upload")  
                            .post(requestBody)  
                            .build();  
                    try (Response response = client.newCall(request).execute()) {  
                        if (!response.isSuccessful()){  
                            EventBus.getDefault().post(new MessageEvent(0,"Unexpected code " + response));  
                        }  
    //                    if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);  
      
    //                    System.out.println(response.body().string());  
      EventBus.getDefault().post(new MessageEvent(1,response.body().string()));  
                    } catch (IOException e) {  
                        e.printStackTrace();  
                    }  
                }  
            }.start();  
        }  
    }
</code></pre></div></div>

<p>Step3: Call the method to upload the wav audio:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>  private void uploadResult(String pro) {  
      String path = getExternalFilesDir(Environment.DIRECTORY_MUSIC) + "/test.wav";  
            boolean fileExist = fileIsExists(path);  
            if (fileExist) {  
      try {  
                    //Uploading the audio   
      AudioUploading.run(f, pro, phoneNum);  
                } catch (Exception e) {  
                    e.printStackTrace();  
                }  
            } 
        } References:  [Official tutorial](https://square.github.io/okhttp/recipes/)
</code></pre></div></div>

<h2 id="loading">Loading</h2>
<p><a href="https://github.com/Kaopiz/KProgressHUD">Progress</a></p>

<h2 id="baseactivity">BaseActivity</h2>
<p>Example:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>public abstract class BaseActivity extends AppCompatActivity {  
    private KProgressHUD hud;  
  
    @Override  
  protected void onCreate(Bundle savedInstanceState){  
        super.onCreate(savedInstanceState);  
  
        //注册事件  
  EventBus.getDefault().register(this);  
  
}  
    @Override  
  protected void onStart() {  
        Log.i(TAG, "onStart");  
  
        super.onStart();  
    }  
  
    @Subscribe(threadMode = ThreadMode.MAIN)  
    public void onMessageEvent(MessageEvent event) {  
        switch (event.getType()){  
            case 0:  
                FancyToast.makeText(this,"Failed to upload. "+event.getMessage(),FancyToast.LENGTH_SHORT, FancyToast.ERROR,false).show();  
  
                break;  
            case 1:  
                FancyToast.makeText(this, event.getMessage(),FancyToast.LENGTH_SHORT, FancyToast.SUCCESS,false).show();  
                break;  
            case 2:  
                FancyToast.makeText(this, getString(R.string.toast_login), FancyToast.LENGTH_LONG, FancyToast.WARNING, false).show();  
                break;  
            case 3:  
                hud = KProgressHUD.create(this)  
                        .setStyle(KProgressHUD.Style.SPIN_INDETERMINATE)  
                        .setLabel(getString(R.string.hud_wait))  
                        .setDetailsLabel(getString(R.string.hud_prc))  
                        .setBackgroundColor(ContextCompat.getColor(this, R.color.teal_200))  
                        .show();  
                break;  
            case 4:  
                if (hud.isShowing()){  
                    hud.dismiss();  
                }  
                break;  
  
        }  
    };  
  
    @Override  
  protected void onRestart() {  
        super.onRestart();  
        if (!EventBus.getDefault().isRegistered(this)){  
            EventBus.getDefault().register(this);  
            Log.d("BaseState","Event true");  
        }  
    }  
  
    @Override  
  protected void onStop() {  
        super.onStop();  
  
    }  
    @Override  
  protected void onDestroy() {  
        EventBus.getDefault().unregister(this);  
        Log.d("BaseState","Event false");  
        super.onDestroy();  
  
    }  
  
}
</code></pre></div></div>

<p>It usually includes the lifecycle of the activity, register and unregister of services and others.</p>

<p><img src="/images/20211204/Lifecycle.jpg" alt="Lifecycle" /></p>]]></content><author><name>Peisong Li</name></author><category term="experience" /><category term="android" /><summary type="html"><![CDATA[Common-used library in my Android project, like data transmission, thread and lifecycle management.]]></summary></entry><entry><title type="html">Build a simple server based on the python Flask library</title><link href="https://peisong0109.github.io//posts/2021/12/blog-post-2/" rel="alternate" type="text/html" title="Build a simple server based on the python Flask library" /><published>2021-12-04T00:00:00-08:00</published><updated>2021-12-04T00:00:00-08:00</updated><id>https://peisong0109.github.io//posts/2021/12/python-server-Android-client</id><content type="html" xml:base="https://peisong0109.github.io//posts/2021/12/blog-post-2/"><![CDATA[<h2 id="background">Background:</h2>
<p>In my project, I need to build a server for the mobile users. After a research, I found that the <strong>python’s Flask library</strong> probably is a great framework. In addition, the server is built as a docker container, so it’s easy for us to transfer.
For the mobile Android users, they need to upload the audio data to the server, so we implement the <strong>OKHTTP</strong> for the communication and data transmission between client and server.</p>

<h2 id="dokcer">Dokcer:</h2>
<p>First of all, you need to build a docker environment on your server, which is not the key point in this article.</p>

<h2 id="server">Server:</h2>
<p><strong>Step1:</strong>
Firstly, we start with creating a new directory:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd flask_server
</code></pre></div></div>

<p>Secondly, come into the forder and build the required files:</p>

<p><img src="/images/20211204/Category.jpg" alt="File category" /></p>

<p>Dockerfile:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>FROM python:3.8
RUN pip install --upgrade pip
WORKDIR /usr/src/app    

COPY requirements.txt ./  
RUN pip install --no-cache-dir -r requirements.txt

COPY . .    

CMD [ "python", "./Server.py" ]
</code></pre></div></div>

<p>requirements.txt:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Flask==2.0.2
</code></pre></div></div>

<p>Server.py:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># @Time    : 2021-12-01 11:54
# @Author  : Peisong Li
# @FileName: Server.py

    from flask import Flask, request
    import os
    from werkzeug.utils import secure_filename
    import time
    
    os.environ['TZ'] = 'Asia/Shanghai'
    time.tzset()
    app = Flask(__name__)
    
    @app.route('/')
    def hello_world():
        return 'Hi, this is a server running in a Docker container!'
    
    @app.route('/upload', methods=['POST', 'GET'])
    def upload():
        if request.method == 'POST':
            # Get the tags
            f = request.files['file']
            pro = request.form['pro']
            ph = request.form['phone']
            datatime = time.strftime('%Y-%m-%d_%H:%M:%S', time.localtime())
            # root path
            basepath = os.path.dirname(__file__)
            # The Audio folder must be created in advance.
            upload_path = os.path.join(basepath, 'Audio', pro+'-'+datatime+'-'+ph+'-'+secure_filename(f.filename))
            # Save the file
            f.save(upload_path)
            return 'Success.'

if __name__ == '__main__':
    app.run(debug=True, host='0.0.0.0')
</code></pre></div></div>

<p><strong>Step2:</strong>
Build the image:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># docker build -t flask-server . Here the image name is *flask-server*, you can name it your own.
</code></pre></div></div>

<p><strong>Step3:</strong>
Run the container:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># sudo docker run -it --name py-server -p 5000:5000 -v "$PWD":/usr/src/app flask-server
</code></pre></div></div>

<p>Now, the website XX.XX.XX.XX:5000 is available. (Replace XX.XX.XX.XX with you own IP.)
Also, you can upload the file from your client by this url: 
XX.XX.XX.XX:5000/upload
In the next chapter, I’ll show how to send a file from the client to the server. Here we use OkHttp to do that.</p>

<h2 id="client">Client:</h2>
<p>The Android client could upload the audio data or other files to the server. Here we show the process of uploading the .wav audio.</p>

<p>I just present the source code, I believe you can understand it. 
Just copy and take a try!</p>

<ol>
  <li>
    <p>Build the method:</p>

    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code> public class AudioUploading {  
      
     private static final String IMGUR_CLIENT_ID = "123";  
     private static final MediaType MEDIA_TYPE_WAV = MediaType.parse("audio/wav");  
     private static final OkHttpClient client = new OkHttpClient();  
      
     public static void run(File f, String pro, String phone) throws Exception {  
         final File file=f;  
         new Thread() {  
             @Override  
   public void run() {  
                 //Sub Thread
   RequestBody requestBody = new MultipartBody.Builder()  
                         .setType(MultipartBody.FORM)  
                         .addFormDataPart("pro", pro)  
                         .addFormDataPart("phone", phone)  
                         .addFormDataPart("file", file.getName(),  
                                 RequestBody.create(file, MEDIA_TYPE_WAV))  
                         .build();  
                 //your ip address  
   Request request = new Request.Builder()  
                         .header("Authorization", "Client-ID " + IMGUR_CLIENT_ID)  
                         .url("http://**.**.**.**:5000/upload")  
                         .post(requestBody)  
                         .build();  
                 try (Response response = client.newCall(request).execute()) {    
                     if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);  
                     System.out.println(response.body().string());  
                 } catch (IOException e) {  
                     e.printStackTrace();  
                 }  
             }  
         }.start();  
     }  
 }
</code></pre></div>    </div>
  </li>
  <li>
    <p>Call the method:</p>

    <p>AudioUploading.run(f, pro, phoneNum);</p>
  </li>
</ol>

<h2 id="source-code">Source code:</h2>
<p><a href="https://github.com/peisong0109/python-server">The source code</a></p>

<p>For more information, you can refer the official tutorial below.</p>

<ol>
  <li>
    <p><a href="https://flask.palletsprojects.com/en/2.0.x/quickstart/#http-methods">Flask</a></p>
  </li>
  <li>
    <p><a href="https://square.github.io/okhttp/recipes/">OkHttp</a></p>
  </li>
</ol>]]></content><author><name>Peisong Li</name></author><category term="Server" /><category term="server" /><category term="python" /><category term="Flask" /><category term="OkHTTP" /><summary type="html"><![CDATA[You can build and dockerize a python-based backend server in 5 minutes.]]></summary></entry><entry><title type="html">Blog Post number 4</title><link href="https://peisong0109.github.io//posts/2012/08/blog-post-4/" rel="alternate" type="text/html" title="Blog Post number 4" /><published>2015-08-14T00:00:00-07:00</published><updated>2015-08-14T00:00:00-07:00</updated><id>https://peisong0109.github.io//posts/2012/08/blog-post-4</id><content type="html" xml:base="https://peisong0109.github.io//posts/2012/08/blog-post-4/"><![CDATA[<p>This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.</p>

<h1 id="headings-are-cool">Headings are cool</h1>

<h1 id="you-can-have-many-headings">You can have many headings</h1>

<h2 id="arent-headings-cool">Aren’t headings cool?</h2>]]></content><author><name>Peisong Li</name></author><category term="cool posts" /><category term="category1" /><category term="category2" /><summary type="html"><![CDATA[This is a sample blog post. Lorem ipsum I can’t remember the rest of lorem ipsum and don’t have an internet connection right now. Testing testing testing this blog post. Blog posts are cool.]]></summary></entry></feed>