轨道动力学的三种外推方式:
- 解析法预报
- 数值法预报
- 半解析法预报
.
轨道根数(或称轨道要素或轨道参数)是描述在牛顿运动定律和牛顿万有引力定律的作用下的天体或航天器,在其开普勒轨道上运动时,确定其轨道所必要的六个参数。由于运动的方式有许多种的参数表示法,依照选定的测量装置不同,对相同的轨道,有几种不同的方式来定义轨道根数。
(注:图片来源于网络)
传统上使用的轨道根数,是在开普勒和他的开普勒定律之后发展出来的,称为开普勒元素,主要有六个参数:
汇总:半长轴、偏心率、轨道倾角、近地点幅角、升交点赤经和真近点角
1. 轨道半长轴,是椭圆长轴的一半。对于圆,也就是半径
2. 轨道偏心率,也就是椭圆两焦点的距离和长轴比值。对于圆,它就是0.
这两个要素决定了轨道的形状
3. 轨道倾角,这个是轨道平面和地球赤道平面的夹角。对于位于赤道上空的同步静止卫星来说,倾角就是0。
4. 升交点赤经:卫星从南半球运行到北半球时穿过赤道的那一点叫升交点。这个点和春分点对于地心的张角称为升交点赤经。
这两个量决定了卫星轨道平面在空间的位置。
5. 近地点幅角:这是近地点和升交点对地心的张角。
前面虽然决定了轨道平面在空间的位置,但是轨道本身在轨道平面里还可以转动。而这个值则确定了轨道在轨道平面里的位置。
6. 过近地点时刻,这个的意义很显然了。卫星位置随时间的变化需要一个初值。
有一点要指出的是,上面的6个参数并不是唯一的一组可以描述卫星轨道情况的参数,完全也可以选取其他参数,比如轨道周期。但是由于完备的描述也只需要6个参数,所以他们之间存在着固定的换算关系。比如轨道周期就可以由半长轴唯一来确定(这在下面讲TLE的时候也会涉及到),反之亦然。上面选取的这组是比较自然的一组。
人造卫星参数:
(1)轨道的形状参数:偏心率 和 半长轴
(2)轨道的位置参数:轨道倾角(轨道与赤道面的二面角) 升交点赤经(春分点、地心、升交点三点在地心构成的夹角) 近地点辐角(轨道近地点、地心、升交点三点在地心构成的夹角)
(3)卫星在轨道上的位置 平近点角(因为长半轴确定了,周期就一定了,所以可以虚拟一个圆,把椭圆上不规则的运动速度化简单圆上规则的变化,平近点角就是虚拟圆上的位置点、近地点、地心三者在地心形成的夹角)
Ω——升交点赤经
i——轨道面倾角
a——卫星轨道为椭圆
e——卫星轨道为椭圆
ω——近地点角距
M——平近点角
以上六个轨道参数,前5个是常数,不随时间变化而改变,大小由卫星发射条件所决定。
其它:
卫星运行轨道常用运算方法:
https://www.xiaobo.li/notes/archives/2265
.
go version
go env -w GOPROXY=https://goproxy.cn
依据需要选择安装
go get -u -v github.com/go-delve/delve/cmd/dlv
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/ramya-rao-a/go-outline
go get -u -v github.com/acroca/go-symbols
go get -u -v github.com/mdempsky/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/godoc
go get -u -v github.com/zmb3/gogetdoc
go get -u -v golang.org/x/lint/golint
go get -u -v github.com/fatih/gomodifytags
go get -u -v golang.org/x/tools/cmd/gorename
go get -u -v sourcegraph.com/sqs/goreturns
go get -u -v golang.org/x/tools/cmd/goimports
go get -u -v github.com/cweill/gotests/...
go get -u -v golang.org/x/tools/cmd/guru
go get -u -v github.com/josharian/impl
go get -u -v github.com/haya14busa/goplay/cmd/goplay
go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs
go get -u -v github.com/davidrjenni/reftools/cmd/fillstruct
.
NTP,全称Network Time Protocol ,即网络时间协议。通过NTP服务器可以同步电脑、服务器的时间。Windows自带的NTP服务器time.windows.com在海外,经常网络卡连不上,导致时间不同步,还是有必要换一下Windows电脑的NTP服务器。
国内推荐使用阿里巴巴、腾讯的公共NTP服务器。
阿里巴巴公共NTP
官网:https://help.aliyun.com/document_detail/92704.html
ntp.aliyun.com
ntp1.aliyun.com
ntp2.aliyun.com
ntp3.aliyun.com
ntp4.aliyun.com
ntp5.aliyun.com
ntp6.aliyun.com
ntp7.aliyun.com
腾讯公共NTP
官网:https://cloud.tencent.com/document/product/213/30392
time1.cloud.tencent.com
time2.cloud.tencent.com
time3.cloud.tencent.com
time4.cloud.tencent.com
time5.cloud.tencent.com
谷歌Google公共NTP
谷歌推出的公共NTP服务器,节点都在海外,在中国使用并不理想
官网:https://developers.google.com/time
time1.google.com
time2.google.com
time3.google.com
time4.google.com
国家授时中心
ntp.ntsc.ac.cn
ntp.org
权威的公共NTP服务器了,NTP服务器多是第三方提供,服务器是海外,国内并不推荐,查查海外NTP服务器还是挺好的。
中国公共NTP服务器,https://www.pool.ntp.org/zone/cn
全球公共NTP服务器,https://www.ntppool.org/zone/@
0.cn.pool.ntp.org
1.cn.pool.ntp.org
2.cn.pool.ntp.org
3.cn.pool.ntp.org
微软公共NTP服务器 Windows公共NTP
time.windows.com
美国标准技术研究院NTP(NIST NTP Server)
官网:https://tf.nist.gov/tf-cgi/servers.cgi
time.nist.gov
.
信息来源于网络,未经证实,仅供参考:
信息源:
https://www.esa.int/Enabling_Support/Space_Engineering_Technology/Radio_Frequency_Systems/Open_Source_Software_Resources_for_Space_Downstream_Applications
This page provides a list of open source software resources for developing space downstream applications, in the following categories:
A short description of each entry appears when hovering over the name (left column).
Disclaimer: the information is provided as is without any guarantee, and ESA cannot be liable for any views expressed in this webpage as well as in the linked websites.
Name | Author/Developer | Format | Licence |
gLAB | Universitat Politecnica de Catalunya (UPC) | Source and Executable for Linux, Windows and macOS | Apache, GPL and LGPL |
GNSS-SDR | CTTC | Source code and libs for Linux Debian, macOS. Runs on GNU Radio | GPL v3 |
GPS-SDR-SIM | Takuji Ebinuma | Source code | MIT |
GNSS-SDRLIB | Taro Suzuki | Source and Executable for Windows | GPL v2 |
RTKLIB | Tomoji Takasu | Source and Executable for Windows | BSD-2-Clause |
ARAMIS | ip-solutions | Executable in Windows | Free for academic use |
goGPS | Geomatics Laboratory of Politecnico di Milano, Como campus (Italy) | Source code for Matlab 2016a+ and Java | GPL v3 |
TEQC | UNAVCO | Executable (Windows, macOS, Linux…). Supports RINEX and BINEX formats | |
Online Positioning User Service (OPUS) | NOAA | Executable online | |
CSRS-PPP | Canadian Geodetic Survey (CGS) | Executable online or as a desktop application. Supports RINEX files | Open Government Licence - Canada |
JAG3D (Java Applied Geodesy 3D) | Steinbeis Transfer Centre Applied Geodesy | Java | GPL v3 |
Android Raw GNSS Measurement | GnssLogger source code in Matlab, but you don’t need Matlab to use it | Apache v2.0 | |
GPSTk | Applied Research Laboratories at the University of Texas at Austin | Source and Executable (Unix, Windows, macOS) | LGPL v3 |
BKG Ntrip Software | Federal Agency for Cartography and Geodesy (BKG) | Source and Executable for Linux, Solaris, Windows and macOS | GPU |
Name | Author/Developer | Format | Licence |
OpenGTS | GeoTelematic Solutions, Inc. | Java | Apache v2.0 |
Viking GPS data editor and analyzer | Various authors | Executable (written mostly in C) | GPL v2 |
OpenStreetMap | OpenStreetMap Community | Data online | ODbL |
GeoServer | Open Source Geospatial Foundation | Supports WFS, WMS and WCS standards | GPL v2 |
Orfeo ToolBox (OTB) | CNES | Source and Executable (Linux, Windows, macOS) | Apache v2.0 |
PolSARpro | ESA / IETR | Executable for Windows and Linux | GPL v2 |
SNAP and Sentinel Toolboxes | ESA Science Toolbox Exploitation Platform (STEP) | Source and Executable (Windows, macOS, Unix) | GPL v3 |
DIMITRI - Database for Imaging Multi-spectral Instruments and Tools for Radiometric Intercomparison | ESA, ARGANS, Magellium | Source code, compatible with Linux, Windows and macOS | SLA |
ADAM API Toolkit | Noveltis | Executable online | Free online service after registration |
TauDEM - Terrain Analysis Using Digital Elevation Models | Utah State University, USA | Source code, command line executable and ArcGIS toolbox GUI | GPL v3 |
GRASS GIS - Geographic Resources Analysis Support System | GRASS GIS developers community | Stand-alone application or backend for other software packages | GPL v2 |
SAGA - System for automated Geoscientific Analyses | University of Hamburg, Germany | Coded in C++. Source code and GUI executable for Windows and Linux | GPL v2 |
Whitebox GAT - Geospatial Analysis Tools | University of Guelph, Canada | Executable (Windows, Linux, macOS) | GPL v3 |
MACCS/MAJA | CNES and CESBIO | Language: C++, Python and Cmake. OS:Linux RedHat 6+, CENTOS 6+ Ubuntu 12.04+ | CNES |
Sen2Agri system | ESA | Linux | GPL v3 |
Open Layers | Open Layers | API and codes | BSD-2-Clause |
GeoTrellis | LocationTech, Azavea | Library for Linux | Apache v2.0 |
GeoMesa | LocationTech, CCRi | Spatio-temporal index for Linux | Apache v2.0 |
gvSIG Desktop | gvSIG Association | Platforms: Linux / Unix, macOSX, Windows, Android. Languages: Java, Python, Groovy, Renjin, Scala | GPL |
QGIS | QGIS Community | Linux, Unix, macOS and Windows | GPL |
Get3Di | GeoCue Group | Executable online | Free up to 100 MB/month |
AHN-viewer | ArcGIS | Executable online | Free online service |
ESA Online Dissemination | ESA | Data online | |
GeoNames | GeoNames | Webservice and database exports | CC BY 4.0 |
HydroSheds | WWF | Vector and raster data | HydroSHEDS |
SRTM Data | CGIAR Consortium for Spatial Information | ACII and GeoTIFF | |
GSAC | UNAVCO | Java. For Linux and Unix |
Name | Author/Developer | Format | Licence |
Network Simulator 3 (ns-3) | ns-3 project | Source code | GPL v2 |
Satellite Network Simulator (SNS3) | Jani Puttonen, Janne Kurjenniemi (Magister Solutions), ESA, CNES | Source code | GPL v3 |
Leandvb | pabr@pabr.org | Executable code | GPL v3 |
gr-dvbs2 | Ron Economos | Source code, also part of GNU Radio | GPL v3 |
gr-dvbs2rx | Ahmet Inan, Ron Economos | Source code | GPL v3 |
ROHC library | CNES, TAS, Viveris Technologies | Source code for Linux, Windows and macOS | LGPL v2.1+ |
OpenLTE | Ben Wojtowicz, Dennis M Senyonjo | Source code in C++ and Python | AGPL v3 |
OAI Radio Access Network (OAI-RAN) | Various | Source code | OAI 5G Public License v1.1 |
OAI Core Network (OAI-CN) | EURECOM, OPEN CELLS | Source code | Apache v2.0 |
free5GC | National Chiao Tung University (NCTU) and other contributors | Source code | Apache v2.0 |
ChirpStack | Orne Brocaar | Source code | MIT |
STRF | Cees Bassa | Source code for Linux and GNU Radio | GPL v3 |
Name | Author/Developer | Format | Licence |
GNU Radio | GNU Radio project | Source code for Linux, macOS | GPL v3 |
MongoDB | MongoDB Inc. | Source and Executable (Windows, Linux, macOS, Solaris, FreeBSD) | Server Side Public License |
Apache Hadoop | Apache Software Foundation | Source code download | Apache v2.0 |
Apache Storm | Apache Software Foundation | Implemented in Java, can be used with any programming language | Apache v2.0 |
Apache Spark | Apache Software Foundation | Standalone cluster mode, on EC2, on Hadoop YARN, on Mesos, or on Kubernetes. | Apache v2.0 |
Tensor Flow | Collection of workflows | Apache v2.0 | |
Docker Engine | Docker | Executable for Linux, Windows, macOS | Apache v2.0 |
OpenStack | OpenStack | Executable | Apache v2.0 |
Rasdaman | Supervised by Jacobs University, in incubation by the OSGeo fundation | Download of packages that work on distributions with gcc 4.8+, Java 7+ | GPL v3 |
SciDB Community Edition | Paradigm4 | Software that can run on existing hardware or in the cloud | GPL v3 |
Theano | Several authors | Python library | BSD-3-Clause |
Deeplearning 4j | Eclipse Deeplearning4j Development Team | Libraries | Apache v2.0 |
Google Earth Engine | The Earth Engine (EE) API is available in Python and JavaScript. | Google Earth Engine License | |
Microsoft CNTK | Microsoft | Toolkit compatible with Linux and Windows | MIT |
Keras | François Chollet and various | Python libraries | MIT |
Scikit-learn | David Cournapeau and various | Python libraries for Linux, macOS and Windows | BSD-3-Clause |
tslearn | Romain Tavenard | Python package | BSD-3-Clause |
Boto3 | Amazon Web Services (AWS) | Python libraries | Apache v2.0 |
PyTorch | Facebook AI research group | Python libraries for Linux, macOS and Windows | BSD-3-Clause |
OpenCV | Intel | C++ library for Windows, Linux, macOS, FreeBSD, NetBSD, OpenBSD... | BSD-3-Clause |
pandas | Wes McKinney and various | Python library | BSD-3-Clause |
NVIDIA DIGITS | NVIDIA | Executable | Free after joining the NVIDIA Developer Program |
XGBoost | XGBoost community | Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Flink and DataFlow. | Apache v2.0 |
GDAL | GDAL community | Source and binaries for Windows, Debian and containers | MIT |
Open Data Cube | Open Data Cube | Collection of software base on Python library | Apache v2.0 |
R Project | R foundation | It compiles and runs on a wide variety of UNIX platforms, Windows and macOS. | GPL v2 |
Project Jupyter | Jupyter Community | Web application, executable online and for downloading. | BSD-3-Clause |
Apache NiFi | Apache Software Foundation | Executable | Apache v2.0 |
Apache Kafka | Apache Software Foundation | Executable | Apache v2.0 |
Kubernetes | Kubernetes | Container | CC BY 4.0 |
NodeJS | Node.js is a trademark of Joyent, Inc | For Windows, macOS and Linux. | MIT |
Leaflet | Vladimir Agafonkin and others | JavaScript library | CC BY 4.0 |
Gapminder Tools Offline | Gapminder | For Windows, macOS and Linux | CC BY 4.0 |
Elasticsearch and Kibana | Amazon Web Services (AWS) | Docker images, RPM files, and Debian files | Apache v2.0 |
Open Geospatial Consortium (OGC) | OGC members | Standards | Open standards |
GeoJSON | Internet Engineering Task Force (IETF), in conjunction with the original specification authors. | Format | Open standards |
gr-opssat | Arctic Space Technologies and ESA | Module for GNU Radio | GPL v3 |
NanoSat MO Framework | Graz University of Technology and ESA | Java source code | ESA-PL v2 |
Name | Application domain | Description |
European Space Software Repository | Multiple | ESA informational web portal created to promote reuse of Software - including Open Source Software (OSS) - and to provide all parties involved in the European Space software development (in particular SMEs) with access to results of previous investments. Registration available to ESA member states. |
ACT Open Source projects & tools | Multiple | ESA Advanced Concepts Team (ACT) resources for Open Sources projects and tools. Together with the introduction of the github and the gitlab dedicated channels for the European Space Agency and the of specific programmes such as SOCIS (the ESA summer of code in space), the ACT, over the years, developed and is now maintaining a number of open source projects that are put at the service of a wider community. |
CNES Software Catalogue | Multiple | The "Centre National d'Études Spatiales" has produced various software for the space projects. This software covers a broad range of topics, from normalization to space dynamics and simulation tools. Some were developed to support CNES internal needs and are now available to the public. |
RTL-SDR Software | Signal processing | RTL-SDR is a USB dongle based on the RTL2832U chipset, for which many SDR software have been developped for different applications (not only satellite) |
ION GNSS SDR Standard | GNSS | The GNSS SDR Metadata Standard defines parameters and schema to express the contents of SDR sample data files. The standard is designed to promote the interoperability of GNSS SDR data collection systems and processors. |
NOAA collection of GPS software | GNSS | Site is running since 1999. The main purpose of this site is to provide a means for distributing the source code and algorithms discussed in the GPS Toolbox column. |
UNAVCO software | GNSS | Web-based data visualization and mapping tools provide users with the ability to view post–processed data while web-based geodetic utilities provide ancillary information. |
Terrasigna Pathfinder | Earth observation | References more than 350 open source software for processing of Earth Observation data, with categorisation and graph representation |
ESA Newcomers EO Guide | Earth observation | Guide to help non experts in providing a starting point in the decision process for selecting an appropriate Earth observation (EO) solution. Includes links to public and commercial EO data providers. See also https://business.esa.int/sites/default/files/Where_to_access_EO_data_AS.pdf |
ESA Earth online portal | Earth observation | List of software tools supported by ESA for Earth Observation |
ESA STEP | Earth observation | ESA is developing free open source toolboxes for the scientific exploitation of Earth Observation missions under the the Scientific Exploitation of Operational Missions (SEOM) programme element. STEP is the ESA community platform for accessing the software and its documentation, communicating with the developers, dialoguing within the science community, promoting results and achievements as well as providing tutorials and material for training scientists using the Toolboxes. |
ESA Thematic Exploitation Platforms (TEPs) | Earth observation | TEPs are collaborative, virtual work environments providing access to EO data and tools, processors, and information and communication technology resources, required to work with them, through one coherent interface. Topics: Coastal, Forestry, Hydrology, Geohazards, Polar, Urban themes, Food Security |
Copernicus Open Access Hub | Earth observation | The Copernicus Open Access Hub (previously known as Sentinels Scientific Data Hub) provides complete, free and open access to Sentinel-1, Sentinel-2, Sentinel-3 and Sentinel-5P user products, starting from the In-Orbit Commissioning Review (IOCR). Sentinel Data are also available via the Copernicus Data and Information Access Services (DIAS) through several platforms. |
DIAS -Copernicus Data & Information Access Services | Earth observation | DIAS online platforms allow users to discover, manipulate, process and download Copernicus Sentinel data and information products from Copernicus’ six operational services, together with cloud-based tools (open source and/or on a pay-per-use basis). |
Sentinel Hub | Earth observation | Sentinel Hub is operated by Sinergise - a GIS IT company with more than 10 years of experience in working with spatial data. Different applications are available online. The satellite imagery distribution service is based on Sinergise's cloud GIS platform - Geopedia - web based spatial management solution, which is being used by more than one million users annualy and is therefore perfectly suitable for large scale spatial deployments. |
Earth System Data Lab (ESDL) | Earth observation | The Earth System Data Lab is a multi-variate data set of essential Earth System variables on a common grid and sharing a common data model. |
USGS Earth Explorer | Earth observation | U.S. Geological Survey -search catalogue of satellite and aerial imagery. |
Alaska Satellite Facility (ASF) | Earth observation | The ASF facility is part of the Geophysical Institute of the University of Alaska Fairbanks. ASF downlinks, processes, archives, and distributes remote-sensing data to scientific users around the world. |
OSGEO | Earth observation | The Open Source Geospatial Foundation (OSGeo) is a not-for-profit organization whose mission is to foster global adoption of open geospatial technology by being an inclusive software foundation devoted to an open philosophy and participatory community driven development. |
OpenDEM | Earth observation | List of free Digital Elevation Models. This project will focus on free high resolution datasets with a spatial resolution of 30 meters and below on county/state scale. |
On-Line Geodesy Resources | Earth observation | A personal collection of geodesy and related resources on the Web. Created by Mike Craymer. |
SDR makerspace | Satellite communications | SDRmaker.space, created by Libre Space Foundation under an ESA ARTES project, is an activity framework that aims to bring together makers, open-source hackers, radio amateurs, researchers and academia from all over Greece. The website lists a number of SDR projects for satellite communications, including TT&C. |
CGRAN | Satellite communications | The Comprehensive GNU Radio Archive Network (CGRAN) is a free open source repository for 3rd party GNU Radio applications (a.k.a Out Of Tree Modules) that are not officially supported by the GNU Radio project. Licensed under CC BY 4.0. For Linux OS. |
Feedback: for proposing new entries or updating information, please send an email to nicolas.girault @ esa.int.
.
1、使用maven创建spring项目,schedule在spring-context.jar的包下边,因此需要导入与之相关的包,如下:
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.1.7.RELEASE</version> </dependency>
2、配置Spring.xml,选择http://www.springframework.org/schema/task
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns:task="http://www.springframework.org/schema/task" xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd"> <!-- 开启定时任务 --> <task:annotation-driven /> </beans>
3、编写定时器类,需要在类上加入@Component注解加入Spring容器,在方法上加入Cron表达式
package scheduleTest; import java.text.SimpleDateFormat; import java.util.Date; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; /** * spring schedule * * @author Su * */ @Component public class ScheduleTest { @Scheduled(cron = "0/30 * * * * ?") public void scheduleTest() { //每30秒执行一次 //相关逻辑操作,如关闭订单,设置定时关单的时间(建议设置在配置文件中) //查询订单表的创建时间进行相关处理 } }
4、在web.xml中配置Spring上下文监听器
<listener> <listener-class>org.springframework.web.context. ContextLoaderListener</listener-class> </listener>
二、对Spring Schedule Cron表达式的理解
Cron表达式使用格式
Seconds | Minutes | Hours | Day | Month | Week | [Year] |
秒 | 分 | 时 | 天 | 月 | 周 | [年 可选] |
字段名 | 允许的值 | 允许的特殊字符 |
---|---|---|
秒 | 0-59 | , - * / |
分 | 0-59 | , - * / |
小时 | 0-23 | , - * / |
月内日期 | 1-32 | , - * ? / L W C |
月 | 1-12 或 JAN-DEC | , - * / |
周内日期 | 1-7 或 SUN-SAT | , - * ? / L C # |
年 | 留空,1980-2099 | , - * / |
每个符号代表的含义:
*:匹配该域的任意值;如*用在分所在的域,表示每分钟都会触发事件。
?:匹配该域的任意值。月份的天河周的天互相冲突,必须将其中一个设置为?
-:匹配一个特定的范围值;如时所在的域的值是10-12,表示10、11、12点的时候会触发事件。
,:匹配多个指定的值;如周所在的域的值是2,4,6,表示在周一、周三、周五就会触发事件(1表示周日,2表示周一,3表示周二,以此类推,7表示周六)。
/:左边是开始触发时间,右边是每隔固定时间触发一次事件,如秒所在的域的值是5/15,表示5秒、20秒、35秒、50秒的时候都触发一次事件。
L:last,最后的意思,如果是用在天这个域,表示月的最后一天,如果是用在周所在的域,如6L,表示某个月最后一个周五。(外国周日是星耀日,周一是月耀日,一周的开始是周日,所以1L=周日,6L=周五。)
W:weekday,工作日的意思。如天所在的域的值是15W,表示本月15日最近的工作日,如果15日是周六,触发器将触发上14日周五。如果15日是周日,触发器将触发16日周一。如果15日不是周六或周日,而是周一至周五的某一个,那么它就在15日当天触发事件。
#:用来指定每个月的第几个星期几,如6#3表示某个月的第三个星期五
举些例子:
表达式 含义
“0 0 12 * * ?” | 每天12:00触发事件 |
“0 15 10 ? * *” | 每天10:15触发事件 |
“0 15 10 * * ?” | 每天10:15触发事件 |
“0 15 10 * * ? *” | 每天10:15触发事件 |
“0 15 10 * * ? 2005″ | 2005年的每天10:15触发事件 |
“0 * 14 * * ?” | 每天14点开始触发,每分钟触发一次,14:59分结束 |
“0 0/5 14 * * ?” | 每天14点开始触发到14:59分结束的每5分钟触发一次事件 |
“0 0/5 14,18 * * ?” | 每天14点开始到14:59期间和18点到18:59期间的每5分钟触发一次事件 |
“0 0-5 14 * * ?” | 每天14点到14:05期间的每1分钟触发一次事件 |
“0 10,44 14 ? 3 WED” | 每年3月的星期三的14:10和14:44触发一次事件 |
“0 15 10 ? * MON-FRI” | 周一至周五的10:15触发一次事件 |
“0 15 10 15 * ?” | 每月15日10:15触发一次事件 |
“0 15 10 L * ?” | 每月最后一日的10:15触发一次事件 |
“0 15 10 ? * 6L” | 每月的最后一个星期五10:15触发一次事件 |
“0 15 10 ? * 6L 2002-2005″ | 2002年至2005年的每月的最后一个星期五10:15触发一次事件 |
“0 15 10 ? * 6#3″ | 每月的第三个星期五10:15触发一次事件 |
————————————————
本文为网摘文章,原文为以下:
版权声明:本文为CSDN博主「苏启豪」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/a2267378/article/details/82019901
.
注: 对应虚拟机的分区为vda,虚拟机系统为centos7
[root@vp-01 export]# qemu-img info test.qcow2
image: test.qcow2
file format: qcow2
virtual size: 20G (21474836480 bytes)
disk size: 2.1G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
新增磁盘容量大小20G
[root@vp-01 export]# qemu-img resize test.qcow2 +20G
Image resized.
[root@vp-01 export]# qemu-img info test.qcow2
image: test.qcow2
file format: qcow2
virtual size: 40G (42949672960 bytes)
disk size: 2.1G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
refcount bits: 16
corrupt: false
对比后发现磁盘已经由原来的20G变为40G了
[root@172-16-20-171 ~]#
[root@172-16-20-171 ~]# df -Th
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root xfs 18G 1.9G 16G 11% /
devtmpfs devtmpfs 487M 0 487M 0% /dev
tmpfs tmpfs 497M 0 497M 0% /dev/shm
tmpfs tmpfs 497M 6.6M 490M 2% /run
tmpfs tmpfs 497M 0 497M 0% /sys/fs/cgroup
/dev/vda1 xfs 497M 130M 368M 27% /boot
tmpfs tmpfs 100M 0 100M 0% /run/user/0
[root@172-16-20-171 ~]#
[root@172-16-20-171 ~]#
[root@172-16-20-171 ~]# fdisk /dev/vda
欢迎使用 fdisk (util-linux 2.23.2)。
更改将停留在内存中,直到您决定将更改写入磁盘。
使用写入命令前请三思。
命令(输入 m 获取帮助):p
磁盘 /dev/vda:42.9 GB, 42949672960 字节,83886080 个扇区
Units = 扇区 of 1 * 512 = 512 bytes
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x0003f814
设备 Boot Start End Blocks Id System
/dev/vda1 * 2048 1026047 512000 83 Linux
/dev/vda2 1026048 41943039 20458496 8e Linux LVM
命令(输入 m 获取帮助):n
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p): p
分区号 (3,4,默认 3):3
起始 扇区 (41943040-83886079,默认为 41943040):
将使用默认值 41943040
Last 扇区, +扇区 or +size{K,M,G} (41943040-83886079,默认为 83886079):
将使用默认值 83886079
分区 3 已设置为 Linux 类型,大小设为 20 GiB
命令(输入 m 获取帮助):t
分区号 (1-3,默认 3):3
Hex 代码(输入 L 列出所有代码):8e
已将分区“Linux”的类型更改为“Linux LVM”
命令(输入 m 获取帮助):w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: 设备或资源忙.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
正在同步磁盘。
[root@172-16-20-171 ~]#
此步骤当中,最终要的地方就是 分配新的区需要修改分区的system id,将分区类型改为LVM(Hex代码为8e)。
创建物理卷
[root@172-16-20-171 ~]# pvcreate /dev/vda3 (分区以后要重启或者执行partprobe,就不会出现Device /dev/sda3 not found (or ignored by filtering)提示)
Physical volume “/dev/vda3” successfully created
[root@172-16-20-171 ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/vda2 centos lvm2 a-- 19.51g 40.00m
/dev/vda3 lvm2 — 20.00g 20.00g
加入卷组
[root@172-16-20-171 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 1 2 0 wz–n- 19.51g 40.00m
[root@172-16-20-171 ~]# vgextend centos /dev/vda3
Volume group “centos” successfully extended
[root@172-16-20-171 ~]# vgs
VG #PV #LV #SN Attr VSize VFree
centos 2 2 0 wz–n- 39.50g 20.04g
扩展逻辑卷
[root@172-16-20-171 ~]# lvextend -l +100%FREE /dev/centos/root
Size of logical volume centos/root changed from 17.47 GiB (4472 extents) to 37.50 GiB (9601 extents).
Logical volume root successfully resized.
[root@172-16-20-171 ~]# resize2fs /dev/centos/root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block 当尝试打开 /dev/centos/root 时
找不到有效的文件系统超级块.
发现报错,分析原因是因为使用dh -T查看系统分区类型为xfs
因此直接使用xfs_growfs扩展即可
[root@172-16-20-171 ~]# xfs_growfs /dev/centos/root
meta-data=/dev/mapper/centos-root isize=256 agcount=4, agsize=1144832 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=4579328, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 4579328 to 9831424
[root@172-16-20-171 ~]# df -Th
文件系统 类型 容量 已用 可用 已用% 挂载点
/dev/mapper/centos-root xfs 38G 1.9G 36G 6% /
devtmpfs devtmpfs 487M 0 487M 0% /dev
tmpfs tmpfs 497M 0 497M 0% /dev/shm
tmpfs tmpfs 497M 6.6M 490M 2% /run
tmpfs tmpfs 497M 0 497M 0% /sys/fs/cgroup
/dev/vda1 xfs 497M 130M 368M 27% /boot
tmpfs tmpfs 100M 0 100M 0% /run/user/0
发现系统容量已经由20G扩展为40G
References:
https://www.cnblogs.com/zzc-blog/p/14121695.html
import logging LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' logging.basicConfig(format=LOG_FORMAT) logger.info('info log') logger.error('error log') logger.warn('warn log') logger.debug('debug log')
import logging LOG_FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s' logging.basicConfig(format=LOG_FORMAT) logger = logging.getLogger('tcpserver') logger.warning('Protocol problem: %s', 'connection reset', extra=d)
import logging # create logger logger = logging.getLogger('simple_example') logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # create formatter formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') # add formatter to ch ch.setFormatter(formatter) # add ch to logger logger.addHandler(ch) # 'application' code logger.debug('debug message') logger.info('info message') logger.warning('warn message') logger.error('error message') logger.critical('critical message')
References:
https://baijiahao.baidu.com/s?id=1663188765325528537&wfr=spider&for=pc
.
Log4j 2.x版本不再支持像1.x中的.properties后缀的文件配置方式,2.x版本配置文件后缀名只能为".xml",".json"或者".jsn"。
系统选择配置文件的优先级(从先到后)如下:
一般默认使用log4j2.xml.
常见的有三种子节点:Console、RollingFile、File.
常见的有两种:Root和Logger.
%-5level 输出日志级别,-5表示左对齐并且固定输出5个字符,如果不足在右边补0
<dependencies> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> <version>2.5</version> </dependency> </dependencies>
使用SLF4J + LOG4J配置时,可以简化到仅一个依赖:
<dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-slf4j-impl</artifactId> <version>2.20.0</version> </dependency>
使用SLF4J + LOGBACK配置时,可以简化到仅一个依赖:
<dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-classic</artifactId> <!-- <version>1.3.6</version> --> <version>1.2.11</version> </dependency>
注意选用1.3.x/1.2.x版本,不要使用1.4.0, 1.4.x 版本出现UnsupportedClassVersionError异常。
目前 Logback 发布了 1.3 & 1.4 两个版本,logback 1.3.x 支持 Java EE 版本,而 logback 1.4.x 支持 Jakarta EE,两个版本的功能相同。
在springboot中使用log4j2时,需要排除springboot默认的logback
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <exclusions> <exclusion> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-logging</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-log4j2</artifactId> </dependency>
<?xml version="1.0" encoding="UTF-8"?> <Configuration> <Appenders> <Console name="Console" target="SYSTEM_OUT"> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %level %logger{1.} - %msg%n"/> </Console> </Appenders> <Loggers> <Root level="error"> <AppenderRef ref="Console"/> </Root> </Loggers> </Configuration>
<?xml version="1.0" encoding="UTF-8"?> <!-- 日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL --> <configuration status="WARN" monitorInterval="30"> <Properties> <!-- <Property name="LOG_ROOT">${sys:user.home}/logs</Property>--> <Property name="LOG_ROOT">./logs</Property> <Property name="LOG_PATTERN">%d{yyyy-MM-dd HH:mm:ss,SSS} %level [%thread] %logger{1.} - %msg%n</Property> </Properties> <!--定义appender--> <appenders> <console name="Console" target="SYSTEM_OUT"> <!--输出日志的格式--> <PatternLayout pattern="${LOG_PATTERN}"/> </console> <RollingFile name="info" fileName="${LOG_ROOT}/info.log" filePattern="${LOG_ROOT}/$${date:yyyyMM}/info-%d{yyyyMMdd}-%i.log"> <!--控制台只输出level及以上级别的信息(onMatch),其他的直接拒绝(onMismatch)--> <ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout pattern="${LOG_PATTERN}"/> <Policies> <SizeBasedTriggeringPolicy size="1024 MB"/> </Policies> </RollingFile> <RollingFile name="warn" fileName="${LOG_ROOT}/warn.log" filePattern="${LOG_ROOT}/$${date:yyyyMM}/warn-%d{yyyyMMdd}-%i.log"> <ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout pattern="${LOG_PATTERN}"/> <Policies> <SizeBasedTriggeringPolicy size="1024 MB"/> </Policies> <DefaultRolloverStrategy max="20"/> </RollingFile> <RollingFile name="error" fileName="${LOG_ROOT}/error.log" filePattern="${LOG_ROOT}/$${date:yyyyMM}/error-%d{yyyyMMdd}-%i.log"> <ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/> <PatternLayout pattern="${LOG_PATTERN}"/> <Policies> <SizeBasedTriggeringPolicy size="1024 MB"/> </Policies> </RollingFile> </appenders> <loggers> <!-- OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL --> <!--过滤 spring mybatis 的 DEBUG 信息--> <logger name="org.springframework" level="INFO"></logger> <logger name="org.mybatis" level="INFO"></logger> <root level="INFO"> <appender-ref ref="Console"/> <appender-ref ref="info"/> <appender-ref ref="warn"/> <appender-ref ref="error"/> </root> </loggers> </configuration>
logback.xml or logback-spring.xml
<?xml version="1.0" encoding="UTF-8"?> <configuration> <!-- 日志存放路径 --> <property name="log.path" value="./logs"/> <!-- 日志天数 --> <property name="log.history" value="60"/> <!-- 日志轮转大小 --> <property name="log.size" value="1024MB"/> <!-- 日志输出格式 --> <!-- <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} -%5p ${PID:-} [%15.15t] %-40.40logger{39} : %m%n" />--> <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} -%5p [%15.15t] %-40.40logger{30} : %m%n"/> <!-- 控制台输出 --> <appender name="console" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <pattern>${log.pattern}</pattern> </encoder> </appender> <!-- 系统日志输出 --> <!-- ch.qos.logback.classic.AsyncAppender --> <appender name="info" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${log.path}/info.log</file> <encoder> <pattern>${log.pattern}</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <fileNamePattern>${log.path}/info-%d{yyyyMMdd}.%i.log</fileNamePattern> <maxHistory>${log.history}</maxHistory> <maxFileSize>${log.size}</maxFileSize> </rollingPolicy> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>INFO</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> </appender> <!-- 用户访问日志输出 --> <appender name="warn" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${log.path}/warn.log</file> <encoder> <pattern>${log.pattern}</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <fileNamePattern>${log.path}/warn-%d{yyyyMMdd}.%i.log</fileNamePattern> <maxHistory>${log.history}</maxHistory> <maxFileSize>${log.size}</maxFileSize> </rollingPolicy> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>WARN</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> </appender> <appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${log.path}/error.log</file> <encoder> <pattern>${log.pattern}</pattern> </encoder> <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy"> <fileNamePattern>${log.path}/error-%d{yyyyMMdd}.%i.log</fileNamePattern> <maxHistory>${log.history}</maxHistory> <maxFileSize>${log.size}</maxFileSize> </rollingPolicy> <filter class="ch.qos.logback.classic.filter.LevelFilter"> <level>ERROR</level> <onMatch>ACCEPT</onMatch> <onMismatch>DENY</onMismatch> </filter> </appender> <!-- 日志级别 --> <logger name="org.springframework" level="warn"/> <logger name="org.mybatis" level="INFO"/> <!-- OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL --> <springProfile name="default"> <root level="INFO"> <appender-ref ref="console"/> <appender-ref ref="info"/> <appender-ref ref="warn"/> <appender-ref ref="error"/> </root> </springProfile> <springProfile name="beta,test"> <root level="INFO"> <appender-ref ref="console"/> <appender-ref ref="info"/> <appender-ref ref="warn"/> <appender-ref ref="error"/> </root> </springProfile> <springProfile name="prod"> <root level="WARN"> <appender-ref ref="console"/> <appender-ref ref="info"/> <appender-ref ref="warn"/> <appender-ref ref="error"/> </root> </springProfile> </configuration>
备注:内容摘自网络,有问题联系我们删除或修改。
.
pip3 install 库名 -i 镜像地址
例:从清华这边的镜像去安装pyspider库。
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider
touch ~/.pip/pip.conf vi ~/.pip/pip.conf [global] index-url=https://pypi.tuna.tsinghua.edu.cn/simple [install] trusted-host=pypi.tuna.tsinghua.edu.cn
或
mkdir ~/.pip/ echo '' > ~/.pip/pip.conf echo '[global]' >> ~/.pip/pip.conf echo 'index-url = https://pypi.tuna.tsinghua.edu.cn/simple' >> ~/.pip/pip.conf echo '[install]' >> ~/.pip/pip.conf echo 'trusted-host=pypi.tuna.tsinghua.edu.cn' >> ~/.pip/pip.conf echo '' >> ~/.pip/pip.conf
清华参考:https://mirror.tuna.tsinghua.edu.cn/help/pypi/
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
注意,simple
不能少, 是 https
而不是 http
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:
pip install pip -U pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
如果您到 pip 默认源的网络连接较差,临时使用本镜像站来升级 pip:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U
。。。