锐单电子商城 , 一站式电子元器件采购平台!
  • 电话:400-990-0325

自动化小车数据客户端的研究与开发

时间:2022-08-11 08:00:01 e0e1e2传感器国内智能双重传感器

摘要
随着物联网技术在中国的应用越来越普遍。清扫机器人和智能电器无处不在。随着物联网技术的成熟,社会将发生巨大的变化。在当今工业经济时代,我们非常追求生产效率和生产力。智能产品将带来新的服务,推动整个生产过程。新组织将解决创新问题,给整个社会经济带来更好的变化。
与此同时,手机已人们的必备品。一些市场研究公司发布了一套数据。数据显示,Android市场占86%,iOS占14%。如果Android手机和物联网设备可以相互操作,大大提高生产效率,提高人们工作和生活的便利性。
本课题是北京农业大学自动化智能车辆子项目,用于接收、处理和管理自动化智能车辆收集的数据。
关键词 物联网,Android,自动化
Research and development of automated
Abstract
With the application of Internet of things technology is more and more common in China. Sweeping robots and smart appliances are everywhere. With the maturity of Internet of things technology, it will lead to great changes in society. In today’s industrial economy era, great pursuit of production efficiency and productivity, intelligent products will bring new services and drive the whole production process, and new organizations will solve the problem of innovation, which will bring better changes to the whole social economy.
At the same time, mobile phones have become a necessity for people. Some market research firms have published a set of figures. Android makes up 86% of the market and ios 14%, according to the data. If Android phones and iot devices can interoperate, it will greatly improve the production efficiency and improve the convenience of people’s work and life.
This project is a sub-project of Beijing agricultural university automatic intelligent vehicle, which is used to receive, process and manage the data collected by automatic intelligent vehicle.
Keywords: the Internet of Things,Android,Automation
目录
1概述 1
1.选题背景及意义 1
1.2研究现状 1
1.论文主要工作 1
2 开发环境描述 3
2.1 Android Studio介绍 3
2.2 JDK介绍开发环境 3
2.3 Android特征 3
2.4 lamp开发环境 4
3 需求分析 5
3.1系统开发目标 5
3.2系统需求分析 5
3.3可行性分析 6
4 设计与实现 8
4.实现1数据传输和指令控制 8
4.1软件概要 9
4.2硬件概要 10
4.4服务器数据库设计 11
4.5服务器php脚本设计 13
4.66安卓自动化汽车登录界面设计 15
4.77安卓自动化汽车注册界面设计 16
4.88安卓自动化汽车数据管理界面设计 17
4.动化车安卓端操作记录管理界面设计 18
4.10动态汽车安卓控制界面设计 19
5 软件测试 20
6总结 23
6.1收获和总结 23
6.2展望未来 23
致谢 24
参考文献 25
3 需求分析
3.1系统开发目标
开发包括安卓客户端和服务器端在内的完整数据管理系统。可实现:用户使用安卓客户端方便操作服务器数据,拥有完整的用户认证登录系统,可显示、分析数据,控制硬件自动化汽车。其中,服务器端要求能够很好地接收网络传输的汽车数据,以及自动化汽车和AndroidAPP两者沟通,接受双重操作。
3.2系统需求分析

通过问题定义和可行性研究,软件项目进入开发期,最重要的工作是需求分析。需求分析对整个软件开发的过程起决定性的作用。需求分析不完善完善,会给后续的开发工作带来很多困难,导致用户对软件不满,延长项目工期,难以沟通协调,甚至导致项目开发失败。可以说,需求分析是软件项目的关键[[[6]沈欣,陈华山.对软件需求分析的理解[J].2018年2(11)现代信息技术:13-14 17.]]。
① 用户需求分析
该软件是针对农业人员的,他们需要使用该软件来观察数据,处理数据,这是其核心,因此软件设计的概念应该需要:
?操作简单,没有复杂的界面和操作步骤。人们应该进入软件,快速找到所需的功能区域。功能应该齐全,但不能繁琐,让人在操作时感到不快。
?运行稳定,不能运行时着出现闪退,崩溃等现象,也不能有数据传输的错误,丢失,多余等现象。
?核心是让人一目了然,顺利操作数据,因为这个软件设计是用来处理数据的。

② 功能需求分析
由于本课题分为自动汽车安卓端和服务器端,本软件自动汽车安卓端应开发以下功能:
1)注册账户功能是确认用户身份的基本功能
2)登录功能,用于认证身份,只有注册用户才能进入软件
3)查看数据,用户可以查看小车的数据,通过表格的形式浏览
4)用户通过长按数据框删除数据
5)用户可以通过视频传输wifi查看自动化汽车摄像头的视频
6)行走命令,用户可以通过wifi传输命令控制前后左右行走
7)用户可以通过拍照命令拍照wifi传输命令控制照片和照片
可上传到服务器
8)用户可以通过传感器开关wifi控制自动化汽车的穿开开关,
9)上传操作记录,软件应记录用户的操作并上传到php的
服务器
10)通过Android自动化汽车的软件端查看操作记录,用户可以通过界限
查看自己的操作记录。
11)通过Android自动化汽车的软件端删除操作记录,用户可以通过边界
根据表格删除自动汽车数据。

服务器端具有以下功能:
1)验证登录,用于验证自动化汽车Android端的数据,并根据用户名和密码是否正确返回相应结果。
2)注册用户,用于向数据库添加用户注册的帐户密码
3)查询数据,用于查询服务器数据,返回安卓
4)删除数据,用于接收自动化汽车安卓终端请求后删除部分数据
5)查询操作记录,接收自动化汽车安卓端请求,取数据库查询操作记录表。
6)添加操作记录,用于接收自动化汽车Android端的请求,然后向服务器数据库添加记录
7)删除操作记录,用于接收自动化汽车Android终端的请求,然后删除服务器数据库的记录
3.3可行性分析

在可行性分析中,核心是实施项目 目标、技术方案、过程控制、人力资源、市场 全方位论证和评价营销、成本利润和风险[[[7]蒲冬梅.软件项目可行性分析评价的要点[J].2017(24)电子技术与软件工程54-55.]]。

1)技术的可行性
本项目自动化汽车安卓端采用java语言教程丰富,服务器端采用php语言非常适合快速开发小型服务器。
2)财务可行性
本课题主要是编写代码,硬件不在范围内。自动化汽车项目组提供资金,软件支出不大,资金可行。
3)社会可行性
该软件用于农业数据收集,对农业科学的发展起着建设性的作用,作为农业科学院,我们可以投入应用。该软件不涉及政治、宗教、法律、道德等问题。因此,社会价值主要体现在科技的推广上。
4)风险因素及对策
主要体现在软件服务器的稳定性、安全性、手机系统的稳定性、安全性等方面。安卓是谷歌的操作系统,经济支持良好,短时间内无风险;服务器端lamp服务器,服务器硬件是腾讯云,它有一定的不可靠性,这反映在服务器负荷和国内网络覆盖问题上,由于服务器负荷有限,不能同时承受大量用户访问,使服务器和自动汽车安卓链接依赖于无线网络,其自动汽车安卓端必须在网络覆盖的地区。前者的对策是在必要时更换更好的服务器,后者控制用户群,使其在中国网络信号覆盖区域使用。
本文转载:http://www.biyezuopin.vip/onews.asp?id=16528

package cn.com.lttc.loginui;  import android.app.Activity; import android.content.DialogInterface; import android.content.Intent; import android.graphics.Color; import android.os.Bundle; import android.os.Looper; import android.support.v7.app.AppCompatActivity; import android.view.Display; import android.view.GestureDetector; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.Button; import android.widget.EditText; import android.widget.LinearLayout; import android.widget.ListView; import android.widget.Toast; import net.tsz.afinal.FinalActivity; import net.tsz.afinal.FinalHttp; import net.tsz.afinal.annotation.view.ViewInject; import net.tsz.afinal.http.AjaxCallBack; import net.tsz.afinal.http.AjaxParams; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class controlActivity extends FinalActivity implements WheelView.WheelClickListener ,View.OnTouchListener,GestureDetector.OnGestureListener{ 
         int FLING_MIN_VELOCITY=100;//触摸时候的移动速度 @ViewInject(id=R.id.myLayout_id)LinearLayout mylayout; private GestureDetector mGestureDetector; @ViewInject(id=R.id.et_cid) EditText et_cid; @ViewInject(id=R.id.bt_shoot, click="bn_onClick") Button bn_shoot; @ViewInject(id=R.id.bt_drive, click="bn_onClick") Button bn_drive; @ViewInject(id=R.id.bt_photo, click="bn_onClick") Button bn_photo; @ViewInject(id=R.id.bt_sensor, click="bn_onClick") Button bn_sensor; private WheelView wheel; @Override protected void onCreate(Bundle savedInstanceState) { 
         super.onCreate(savedInstanceState); setContentView(R.layout.activity_control); wheel = (WheelView) findViewById(R.id.ctrls); wheel.setWheelClickListener(this); mylayout.setOnTouchListener(this); mylayout.setLongClickable(true); mGestureDetector = new GestureDetector(this, this); } @Override public void onWheelClick(int type) { 
         switch (type) { 
         case WheelView.CLICK_BOTTOM_DOWN: //下面按钮按下的时候 issue("behind"); break; case WheelView.CLICK_LEFT_DOWN: //左边按钮按下的时候 issue("left"); break; case WheelView.CLICK_RIGHT_DOWN: //右边按钮按下的时候 issue("right"); break; case WheelView.CLICK_TOP_DOWN: //上面按钮按下的时候 issue("front"); break; case WheelView.CLICK_BOTTOM_UP: //下面按钮按下抬起的时候 break; case WheelView.CLICK_LEFT_UP: //左边按钮按下抬起的时候 break; case WheelView.CLICK_RIGHT_UP: //右边按钮按下抬起的时候 break; case WheelView.CLICK_TOP_UP: //上面按钮按下抬起的时候 break; } } public void bn_onClick(View view) { 
         if(et_cid.length()==0){ 
         return ; } if( view.getId()==R.id.bt_shoot){ 
         if(bn_shoot.getText().toString().equals("开启视频")){ 
         bn_shoot.setText("关闭视频"); issue("open_shoot"); }else if(bn_shoot.getText().toString().equals("关闭视频")){ 
         bn_shoot.setText("开启视频"); issue("close_shoot"); } }else if(view.getId()==R.id.bt_drive){ 
         if(bn_drive.getText().toString().equals("自动驾驶")){ 
         bn_drive.setText("关闭自动驾驶"); issue("open_drive"); }else if(bn_drive.getText().toString().equals("关闭自动驾驶")){ 
         bn_drive.setText("自动驾驶"); issue("close_drive"); } }else if(view.getId()==R.id.bt_photo){ 
         issue("photo"); }else if(view.getId()==R.id.bt_sensor){ 
         if(bn_sensor.getText().toString().equals("开启传感器")){ 
         bn_sensor.setText("关闭传感器"); issue("open_sensor"); }else if(bn_sensor.getText().toString().equals("关闭传感器")){ 
         bn_sensor.setText("开启传感器"); issue("close_sensor"); } } } //按下就触发 @Override public boolean onDown(MotionEvent e){ 
         //flushData(); return false; } //短按触摸屏 @Override public void onShowPress(MotionEvent e) { 
        } //点击屏幕后抬起时触发该事件 @Override public boolean onSingleTapUp(MotionEvent e) { 
         return false; } //在屏幕上拖动控件 @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { 
         return false; } //长按触摸屏 @Override public void onLongPress(MotionEvent e) { 
         } //滑屏,用户按下触摸屏、快速移动后松开,由1个MotionEvent ACTION_DOWN, 多个ACTION_MOVE, 1个 //ACTION_UP触发;参数分别表示:按下事件、抬起事件、x方向移动速度、y方向移动速度。  @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { 
         final int FLING_MIN_DISTANCE = 100; if (Math.abs((int) (e1.getX() - e2.getX())) > FLING_MIN_DISTANCE && velocityX > FLING_MIN_VELOCITY) { 
        //右滑跳到控制界面 startActivity(new Intent(controlActivity.this, rememberActivity.class)); finish(); }else if(Math.abs((int) (e1.getX() - e2.getX())) > FLING_MIN_DISTANCE && velocityX < -FLING_MIN_VELOCITY){ 
        //左滑跳到记录界面 startActivity(new Intent(controlActivity.this, DisplayActivity.class)); finish(); } return false; } //实现OnTouchListener接口中的方法 @Override public boolean onTouch(View v, MotionEvent event) { 
         return mGestureDetector.onTouchEvent(event); } private String readFile(String path) { 
         MainActivity.verifyStoragePermissions(this); File file = new File(path); //如果path是传递过来的参数,可以做一个非目录的判断 if (file.isDirectory()) { 
         // Log.d("TestFile", "The File doesn't not exist.1"); }else { 
         try { 
         InputStream instream = new FileInputStream(file); if (instream != null) { 
         InputStreamReader inputreader = new InputStreamReader(instream); BufferedReader buffreader = new BufferedReader(inputreader); String line=buffreader.readLine(); instream.close(); return line; } } catch (java.io.FileNotFoundException e) { 
         //Log.d("TestFile", "The File doesn't not exist.2"); } catch (IOException e) { 
         //Log.d("TestFile", e.getMessage()); } } return ""; } public void writeFile(String path,String str){ 
         /* * 首先安卓下写文件要到sd卡位置是/mnt/sdcard/ * 还要注册权限,在AndroidManifest.xml中 */ MainActivity.verifyStoragePermissions(this); try { 
         File file=new File(path); FileOutputStream outStream = new FileOutputStream(file); outStream.write(str.getBytes()); outStream.close(); } catch (FileNotFoundException e) { 
         // TODO Auto-generated catch block e.printStackTrace(); } catch (UnsupportedEncodingException e) { 
         // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { 
         // TODO Auto-generated catch block e.printStackTrace(); } } void issue(String order){ 
         if(order.length()==0) return ; String cid=et_cid.getText().toString(); FinalHttp fh=new FinalHttp(); String url = MainActivity.selfip+"car/addMyremember.php"; AjaxParams params = new AjaxParams(); params.put("op_time", "now()"); params.put("car_id",cid); params.put("user_name", readFile("/mnt/sdcard/stateName.txt")); params.put("operate_name", order); params.put("__key", "op_time,car_id,user_name,operate_name"); fh.post(url, params,new AjaxCallBack<String>(){ 
         @Override public void onStart() { 
         super.onStart(); } @Override public void onLoading(long count, long current) { 
         super.onLoading(count, current); } @Override public void onSuccess(String t) { 
         // TODO Auto-generated method stub super.onSuccess(t); } @Override public void onFailure(Throwable t, int errorNo, String strMsg) { 
         // TODO Auto-generated method stub super.onFailure(t, errorNo, strMsg); tu("网络异常"); } }); } public void tu(String s){ 
         Toast.makeText(this, s, Toast.LENGTH_SHORT).show(); Looper.loop(); } } 

在这里插入图片描述














锐单商城拥有海量元器件数据手册IC替代型号,打造电子元器件IC百科大全!

相关文章