你的位置:亚博体育 - Yabo亚博集团官方网站 > 新闻 > 亚博体育(中国)官方网站# 本剧本编码为UTF-8-亚博体育 - Yabo亚博集团官方网站
发布日期:2026-03-12 16:17 点击次数:75

显露信在官网提供了好意思满的盘后K线数据,通过官网下载的速率赫然快于通过法式自己更新的速率,而且皆集褂讪性获得权贵增强。主要原因在于显露信的盘后K线数据是按来去见地存放的亚博体育(中国)官方网站,而数据更新法式需要按往未来历推送盘口数据并接受和存储,形成数据搜索和存储成果上较低。
本剧本不错完毕官网全量数据平直下载,而况解压缩隐秘土产货存储数据,从而灵验加速数据更新频率。经测试剧本开动20分钟控制即可完毕全量数据下载,包括沪深京日线数据和膨大商场日线数据亚博体育(中国)官方网站,浅显开展土产货数据分析商榷责任。
chcp 65001# Author: tomdonald# 本剧本通过显露信官网券商数据下载模块完毕逐日盘后数据全量更新,相较于显露信主法式中的盘后数据下载功能具有下载速率快、全量更新数据规整性好、可树立定时任务后台践诺的特质,粗略兼顾数据集措置和显露信日常读取使用的需求。# 本剧本需要放弃在显露信主法式目次外一层,幸免显露信主法式版块更新或者重装等原因导致本剧本误删除。如放弃在其他位置,请手工修改$TdxInstallation变量的神色位置。本剧本使用aria2c下载显露信券商数据,经测试aria2c速率赫然快于系统原生的Invoke-WebRequest和Start-BitsTransfer教唆,请准备aria2c法式并在$aria2c变量神色其位置。本剧本使用7zip解压缩显露信券商数据,经测试7zip解压缩速率赫然快于系统原生的Expand-Archive教唆,而况不错幸免显露信官方zip存在的丢失中央目次问题,请准备7zip敕令行版块法式并在$7zip变量神色其位置。# aria2c名堂地址:https://github.com/aria2/aria2/releases/download/release-1.36.0/aria2-1.36.0-win-64bit-build1.zip# 7zip名堂地址:https://7-zip.org/a/7z2301-extra.7z# 本剧本开动进程中将在同级目次创建temp文献夹用于临时存放下载文献,请确保本剧本具有同级文献夹裁剪和探听权限。# 本剧本践诺时将通过start-process创建aria2c下载和7zip解压的子程度弹窗,请保执弹窗开动。# 本剧本编码为UTF-8,已通过chcp 65001进行开动编码调遣。Windows默许建树的power shell使用系统面前默许编码,频繁是GBK,即chcp936,践诺chcp 65001后可普通清楚。power shell 7以上版块默许编码为UTF-8# 用户变量树立区域$TdxInstallation = './显露信金融末端/vipdoc'$aria2c = './aria2c/aria2-1.36.0-win-64bit-build1/aria2c'$7zip = './7z2301/7za'# 系统变量树立区域,其中$fileHash界说显露信奇迹器下载文献称号和土产货解压缩存放位置,$fileArray暂时无须。$fileHash = [ordered]@{'ggtday.zip' = '/ds/lday'; 'shlday.zip' = '/sh/lday'; 'xsbday.zip' = '/ds/lday'; '62day.zip' = '/ds/lday'; 'szqqday.zip' = '/ds/lday' ; 'shqqday.zip' = '/ds/lday' ; 'szzsday.zip' = '/sz/lday'; 'shzsday.zip' = '/sh/lday'; 'tdxzs_day.zip' = '/sh/lday'; 'bjlday.zip' = '/bj/lday' ; 'szlday.zip' = '/sz/lday' } # 'szlday_4.zip' = ''; 'shlday_4.zip' =''; 属于TCKV=1数据,不下载$fileArray = 'szlday.zip', 'ggtday.zip', 'shlday.zip', 'xsbday.zip', '62day.zip', 'szqqday.zip', 'shqqday.zip', 'szlday_4.zip', 'shlday_4.zip', 'szzsday.zip', 'shzsday.zip', 'tdxzs_day.zip', 'bjlday.zip'# 法式操作践诺区域Remove-Item -Path ./temp -Recurseforeach ($file in $fileHash.Keys) { $DownloadLink = 'https://www.tdx.com.cn/products/data/data/vipdoc/' + $file $DestinationLink = $TdxInstallation + $fileHash.$file $download_arguments = $DownloadLink + ' --dir=./temp --split=64 --min-split-size=4M --disk-cache=64M --continue=true --always-resume=false --max-resume-failure-tries=0 --remote-time=true --max-concurrent-downloads=5 --max-connection-per-server=16 --piece-length=1M --allow-piece-length-change=true --lowest-speed-limit=0 --max-overall-download-limit=0 --max-download-limit=0 --http-accept-gzip=true --reuse-uri=false' # Start-BitsTransfer -Source $DownloadLink -Destination $file # Invoke-WebRequest -Uri $DownloadLink Start-Process -FilePath $aria2c -Argumentlist $download_arguments -wait $Zipfile = './temp/' + $file $expand_arguments = 'x -y -o' + $DestinationLink + ' ' + $Zipfile # if ((Get-ChildItem $Zipfile).LastWriteTime -gt (Get-Date -date (Get-Date -format 'MM/dd/yyyy'))) if ((Get-Childitem $Zipfile | New-Timespan) -lt (New-Timespan -days 1)) { Write-Output $Zipfile Write-Output '是当日文献,不错更新' # Expand-Archive -Path $Zipfile -DestinationPath $DestinationLink -Force Start-Process -FilePath $7zip -Argumentlist $expand_arguments -wait } elseif (((get-date -format 'dddd').contains('星期六') -or (get-date -format 'dddd').contains('日曜日')) -and ((Get-Childitem $Zipfile | New-Timespan) -lt (New-Timespan -days 3))) { Write-Output $Zipfile Write-Output '是当周五文献,不错更新' # Expand-Archive -Path $Zipfile -DestinationPath $DestinationLink -Force Start-Process -FilePath $7zip -Argumentlist $expand_arguments -wait } else { Write-Output $Zipfile Write-Output '不是当日文献,无法更新' # Expand-Archive -Path $Zipfile -DestinationPath $DestinationLink -Force # ./7z2301/7za.exe x -y -o$DestinationLink $Zipfile -wait } Remove-Item -Path $Zipfile} 本站仅提供存储奇迹,所有现实均由用户发布,如发现存害或侵权现实,请点击举报。Powered by 亚博体育 - Yabo亚博集团官方网站 @2013-2022 RSS地图 HTML地图