摘 要
本文的主题是设计与实现一个基于 SpringCloud+Golang 微服务框架的分布式直播平台,主要聚焦于短视频与直播流媒体服务。系统由服务端,后台管理端和微信小程序端三部分组成,推拉直播流的协议分别为 RTMP 协议和 HLS 协议, 直播服务器为livego。后端服务由 Eureka 注册中心,Gateway 网关,和各种 Gloang实现的微服务模块组成,Golang    具有高性能、高并发、轻量等特点,服务端之间的相互调用基于 HTTP 协议,耦合性相对于 RPC、gRPC 协议较低。后台管理端使用 Vue.js  框架,ui 框架为 Ant  Design,用户端的微信小程序基于 Vant-UI 设计。用户端的所有 API 请求都需要经过 Gateway 网关统一拦截、鉴权、代理转发, 网关在启动时从 Eureka 同步所有服务实例,同时提供负载均衡能力。
关键词:  流媒体直播,微服务,SpringCloud,Golang
ABSTRACT
The theme of this paper is to design and implement a distributed live platform based on spring cloud + golang micro service framework, which mainly focuses on short video and live streaming media services. The system consists of three parts: server, background management and wechat applet. The protocol of push-pull live stream is RTMP protocol and HLS protocol, and the live server is livego. The back-end service is composed of Eureka registry, gateway gateway and various micro service modules implemented by gloang. Golang has the characteristics of high performance, high concurrency and light weight. The mutual calls between servers are based on HTTP protocol, and the coupling is lower than RPC and grpc protocols. The background management end uses vue.js framework, the UI framework is ant design, and the wechat applet of the user end is designed based on vant UI. All API requests of client end need to be intercepted, authenticated and forwarded by gateway gateway. Gateway synchronizes all service instances from Eureka when it starts, and provides load balancing capability.
Keywords: Streaming Media Live; Micro Service; Spring Cloud; Golang
目录
摘 要 I
ABSTRACT II
1 绪论 1
1.1 课题研究背景 1
1.2 国内外研究现状 1
1.3 系统实现目标 1
2 微服务架构设计 2
2.1 微服务架构简介 2
2.2 SpringCloud简介 2
2.3 开发环境简介 3
3 系统概要设计 3
3.1 功能分析 3
3.2 服务划分 4
3.3 系统架构实现 4
4.1 数据库需求分析 4
4.2 表结构设计 5
5 系统设计与实现 9
5.1 微服务系统搭建 9
5.1.1 Eureka环境搭建 9
5.1.2 Gateway网关搭建 10
5.1.3 服务注册 10
5.1.4 服务调用 11
5.2 账户服务 12
5.2.1 用户登录 12
5.2.2 管理员登录 13
5.3 邮箱服务 13
5.4 上传服务 14
5.4.1 视频录制 14
5.4.2 视频合成 15
5.5 直播间服务 16
6 系统调试与优化 17
6.1 调试环境简介 17
6.2 遇到的问题与解决 17
7 结论 18
参考文献 19
致谢 20