Design and implementation of bus management based on Java (with source code address)


The source code is open source and can be obtained by yourself. The link is at the end of the article.

Summary

In the context of the rapid development of industrial processes, our lives have brought many conveniences. People used to choose private cars as a means of travel. However, currently, due to serious excessive emissions of fuel pollutants, Our air is seriously polluted, so people consciously choose low-carbon emissions. Buses are a typical representative of low-carbon transportation. People choose buses as transportation when walking long distances. However, due to the large number of bus trips and complex bus routes, people do not know where the bus is going or which bus they should take when choosing a bus. Therefore, based on the analysis of the actual bus experience and the omissions in bus management, a bus inquiry system is designed to allow people to clarify the route before taking the bus, find the correct vehicle, and take the bus in a timely and convenient manner.
The design and development of the system uses Java as the development language, MySQL to store database information, and Idea as the development tool. The front-end uses the JS framework, and the back-end uses the SSM architecture to organize the above technical resources. Design and implement a complete bus query system. Functionally, it can realize login registration, user query management, vehicle management, site management, line management, user management, personal information management, etc.

Keywords: Java; JS framework; MySQL database; SSM architecture

1. Introduction

(1) Research background

According to data released by the public transportation information platform, in recent years, the overall scale of public transportation in our country has continued to expand, and the public transportation inquiry system plays an irreplaceable role in passengers choosing routes and selecting stops to board the bus with its efficient resource allocation. It is favored by the majority of users. The online bus inquiry mode has gradually been applied to many aspects of social production and life, and with its time flexibility, it has become an indispensable travel tool in everyone's life.
The bus inquiry system refers to a convenient system that provides functions such as bus route inquiry, ride plan recommendation, real-time bus information inquiry and prediction, and vehicle location tracking through network platforms, mobile APPs and other media. Public transport information service. At present, domestic bus inquiry system research is relatively rich, mainly focusing on the following aspects:
1. Positioning technology: The real-time information collection and update of the bus inquiry system relies on positioning technology. Domestic research The personnel mainly focus on the accuracy, stability and application of GPS, base station positioning and other technologies. For example, the Beijing Municipal Transportation Commission has installed a GPS system on city buses to provide real-time location information of the vehicles and display it to users through electronic screens and online platforms.
2. Data mining: The bus query system needs to obtain information such as bus lines, stations, vehicles, etc. Data mining technology can help the system extract useful information from the original data, such as extracting the shortest path of the bus line, Average travel time, etc. Domestic researchers mainly focus on the efficiency and accuracy of data mining algorithms.
3. Transportation planning: The bus query system can provide reference opinions for urban transportation planning, such as predicting future traffic demand and optimizing bus route planning based on user travel data. Domestic researchers mainly focus on the degree of intelligence and informatization of the public transportation system to provide scientific decision-making support for urban transportation planning.
4. User experience: The user experience of the public transportation inquiry system directly affects the user usage and satisfaction. Domestic researchers mainly focus on the interface design, information display and interaction methods of the system, in order to Improve user experience and convenience.
In general, the research and application of public transportation inquiry system in China has been relatively mature, and the technology and application models are constantly optimized and updated, which contributes to the intelligence, convenience and comfort of urban public transportation. development is of great significance.

(2) Research significance

With the comprehensive popularization of information-based life, the Internet is no longer as out of reach as it used to be, and has been deeply engraved in the hearts of every netizen. People have become accustomed to the convenient life brought by the Internet, and are more accustomed to using simple and convenient bus query tools to improve daily travel efficiency. The development of the bus inquiry system can not only save people's precious time and save the time of checking a large number of bus lines, but also allow bus managers to save costs and work efficiently. Therefore, the bus inquiry system has irreplaceable significance for both passengers and managers. .

2. Related technologies

(1) Java language

The Java language is an object-oriented, cross-platform programming language first launched by Sun Microsystems in 1995. The Java language has good portability, security, and is easy to learn and use. It is widely used in the Internet, enterprise applications, mobile applications and other fields. The core features of the Java language include Java Virtual Machine (JVM), automatic garbage collection mechanism, exception handling, multi-threading, etc. Basic knowledge of the Java language includes concepts such as data types, variables, operators, control flow statements, classes, objects, inheritance, interfaces, and exception handling. The application fields of Java language include web development, desktop applications, mobile applications, game development, data analysis, etc.

(2) SSM framework

The SSM framework is the integration of Spring MVC, Spring and Mybatis frameworks. It is a standard MVC model. The entire system is divided into four layers: View layer, Controller layer, Service layer, and DAO layer. Spring MVC is used to be responsible for request forwarding and view management. Spring implements business object management, and Mybatis serves as the persistence engine for data objects.

(3) MySQL database

As a relational database management system, MySQL is one of the most popular and widely used database management tools on the market. The installation and deployment of MySQL based on WinDows system is relatively simple, easy for beginners to get started, and is very popular among developers for its reliability, security, and high availability. The MySQL database is smaller in size than other databases and takes up less computer memory space. This avoids the trouble of insufficient memory when developing large systems.

3. Demand analysis

(1) System design goals

This system carries out information management for current public transportation vehicles and uses Java and other technologies to improve the traditional public transportation management environment. Solve the problems of slow bus inquiry for passengers and imperfect bus route management. It provides passengers with a healthy and comfortable riding environment, allowing administrators to improve the efficiency of bus management and better manage bus lines and vehicles. The system must be clean and beautiful to provide users with a more sound and tidy riding environment.

(2) Feasibility analysis

1. Technical feasibility analysis
The system is developed using the current mainstream Spring-derived open source framework. There are detailed instructions from resource acquisition to development cases, making the system implementation easier. Some; in addition, front-end rendering framework and database layer development are self-taught content in universities, and it is relatively easy to get started. If you have technical difficulties, you can refer to relevant literature and ask your instructor and classmates for advice. Based on the above analysis, it is feasible from a technical level.
2. Economic feasibility analysis
Based on the waste of resources, low efficiency, and many difficult problems in the management and maintenance of data persistence in current public transportation management, Therefore, a bus inquiry system is needed to change the current situation of resource waste and low efficiency, and may even change the pattern of network resource competition. Therefore, the research and design of a bus inquiry system is of great significance. This system basically solves the above problems and disadvantages in terms of system design and function implementation, so it is feasible in terms of demand.
3. Operation feasibility analysis
The system developed based on Java itself has cross-platform characteristics, and the system can be used on a variety of operating systems. The application interface based on the SSM framework is clear and concise, and each business operation is relatively convenient. The operating system can be operated through the configuration manual or simple guidance.

(3) System requirements analysis

Before system design, we need to analyze the needs of the users for whom the system is oriented. The following is an analysis of user needs.
When people want to take a bus, faced with a huge number of bus operating networks, it is inevitable that it will be inconvenient to check the destination, the bus route cannot find the fastest solution, and the bus station is unknown. Which one is the most recent and many other questions. Therefore, a bus inquiry system with detailed functions and sufficient data is needed to show passengers all recommended bus routes to their destinations, so that passengers can clearly see the location of each stop and the time it takes to reach the stop. All the functions that this system needs for users are: registration and login, bus query, route query, site map query and route map query.

4. System design

(1) Overall structure design of the system

This system is mainly divided into seven modules, login module, user query management module, vehicle management module, site management module, line management module, user management module, and personal information management module. The system function module diagram is shown in Figure 4-1.
Insert image description here

Figure 4-1 System functional structure diagram

(2) Database design

1. Conceptual structure design
The E-R diagram represents entities, attributes and connections. It abstracts the conceptual model of the real world into entities and attributes and links them together, and their relationships are The illustrated design method provides a convenient, visual model for system development. The E-R model involved in this system is shown in Figure 4-2.

Insert image description here

Figure 4-2 System E-R diagram

2. Logical structure design
(1) Line information table
Line information mainly includes train number, IC card, starting point, end point, time ,line. The train information table is shown in Table 4-1.
Table 4-1 Line information table
Column name description type remarks
Bh train number nvarchar(6) primary key distance distance nvarchar(20) not allowed to be empty< /span> a> Add contact address nvarchar(20) is not allowed to be empty Birthday date of birth nvarchar(20) is not allowed to be empty Email nvarchar(20) is not allowed to be empty Telephone contact number nvarchar(20) is not allowed to be empty Gender gender nvarchar(20) is not allowed to be empty Denglu login name nvarchar(20) is not allowed to be empty Column name description type remarks Table 4-4 User information table User information includes login name, name, gender, contact number, email, date of birth, and contact address. The user information table is shown in Table 4-4. (4 ) User information table Beizhu Remarks nvarchar(20) is not allowed to be empty Zuowei Number of seats nvarchar(20) is not allowed to be empty Chenumber license plate number nvarchar(20) is not allowed to be empty Column description type remarks Table 4-3 Vehicle information table Vehicle information includes license plate number, seat Number, remarks. The vehicle information table is shown in Table 4-3. (3) Vehicle information table Zdmc site name nvarchar(20) is not allowed to be empty Column name description type remarks Table 4-2 Site information table Site information includes site name and site distance. The site information table is shown in Table 4-2. (2) Site information table Way route nvarchar(20) is not allowed to be empty Time time nvarchar(20) is not allowed to be empty Zd end point nvarchar(20) ) is not allowed to be empty Qd starting point nvarchar(20) is not allowed to be empty
Ic IC card nvarchar(20) is not allowed to be empty


























5. System implementation

(1) Login module implementation

In this system, both passengers and administrators can log in to their accounts, and passengers have one more registration function than administrators.
When using this system, passengers can simply browse the system front-end page without logging in with an account. However, if they need to perform operations such as bus information inquiry, they must log in with their account again. completed under the premise. If a passenger does not have an account in this system, he or she cannot enter the system. All passengers must register a personal account to log in to the system. When passengers need to register an account, they need to click the 'Register' button in the upper right corner of the front desk interface, and then switch to the system's registration interface. In the registration interface, passengers enter their account number, password, name, and gender. Required fields, passengers can also fill in the optional fields according to their actual situation: contact number, email, contact address. The rendering of the registration page is shown in Figure 5-1.
Insert image description here

Figure 5-1 Registration page renderings

(2) Site management implementation

After the passenger logs in to the account, if the passenger is not familiar with the local bus system and needs to check the specific location of each station, he can click on the 'Site Map'. The passenger can see the location of each station in the system, and the passenger can arrive accurately and quickly Destination station to avoid the problem of giving only one station name, leaving passengers unable to find the specific location. The site map rendering is shown in Figure 5-2.

Insert image description here

Figure 5-2 Site map implementation

(3) Add site implementation

If there are too many bus stops and the bus management system is not operating smoothly, it is necessary to delete the site information appropriately. To delete the site, the administrator selects the site to be deleted in the site management interface, and then clicks 'Delete' to confirm. If you delete it, it will be deleted successfully. After the site is successfully deleted, it can effectively alleviate the pressure on bus operations. If the number of bus stops in the system cannot meet the local bus demand, the number of bus stops can be added appropriately. The method of adding is that the administrator clicks 'Add Station' in the site management interface and the interface to add a site will pop up. Manage After the user enters the add site interface, he can enter the name of the site in the input field, and then click 'Save' to add the site successfully. The effect of adding a site is shown in Figure 5-3.

Figure 5-3 Add site implementation! [Insert picture description here](https://img-blog.csdnimg.cn/50a5ca036a494615a178af30babdf407.png#pic_center)

(4) Implementation of line management

After passengers enter the system front-end page, the route query function will be displayed. Passengers click 'Route Query', enter the train number or station name into the search box, and then click 'Query'. Passengers will see the train number entered in the search box. The line information corresponding to the name and site name, and the front-end line query effect is shown in Figure 5-4.
Insert image description here

Figure 5-4 Front desk line inquiry

(5) Implementation of vehicle management

After the administrator logs in to the backend interface, he can manage the bus vehicle information. The administrator clicks 'Vehicle Management' to enter the vehicle management interface. The vehicle management effect is shown in Figure 5-5.

Insert image description here

Figure 5-5 Vehicle management implementation

(6) Information management implementation

If there is a new bus system administrator, you need to create an administrator login account for this person. Administrator accounts cannot be registered and can only be created for them through the super administrator. The effect of user management is shown in Figure 5-6.

Insert image description here

Figure 5-6 User management implementation

6. System test

(1) Test method

The content tested by the system mainly includes functional testing, performance testing, security testing and regression testing
Functional testing: This stage mainly focuses on the functional requirements proposed during the design process. Whether they are in accordance with the prototype Figure development and implementation, and perform corresponding functional operations according to the specified design logic, verify whether the function is implemented and whether the function is available.
Performance testing: Mainly for frequent request interfaces, or whether high-concurrency modules can achieve the target effect under stress testing.
Security test: Common security issues in the system are whether the password of the logged-in user is explicit, whether it is encrypted and protected, and whether the user login request path carries sensitive characters (such as: login verification uses GET request, parameters on the path, the system is vulnerable to attack).
Regression testing: Complete functional, performance and security testing, and solve the problems that arise. At this time, it is necessary to verify again the issues raised in the above links to check whether the expected results are achieved [8].
After completing the above stages of testing, the system is basically in a low-risk operational state, and can be further optimized and improved based on the issues raised by users during use.

(2) Test cases

Table 6-1 Login test case table
Whether the expected result of the test point test case is consistent with the expected result
Passenger registration enters the user name user and password 34567, name, ID number, phone number can be registered
Passenger registration input user name 123, password 1234, name, ID card, contact address can be registered
The passenger login user enters the account user and fills in the correct password 34567. The successful login is
. The passenger login enters the user name 123 and the password yyyyy. The login failure is
Administrator login. Enter the administrator account admit and password 987654321 to successfully log in

in conclusion

In the past design and development process, I deepened my understanding of professional knowledge and basically completed the graduation project description. This system improves the traditional bus mode and brings a better experience to users quickly and conveniently. During the development process, I drew on many excellent projects and previous practical experience to develop and design the software to bring more comprehensive and specific effects. We hope this system can bring a better user experience to users.
The design and development process was completed by myself. However, due to the lack of design experience of a complete system, limited time, and insufficient technical skills, the design results were immature. But this has also become the direction of my future study and laid the foundation for future work.

Source code network disk link address
Link: https://pan.baidu.com/s/1QIMlvk42T-z4wqiPbHEqjQ?pwd=s3ob
Extraction Code: s3ob

The source code is open source and can be obtained by yourself

Guess you like

Origin blog.csdn.net/a1g45/article/details/131390918