Design and Implementation of Urban Public Transport Inquiry System (Java+Web+MySQL+J2EE)

Table of Contents Abstract
1
Abstract 1
1 Introduction 1
1.1 Background of topic selection 1
1.2 Development status at home and abroad 1
1.3 Purpose of topic selection 1
1.4 Research methods and significance 1
2 Introduction to related technologies 3 2.1 Introduction to
Jsp technology 3
2.2 Introduction to MyEclipse 4
2.3 Database technology 4
2.3 .1 Database Architecture 4
2.3.2 Database Management System (DBMS) 5
2.3.3 Mysql Database 5
2.3.4 MySQL Features 7
2.3.5 MySQL Database Application Environment 7
2.4 JAVA Overview 7
2.5 J2EE Technology 7
2.6 B/S Structure 8
2.7 Tomcat Server 10
2.8 Web Technology 10
3 System Requirements Analysis 11
3.1 Requirements Analysis 11
3.1.1 Design Principles 11
3.1.2 System Design Objectives 11
3.2 System Feasibility Analysis 11
3.2.1 Economic Feasibility Analysis 12
3.2.2 Technical Feasibility Analysis12
3.3 User Requirements12
3.4 Overview of System Functional Requirements13
3.5 Operating Environment13
4 System outline design 15
4.1 Overview of outline design 15
4.2 Architecture design 15
4.3 System function structure diagram and analysis 15
4.3.1 System function structure diagram…………………………………… ………………………………………… 15
4.3.2 Basic functions of the system…………………………………………………………… …16
4.4 System Use Case Diagram 17
4.4.1 Introduction to UML Use Case Diagram 17
4.4.2 System Use Case Diagram 18
4.5 Technical Architecture 19
4.6 Database Structure Design 19
4.6.1 Principles of Database Design 19
4.6.2 Database Structure Analysis 19
4.6.3 Database Conceptual model 20
4.6.4 Partial database data table field design 21
5 System detailed design 24
5.1 System database connection configuration 24
5.2 Analysis and design of system flow chart…………………………………… ……………… 25
5.3 Realization of system login module 26
5.4 Front desk function module design 27
5.4.1 Bus query design 27
5.4.2 Popular line function module design 29
5.4.3 Website announcement function module design 29
5.4.4 Online question Module Design 30
5.5 Background Function Module Design 30
6 System Test 33
6.1 Program testing 33
6.2 Importance and purpose of testing 33
6.3 Testing steps 34
6.4 Main content of testing 34
6.4.1 Functional testing 35
6.4.2 Usability testing 37
6.4.3 Performance testing 38
6.5 Test conclusion 38
Summary and outlook 39
References Literature 40
Acknowledgments 42
3 System Requirements Analysis
3.1 Requirements Analysis
Software requirements refer to the user's expectations of the target software system in terms of function, behavior, performance, and design constraints. Through the understanding and analysis of the corresponding problem and its environment, establish a model for the information, function and system behavior involved in the problem, refine and complete the user's requirements, and finally form a requirement specification. This series of activities constitutes the software development life cycle needs analysis stage.
Requirements analysis is the bridge between the system analysis and software design phases. On the one hand, requirements analysis takes system specifications and project planning as the basic starting point of analysis activities, and checks and adjusts them from the perspective of software; on the other hand, requirements specifications are the main basis for software design, implementation, testing and maintenance . Good analysis activities help to avoid or eliminate early errors as early as possible, thereby increasing software productivity, reducing development costs, and improving software quality.
3.1.1 Design principles

  1. Usability principle. The development of this system is based on the principle of making it easy for passengers to query accurate bus information and for users to make reasonable arrangements for the bus system.
  2. Principle of reliability. Security services must be provided for administrators and users, especially the security of background user management and bus information management that can be accessed from the Internet.
  3. Principle of friendliness. The operation requirements of the urban public transport information query system are simple and convenient, and it is easy for users and administrators to grasp.
  4. Principles of maintainability. Be able to modify and maintain the software according to the relevant needs raised by users.
    3.1.2 System design objectives
    (1) Analyze the research status and characteristics of domestic and foreign public transport construction and bus query, and briefly describe the development process of scholars in the research of bus network routing algorithms; (2)
    Analyze system requirements. Study the psychology and behavior of passengers when traveling, including the way passengers obtain bus information, the information they care about, and travel considerations, etc., and analyze the goals and functions that the system needs to complete from the perspective of users; (3) Design the overall framework of the system
    . Introduce the development environment and process of the system, design the functions of the system as a whole, divide the sub-modules according to the system functions, and detail the functions that each part needs to complete, and design the database; (4) Find the best network path for understanding the existing bus inquiry
    system Optimal algorithm. By analyzing the characteristics of the city's bus routes, a route model of the bus network is established by abstracting the geographical bus network, and based on this model, the optimal route algorithm of the bus network is discussed.
    (5) Describe the design and implementation process of the system in detail. Provides a clear description of the specific implementation and results of each module of the system, and uses the proposed route as the experimental data to analyze the results of the query
    ; The improvement is prospected.
    3.2 System feasibility analysis
    Feasibility analysis includes the existing conditions and problems to be solved, the analysis of research methods, the technical route adopted, and the feasibility of the experimental plan. The existing conditions are: the research and experience of the urban public transport inquiry system, the complete software and hardware of my computer, and the preparation of literature. The problem to be solved is to realize the design of the page, the establishment of the database, the connection and creation of the database, and the file upload function of each table.
    3.2.1 Economic Feasibility Analysis
    Because this system belongs to the system used by small-scale management, the whole system is relatively small, so the development cost is not particularly large. I have completed the entire development process independently, and only a PC and the above-mentioned various software are needed to realize all development tasks. Since the PC is my original, and there is no need to upgrade the hardware; and various software can be downloaded free of charge on the Internet, the overall development cost is relatively small, which also provides us with great convenience and can further improve the website. In terms of use cost, users only need to own one computer to connect to the Internet, and only need to register to use all the functions and services of the website in any corner of the world. And there are no high requirements for computer hardware, and there are no other requirements for software, and the access and use are extensive. Therefore, from the perspective of economic feasibility analysis, this system embodies the characteristics of being economical but powerful.
    3.2.2 Technical Feasibility Analysis
    This topic uses Java technology, and MyEclipse is used as the development platform. MyEclipse has this complete set of functions, which is convenient for beginners to use and also has code prompts, which makes it easier for me to use. After deciding on the programming framework, let's talk about the advantages of coding in Java language: high efficiency, strong reusability, and small amount of code. At the same time, the database used is MySQL. The open source MySQL has added the advantages of visualization and stability, and has done a good job in terms of security, not to mention its powerful function of saving data and querying data.
    3.3 User requirements
    To design a good public transport inquiry system, it is necessary to clarify the requirements of the application environment for the system. The application background of the bus query system is: to facilitate citizens to travel by bus. Therefore, passengers can use three types of inquiries: station site inquiry, bus line inquiry, and station-to-station inquiry. At the same time, there is an administrator management interface, which is responsible for adding, modifying, and deleting the specified bus line information. In order to better adapt to the real-time nature of the bus query system, make this system more perfect, and be better used by users. The function of online questioning and announcement on the website is designed. The online questioning can be very good, and the public’s opinions on the bus inquiry system and some unclear questions about the route can be known quickly. The website publishing function can better help the government and the bus The company releases news and emergencies for the convenience of citizens. Therefore, the system needs to meet the following requirements:
    Query function: The system needs to provide several different ways of query, including querying bus routes based on bus lines, daily stops, and any two stops. Second, an algorithm is employed to find ride-hailing routes between any two stops. The specific functions are as follows:
  5. Carry out corresponding information query according to the bus station.
  6. Carry out corresponding information query according to the bus line.
  7. By selecting any two stations, complete the query of the shortest bus route between the two stations.
    User management function: mainly to delete user information and modify user basic information;
    background train management functions mainly include adding trains and sites, updating trains and sites, deleting trains and sites, so that the system can be updated in real time and provide user queries more accurate information. details as follows:
  8. Complete the function of adding trains and stations.
  9. Complete the train number and station update function.
  10. Complete the function of deleting train numbers and stations.
  11. User login verification function.
  12. User registration information function.
  13. User logout functionality.
  14. Delete user information function.
    Online questioning function: Online questioning mainly includes the posting of questions that users have doubts about bus lines, aiming to allow citizens, the government, and citizens who raise questions to solve and discuss together.
    Website announcement release function: release some real-time news, including line detours, bus price adjustments, and some real-time traffic information, all of which can be queried through this, aiming to provide users with a real-time and convenient bus Interlude system.
    3.4 Overview of System Functional Requirements
    Requirements analysis is to analyze the needs and requirements of users. If the results of the evaluation need to accurately reflect the actual needs of users, it will directly affect the entire stage of program design, and will also affect the use of the system. Focusing on a needs assessment is the process of completing a survey, collecting and researching, and potentially impacting, data management and security information needs. Ordinary users are relatively lack of relevant computer knowledge, and can determine whether the computer can and cannot do for themselves, so they cannot express their needs very accurately, but they are the end users, and their needs are It is the final demand, but the technicians lack the professional knowledge of the users, so it is not easy to understand the real needs of the users, and sometimes they may misunderstand the needs of the users; the emergence of new hardware and software technologies will also make the system Business needs have to change. Therefore, technicians must use some obtained methods to ensure continuous communication with users so as to determine the final needs of users. Through continuous and in-depth communication with users, we understand the main problems existing in the current system.
    Need research is the information analyzed and refined from users, described in function and performance. It is part of the first phase of the software development process, the main task is to understand what you need and what should be done to determine the system, so put forward complete, accurate, clear and specific requirements in the target system, and express Wake up in writing.
    The user interface of the software is the most direct contact with the object, including whether it allows the user to use it simply and conveniently, and the response time of the request, which has a great difference in the overall user experience.
    To design a good public transport inquiry system, we must first clarify the requirements of the application environment for the system. The application background of the bus query system is: to facilitate citizens to travel by bus; manual (current), automatic (future), and timely update of query data. Therefore, the system needs to meet the following requirements:
    1. Inquiry function: The system needs to provide several different ways of inquiring means to manage the entire system flexibly and conveniently.
    2. Data update and modification:
    update: the system allows administrator-level users to update, modify and save data;
    edit: the system allows administrator-level users to edit and delete data to ensure the authenticity of the current database and real-time.
    The system adopts B/S mode. The key to the whole system is the database system. A powerful database can support an excellent software design. This article is reproduced from http://www.biyezuopin.vip/onews.asp?id=11189 through the connection between the software system and the database system To observe and process operation data through software interface
    3.5 Operating environment
    This system is a WEb application program, which needs to deploy middleware Tomcat and MySQL database on the server, and other clients can access the server through the network.
    (1) Development hardware platform:
    CPU: Core Duo 3.2GHZ
    Memory: 4G or more
    Hard disk: 500GB
    (2) Server-side hardware platform:
    Server reference configuration: Intel Xeon Quad Core E5530 80W 2.40GHz/5.8GT/8MB Cache, 2x2GB DDR3-1066MHz, 2.5in HS 146GB SAS, HS 675W PSU, ServeRAID MR10i(RAID 5), 2*Giga Ethernet,Light Path, CD -RW/DVD Combo, 1U,3 Years Onsite Next Business Day. 146GB 10K 6Gbps SAS 2.5" SFF Slim-HS HDD x3550M2/x3650M2/HS22 (3) Development software platform: Operating system: Window 8 or Win
    7
    Database
    : mysql
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	String menu = (String)request.getAttribute("menu");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>我的UI我做主</title>
<link href="<%=path %>/resource/lib/ligerUI/skins/Aqua/css/ligerui-all.css" rel="stylesheet"
	type="text/css" />
<link rel="stylesheet" type="text/css" id="mylink" />
<script src="<%=path %>/resource/lib/jquery/jquery-1.9.0.min.js" type="text/javascript"></script>
<script src="<%=path %>/resource/lib/ligerUI/js/ligerui.all.js" type="text/javascript"></script>
<script src="<%=path %>/resource/lib/ligerUI/js/plugins/ligerTab.js"></script>
<script src="<%=path %>/resource/lib/jquery.cookie.js"></script>
<script src="<%=path %>/resource/lib/json2.js"></script>
<script type="text/javascript">
	var tab = null;
	var accordion = null;
	var tree = null;
	var tabItems = [];
	$(function() {
    
    

		//布局
		$("#layout1").ligerLayout({
    
    
			leftWidth : 190,
			height : '100%',
			heightDiff : -34,
			space : 4,
			onHeightChanged : f_heightChanged
		});

		var height = $(".l-layout-center").height();

		//Tab
		$("#framecenter").ligerTab({
    
    
			height : height,
			showSwitchInTab : true,
			showSwitch : true,
			onAfterAddTabItem : function(tabdata) {
    
    
				tabItems.push(tabdata);
				saveTabStatus();
			},
			onAfterRemoveTabItem : function(tabid) {
    
    
				for (var i = 0; i < tabItems.length; i++) {
    
    
					var o = tabItems[i];
					if (o.tabid == tabid) {
    
    
						tabItems.splice(i, 1);
						saveTabStatus();
						break;
					}
				}
			},
			onReload : function(tabdata) {
    
    
				var tabid = tabdata.tabid;
				addFrameSkinLink(tabid);
			}
		});

		//面板
		$("#accordion1").ligerAccordion({
    
    
			height : height - 24,
			speed : null
		});

		$(".l-link").hover(function() {
    
    
			$(this).addClass("l-link-over");
		}, function() {
    
    
			$(this).removeClass("l-link-over");
		});
	
		
		//我的菜单
		$("#mytree").ligerTree(
				{
    
    
					data :<%=menu%> ,
					checkbox : false,
					slide : false,
					nodeWidth : 120,
					attribute : [ 'nodename', 'url' ],
					render : function(a) {
    
    
						if (!a.isnew)
							return a.text;
						return '<a href="<%=path %>/resource/' + a.url + '" target="_blank">'
								+ a.text + '</a>';
					},
					onSelect : function(node) {
    
    
						if (!node.data.url)
							return;
						if (node.data.isnew) {
    
    
							return;
						}
						var tabid = $(node.target).attr("tabid");
						if (!tabid) {
    
    
							tabid = new Date().getTime();
							$(node.target).attr("tabid", tabid)
						}
						f_addTab(tabid, node.data.text, node.data.url);
					}
				});


		function openNew(url) {
    
    
			var jform = $('#opennew_form');
			if (jform.length == 0) {
    
    
				jform = $('<form method="post" />').attr('id', 'opennew_form')
						.hide().appendTo('body');
			} else {
    
    
				jform.empty();
			}
			jform.attr('action', url);
			jform.attr('target', '_blank');
			jform.trigger('submit');
		}
		;

		tab = liger.get("framecenter");
		accordion = liger.get("accordion1");
		tree = liger.get("tree1");
		$("#pageloading").hide();

		css_init();
		pages_init();
	});
	function f_heightChanged(options) {
    
    
		if (tab)
			tab.addHeight(options.diff);
		if (accordion && options.middleHeight - 24 > 0)
			accordion.setHeight(options.middleHeight - 24);
	}
	function f_addTab(tabid, text, url) {
    
    
		tab.addTabItem({
    
    
			tabid : tabid,
			text : text,
			url : url,
			callback : function() {
    
    
				//addShowCodeBtn(tabid); 
				addFrameSkinLink(tabid);
			}
		});
	}
	function addShowCodeBtn(tabid) {
    
    
		var viewSourceBtn = $('<a class="viewsourcelink" href="javascript:void(0)">查看源码</a>');
		var jiframe = $("#" + tabid);
		viewSourceBtn.insertBefore(jiframe);
		viewSourceBtn.click(function() {
    
    
			showCodeView(jiframe.attr("src"));
		}).hover(function() {
    
    
			viewSourceBtn.addClass("viewsourcelink-over");
		}, function() {
    
    
			viewSourceBtn.removeClass("viewsourcelink-over");
		});
	}
	function showCodeView(src) {
    
    
		$.ligerDialog.open({
    
    
			title : '源码预览',
			url : '<%=path %>/resource/dotnetdemos/codeView.aspx?src=' + src,
			width : $(window).width() * 0.9,
			height : $(window).height() * 0.9
		});

	}
	function addFrameSkinLink(tabid) {
    
    
		var prevHref = getLinkPrevHref(tabid) || "";
		var skin = getQueryString("skin");
		if (!skin)
			return;
		skin = skin.toLowerCase();
		attachLinkToFrame(tabid, prevHref + skin_links[skin]);
	}
	var skin_links = {
    
    
		"aqua" : "<%=path %>/resource/lib/ligerUI/skins/Aqua/css/ligerui-all.css",
		"gray" : "<%=path %>/resource/lib/ligerUI/skins/Gray/css/all.css",
		"silvery" : "<%=path %>/resource/lib/ligerUI/skins/Silvery/css/style.css",
		"gray2014" : "<%=path %>/resource/lib/ligerUI/skins/gray2014/css/all.css"
	};
	function pages_init() {
    
    
		var tabJson = $.cookie('liger-home-tab');
		if (tabJson) {
    
    
			var tabitems = JSON2.parse(tabJson);
			for (var i = 0; tabitems && tabitems[i]; i++) {
    
    
				f_addTab(tabitems[i].tabid, tabitems[i].text, tabitems[i].url);
			}
		}
	}
	function saveTabStatus() {
    
    
		$.cookie('liger-home-tab', JSON2.stringify(tabItems));
	}
	function css_init() {
    
    
		var css = $("#mylink").get(0), skin = getQueryString("skin");
		$("#skinSelect").val(skin);
		$("#skinSelect").change(function() {
    
    
			if (this.value) {
    
    
				location.href = "<%=path %>/jsp/index.jsp?skin=" + this.value;
			} else {
    
    
				location.href = "<%=path %>/jsp/index.jsp";
			}
		});

		if (!css || !skin)
			return;
		skin = skin.toLowerCase();
		$('body').addClass("body-" + skin);
		$(css).attr("href", skin_links[skin]);
	}
	function getQueryString(name) {
    
    
		var now_url = document.location.search.slice(1), q_array = now_url
				.split('&');
		for (var i = 0; i < q_array.length; i++) {
    
    
			var v_array = q_array[i].split('=');
			if (v_array[0] == name) {
    
    
				return v_array[1];
			}
		}
		return false;
	}
	function attachLinkToFrame(iframeId, filename) {
    
    
		if (!window.frames[iframeId])
			return;
		var head = window.frames[iframeId].document
				.getElementsByTagName('head').item(0);
		var fileref = window.frames[iframeId].document.createElement("link");
		if (!fileref)
			return;
		fileref.setAttribute("rel", "stylesheet");
		fileref.setAttribute("type", "text/css");
		fileref.setAttribute("href", filename);
		head.appendChild(fileref);
	}
	function getLinkPrevHref(iframeId) {
    
    
		if (!window.frames[iframeId])
			return;
		var head = window.frames[iframeId].document
				.getElementsByTagName('head').item(0);
		var links = $("link:first", head);
		for (var i = 0; links[i]; i++) {
    
    
			var href = $(links[i]).attr("href");
			if (href && href.toLowerCase().indexOf("ligerui") > 0) {
    
    
				return href.substring(0, href.toLowerCase().indexOf("lib"));
			}
		}
	}
</script>
<style type="text/css">
body, html {
    
    
	height: 100%;
}
body {
    
    
	padding: 0px;
	margin: 0;
	overflow: hidden;
}

.l-link {
    
    
	display: block;
	height: 26px;
	line-height: 26px;
	padding-left: 10px;
	text-decoration: underline;
	color: #333;
}

.l-link2 {
    
    
	text-decoration: underline;
	color: white;
	margin-left: 2px;
	margin-right: 2px;
}

.l-layout-top {
    
    
	background: #102A49;
	color: White;
}

.l-layout-bottom {
    
    
	background: #E5EDEF;
	text-align: center;
}

#pageloading {
      
      
	position: absolute;
	left: 0px;
	top: 0px;
	background: white url('<%=path %>/resource/loading.gif') no-repeat center;
	width: 100%;
	height: 100%;
	z-index: 99999;
}

.l-link {
    
    
	display: block;
	line-height: 22px;
	height: 22px;
	padding-left: 16px;
	border: 1px solid white;
	margin: 4px;
}

.l-link-over {
    
    
	background: #FFEEAC;
	border: 1px solid #DB9F00;
}

.l-winbar {
    
    
	background: #2B5A76;
	height: 30px;
	position: absolute;
	left: 0px;
	bottom: 0px;
	width: 100%;
	z-index: 99999;
}

.space {
    
    
	color: #E7E7E7;
}
/* 顶部 */
.l-topmenu {
    
    
	margin: 0;
	padding: 0;
	height: 31px;
	line-height: 31px;
	background: url('<%=path %>/resource/lib/images/top.jpg') repeat-x bottom;
	position: relative;
	border-top: 1px solid #1D438B;
}

.l-topmenu-logo {
    
    
	color: #E7E7E7;
	padding-left: 35px;
	line-height: 26px;
	background: url('<%=path %>/resource/lib/images/topicon.gif') no-repeat 10px 5px;
}

.l-topmenu-welcome {
    
    
	position: absolute;
	height: 24px;
	line-height: 24px;
	right: 30px;
	top: 2px;
	color: #070A0C;
}

.l-topmenu-welcome a {
    
    
	color: #E7E7E7;
	text-decoration: underline
}

.body-gray2014 #framecenter {
    
    
	margin-top: 3px;
}

.viewsourcelink {
    
    
	background: #B3D9F7;
	display: block;
	position: absolute;
	right: 10px;
	top: 3px;
	padding: 6px 4px;
	color: #333;
	text-decoration: underline;
}

.viewsourcelink-over {
    
    
	background: #81C0F2;
}

.l-topmenu-welcome label {
    
    
	color: white;
}

#skinSelect {
      
      
	margin-right: 6px;
}
</style>
</head>
<body style="padding: 0px; background: #EAEEF5;">
	<div id="pageloading"></div>
	<div id="topmenu" class="l-topmenu">
		<div class="l-topmenu-logo"><h1>城市公交查询系统 </h1></div>
		<%--<div class="l-topmenu-welcome">
			<label> 皮肤切换:</label> <select id="skinSelect">
				<option value="aqua">默认</option>
				<option value="silvery">Silvery</option>
				<option value="gray">Gray</option>
				<option value="gray2014">Gray2014</option>
			</select> </span>
			
		</div>
	--%></div>
	<div id="layout1"
		style="width: 99.2%; margin: 0 auto; margin-top: 4px;">
		<div position="left" title="主要菜单" id="accordion1">
			
			<div title="功能列表" class="l-scroll">
				<ul id="mytree" style="margin-top: 3px;">
			</div>
		
		</div>
		<div position="center" id="framecenter">
			<div tabid="home" title="我的主页" style="height: 300px">
				<iframe frameborder="0" name="home" id="home" src="<%=path %>/jsp/welcome.jsp"></iframe>
			</div>
		</div>
	</div>
	<div style="height: 32px; line-height: 32px; text-align: center;">
		Copyright © 城市公交查询系统 </div>
	<div style="display: none"></div>
</body>
</html>

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here

おすすめ

転載: blog.csdn.net/newlw/article/details/127745332