-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
771 lines (627 loc) · 80.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>小牛博客 - 每天进步一点点!</title><meta name="keywords" content="Blog,博客,Java,js,JavaScript,C,C++,SQL,Python,Git"><meta name="author" content="ITNXD"><meta name="copyright" content="ITNXD"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一个大学生的博客,记录学习,记录成长,分享生活!">
<meta property="og:type" content="website">
<meta property="og:title" content="小牛博客">
<meta property="og:url" content="https://www.itnxd.cn/index.html">
<meta property="og:site_name" content="小牛博客">
<meta property="og:description" content="一个大学生的博客,记录学习,记录成长,分享生活!">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/02/06/e373babbf340391956b673128a84185d.png">
<meta property="article:author" content="ITNXD">
<meta property="article:tag" content="Blog,博客,Java,js,JavaScript,C,C++,SQL,Python,Git">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/02/06/e373babbf340391956b673128a84185d.png"><link rel="shortcut icon" href="https://gitcode.net/qq_43590403/images/-/raw/master/img/favicon.ico"><link rel="canonical" href="https://www.itnxd.cn/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="google-site-verification" content="H9LW1qdxrkJ55YbkfWulMvpaexxx3Rk0Yo6dVANeNHc"/><meta name="baidu-site-verification" content="code-YglH3DObCb"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?8d3bd59bf6303bd5f44677445d369df5";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
root: '/',
algolia: undefined,
localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容:${query}"}},
translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
noticeOutdate: undefined,
highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
copy: {
success: '复制成功',
error: '复制错误',
noSupport: '浏览器不支持'
},
relativeDate: {
homepage: false,
post: false
},
runtime: '天',
date_suffix: {
just: '刚刚',
min: '分钟前',
hour: '小时前',
day: '天前',
month: '个月前'
},
copyright: {"limitCount":300,"languages":{"author":"作者: ITNXD","link":"链接: ","source":"来源: 小牛博客","info":"著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。"}},
lightbox: 'mediumZoom',
Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#2d3035","position":"bottom-left"},
source: {
jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
justifiedGallery: {
js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
},
fancybox: {
js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
}
},
isPhotoFigcaption: false,
islazyload: false,
isanchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
title: '小牛博客',
isPost: false,
isHome: true,
isHighlightShrink: false,
isToc: false,
postUpdate: '2024-01-28 23:00:31'
}</script><noscript><style type="text/css">
#nav {
opacity: 1
}
.justified-gallery img {
opacity: 1
}
#recent-posts time,
#post-meta time {
display: inline !important
}
</style></noscript><script>(win=>{
win.saveToLocal = {
set: function setWithExpiry(key, value, ttl) {
if (ttl === 0) return
const now = new Date()
const expiryDay = ttl * 86400000
const item = {
value: value,
expiry: now.getTime() + expiryDay,
}
localStorage.setItem(key, JSON.stringify(item))
},
get: function getWithExpiry(key) {
const itemStr = localStorage.getItem(key)
if (!itemStr) {
return undefined
}
const item = JSON.parse(itemStr)
const now = new Date()
if (now.getTime() > item.expiry) {
localStorage.removeItem(key)
return undefined
}
return item.value
}
}
win.getScript = url => new Promise((resolve, reject) => {
const script = document.createElement('script')
script.src = url
script.async = true
script.onerror = reject
script.onload = script.onreadystatechange = function() {
const loadState = this.readyState
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
script.onload = script.onreadystatechange = null
resolve()
}
document.head.appendChild(script)
})
win.activateDarkMode = function () {
document.documentElement.setAttribute('data-theme', 'dark')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
}
}
win.activateLightMode = function () {
document.documentElement.setAttribute('data-theme', 'light')
if (document.querySelector('meta[name="theme-color"]') !== null) {
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
}
}
const t = saveToLocal.get('theme')
const isDarkMode = window.matchMedia('(prefers-color-scheme: dark)').matches
const isLightMode = window.matchMedia('(prefers-color-scheme: light)').matches
const isNotSpecified = window.matchMedia('(prefers-color-scheme: no-preference)').matches
const hasNoSupport = !isDarkMode && !isLightMode && !isNotSpecified
if (t === undefined) {
if (isLightMode) activateLightMode()
else if (isDarkMode) activateDarkMode()
else if (isNotSpecified || hasNoSupport) {
const now = new Date()
const hour = now.getHours()
const isNight = hour <= 6 || hour >= 18
isNight ? activateDarkMode() : activateLightMode()
}
window.matchMedia('(prefers-color-scheme: dark)').addListener(function (e) {
if (saveToLocal.get('theme') === undefined) {
e.matches ? activateDarkMode() : activateLightMode()
}
})
} else if (t === 'light') activateLightMode()
else activateDarkMode()
const asideStatus = saveToLocal.get('aside-status')
if (asideStatus !== undefined) {
if (asideStatus === 'hide') {
document.documentElement.classList.add('hide-aside')
} else {
document.documentElement.classList.remove('hide-aside')
}
}
const fontSizeVal = saveToLocal.get('global-font-size')
if (fontSizeVal !== undefined) {
document.documentElement.style.setProperty('--global-font-size', fontSizeVal + 'px')
}
const detectApple = () => {
if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
document.documentElement.classList.add('apple')
}
}
detectApple()
document.addEventListener('pjax:complete', detectApple)})(window)</script><link rel="stylesheet" href="/css/my.css"><style type="text/css">#toggle-sidebar {bottom: 80px}</style><link rel="stylesheet" href="//at.alicdn.com/t/font_1828588_zrw9f0qqie.css"><link rel="stylesheet" href="/self/atom-one-light.css"><meta name="generator" content="Hexo 5.3.0"><link rel="alternate" href="/atom.xml" title="小牛博客" type="application/atom+xml">
</head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/02/06/e373babbf340391956b673128a84185d.png" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/archives/"><div class="headline">文章</div><div class="length-num">261</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tags/"><div class="headline">标签</div><div class="length-num">214</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/categories/"><div class="headline">分类</div><div class="length-num">31</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/contact/"><i class="fa-fw fa fa-coffee"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fa fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fa fa-heart"></i><span> 关于我</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page" id="page-header" style="background-image: url('https://gitcode.net/qq_43590403/images/-/raw/master/img/H21b5f6b8496141a1979a33666e1074d9x.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">小牛博客</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fa fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fa fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fa fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fa fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/contact/"><i class="fa-fw fa fa-coffee"></i><span> 留言板</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fa fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fa fa-heart"></i><span> 关于我</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">小牛博客</h1><div id="site-subtitle"><span id="subtitle"></span></div><div id="site_social_icons"><a class="social-icon" href="tencent://message/?Menu=yes&amp;uin=158903258&amp;Service=300&amp;sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45" rel="external nofollow noreferrer" target="_blank" title="QQ"><i class="iconfont icon-QQ card-qq"></i></a><a class="social-icon" href="https://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=q8XC3tPdz8TFzOva2oXIxMY" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="iconfont icon-youxiang card-youxiang"></i></a><a class="social-icon" href="https://github.com/niuxvdong" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="iconfont icon-GitHub card-github"></i></a><a class="social-icon" href="/atom.xml" target="_blank" title="RSS"><i class="iconfont icon-rss card-rss"></i></a><a class="social-icon" href="https://blog.csdn.net/qq_43590403" rel="external nofollow noreferrer" target="_blank" title="CSDN"><i class="iconfont icon-csdn card-csdn"></i></a><a class="social-icon" href="https://space.bilibili.com/389893592" rel="external nofollow noreferrer" target="_blank" title="Bilibili"><i class="iconfont icon-bilibili card-bilibili"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left_radius"><a href="/posts/43777.html" title="JVM学习总结"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2022/08/06/d625a577df424a8e480bb87940d0debc.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JVM学习总结"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/43777.html" title="JVM学习总结">JVM学习总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2022-01-14T05:31:39.000Z" title="发表于 2022-01-14 13:31:39">2022-01-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/JVM/">JVM</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/JVM/">JVM</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/43777.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、什么是JVM
¶定义
Java Virtual Machine,JAVA程序的运行环境(JAVA二进制字节码的运行环境)
¶好处
一次编写,到处运行
自动内存管理,垃圾回收机制
数组下标越界检查
多态,使用虚方法机制调用实现
¶比较
JVM JRE JDK的区别
¶二、内存结构
¶0、整体结构
方法区:类保存位置
堆:实例、对象保存位置
虚拟机栈、程序计数器、本地方法栈:实例对象调用方法时用到
解释器:解释字节码变为机器码
JIT即时编译器:对热点数据优化处理
本地方法接口:Java无法实现的部分,根操作系统底层打交道的接口
¶1、程序计数器
¶定义
Program Counter Register 程序计数器(寄存器)
¶作用
用于保存JVM中下一条所要执行的指令的地址
¶特点
线程私有
CPU会为每个线程分配时间片,当当前线程的时间片使用完以后,CPU就会去执行另一个线程中的代码
程序计数器是每个线程所私有的,当另一个线程的时间片用完,又返回来执行当前线程的代码时,通过程序计数器可以知道应该执行哪一句指令
不会存在内存溢出
JVM中唯一一个内存不会溢出的 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/posts/40062.html" title="计算机操作系统 - 详细版"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/27/5d8b1ee0b25fc82e480fff0b66fc87f5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机操作系统 - 详细版"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/40062.html" title="计算机操作系统 - 详细版">计算机操作系统 - 详细版</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-12-04T14:07:36.000Z" title="发表于 2021-12-04 22:07:36">2021-12-04</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80/">计算机基础</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/40062.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、操作系统概述
¶1、操作系统定义
操作系统(Operating System,OS):是指控制和管理整个计算机系统的硬件和软件资源,并合理地组织调度计算机的工作和资源的分配,以提供给用户和其他软件方便的接口和环境,它是计算机系统中最基本的系统软件。
是系统最基本最核心的软件,属于系统软件
控制和管理整个计算机的硬件和软件资源
合理的组织、调度计算机的工作与资源的分配
为用户和其它软件提供方便的接口和环境
¶2、操作系统功能和目标
¶作为系统资源的管理者
处理机调度(管理):在多道程序环境下,cpu的分配和运行都以进程(或线程)为基本单位,因此对cpu的管理可理解为对进程的管理。进程管理的主要功能包括进程控制、进程同步、进程通信、死锁处理、处理机调度等
存储器管理:为多道程序的运行提供良好的环境,方便用户使用及提高内存的利用率,主要包括内存分配与回收、地址映射、内存保护与共享和内存扩充等功能。
文件管理:计算机中所有的信息都是以文件的形式存在的,操作系统中负责文件的管理的部分称为文件系统,文件管理包括文件存储空间的管理、目录管理及文件读写管理和保护等。
设备管理:主要任务是完 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/posts/28758.html" title="计算机网络"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/12/04/61344cb2456937f1355e9f33715997ec.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机网络"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/28758.html" title="计算机网络">计算机网络</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-11-29T09:16:40.000Z" title="发表于 2021-11-29 17:16:40">2021-11-29</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80/">计算机基础</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/">计算机网络</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/28758.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、计算机网络体系结构
¶0、脑图
¶1、计算机网络概述
¶脑图
¶概念
计算机网络是 互连的、自治的 计算机系统的集合。
互连:互联互通
自治:无主从关系
计算机网络是一个将分散的、具有独立功能的计算机系统,通过通信设备和线路连接起来,由功能完善的软件实现资源共享和信息传递的系统。
网络把许多计算机连接在一起,而互联网则把许多网络连接在一起,因特网是世界上最大的互联网。
¶功能
数据通信(连通性)
资源共享(硬件、软件、数据)
分布式处理
提高可靠性(容错性)
负载均衡
¶组成
组成部分:
硬件(主机(端系统)、链路(双绞线、光纤)、通信设备(路由器、交换机))
软件
协议(约定和规则)
工作方式:
边缘部分(用户直接使用)
C/S方式
P2P方式
核心部分(为边缘部分服务)
大量网络和连接这些网络的路由器组成
功能组成:
通信子网:实现数据通信
资源子网:实现资源共享(数据处理)
¶分类
按分布范围分
广域网WAN(交换技术)
城域网MAN
局域网LAN(广播技术)
个人区域网PAN
按使用者分
公用网(指电信公司出资建造的大型 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/posts/8398.html" title="计算机操作系统"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/27/5d8b1ee0b25fc82e480fff0b66fc87f5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机操作系统"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/8398.html" title="计算机操作系统">计算机操作系统</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-11-21T13:16:17.000Z" title="发表于 2021-11-21 21:16:17">2021-11-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80/">计算机基础</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F/">操作系统</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/8398.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、操作系统结构
¶1、操作系统定义
从用户、控制的角度,操作系统是个控制软件,管理应用程序、为应用程序提供服务、杀死应用程序。
从资源分配的角度来说,操作系统进行资源管理、管理各种外设、对资源进行分配。
操作系统将物力资源进行抽象:CPU抽象成进程、磁盘抽象成文件、内存抽象成地址空间提供给应用程序使用。
¶2、操作系统地位
硬件之上、应用程序之下。是个中间层的系统软件。
操作系统位于应用软件之下、为应用软件提供服务支撑,完成对硬件的管理。
操作系统有两层对外的接口:对外暴露的接口外壳(Shell),和面向内部的内核(Kernel)。
¶3、操作系统分类
¶4、操作系统软件的组成
shell:命令行接口,方便用户操作
gui:图形用户接口
kernel:内核,执行资源管理。
Kernel:操作系统内部组件,包括:CPU调度、物理内存管理、虚拟内存管理(给上层应用提供相对独立而且尽可能大的内存)、文件系统管理(存储和访问永久保存的数据)、中断处理与设备驱动(和底层设备直接打交道)等。
¶5、操作系统内核特征
并发:计算机系统中同时存在多个运行的程序,需要OS管理和 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/posts/16013.html" title="在线教育-谷粒学苑项目总结"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/21/c4ec5bbaa750f47666154dca86ac91b5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="在线教育-谷粒学苑项目总结"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/16013.html" title="在线教育-谷粒学苑项目总结">在线教育-谷粒学苑项目总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-11-21T02:08:44.000Z" title="发表于 2021-11-21 10:08:44">2021-11-21</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E9%A1%B9%E7%9B%AE%E6%80%BB%E7%BB%93/">项目总结</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/%E9%A1%B9%E7%9B%AE/">项目</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/16013.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">
项目GitHub地址:https://github.com/niuxvdong/Guli_Project
¶零、在线教育项目简介
¶工程结构
¶模块说明
guli-parent:在线教学根目录(父工程),管理四个子模块:
canal-client:canal数据库表同步模块(统计同步数据)
common:公共模块父节点
common-util:工具类模块,所有模块都可以依赖于它
service-base:service服务的base包,包含service服务的公共配置类,所有service模块依赖于它
spring-security:认证与授权模块,需要认证授权的service服务依赖于它
infrastructure:基础服务模块父节点
api-gateway:api网关服务
service:api接口服务父节点
service-acl:用户权限管理api接口服务(用户管理、角色管理和权限管理等)
service-cms:cms api接口服务
service-edu:教学相关api接口服务
service-msm:短信api接口服务
service-order ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/posts/45102.html" title="前端知识点总结"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/20/59e6bed391110092545ed9ae79229f2f.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="前端知识点总结"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/45102.html" title="前端知识点总结">前端知识点总结</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-11-20T09:33:21.000Z" title="发表于 2021-11-20 17:33:21">2021-11-20</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%89%8D%E7%AB%AF%E7%9F%A5%E8%AF%86/">前端知识</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/es6/">es6</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/vue/">vue</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/axios/">axios</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/webpack/">webpack</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/babel/">babel</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/npm/">npm</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/45102.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、Es6基础入门
更加全面的阮一峰Es6教程!
¶1、简介
ECMAScript 6.0(以下简称 ES6)是 JavaScript 语言的下一代标准,已经在 2015 年 6 月正式发布了。它的目标,是使得 JavaScript 语言可以用来编写复杂的大型应用程序,成为企业级开发语言。
¶ECMAScript 和 JavaScript 的关系
一个常见的问题是,ECMAScript 和 JavaScript 到底是什么关系?
要讲清楚这个问题,需要回顾历史。1996 年 11 月,JavaScript 的创造者 Netscape 公司,决定将 JavaScript 提交给标准化组织 ECMA,希望这种语言能够成为国际标准。次年,ECMA 发布 262 号标准文件(ECMA-262)的第一版,规定了浏览器脚本语言的标准,并将这种语言称为 ECMAScript,这个版本就是 1.0 版。
因此,ECMAScript 和 JavaScript 的关系是,前者是后者的规格,后者是前者的一种实现(另外的 ECMAScript方言还有 Jscript 和ActionScript)
¶ES ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/posts/44402.html" title="基于异步的、事件驱动的网络应用程序框架、快速开发高性能、高可靠性的网络服务器和客户端程序Netty介绍"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/02/5a36755da549fd44dd641d57680b154c.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="基于异步的、事件驱动的网络应用程序框架、快速开发高性能、高可靠性的网络服务器和客户端程序Netty介绍"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/44402.html" title="基于异步的、事件驱动的网络应用程序框架、快速开发高性能、高可靠性的网络服务器和客户端程序Netty介绍">基于异步的、事件驱动的网络应用程序框架、快速开发高性能、高可靠性的网络服务器和客户端程序Netty介绍</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-11-01T06:38:06.000Z" title="发表于 2021-11-01 14:38:06">2021-11-01</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/">网络编程</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Netty/">Netty</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/NIO/">NIO</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/44402.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、BIO编程
¶1、I/O 模型
I/O 模型简单的理解:就是用什么样的通道进行数据的发送和接收,很大程度上决定了程序通信的性能
Java 共支持 3 种网络编程模型 IO 模式:BIO、NIO、AIO
Java BIO : 同步并阻塞(传统阻塞型),服务器实现模式为一个连接一个线程,即客户端有连接请求时服务器端就需要启动一个线程进行处理,如果这个连接不做任何事情会造成不必要的线程开销
Java NIO : 同步非阻塞,服务器实现模式为一个线程处理多个请求(连接),即客户端发送的连接请求都会注册到多路复用器上,多路复用器轮询到连接有 I/O 请求就进行处理
Java AIO(NIO.2) : 异步非阻塞,AIO 引入异步通道的概念,采用了 Proactor 模式,简化了程序编写,有效的请求才启动线程,它的特点是先由操作系统完成后才通知服务端程序启动线程去处理,一般适用于连接数较多且连接时间较长的应用
¶2、适用场景分析
BIO 方式适用于连接数目比较小且固定的架构,这种方式对服务器资源要求比较高,并发局限于应用中,JDK1.4以前的唯一选择,但程序简单易理解。
NIO ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/posts/63819.html" title="处理线程的工具包、JUC并发编程"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/10/25/1d57ced3775c11d0e1c2f25bcd3b1f33.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="处理线程的工具包、JUC并发编程"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/63819.html" title="处理线程的工具包、JUC并发编程">处理线程的工具包、JUC并发编程</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-10-24T08:40:49.000Z" title="发表于 2021-10-24 16:40:49">2021-10-24</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B/">并发编程</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/JUC/">JUC</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/63819.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、JUC概述
**推荐博客:https://blog.csdn.net/TZ845195485/article/details/109210095**
¶1、JUC简介
在 Java 中,线程部分是一个重点,本篇文章说的 JUC 也是关于线程的。JUC就是 java.util .concurrent 工具包的简称。这是一个处理线程的工具包,JDK
1.5 开始出现的。
¶2、进程和线程
进程(Process) 是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础。 在当代面向线程设计的计算机结构中,进程是线程的容器。程序是指令、数据及其组织形式的描述,进程是程序的实体。
线程(thread) 是操作系统能够进行运算调度的最小单位。它被包含在进程之中,是进程中的实际运作单位。一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,每条线程并行执行不同的任务。
总结来说:
进程:指在系统中正在运行的一个应用程序;程序一旦运行就是进程;进程——资源分配的最小单位。
线程:系统分配处理器时间资源的基本单元,或者说进程之 ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/posts/29680.html" title="分布式微服务架构的一站式解决方案、多种微服务架构落地技术的集合体、俗称微服务全家桶的 SpringCloud"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/10/23/922026402b21435e77ec5a1c183683b7.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="分布式微服务架构的一站式解决方案、多种微服务架构落地技术的集合体、俗称微服务全家桶的 SpringCloud"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/29680.html" title="分布式微服务架构的一站式解决方案、多种微服务架构落地技术的集合体、俗称微服务全家桶的 SpringCloud">分布式微服务架构的一站式解决方案、多种微服务架构落地技术的集合体、俗称微服务全家桶的 SpringCloud</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-10-14T01:42:54.000Z" title="发表于 2021-10-14 09:42:54">2021-10-14</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E5%BE%AE%E6%9C%8D%E5%8A%A1/">分布式微服务</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/SpringCloud/">SpringCloud</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/29680.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、微服务架构概述
¶1、微服务
微服务架构是一种架构模式,它提倡将单一应用程序划分成一组小的服务,服务之间互相协调、互相配合,为用户提供最终价值。每个务运行在其独立的进程中,服务与服务间采用轻量级的通信机制互相协作(通常是基于HTTP协议的RESTful API)。每个服务都围绕着具业务进行构建,并且能够被独立的部署到生产环境、类生产环境等。另外,应当尽量避免统一的、集中式的服务管理机制,对具体的一个服务而言,应根据业务上下文,选择合适的语言、工具对其进行构建。
¶2、架构图
¶3、SpringCloud技术栈
SpringCloud = 分布式微服务架构的一站式解决方案,是多种微服务架构落地技术的集合体,俗称微服务全家桶!
¶4、版本选择
官网版本依赖关系:https://start.spring.io/actuator/info
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/posts/12809.html" title="进一步封装Spring、为简化Spring开发而生的SpringBoot框架"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/10/13/f4ee28a291f9feb683183e72ba34bb7a.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="进一步封装Spring、为简化Spring开发而生的SpringBoot框架"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/12809.html" title="进一步封装Spring、为简化Spring开发而生的SpringBoot框架">进一步封装Spring、为简化Spring开发而生的SpringBoot框架</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-10-06T08:14:09.000Z" title="发表于 2021-10-06 16:14:09">2021-10-06</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%BC%80%E5%8F%91%E6%A1%86%E6%9E%B6/">开发框架</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/SpringBoot/">SpringBoot</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/12809.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、SpringBoot概述
¶1、能做什么
¶Spring能力
微服务开发
响应式编程(异步非阻塞)
分布式云开发
web开发
无服务开发(FAAS:函数级开发)
事件驱动(使用数据流利用响应式编程)
批处理开发
¶Spring生态
web开发
数据访问
安全控制
分布式
消息服务
移动开发
批处理
…
¶Spring5升级
响应式编程:占用少量线程,使用少量资源就可以处理大量的并发和需要的业务!
内部源码设计:基于Java8的一些新特性,如:接口默认实现(适配器模式)。重新设计源码架构。
¶2、为什么用
能快速创建出生产级别的Spring应用!
¶SpringBoot优点
SpringBoot是整合Spring技术栈的一站式框架!
SpringBoot是简化Spring技术栈的快速开发脚手架!
创建独立Spring应用
内嵌web服务器
自动starter依赖,简化构建配置
自动配置Spring以及第三方功能
提供生产级别的监控、健康检查及外部化配置
无代码生成、无需编写XML
¶SpringBoot缺点
人称版本帝,迭代快,需要时刻关注变化
封装太深, ...</div></div></div><div class="recent-post-item"><div class="post_cover left_radius"><a href="/posts/49375.html" title="高级消息队列、开源消息代理软件、面向消息的中间件 RabbitMQ 介绍"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/10/04/bad5b13b191abdc4a6020f51449722c3.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="高级消息队列、开源消息代理软件、面向消息的中间件 RabbitMQ 介绍"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/49375.html" title="高级消息队列、开源消息代理软件、面向消息的中间件 RabbitMQ 介绍">高级消息队列、开源消息代理软件、面向消息的中间件 RabbitMQ 介绍</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-10-04T03:27:51.000Z" title="发表于 2021-10-04 11:27:51">2021-10-04</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/">中间件</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/RabbitMQ/">RabbitMQ</a><span class="article-meta__link">•</span><a class="article-meta__tags" href="/tags/%E6%B6%88%E6%81%AF%E9%98%9F%E5%88%97/">消息队列</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/49375.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、MQ相关概念
¶1、什么是 MQ
MQ(message queue),从字面意思上看,本质是个队列,FIFO 先入先出,只不过队列中存放的内容是message 而已,还是一种跨进程的通信机制,用于上下游传递消息。在互联网架构中,MQ 是一种非常常见的上下游“逻辑解耦+物理解耦”的消息通信服务。使用了 MQ 之后,消息发送上游只需要依赖 MQ,不用依赖其他服务。
¶2、为什么要用 MQ
¶流量消峰
举个例子,如果订单系统最多能处理一万次订单,这个处理能力应付正常时段的下单时绰绰有余,正常时段我们下单一秒后就能返回结果。但是在高峰期,如果有两万次下单操作系统是处理不了的,只能限制订单超过一万后不允许用户下单。使用消息队列做缓冲,我们可以取消这个限制,把一秒内下的订单分散成一段时间来处理,这时有些用户可能在下单十几秒后才能收到下单成功的操作,但是比不能下单的体验要好。
¶应用解耦
以电商应用为例,应用中有订单系统、库存系统、物流系统、支付系统。用户创建订单后,如果耦合调用库存系统、物流系统、支付系统,任何一个子系统出了故障,都会造成下单操作异常。当转变成基于消息队列的方式后,系统间调 ...</div></div></div><div class="recent-post-item"><div class="post_cover right_radius"><a href="/posts/23425.html" title="高性能、轻量级开源分布式RPC服务框架Dubbo使用介绍"> <img class="post_bg" src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/10/01/27c3919bb7046bc5ece2657118592e38.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="高性能、轻量级开源分布式RPC服务框架Dubbo使用介绍"></a></div><div class="recent-post-info"><a class="article-title" href="/posts/23425.html" title="高性能、轻量级开源分布式RPC服务框架Dubbo使用介绍">高性能、轻量级开源分布式RPC服务框架Dubbo使用介绍</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2021-10-01T07:48:41.000Z" title="发表于 2021-10-01 15:48:41">2021-10-01</time></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E5%BE%AE%E6%9C%8D%E5%8A%A1/">分布式微服务</a></span><span class="article-meta tags"><span class="article-meta__separator">|</span><i class="fas fa-tag"></i><a class="article-meta__tags" href="/tags/Dubbo/">Dubbo</a></span><span class="article-meta"><span class="article-meta__separator">|</span><i class="fas fa-comments"></i><a class="twikoo-count" href="/posts/23425.html#post-comment"></a><span class="article-meta-label"> 条评论</span></span></div><div class="content">¶一、分布式介绍
¶1、是什么
《分布式系统原理与范型》定义:
“分布式系统是若干独立计算机的集合,这些计算机对于用户来说就像单个相关系统”
分布式系统(distributed system)是建立在网络之上的软件系统。
随着互联网的发展,网站应用的规模不断扩大,常规的垂直应用架构已无法应对,分布式服务架构以及流动计算架构势在必行,亟需一个治理系统确保架构有条不紊的演进。
¶2、发展演变
¶单一应用架构
当网站流量很小时,只需一个应用,将所有功能都部署在一起,以减少部署节点和成本。此时,用于简化增删改查工作量的数据访问框架(ORM)是关键。
适用于小型网站,小型管理系统,将所有功能都部署到一个功能里,简单易用。
缺点:
性能扩展比较难
协同开发问题
不利于升级维护
¶垂直应用架构
当访问量逐渐增大,单一应用增加机器带来的加速度越来越小,将应用拆成互不相干的几个应用,以提升效率。此时,用于加速前端页面开发的Web框架(MVC)是关键。
通过切分业务来实现各个模块独立部署,降低了维护和部署的难度,团队各司其职更易管理,性能扩展也更方便,更有针对性。
缺点:
公用模块无法重复利用,开发 ...</div></div></div><nav id="pagination"><div class="pagination"><span class="page-number current">1</span><a class="page-number" href="/page/2/#content-inner">2</a><span class="space">…</span><a class="page-number" href="/page/22/#content-inner">22</a><a class="extend next" rel="next" href="/page/2/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/02/06/e373babbf340391956b673128a84185d.png" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">ITNXD</div><div class="author-info__description">一个大学生的博客,记录学习,记录成长,分享生活!</div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">261</div></a></div><div class="card-info-data-item is-center"><a href="/tags/"><div class="headline">标签</div><div class="length-num">214</div></a></div><div class="card-info-data-item is-center"><a href="/categories/"><div class="headline">分类</div><div class="length-num">31</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/niuxvdong"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="tencent://message/?Menu=yes&amp;uin=158903258&amp;Service=300&amp;sigT=45a1e5847943b64c6ff3990f8a9e644d2b31356cb0b4ac6b24663a3c8dd0f8aa12a595b1714f9d45" rel="external nofollow noreferrer" target="_blank" title="QQ"><i class="iconfont icon-QQ card-qq"></i></a><a class="social-icon" href="https://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=q8XC3tPdz8TFzOva2oXIxMY" rel="external nofollow noreferrer" target="_blank" title="Email"><i class="iconfont icon-youxiang card-youxiang"></i></a><a class="social-icon" href="https://github.com/niuxvdong" rel="external nofollow noreferrer" target="_blank" title="Github"><i class="iconfont icon-GitHub card-github"></i></a><a class="social-icon" href="/atom.xml" target="_blank" title="RSS"><i class="iconfont icon-rss card-rss"></i></a><a class="social-icon" href="https://blog.csdn.net/qq_43590403" rel="external nofollow noreferrer" target="_blank" title="CSDN"><i class="iconfont icon-csdn card-csdn"></i></a><a class="social-icon" href="https://space.bilibili.com/389893592" rel="external nofollow noreferrer" target="_blank" title="Bilibili"><i class="iconfont icon-bilibili card-bilibili"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn card-announcement-animation"></i><span>公告</span></div><div class="announcement_content">欢迎访问小牛博客,本博客是用来记录一些学习笔记以及一些所见所感,好玩好看的东西,如果阅读中有什么问题,可以随时到留言版留言或通过QQ以及邮箱及时联系哦!</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/43777.html" title="JVM学习总结"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2022/08/06/d625a577df424a8e480bb87940d0debc.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="JVM学习总结"/></a><div class="content"><a class="title" href="/posts/43777.html" title="JVM学习总结">JVM学习总结</a><time datetime="2022-01-14T05:31:39.000Z" title="发表于 2022-01-14 13:31:39">2022-01-14</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/40062.html" title="计算机操作系统 - 详细版"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/27/5d8b1ee0b25fc82e480fff0b66fc87f5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机操作系统 - 详细版"/></a><div class="content"><a class="title" href="/posts/40062.html" title="计算机操作系统 - 详细版">计算机操作系统 - 详细版</a><time datetime="2021-12-04T14:07:36.000Z" title="发表于 2021-12-04 22:07:36">2021-12-04</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/28758.html" title="计算机网络"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/12/04/61344cb2456937f1355e9f33715997ec.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机网络"/></a><div class="content"><a class="title" href="/posts/28758.html" title="计算机网络">计算机网络</a><time datetime="2021-11-29T09:16:40.000Z" title="发表于 2021-11-29 17:16:40">2021-11-29</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/8398.html" title="计算机操作系统"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/27/5d8b1ee0b25fc82e480fff0b66fc87f5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="计算机操作系统"/></a><div class="content"><a class="title" href="/posts/8398.html" title="计算机操作系统">计算机操作系统</a><time datetime="2021-11-21T13:16:17.000Z" title="发表于 2021-11-21 21:16:17">2021-11-21</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/16013.html" title="在线教育-谷粒学苑项目总结"><img src="https://gitcode.net/qq_43590403/pic/-/raw/master/2021/11/21/c4ec5bbaa750f47666154dca86ac91b5.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="在线教育-谷粒学苑项目总结"/></a><div class="content"><a class="title" href="/posts/16013.html" title="在线教育-谷粒学苑项目总结">在线教育-谷粒学苑项目总结</a><time datetime="2021-11-21T02:08:44.000Z" title="发表于 2021-11-21 10:08:44">2021-11-21</time></div></div></div></div><div class="card-widget" id="card-newest-comments"><div class="item-headline"><i class="fas fa-comment-dots"></i><span>最新评论</span></div><div class="aside-list"><span>正在加载中...</span></div></div><div class="card-widget card-categories"><div class="item-headline">
<i class="fas fa-folder-open"></i>
<span>分类</span>
</div>
<ul class="card-category-list" id="aside-cat-list">
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/AcWing/"><span class="card-category-list-name">AcWing</span><span class="card-category-list-count">41</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Git/"><span class="card-category-list-name">Git</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Hexo/"><span class="card-category-list-name">Hexo</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Hexo%E4%B8%BB%E9%A2%98/"><span class="card-category-list-name">Hexo主题</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JDBC/"><span class="card-category-list-name">JDBC</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JS%E5%AE%9E%E6%88%98/"><span class="card-category-list-name">JS实战</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JVM/"><span class="card-category-list-name">JVM</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JavaScript%E6%95%99%E7%A8%8B/"><span class="card-category-list-name">JavaScript教程</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/JavaWeb/"><span class="card-category-list-name">JavaWeb</span><span class="card-category-list-count">10</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Java%E6%95%99%E7%A8%8B/"><span class="card-category-list-name">Java教程</span><span class="card-category-list-count">16</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/LeetCode%E5%88%B7%E9%A2%98/"><span class="card-category-list-name">LeetCode刷题</span><span class="card-category-list-count">142</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Markdown/"><span class="card-category-list-name">Markdown</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/MySQL/"><span class="card-category-list-name">MySQL</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/Shell/"><span class="card-category-list-name">Shell</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E4%B8%AD%E9%97%B4%E4%BB%B6/"><span class="card-category-list-name">中间件</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%88%86%E5%B8%83%E5%BC%8F%E5%BE%AE%E6%9C%8D%E5%8A%A1/"><span class="card-category-list-name">分布式微服务</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%89%8D%E7%AB%AF%E7%9F%A5%E8%AF%86/"><span class="card-category-list-name">前端知识</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%AE%B9%E5%99%A8/"><span class="card-category-list-name">容器</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%B9%B6%E5%8F%91%E7%BC%96%E7%A8%8B/"><span class="card-category-list-name">并发编程</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%BC%80%E5%8F%91%E6%A1%86%E6%9E%B6/"><span class="card-category-list-name">开发框架</span><span class="card-category-list-count">8</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/"><span class="card-category-list-name">数据库</span><span class="card-category-list-count">10</span></a><ul class="card-category-list child"><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93/"><span class="card-category-list-name">关系型数据库</span><span class="card-category-list-count">8</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/%E7%B4%A2%E5%BC%95/"><span class="card-category-list-name">索引</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/%E9%9D%9E%E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93/"><span class="card-category-list-name">非关系型数据库</span><span class="card-category-list-count">1</span></a></li></ul></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E6%9E%84%E5%BB%BA%E5%B7%A5%E5%85%B7/"><span class="card-category-list-name">构建工具</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E7%BD%91%E7%BB%9C%E7%BC%96%E7%A8%8B/"><span class="card-category-list-name">网络编程</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%93%9D%E6%A1%A5%E6%9D%AF/"><span class="card-category-list-name">蓝桥杯</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9F%BA%E7%A1%80/"><span class="card-category-list-name">计算机基础</span><span class="card-category-list-count">3</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E9%9A%8F%E7%AC%94/"><span class="card-category-list-name">随笔</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E9%A1%B9%E7%9B%AE%E6%80%BB%E7%BB%93/"><span class="card-category-list-name">项目总结</span><span class="card-category-list-count">1</span></a></li>
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/AcWing/" style="font-size: 1.45em; color: rgb(154, 173, 64)">AcWing</a><a href="/tags/%E5%B7%AE%E5%88%86%E5%BA%8F%E5%88%97/" style="font-size: 1.18em; color: rgb(169, 89, 95)">差分序列</a><a href="/tags/%E5%89%8D%E7%BC%80%E5%92%8C/" style="font-size: 1.2em; color: rgb(121, 17, 157)">前缀和</a><a href="/tags/%E4%BA%8C%E5%88%86/" style="font-size: 1.37em; color: rgb(90, 188, 47)">二分</a><a href="/tags/%E5%8F%8C%E6%8C%87%E9%92%88/" style="font-size: 1.4em; color: rgb(98, 100, 178)">双指针</a><a href="/tags/%E6%8E%92%E5%BA%8F/" style="font-size: 1.31em; color: rgb(139, 89, 147)">排序</a><a href="/tags/%E8%B4%AA%E5%BF%83/" style="font-size: 1.42em; color: rgb(65, 11, 183)">贪心</a><a href="/tags/%E4%B8%AD%E4%BD%8D%E6%95%B0/" style="font-size: 1.2em; color: rgb(63, 159, 64)">中位数</a><a href="/tags/priority-queue/" style="font-size: 1.15em; color: rgb(13, 94, 6)">priority_queue</a><a href="/tags/%E5%A0%86/" style="font-size: 1.2em; color: rgb(164, 132, 12)">堆</a><a href="/tags/%E5%BD%92%E5%B9%B6%E6%8E%92%E5%BA%8F/" style="font-size: 1.23em; color: rgb(133, 58, 122)">归并排序</a><a href="/tags/%E9%80%86%E5%BA%8F%E5%AF%B9/" style="font-size: 1.2em; color: rgb(72, 65, 24)">逆序对</a><a href="/tags/%E5%A5%87%E5%81%B6%E6%80%A7/" style="font-size: 1.15em; color: rgb(141, 178, 26)">奇偶性</a><a href="/tags/%E5%80%8D%E5%A2%9E/" style="font-size: 1.18em; color: rgb(29, 142, 183)">倍增</a><a href="/tags/%E9%AB%98%E7%B2%BE%E5%BA%A6/" style="font-size: 1.2em; color: rgb(128, 76, 0)">高精度</a><a href="/tags/Dp/" style="font-size: 1.2em; color: rgb(27, 41, 100)">Dp</a><a href="/tags/%E6%A8%A1%E6%8B%9F/" style="font-size: 1.42em; color: rgb(130, 130, 20)">模拟</a><a href="/tags/%E6%A0%88/" style="font-size: 1.34em; color: rgb(53, 90, 121)">栈</a><a href="/tags/%E5%8D%95%E8%B0%83%E6%A0%88/" style="font-size: 1.29em; color: rgb(25, 60, 71)">单调栈</a><a href="/tags/%E5%BF%AB%E9%80%9F%E5%B9%82/" style="font-size: 1.2em; color: rgb(174, 12, 12)">快速幂</a><a href="/tags/DFS/" style="font-size: 1.45em; color: rgb(42, 185, 150)">DFS</a><a href="/tags/%E4%BA%8C%E8%BF%9B%E5%88%B6/" style="font-size: 1.23em; color: rgb(14, 140, 84)">二进制</a><a href="/tags/%E7%8A%B6%E6%80%81%E5%8E%8B%E7%BC%A9/" style="font-size: 1.15em; color: rgb(117, 182, 177)">状态压缩</a><a href="/tags/%E7%8A%B6%E5%8E%8BDp/" style="font-size: 1.15em; color: rgb(142, 22, 42)">状压Dp</a><a href="/tags/%E6%9C%80%E7%9F%AD%E8%B7%AF/" style="font-size: 1.2em; color: rgb(122, 66, 119)">最短路</a><a href="/tags/%E9%80%92%E6%8E%A8/" style="font-size: 1.23em; color: rgb(3, 145, 166)">递推</a><a href="/tags/%E4%BD%8D%E8%BF%90%E7%AE%97/" style="font-size: 1.2em; color: rgb(175, 99, 166)">位运算</a><a href="/tags/%E4%BA%8C%E7%BB%B4%E5%89%8D%E7%BC%80%E5%92%8C/" style="font-size: 1.15em; color: rgb(0, 53, 179)">二维前缀和</a><a href="/tags/aplayer/" style="font-size: 1.15em; color: rgb(136, 136, 45)">aplayer</a><a href="/tags/dplayer/" style="font-size: 1.15em; color: rgb(155, 63, 99)">dplayer</a><a href="/tags/%E6%B2%B9%E7%8C%B4%E8%84%9A%E6%9C%AC/" style="font-size: 1.15em; color: rgb(157, 81, 185)">油猴脚本</a><a href="/tags/%E7%9F%A5%E4%B9%8E/" style="font-size: 1.15em; color: rgb(154, 89, 94)">知乎</a><a href="/tags/JavaScript/" style="font-size: 1.26em; color: rgb(81, 33, 27)">JavaScript</a><a href="/tags/%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1/" style="font-size: 1.2em; color: rgb(20, 118, 176)">面向对象</a><a href="/tags/Cookie/" style="font-size: 1.15em; color: rgb(173, 132, 21)">Cookie</a><a href="/tags/Session/" style="font-size: 1.15em; color: rgb(113, 62, 109)">Session</a><a href="/tags/Filter/" style="font-size: 1.15em; color: rgb(43, 190, 100)">Filter</a><a href="/tags/ThreadLocal/" style="font-size: 1.15em; color: rgb(28, 108, 126)">ThreadLocal</a><a href="/tags/jQuery/" style="font-size: 1.15em; color: rgb(191, 53, 72)">jQuery</a><a href="/tags/JSP/" style="font-size: 1.15em; color: rgb(69, 18, 5)">JSP</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/archives/" title="查看更多">
<i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2022/01/"><span class="card-archive-list-date">一月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/12/"><span class="card-archive-list-date">十二月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/11/"><span class="card-archive-list-date">十一月 2021</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/10/"><span class="card-archive-list-date">十月 2021</span><span class="card-archive-list-count">5</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/09/"><span class="card-archive-list-date">九月 2021</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/08/"><span class="card-archive-list-date">八月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/05/"><span class="card-archive-list-date">五月 2021</span><span class="card-archive-list-count">3</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2021/04/"><span class="card-archive-list-date">四月 2021</span><span class="card-archive-list-count">13</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">261</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2020-01-29T16:00:00.000Z"></div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">840.2k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2024-01-28T15:00:20.280Z"></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">©2020 - 2024 By ITNXD</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener external nofollow noreferrer" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">CDN BY <a target="_blank" rel="external nofollow" href="https://www.jsdelivr.com/"><b>jsDelivr</b></a> | HOST BY <a target="_blank" rel="external nofollow" href="https://vercel.com/"><b>Vercel</b></a> && <a target="_blank" rel="external nofollow" href="https://github.com/"><b>Github</b></a><br><img style="vertical-align:middle" src="https://gitcode.net/qq_43590403/img/-/raw/master/pictures/2022/10/22_19_11_15_202210221911223.png" alt=""> <a target="_blank" rel="noopener external nofollow noreferrer" href="https://beian.miit.gov.cn/"><b>晋ICP备19005025号-2</b></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="font-plus" type="button" title="放大字体"><i class="fas fa-plus"></i></button><button id="font-minus" type="button" title="缩小字体"><i class="fas fa-minus"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="chat_btn" type="button" title="rightside.chat_btn"><i class="fas fa-sms"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><div class="search-dialog__title" id="local-search-title">本地搜索</div><div id="local-input-panel"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div></div><hr/><div id="local-search-results"></div><span class="search-close-button"><i class="fas fa-times"></i></span></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/medium-zoom/dist/medium-zoom.min.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page@latest/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><div class="js-pjax"><script>(() => {
const getCommentUrl = () => {
const eleGroup = document.querySelectorAll('#recent-posts .article-title')
let urlArray = []
eleGroup.forEach(i=>{
urlArray.push(i.getAttribute('href'))
})
return urlArray
}
const getCount = () => {
const runTwikoo = () => {
twikoo.getCommentsCount({
envId: 'https://twikoo.itnxd.eu.org/',
region: '',
urls: getCommentUrl(),
includeReply: false
}).then(function (res) {
document.querySelectorAll('#recent-posts .twikoo-count').forEach((item,index) => {
item.innerText = res[index].count
})
}).catch(function (err) {
console.log(err)
})
}
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(runTwikoo)
}
}
window.pjax ? getCount() : window.addEventListener('load', getCount)
})()</script><script>function subtitleType () {
fetch('https://v1.hitokoto.cn')
.then(response => response.json())
.then(data => {
if (true) {
var from = '出自 ' + data.from
var sub = "今日事,今日毕,Never put off till tomorrow what you can do today,从来没有真正的绝境, 只有心灵的迷途,Never really desperate, only the lost of the soul,志之所向,金石为开,谁能御之?,花开不是为了花落,而是为了开的更加灿烂。,没有伞的孩子必须努力奔跑!,欲望以提升热忱,毅力以磨平高山。,如果放弃太早,你永远都不知道自己会错过什么。,没有礁石,就没有美丽的浪花;没有挫折,就没有壮丽的人生。".length == 0 ? new Array() : "今日事,今日毕,Never put off till tomorrow what you can do today,从来没有真正的绝境, 只有心灵的迷途,Never really desperate, only the lost of the soul,志之所向,金石为开,谁能御之?,花开不是为了花落,而是为了开的更加灿烂。,没有伞的孩子必须努力奔跑!,欲望以提升热忱,毅力以磨平高山。,如果放弃太早,你永远都不知道自己会错过什么。,没有礁石,就没有美丽的浪花;没有挫折,就没有壮丽的人生。".split(',')
var both = sub.unshift(data.hitokoto, from)
var typed = new Typed('#subtitle', {
strings: sub,
startDelay: 300,
typeSpeed: 150,
loop: true,
backSpeed: 50,
})
} else {
document.getElementById('subtitle').innerHTML = data.hitokoto
}
})
}
if (true) {
if (typeof Typed === 'function') {
subtitleType()
} else {
getScript('https://cdn.jsdelivr.net/npm/typed.js/lib/typed.min.js').then(subtitleType)
}
} else {
subtitleType()
}
</script><script>if (document.getElementsByClassName('mermaid').length) {
if (window.mermaidJsLoad) mermaid.init()
else {
getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(() => {
window.mermaidJsLoad = true
mermaid.initialize({
theme: 'default',
})
true && mermaid.init()
})
}
}</script></div><script>window.addEventListener('load', () => {
const changeContent = (content) => {
if (content === '') return content
content = content.replace(/<img.*?src="(.*?)"?[^\>]+>/ig, '[图片]') // replace image link
content = content.replace(/<a[^>]+?href=["']?([^"']+)["']?[^>]*>([^<]+)<\/a>/gi, '[链接]') // replace url
content = content.replace(/<pre><code>.*?<\/pre>/gi, '[代码]') // replace code
content = content.replace(/<[^>]+>/g,"") // remove html tag
if (content.length > 150) {
content = content.substring(0,150) + '...'
}
return content
}
const getComment = () => {
const runTwikoo = () => {
twikoo.getRecentComments({
envId: 'https://twikoo.itnxd.eu.org/',
region: '',
pageSize: 6,
includeReply: true
}).then(function (res) {
const twikooArray = res.map(e => {
return {
'content': changeContent(e.comment),
'avatar': e.avatar,
'nick': e.nick,
'url': e.url + '#' + e.id,
'date': new Date(e.created).toISOString()
}
})
saveToLocal.set('twikoo-newest-comments', JSON.stringify(twikooArray), 10/(60*24))
generateHtml(twikooArray)
}).catch(function (err) {
const $dom = document.querySelector('#card-newest-comments .aside-list')
$dom.innerHTML= "无法获取评论,请确认相关配置是否正确"
})
}
if (typeof twikoo === 'object') {
runTwikoo()
} else {
getScript('https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js').then(runTwikoo)
}
}
const generateHtml = array => {
let result = ''
if (array.length) {
for (let i = 0; i < array.length; i++) {
result += '<div class=\'aside-list-item\'>'
if (true) {
const name = 'src'
result += `<a href='${array[i].url}' class='thumbnail'><img ${name}='${array[i].avatar}' alt='${array[i].nick}'></a>`
}
result += `<div class='content'>
<a class='comment' href='${array[i].url}'>${array[i].content}</a>
<div class='name'><span>${array[i].nick} / </span><time datetime="${array[i].date}">${btf.diffDate(array[i].date, true)}</time></div>
</div></div>`
}
} else {
result += '没有评论'
}
let $dom = document.querySelector('#card-newest-comments .aside-list')
$dom.innerHTML= result
window.lazyLoadInstance && window.lazyLoadInstance.update()
window.pjax && window.pjax.refresh($dom)
}
const newestCommentInit = () => {
if (document.querySelector('#card-newest-comments .aside-list')) {
const data = saveToLocal.get('twikoo-newest-comments')
if (data) {
generateHtml(JSON.parse(data))
} else {
getComment()
}
}
}
newestCommentInit()
document.addEventListener('pjax:complete', newestCommentInit)
})</script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><div class="aplayer no-destroy" data-id="1551071404" data-server="tencent" data-type="playlist" data-fixed="true" data-mini="true" data-listFolded="false" data-order="random" data-preload="none" data-autoplay="false" muted></div><script>(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/6dc9e8f9.js","daovoice")
</script><script>var isChatBtn = true
daovoice('init', {
app_id: '6dc9e8f9',},{
launcher: {
disableLauncherIcon: isChatBtn // 悬浮 ICON 是否显示
},
});
daovoice('update');
if (isChatBtn) {
var chatBtnFn = () => {
var chatBtn = document.getElementById("chat_btn")
chatBtn.addEventListener("click", function(){
daovoice('show')
});
}
chatBtnFn()
} else {
if (false) {
function chatBtnHide () {
daovoice('update', {},{
launcher: {
disableLauncherIcon: true // 悬浮 ICON 是否显示
},
});
}
function chatBtnShow () {
daovoice('update', {},{
launcher: {
disableLauncherIcon: false // 悬浮 ICON 是否显示
},
});
}
}
}</script><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script><script src="https://cdn.jsdelivr.net/gh/metowolf/[email protected]/dist/Meting.min.js"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = [
'title',
'#config-diff',
'#body-wrap',
'#rightside-config-hide',
'#rightside-config-show',
'.js-pjax'
]
if (false) {
pjaxSelectors.unshift('meta[property="og:image"]', 'meta[property="og:title"]', 'meta[property="og:url"]')
}
var pjax = new Pjax({
elements: 'a:not([target="_blank"])',
selectors: pjaxSelectors,
cacheBust: false,
analytics: false,
scrollRestoration: false
})
document.addEventListener('pjax:send', function () {
// removeEventListener scroll
window.removeEventListener('scroll', window.tocScrollFn)
window.removeEventListener('scroll', scrollCollect)
typeof preloader === 'object' && preloader.initLoading()
if (window.aplayers) {
for (let i = 0; i < window.aplayers.length; i++) {
if (!window.aplayers[i].options.fixed) {
window.aplayers[i].destroy()
}
}
}
typeof typed === 'object' && typed.destroy()
//reset readmode
const $bodyClassList = document.body.classList
$bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')
})
document.addEventListener('pjax:complete', function () {
window.refreshFn()
document.querySelectorAll('script[data-pjax]').forEach(item => {
const newScript = document.createElement('script')
const content = item.text || item.textContent || item.innerHTML || ""
Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
newScript.appendChild(document.createTextNode(content))
item.parentNode.replaceChild(newScript, item)
})
GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()
typeof chatBtnFn === 'function' && chatBtnFn()
typeof panguInit === 'function' && panguInit()
// google analytics
typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});
// baidu analytics
typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);
typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()
// Analytics
if (false) {
MtaH5.pgv()
}
// prismjs
typeof Prism === 'object' && Prism.highlightAll()
typeof preloader === 'object' && preloader.endLoading()
})
document.addEventListener('pjax:error', (e) => {
if (e.request.status === 404) {
pjax.loadUrl('/404.html')
}
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>