国家太空安全是国家安全在空间领域的表现。随着太空技术在政治、经济、军事、文化等各个领域的应用不断增加,太空已经成为国家赖以生存与发展的命脉之一,凝聚着巨大的国家利益,太空安全的重要性日益凸显[1]。而在信息化时代,太空安全与信息安全紧密地结合在一起。
2020年9月4日,美国白宫发布了首份针对太空网络空间安全的指令——《航天政策第5号令》,其为美国首个关于卫星和相关系统网络安全的综合性政策,标志着美国对太空网络安全的重视程度达到新的高度。在此背景下,美国自2020年起,连续两年举办太空信息安全大赛“黑掉卫星(Hack-A-Sat)”,在《Hack-A-Sat太空信息安全挑战赛深度解析》一书中有详细介绍,本文介绍了Hack-A-Sat黑掉卫星挑战赛的卫星任务规划制定Mission这道赛题的解题过程。
Help the Launchdotcom team perform a mission on their satellite to take a picture of a specific location on the ground. No hacking here, just good old fashion mission planning!
这是一道关于侦察卫星的挑战题,在给定的背景下,要求制订该卫星的任务规划,实现拍摄并下传特定目标的目的。
主办方给出了一个链接,使用netcat打开该链接后,会获取很长一段提示信息,为了便于理解,这里将提示信息区分为几部分,下面分别介绍:
(1)基本信息:侦察卫星是USA 224,给出了当前时刻、侦察卫星的TLE、要侦察的目标的经纬度(伊朗航天港),要求参赛者制订一个卫星拍照计划,从指定时间开始,在48h内取得目标的图像信息,并回传到地面站;给出了地面站的坐标(美国阿拉斯加州费尔班克斯),要求的图像数据量为120MB。
##########################
Mission Planning Challenge
##########################
给出了当前时刻
The current time is April 22, 2020 at midnight (2020-04-22T00:00:00Z).
给出了侦察目标(伊朗航天港)
We need to obtain images of the Iranian space port (35.234722 N 53.920833 E) with our satellite within the next 48 hours.
要求设计一个计划用来对目标拍照,同时下传照片
You must design a mission plan that obtains the images and downloads them within the time frame without causing any system failures on the spacecraft, or putting it at risk of continuing operations.
给出了侦察卫星的TLE
The spacecraft in question is USA 224 in the NORAD database with the following TLE:
1 37348U 11002A 20053.50800700 .00010600 00000-0 95354-4 0 09
2 37348 97.9000 166.7120 0540467 271.5258 235.8003 14.76330431 04
The TLE and all locations are already known by the simulator, and are provided for your information only.
Requirements
############
给出了要求的照片大小及接收照片的地面站坐标(美国阿拉斯加州费尔班克斯)
You need to obtain 120 MB of image data of the target location and downlink it to our ground station in Fairbanks, AK (64.977488 N 147.510697 W).
要求给出48h的卫星任务规划
Your mission will begin at 2020-04-22T00:00:00Z and last 48 hours.You are submitting a mission plan to a simulator that will ensure the mission plan will not put the spacecraft at risk, and will accomplish the desired objectives.
(2)任务规划格式:每行是一个任务,格式是日期+时间+模式,其中由于模拟器的原因,时间的“秒”总是为0。卫星平台有以下4种模式:
Mission Plan
############
Enter the mission plan into the interface, where each line corresponds to an entry.
You can copy/paste multiple lines at once into the interface.
给出了规划的格式,因为模拟器每分钟执行一次,所以时间中的“秒”总是为0
The simulation runs once per minute, so all entries must have 00 for the seconds field.
Each line must be a timestamp followed by the mode with the format:
2020-04-22T00:00:00Z sun_point
YYYY-MM-DDThh:mm:00Z next_mode
...
要注意确保平台在这个期间是可用的
The mission will run for it's full duration, regardless of when the image data if obtained.
You must ensure the bus survives the entire duration.
Mode Information
################
平台有4种模式
The bus has 4 possible modes:
- sun_point: Charges the batteries by pointing the panels at the sun.
- imaging: Trains the imager on the target location and begins capturing image data.
- data_downlink: Slews the spacecraft to point it's high bandwidth downlink transmitter at the ground station and transmits data to the station.
- wheel_desaturate: Desaturates the spacecraft reaction wheels using the on board magnetorquers.
Each mode dictates the entire state of the spacecraft.
The required inputs for each mode are already known by the mission planner.
3)卫星平台信息
Bus Information
###############
The onboard computer has 95 MB of storage.
All bus components are rated to operate effectively between 0 and 60 degrees Celsius.
The battery cannot fall below 10% capacity, or it will reduce the life of the spacecraft.
The reaction wheels have a maximum speed of 7000 RPM.
You will received telemetry from the spacecraft throughout the simulated mission duration.
You will need to monitor this telemetry to derive the behavior of each mode.
########################################################################
4)对参赛者输入的要求
按照日期+时间+模式的格式,一行一行输入卫星运行规划。输入run,开始模拟执行该卫星运行规划,验证是否可以按照要求得到目标的图像信息。
Please input mission plan in order by time.
Each line must be a timestamp followed by the mode with the format:
YYYY-MM-DDThh:mm:ssZ new_mode
Usage:
run -- Starts simulation
plan -- Lists current plan entries
exit -- Exits
Once your plan is executed, it will not be saved, so make note of your plan elsewhere.
这个挑战题的代码位于mission目录下,查看challenge、solver目录下的Dockerfile,发现其中用到的是python:3.7-slim,为了加快题目的编译进度,在mission目录下新建一个文件sources.list,内容如下:
deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main
deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
将sources.list复制到mission、challenge、solver目录下,修改challenge、solver目录下的Dockerfile,在所有的FROM python:3.7-slim下方添加:
ADD sources.list /etc/apt/sources.list
在所有的pip命令后方添加指定源:
打开终端,进入mission所在目录,执行命令:
sudo make build
使用make test命令进行测试,有大量输出,最后的输出如图7-4所示。
其中,大量输出是模拟器给出的每分钟的卫星遥测信息。图7-4中,每分钟的遥测信息包括时间、电池电量、面板、通信、板载计算机、相机、温度等信息,以及收集到的数据大小,图7-4最后是123977620字节,大约为118MB,虽然没有达到题目要求的120MB,但是题目依然认为达到了目的,这可能是题目设计的一个缺陷。
图7-4 mission挑战题的测试结果
为了解答这道题目,用到了软件Gpredict。使用Ubutu20.04安装Gpredict,首先更新软件源:
sudo add-apt-repository ppa:gpredict-team/ppa
sudo apt-get update
然后执行命令:
sudo apt install gpredict
输入gpredict即可运行该软件。
新建一个文本文件,内容为主办方给出的侦察卫星的TLE信息:
1 37348U 11002A 20053.50800700 .00010600 00000-0 95354-4 0 09
2 37348 97.9000 166.7120 0540467 271.5258 235.8003 14.76330431 04
在Gpredict中将该文件作为TLE文件打开,即可显示该卫星运行情况,如图7-5所示。
单击主界面右上角的三角按钮,选择Configure,弹出配置界面,首先设置卫星编号为37348(刚刚导入的侦察卫星),然后设置地面站为要求拍照的地点,也就是题目中要求的伊朗航天港,接着单击三角按钮,选择Time Controller,弹出如图7-6所示的界面,将时间设置为2020-4-22(题目要求的起始时间),注意这里需要先单击Reset按钮,然后才能设置时间。
图7-5 Gpredict导入侦察卫星信息
图7-6 Gpredict设置起始时间
单击主界面右下角的三角按钮,选择Future Passes,会出现之后几天编号37348卫星所有经过伊朗航天港的时间,其中AOS是Acquisition of Signal Satellite卫星出现的时间,LOS是Loss of Satellite卫星消失的时间,AOS Az是卫星出现时的方位角,LOS Az是卫星消失时的方位角,Max EL是最大俯仰,Duration是持续时间。可以发现22日、23日两天,经过伊朗航天港的次数是6次,如图7-7所示。
图7-7 2020年4月22日至23日,侦察卫星飞临伊朗航天港的时间
修改地面站为题目中给出的美国阿拉斯加费尔班克斯的地面站,用同样的方法得到之后几天编号37348卫星所有经过该地面站的时间,如图7-8所示,可以发现22日、23日两天共有10次经过阿拉斯加地面站。
图7-8 2020年4月22日至23日,侦察卫星飞临美国阿拉斯加州费尔班克斯的时间
接下来就是尝试,写一个计划如下:
2020-04-22T09:27:00Z imaging
2020-04-22T10:46:00Z data_downlink
2020-04-22T11:05:00Z imaging
2020-04-22T22:21:00Z data_downlink
上述是最简单的思路,第一次经过伊朗航天港就拍照,到了阿拉斯加地面站上空就下传数据,然后第二次到了伊朗航天港就拍照,到了阿拉斯加地面站上空就下传数据。输入run,结果摘录如下:
First entry must be at the start time: 2020-04-22T00:00:00Z
也就是计划第一行必须从2020-4-22日00:00:00开始,修改如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:27:00Z imaging
2020-04-22T10:46:00Z data_downlink
2020-04-22T11:05:00Z imaging
2020-04-22T22:21:00Z data_downlink
再次执行run,提示如下:
2020-04-22T09:27:00Z
Changing mode to: imaging
{'batt': {'percent': 91.80000000000001, 'temp': 29.300000000000043}, 'panels': {'illuminated': True}, 'comms': {'pwr': False, 'temp': 23.100000000000268}, 'obc': {'disk': 10, 'temp': 28.300000000000043}, 'adcs': {'mode': 'target_track', 'temp': 28.300000000000043, 'whl_rpm': [1877.364415576414, 1973.9791583362576, 1868.656426087326], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': True, 'temp': 28.100000000000268}}
Collected Data: 0 bytes
Mission Failed. ERROR: Target not in view. Cannot image.
在9:27时计划拍照,但是提示目标不在范围内,无法拍照,结合实际,虽然此时理论上可以从地面看到卫星,但是卫星要拍照还要一些其他条件,如相机的角度等限制,将时间延后1min。计划修改如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T10:46:00Z data_downlink
2020-04-22T11:05:00Z imaging
2020-04-22T22:21:00Z data_downlink
再次执行run,提示如下:
2020-04-22T09:35:00Z
{'batt': {'percent': 35.10000000000002, 'temp': 37.800000000000054}, 'panels': {'illuminated': True}, 'comms': {'pwr': False, 'temp': 24.600000000000264}, 'obc': {'disk': 80, 'temp': 29.80000000000004}, 'adcs': {'mode': 'target_track', 'temp': 29.80000000000004, 'whl_rpm': [1994.1893697570174, 2044.092221966546, 2041.7184082764354], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': True, 'temp': 64.60000000000028}}
Collected Data: 0 bytes
Mission Failed. ['ERROR: cam fried due to high temp.']
时间前进到了9:35,说明修改成功,可以拍照了,但是又提示相机温度过高,已经到64℃。结合题目只有4个模式可以列入计划,与温度有关的可能是sun_point、wheel_desaturate,怀疑可能是电能不够,所以制冷效果不好,导致温度过高,在9:35:00加入一个sun_point模式,电能提高了,应该就能制冷了,修改如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:46:00Z data_downlink
2020-04-22T11:05:00Z imaging
2020-04-22T22:21:00Z data_downlink
再次执行run,结果如下:
2020-04-22T10:46:00Z
Changing mode to: data_downlink
{'batt': {'percent': 49.39999999999998, 'temp': 34.300000000000004}, 'panels': {'illuminated': False}, 'comms': {'pwr': True, 'temp': 28.600000000000286}, 'obc': {'disk': 50, 'temp': 26.7}, 'adcs': {'mode': 'target_track', 'temp': 26.7, 'whl_rpm': [2233.7679133690744, 2281.251507414877, 2274.9805792160473], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': False, 'temp': 41.70000000000003}}
Collected Data: 19073480.0 bytes
Mission Failed. ERROR: Ground station not in view. Cannot downlink data.
时间前进到了10:46,说明成功解决相机温度过高的问题,但是这次又提示地面站不在视界内,无法下传数据。参考前面的方法,将下传时间延后1min,如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T11:05:00Z imaging
2020-04-22T22:21:00Z data_downlink
再次执行run,得到结果如下:
2020-04-22T10:51:00Z
{'batt': {'percent': 8.899999999999972, 'temp': 38.70000000000001}, 'panels': {'illuminated': True}, 'comms': {'pwr': True, 'temp': 57.00000000000029}, 'obc': {'disk': 0, 'temp': 27.099999999999994}, 'adcs': {'mode': 'target_track', 'temp': 27.099999999999994, 'whl_rpm': [2356.7949749976615, 2316.355372277725, 2326.8496527246116], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': False, 'temp': 41.10000000000002}}
Collected Data: 66757180.0 bytes
Mission Failed. ['ERROR: Battery level critical. Entering Safe Mode.']
时间前进到了10:51,又提示电池电压低,需要插入sun_point,如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-22T11:05:00Z imaging
2020-04-22T22:21:00Z data_downlink
再次执行run,这次又前进了,到了11:05时,出现了错误,提示目标不在视界内。
2020-04-22T11:05:00Z
Changing mode to: imaging
{'batt': {'percent': 17.89999999999997, 'temp': 38.70000000000001}, 'panels': {'illuminated': True}, 'comms': {'pwr': False, 'temp': 47.00000000000025}, 'obc': {'disk': 10, 'temp': 28.500000000000014}, 'adcs': {'mode': 'target_track', 'temp': 28.500000000000014, 'whl_rpm': [2353.279984412547, 2409.5601434613814, 2377.159872126071], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': True, 'temp': 43.499999999999986}}
Collected Data: 66757180.0 bytes
Mission Failed. ERROR: Target not in view. Cannot image.
继续修改计划,但是测试11:05:00—11:12:00整个时段,都提示目标不在视界内,可能与仰角太低有关,因此该时段不能拍照。因此,需要修改计划,参考图7-7,修改如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-22T20:23:00Z imaging
2020-04-22T22:21:00Z data_downlink
还是提示20:23:00时,目标不在视界内,修改为20:24:00,提示如下:
2020-04-22T20:24:00Z
Changing mode to: imaging
{'batt': {'percent': 89.30000000000015, 'temp': 28.499999999999865}, 'panels': {'illuminated': False}, 'comms': {'pwr': False, 'temp': 22.200000000000305}, 'obc': {'disk': 10, 'temp': 27.400000000000002}, 'adcs': {'mode': 'target_track', 'temp': 27.400000000000002, 'whl_rpm': [4364.605937837991, 4204.103176996605, 4161.290885165412], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': True, 'temp': 27.300000000000136}}
Collected Data: 66757180.0 bytes
Mission Failed. ERROR: Target location is not sunlit. Cannot image.
提示不在白天,无法拍照,所以直接跳过这个飞临伊朗航天港上空的时间段,在下一个时间段依然提示不在白天,跳到再下一个飞临伊朗航天港上空的时间段,参考图7-7,是23日9:48:54,因为模拟器是以分钟为单位的,所以直接设置为9:49:00。
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-23T09:49:00Z imaging
2020-04-23T11:09:00Z data_downlink
提示不在视界内,拍照时间延后1min,就可以拍照了,但是在9:51:00,提示如下:
2020-04-23T09:51:00Z
{'batt': {'percent': 83.70000000000002, 'temp': 30.599999999999874}, 'panels': {'illuminated': True}, 'comms': {'pwr': False, 'temp': 23.30000000000069}, 'obc': {'disk': 20, 'temp': 28.50000000000001}, 'adcs': {'mode': 'target_track', 'temp': 28.50000000000001, 'whl_rpm': [7008.192975483104, 6890.8581044528555, 6940.948920064027], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': True, 'temp': 33.40000000000052}}
Collected Data: 66757180.0 bytes
Mission Failed. ['ERROR: adcs wheel 0 has exceeded max wheel speed.']
第0号轮子超速了,结合给出的提示,也就是需要在计划中添加wheel_desaturate,经过测试可知,需要将添加wheel_desaturate的时间往前放,本节放在9:28:00,接着执行,又会在9:55:00提示相机温度过高,依据前面的办法添加一个sun_point即可。
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-23T09:27:00Z wheel_desaturate
2020-04-23T09:50:00Z imaging
2020-04-23T09:55:00Z sun_point
2020-04-23T11:09:00Z data_downlink
继续run,可以执行到11:09:00,此时提示地面站不在视界内。
2020-04-23T11:09:00Z
Changing mode to: data_downlink
{'batt': {'percent': 59.1000000000003, 'temp': 33.3999999999998}, 'panels': {'illuminated': False}, 'comms': {'pwr': True, 'temp': 28.40000000000068}, 'obc': {'disk': 30, 'temp': 27.299999999999926}, 'adcs': {'mode': 'target_track', 'temp': 27.299999999999926, 'whl_rpm': [6449.837980221327, 6396.872126383672, 6403.28989339501], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': False, 'temp': 32.20000000000023}}
Collected Data: 85830660.0 bytes
Mission Failed. ERROR: Ground station not in view. Cannot downlink data.
将下传数据时间延后1min,修改为11:10:00,继续执行,可以下传数据,但是在11:14:00时提示地面站不在视界内,无法下传数据,在11:14:00插入一个sun_point,修改如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-23T09:27:00Z wheel_desaturate
2020-04-23T09:50:00Z imaging
2020-04-23T09:55:00Z sun_point
2020-04-23T11:10:00Z data_downlink
2020-04-23T11:14:00Z sun_point
继续run,在23日13:32:00,又会提示:
2020-04-23T13:32:00Z
{'batt': {'percent': 77.20000000000026, 'temp': 33.09999999999975}, 'panels': {'illuminated': True}, 'comms': {'pwr': False, 'temp': 24.90000000000051}, 'obc': {'disk': 0, 'temp': 30.09999999999996}, 'adcs': {'mode': 'track_sun', 'temp': 30.09999999999996, 'whl_rpm': [6811.579164780124, 6988.2701329541605, 7000.150702265736], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': False, 'temp': 24.80000000000036}}
Collected Data: 114440880.0 bytes
Mission Failed. ['ERROR: adcs wheel 2 has exceeded max wheel speed.']
根据提示,在13:30:00插入一个wheel_desaturate,修改如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-23T09:15:00Z wheel_desaturate
2020-04-23T09:50:00Z imaging
2020-04-23T09:55:00Z sun_point
2020-04-23T11:10:00Z data_downlink
2020-04-23T11:14:00Z sun_point
2020-04-23T13:00:00Z wheel_desaturate
2020-04-23T17:00:00Z sun_point
继续run,可以执行到2020年4月23日最后1min,但是提示数据传输数量不够,如下,只获取了114440880字节,也就是109MB左右。
2020-04-23T23:59:00Z
{'batt': {'percent': 97.50000000000014, 'temp': 43.199999999999896}, 'panels': {'illuminated': False}, 'comms': {'pwr': False, 'temp': 22.500000000000576}, 'obc': {'disk': 0, 'temp': 37.79999999999999}, 'adcs': {'mode': 'track_sun', 'temp': 37.79999999999999, 'whl_rpm': [1426.229554887768, 1428.5154131730649, 1345.2550319391669], 'mag_pwr': [False, False, False]}, 'cam': {'pwr': False, 'temp': 22.500000000000405}}
Collected Data: 114440880.0 bytes
Mission Failed. Data was not obtained within the time limit.
为此,修改上面的计划,一个原则是使得拍照时间、下传时间尽量长,按照这个原则修改23日拍照的时间,使其延长1min即可,如下:
2020-04-22T00:00:00Z sun_point
2020-04-22T09:28:00Z imaging
2020-04-22T09:35:00Z sun_point
2020-04-22T10:47:00Z data_downlink
2020-04-22T10:51:00Z sun_point
2020-04-23T09:15:00Z wheel_desaturate
2020-04-23T09:50:00Z imaging
2020-04-23T09:56:00Z sun_point
2020-04-23T11:10:00Z data_downlink
2020-04-23T11:14:00Z sun_point
2020-04-23T13:00:00Z wheel_desaturate
2020-04-23T16:15:00Z sun_point
最终输出如图7-9所示。
图7-9 mission挑战最终输出结果