design of mobile bicycle mobile phone application software · design of mobile bicycle mobile phone...

7

Click here to load reader

Upload: dangcong

Post on 13-Jun-2019

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

165

Design of Mobile Bicycle Mobile Phone Application Software

Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng

School of Automation, Chongqing University of Posts and Telecommunications, Chongqing 400065,

China

[email protected]

Abstract

For the current domestic is the rise of the electric bicycle rental market, combined with

Bluetooth communications technology, Internet technology and computer software technology,

for an electric bike designed a mobile application software. Between the bike and the phone

through the Bluetooth data exchange, the design of the mobile phone application software can

display the current speed, riding time, riding distance, the average speed and other

information. Using the software, the rider can understand the status of riding in real time.

Keywords

Electric Bicycle,Mobile Phone Application Software, Bluetooth Communication,Riding

State.

1. Introduction

Traditional bike is driven by manpower, and it is very laborious to ride on bad roads such as

mountains and ramps. The advent of electric cars has improved the problem. However, with the

popularity of modern social fitness concept and the popularity of the Internet, bicycles as people

travel when the choice of transport at the same time, has become a healthy sports lifestyle, widely

loved by fitness enthusiasts. Combined with electric vehicles for the advantages of a wide range of

environments and inspire people to travel a healthy vision, this paper proposed a mobile bike for

mobile phone applications.

In addition to the software can display the current speed, riding time, riding distance and other

information, users can also register through the account on the Internet to share their riding

experience. More importantly, the software can obtain the calorie value consumed during cycling

from the bicycle motor controller and record it, which makes sense for the rider for fitness purposes.

2. System Structure Design

The system design based on the Android platform riding application software program consists of

four parts: electric bicycles, small instruments, Android mobile terminals and vehicle monitoring

center. The overall framework of the system is shown in Fig. 1. Small instrument is the electronic

control unit of electric bicycle. A variety of sensors on the car can be collected electric bicycle parts

of the work information, sent to the small instrument, and a variety of signals for analysis and

processing. Electric bicycle riding application software through the Bluetooth module and small

instrument for data communication, real-time collection of electric bicycle riding data. At the same

time, the mobile terminal uploads the riding data to the vehicle monitoring center through the

terminal own network.

The mobile phone application software mainly realizes the diagnosis data processing, the data

analysis, the data display and the data upload; The vehicle monitoring center can receive the front-end

vehicle diagnosis data and analyze the data of the electric vehicle and the data transmission function

of the electric bicycle The

Electric bicycle small instrument through the serial port to collect the electric bicycle riding data, mobile platform terminal through the built-in GPS module to collect location information. Data

transmission through the Bluetooth module and the mobile terminal comes with the network. Data

Page 2: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

166

processing and analysis using an efficient Android operating system to complete. The data flow is

shown in Fig. 2.

Electric Bicycle Small instrument Smartphone terminal

Testing

Software

UART

MCU

Remote server

3G/Wifi

Server

Serial port

Fig. 1 The overall structure of the body network

Mobile terminalSmall instrument

GPS moduleInstrument

serial module

Microcontroller Module

Bluetooth module Bluetooth module

Positioning information

Android platform Terminal display

Bike data Remote monitoring center

Mobile phone network

Ridinginformation

Ridinginformation

Ridinginformation

Ridinginformation

Ridinginformation

Positioning information

Positioning information

Ridinginformation

Fig. 2 Electric bicycle mobile application software data flow

开发人员

测试人员

Electric Bicycle Mobile App Case

设计测试用例

设计蓝牙连接功能

观察测试结果

设计UI界面

执行测试功能

测试管理功能 配置测试参数

输出测试结果

连接蓝牙设备 <<uses>>

<<uses>><<uses>>

<<uses>>

设计远程通信接口

<<uses>>

Design test cases

Bluetooth function

management functions

UI interface

communication interface

Test Results

Connect the Bluetooth device

Test parameters

Perform functional

test

Test Results

Developer

Tester

Fig. 3 Test application modeling use case diagram

Page 3: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

167

3. Software Function Modeling

According to the overall design, UML modules are modeled on each function module, and the

functions of the test software are shown in Fig. 3

Developers in the test software development process, the need to design test cases, connect the Bluetooth device features, test management functions, design UI interface, the output test results. The

tester needs to connect the Bluetooth device, configure the test parameters, perform the test function,

observe the test results.

3.1 Test Case Modeling

According to the method of consistency test, combined with the electric bicycle data transmission

protocol, this paper models the test cases of the network management protocol. The test cases include

the preconditions, the input parameters, the test steps and the expected results. The test case design

Fig. 4 shows.

开发人员

前置条件

测试步骤

期望结果

输入参数

Test case modeling

Preconditions

Input parameters

Test steps

Desired result

Developer

Fig. 4 Test case design modeling

Among them, the precondition is to perform this test to meet the prerequisites, such as the status of the

DUT. The input parameters are parameters that need to be configured for the test system, such as ride

mileage, time parameters, and so on. The test procedure is related to the test process, such as sending serial data, delay and other operations. The expected result is the result of the expected occurrence of

the current test case, that is, the result of the agreement.

3.2 Bluetooth Management Modeling

Bluetooth device management functions mainly include some of the basic functions of Bluetooth devices, such as: open, close, find, connect, match and so on. For different roles, different functions

are required. For example: developers need to design and implement the Bluetooth protocol stack, the

design of Bluetooth operating UI interface. And the tester will need to connect the specific operation

of the Bluetooth, Bluetooth and complete the connection between the two Bluetooth devices.

In view of the different functional requirements of the above analysis, using UML modeling, the use of Bluetooth management module shown in Fig. 5.

3.3 Test Management Modeling

Test management mainly includes parsing the XML file for the test case, the test recording based on the test result generated, encapsulation of serial data, design data communication with the Bluetooth

mobile terminal device, the data during the test for analysis and processing. Which UML use case

modeling shown in Fig. 6.

Page 4: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

168

开发人员 测试人员

Bluetooth device management use case

打开

关闭

查找

连接

配对

<<uses>><<uses>><<uses>>

<<uses>>

<<uses>>

Open

Close

Find

Connection

Pair

Developer Tester

Fig. 5 Bluetooth device management use case

开发人员

Test management case

解析XML文件

封装CAN报文

生成测试记录文件

测试执行处理

数据通信

Parse the XML file

Generate test log file

Encapsulate riding data

Data communication

Test execution processing

Developer

Fig. 6 Test management use case diagram

3.4 UI Interface Design Modeling

UI interface is an important way of human-computer interaction. The UI interface of the test software

includes a list of test cases, a message display window during the test, a test parameter configuration

interface, a Bluetooth device management control, a test result display interface, and other setting

controls. The UML model is shown in Fig. 7.

Page 5: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

169

开发人员

UI interface case

测试用例配置列表

测试参数配置窗口

其他设置控件

蓝牙设备管理控件

测试结果显示

Developer

Test case configuration

Test the process display window

Test parameter configuration

Bluetooth device

management controls

Test results show

Other settings controls

Fig. 7 UI interface modeling use case diagram

4. Software Interface Design

Using Android language for software design, the main interface of the software shown in Fig. 8. The

main interface can display information such as current speed, ride distance, ride time, calorie

consumption, maximum speed, average speed, current elevation. In the personal information editing interface, the user can make head, nickname, birthday, gender, telephone, height, weight and other

information settings.

Fig. 8 Software interface design

Page 6: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

170

5. Data Interaction Design

Use the application software to unlock the vehicle, then the phone can be through the Bluetooth and

bicycle motor controller to communicate. The phone will be collected to the speed, battery power,

gear and GPS and other data displayed in the phone interface.

Mobile phone and bicycle motor data exchange software design process shown in Figure 3. First, the motor is running and the data is sent to the Bluetooth through the serial port, and then Bluetooth to the

transmission of the motor data sent to the phone, the phone receives the message after its analysis and

processing, according to the length of the message and the first 0 Is 0x64 to determine the legitimacy

of the message, and then according to the first message to determine the function of this message, and

finally the data will be processed to the phone interface. Electric bicycle mobile application software

data exchange process shown in Fig. 9.

Start

The phone resolves the

data and displays it

End

Riding data is sent to Bluetooth via serial port

Bluetooth sends the riding data to the phone in a transparent

manner

Mobile client analysis of riding data

Determine whether it is 19

Determine whether the 0 bit is 0x64

YES

YES

NO

NO

The function is differentiated for

the first bit0x5A (0x5B, 0x5C,

0x5D)

Fig. 9 Data interaction flow chart

In order to ensure that the phone can get the data when the bicycle is running, you need to develop a

communication protocol. Bicycle motor controller and mobile phone between the use of Bluetooth for data transmission. Defines the length of the data frame sent by the Bluetooth module of the motor

Page 7: Design of Mobile Bicycle Mobile Phone Application Software · Design of Mobile Bicycle Mobile Phone Application Software Hao Tang a, Bingyang Chen, Mei Yuan, Xiaofeng Meng School

International Journal of Science Vol.4 No.4 2017 ISSN: 1813-4890

171

controller for 11 bytes, sent once every 500ms, and the phone does not respond. The format of the

data frame is shown in Table 1.

Table 1. Format of data frames

Data bits Function Description

BYTE0 Start character Fixed value 0x64.

BYTE1 Voltage state

Bit7: voltage undervoltage, 0 for battery, 1 for

battery undervoltage.

Bit6-0: reserved.

BYTE2 Current state The operating current of the controller.

BYTE3 Speed information high byte The wheel rotates one week in milliseconds. BYTE4 Speed information low byte

BYTE5 Remaining battery 0-100%.

BYTE6 Power motor stalls Divided into four files 0x00, 0x04, 0x08,

0x09.

BYTE7 Power switch status, headlight

switch status

Bit0: 0 indicates that the headlamp is off and 1

indicates that the headlamp is on.

Bit4: 0 means the switch is off, 1 means the

switch is on.

BYTE8 Error code

BYTE9 Checksum

BYTE10 The end character Fixed to 0x0E.

6. Conclusion

In this article, the phone and the bike of the motor through the Bluetooth data exchange, the phone

will receive the motor data for a certain deal and through the design of the application software to

display. Users through the design of the mobile phone software, you can very intuitive understanding

of the current riding status and make the appropriate adjustments.

References

[1] Trompenaars F, Hampden-Turner C. Riding the waves of culture: Understanding diversity in

global business[M]. Nicholas Brealey Publishing, 2011.

[2] Zander J, Mähönen P. Riding the data tsunami in the cloud: myths and challenges in future

wireless access[J]. IEEE Communications Magazine, 2013, 51(3): 145-151.

[3] Su J, Chan K K W, Miklas A G, et al. A preliminary investigation of worm infections in a

bluetooth environment[C]//Proceedings of the 4th ACM workshop on Recurring malcode. ACM,

2006: 9-16.

[4] Scheuner D, Eckman C, Jensen M, et al. Secreted amyloid β–protein similar to that in the senile plaques of Alzheimer's disease is increased in vivo by the presenilin 1 and 2 and APP mutations

linked to familial Alzheimer's disease[J]. Nature medicine, 1996, 2(8): 864-870.

[5] Hwang J J, Wang D Y, Shih N C, et al. Development of fuel-cell-powered electric bicycle[J].

Journal of Power Sources, 2004, 133(2): 223-228.