cpu scheduling cpu调度

news2024/10/6 1:47:13

soft real-time Vs hard real-time scheduling

Real-Time CPU Scheduling

  • Can present obvious challenges
  • Soft real-time systems – Critical real-time tasks have the highest priority, but no guarantee as to when tasks will be scheduled
  • Hard real-time systems – task must be serviced by its deadline
  • Event latency – the amount of time that elapses from when an event occurs to when it is serviced.
  • Two types of latencies affect performance
    •  Interrupt latency – time from arrival of interrupt to start of routine that services interrupt
    •  Dispatch latency – time for schedule to take current process off CPU and switch to another

软实时系统--关键实时任务具有最高优先级,但无法保证任务的调度时间

- 硬实时系统--任务必须在截止日期前完成

- 事件延迟 - 从事件发生到事件得到处理所需的时间。

- 有两种延迟会影响性能

- 中断延迟 - 从中断到达到中断服务例程开始的时间

- 调度延迟--调度将当前进程从 CPU 移除并切换到另一个进程的时间

Priority-based Scheduling

  • For real-time scheduling, scheduler must support preemptive, priority-based scheduling
    • But only guarantees soft real-time
  • For hard real-time must also provide ability to meet deadlines
  • Processes have new characteristics: periodic ones require CPU at constant intervals
    • Has processing time t, deadline d, period p
    • 0 ≤ tdp
    • Rate of periodic task is 1/p

对于实时调度,调度器必须支持抢占式、基于优先级的调度

但只能保证软实时

对于硬实时,还必须提供满足截止日期要求的能力

进程具有新的特点:周期性进程以恒定的时间间隔需要 CPU

具有处理时间 t、截止日期 d、周期 p

0 ≤ t ≤ d ≤ p

周期任务的速率为 1/p

CPU Scheduler • The CPU scheduler selects from among the processes in ready queue, and allocates a CPU core to one of them • Queue may be ordered in various ways

• CPU scheduling decisions may take place when a process:

1. Switches from running to waiting state

2. Switches from running to ready state

3. Switches from waiting to ready

4. Terminates

• For situations 1 and 4, there is no choice in terms of scheduling. A new process (if one exists in the ready queue) must be selected for execution. • For situations 2 and 3, however, there is a choice.

Preemptive and Nonpreemptive Scheduling

  • When scheduling takes place only under circumstances 1 and 4, the scheduling scheme is nonpreemptive.
  • Otherwise, it is preemptive.
  • Under Nonpreemptive scheduling, once the CPU has been allocated to a process, the process keeps the CPU until it releases it either by terminating or by switching to the waiting state.
  • Virtually all modern operating systems including Windows, MacOS, Linux, and UNIX use preemptive scheduling algorithms.

当调度仅在第 1 和第 4 种情况下进行时,调度方案是非抢占式的。

否则,就是抢占式调度。

在非抢占式调度下,CPU 一旦分配给某个进程,该进程就会一直使用 CPU,直到通过终止或切换到等待状态来释放 CPU。

实际上,包括 Windows、MacOS、Linux 和 UNIX 在内的所有现代操作系统都使用抢占式调度算法。

  • Preemptive scheduling can result in race conditions when data are shared among several processes.
  • Consider the case of two processes that share data. While one process is updating the data, it is preempted so that the second process can run. The second process then tries to read the data, which are in an inconsistent state.

当多个进程共享数据时,抢占式调度可能会导致竞赛条件。

考虑两个进程共享数据的情况。当一个进程正在更新数据时,它被抢占,以便第二个进程可以运行。然后,第二个进程试图读取处于不一致状态的数据。

starvation

The situation in which a process or thread waits indefi nitely within a semaphore. Also, a scheduling risk in which a thread that is ready to run is never put onto the CPU due to the scheduling algorithm; it is starved for CPU time.

指的是进程或线程在信号量中无限期等待的情况。此外,它还指调度策略导致就绪线程无法被调度到 CPU 上执行的风险;它被 CPU 时间所“饿死”。

evaluation of scheduling algorithms FCFS SJF RR Prioring

First- Come, First-Served (FCFS) Scheduling

Suppose that the processes arrive in the order:

               P2 , P3 , P1

  • The Gantt chart for the schedule is:
  • Waiting time for P1 = 6; P2 = 0; P3 = 3
  • Average waiting time:   (6 + 0 + 3)/3 = 3
  • Much better than previous case
  • Convoy effect - short process behind long process

Consider one CPU-bound and many I/O-bound processes

Shortest-Job-First (SJF) Scheduling

  • Associate with each process the length of its next CPU burst
    • Use these lengths to schedule the process with the shortest time
  • SJF is optimal – gives minimum average waiting time for a given set of processes
  • Preemptive version called shortest-remaining-time-first
  • How do we determine the length of the next CPU burst?
    • Could ask the user
    • Estimate

为每个进程关联其下一次 CPU 突发的长度

使用这些长度来调度时间最短的进程

SJF 是最优的 - 为一组给定的进程提供最短的平均等待时间

抢占式版本称为 "剩余时间最短优先"。

通过询问用户和估计确定下一次cpu突发的长度

SJF算法从就绪队列中选择当前优先级最高的进程(如果有多个进程具有相同的优先级,则选择当前优先级最高的进程)。

如果就绪队列中没有进程,它从运行状态中选择一个进程。

定期检查和调整进程的优先级。

SJF也旨在最小化AWT,但它通过考虑进程的优先级而不是仅考虑它们的剩余时间来实现。

Determining Length of Next CPU Burst

  • Can only estimate the length – should be similar to the previous one
    • Then pick process with shortest predicted next CPU burst
  • Can be done by using the length of previous CPU bursts, using exponential averaging
  • Commonly, α set to ½

Shortest Remaining Time First Scheduling

Preemptive version of SJN(即SJF)

Whenever a new process arrives in the ready queue, the decision on which process to schedule next is redone using the SJN algorithm.

抢占式 SJN 版本

每当有新进程进入就绪队列,就会使用 SJN 算法重新决定下一个进程的调度。

Is SRT more “optimal” than SJN in terms of the minimum average waiting time for a given set of processes?

SRT算法安排剩余执行时间最短的进程下一个执行。

它为每个进程维护一个剩余CPU突发时间的估计。

当新进程到达或进程完成执行时,相应地更新估计。

SRT旨在最小化平均等待时间(AWT),假设估计是准确的。

Round Robin (RR)

  • Each process gets a small unit of CPU time (time quantum q), usually 10-100 milliseconds.  After this time has elapsed, the process is preempted and added to the end of the ready queue.
  • If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once.  No process waits more than (n-1)q time units.
  • Timer interrupts every quantum to schedule next process
  • Performance
    • q large Þ FIFO (FCFS)
    • q small Þ RR
  • Note that q must be large with respect to context switch, otherwise overhead is too high

每个进程获得一个小单位的 CPU 时间(时间量子 q),通常为 10-100 毫秒。 过了这段时间后,进程就会被抢占并加入就绪队列的末尾。

如果就绪队列中有 n 个进程,而时间量子为 q,那么每个进程都会一次性获得 1/n 的 CPU 时间,每块最多 q 个时间单位。 没有进程的等待时间超过 (n-1)q 个时间单位。

计时器每隔一个量子中断一次,以安排下一个进程

q小FIFO  q大RR

注意,相对于上下文切换,q 必须很大,否则开销太大

Example of RR with Time Quantum = 4

  

Priority Scheduling

  • A priority number (integer) is associated with each process
  • The CPU is allocated to the process with the highest priority (smallest integer º highest priority)
    • Preemptive
    • Nonpreemptive
  • SJF is priority scheduling where priority is the inverse of predicted next CPU burst time
  • Problem º Starvation – low priority processes may never execute
  • Solution º Aging – as time progresses increase the priority of the process

每个进程都有一个优先级编号(整数

CPU 分配给优先级最高的进程(最小整数 =最高优先级)

抢占式 非抢占式

SJF(最短作业优先)调度算法可以被视为一种特殊的优先级调度算法,优先级的分配是基于预测的CPU突发时间(即进程下一次需要CPU的时间长度)预测的CPU突发时间越短,进程的优先级就越高,这样它就越有可能被调度器选中执行。

问题  饥饿--低优先级进程可能永远不会执行

解决方案  老化--随着时间的推移提高进程的优先级

Priority Scheduling w/ Round-Robin

Scheduling Criteria

  • CPU utilization – keep the CPU as busy as possible
  • Throughput – # of processes that complete their execution per time unit
  • Turnaround time – amount of time to execute a particular process
  • Waiting time – amount of time a process has been waiting in the ready queue
  • Response time – amount of time it takes from when a request was submitted until the first response is produced.

CPU 利用率 - 尽可能保持 CPU 的繁忙状态

吞吐量 - 每个时间单位内完成执行的进程数量

周转时间 - 执行特定进程所需的时间

等待时间 - 进程在就绪队列中等待的时间

响应时间 - 从提交请求到产生第一个响应所需的时间。

memory management

Memory-Management Unit (MMU)

  • Hardware device that at run time maps virtual to physical address

  • Many methods possible, covered in the rest of this chapter
  • Consider simple scheme. which is  a generalization of the base-register scheme.
    • The base register now called relocation register
  • The value in the relocation register is added to every address generated by a user process at the time it is sent to memory
  • The user program deals with logical addresses; it never sees the real physical addresses
    • Execution-time binding occurs when reference is made to location in memory
    • Logical address bound to physical addresses

考虑简单的方案,它是基寄存器方案的一般化。

基寄存器现在称为重定位寄存器

重新定位寄存器中的值在用户进程生成的每个地址被发送到内存时都会被加上

用户程序处理的是逻辑地址,从未见过真正的物理地址

当引用内存中的位置时,就会发生执行时绑定

逻辑地址绑定到物理地址

  • Consider simple scheme. which is  a generalization of the base-register scheme.
  • The base register now called relocation register
  • The value in the relocation register is added to every address generated by a user process at the time it is sent to memory

基寄存器现在称为重定位寄存器

用户进程生成的每个地址在发送到内存时,都会加上重定位寄存器中的值

Paging

  • Physical  address space of a process can be noncontiguous; process is allocated physical memory whenever the latter is available
    • Avoids external fragmentation
    • Avoids problem of varying sized memory chunks
  • Divide physical memory into fixed-sized blocks called frames
    • Size is power of 2, between 512 bytes and 16 Mbytes
  • Divide logical memory into blocks of same size called pages
  • Keep track of all free frames
  • To run a program of size N pages, need to find N free frames and load program
  • Set up a page table to translate logical to physical addresses
  • Backing store likewise split into pages

进程的物理地址空间可以是非连续的;只要有物理内存,就会为进程分配物理内存

避免外部碎片

避免内存块大小不一的问题

将物理内存划分为固定大小的块,称为帧

大小为 2 的幂次,介于 512 字节和 16 兆字节之间

将逻辑内存划分为相同大小的块,称为页

跟踪所有空闲帧

要运行大小为 N 页的程序,需要找到 N 个空闲帧并加载程序

建立页表,将逻辑地址转换为物理地址

后备存储同样分为页

Address Translation Scheme

  • Address generated by CPU is divided into:
    • Page number (p) – used as an index into a page table which contains base address of each page in physical memory
    • Page offset (d) – combined with base address to define the physical memory address that is sent to the memory unit

CPU 生成的地址分为

页码 (p) - 用作页表的索引,页表中包含物理内存中每个页的基地址

页偏移 (d) - 与基地址相结合,定义发送到内存单元的物理内存地址

    • For given logical address space 2m and page size 2n

Paging Hardware

  • Logical address:  n = 2 and  m = 4. Using a page size of 4 bytes and a physical memory of 32 bytes (8 pages)

Paging -- Calculating internal fragmentation

  • Page size = 2,048 bytes
  • Process size = 72,766 bytes
  • 35 pages + 1,086 bytes
  • Internal fragmentation of 2,048 - 1,086 = 962 bytes
  • Worst case fragmentation = 1 frame – 1 byte
  • On average fragmentation = 1 / 2 frame size
  • So small frame sizes desirable?
  • But each page table entry takes memory to track
  • Page sizes growing over time
    • Solaris supports two page sizes – 8 KB and 4 MB

Steps in Handling Page Fault

  1. If there is a reference to a page, first reference to that page will trap to operating system
    • Page fault
  2. Operating system looks at another table to decide:
    • Invalid reference Þ abort
    • Just not in memory
  3. Find free frame
  4. Swap page into frame via scheduled disk operation
  5. Reset tables to indicate page now in memory
    Set validation bit = v
  6. Restart the instruction that caused the page fault

如果存在对某个页面的引用,则对该页面的首次引用将向操作系统发出陷阱信号

页面故障

操作系统查看另一个表来决定:

无效引用  中止

只是不在内存中

查找空闲框架

通过计划的磁盘操作将页面交换到帧中

重置表以显示页面已在内存中设置验证位 = v

重启导致页面故障的指令

Page Replacement

  • Prevent over-allocation of memory by modifying page-fault service routine to include page replacement
  • Use modify (dirty) bit to reduce overhead of page transfers – only modified pages are written to disk
  • Page replacement completes separation between logical memory and physical memory – large virtual memory can be provided on a smaller physical memory

- 通过修改页面故障服务例程以包括页面替换,防止内存过度分配

- 使用修改(脏)位来减少页面传输的开销--只有修改过的页面才会写入磁盘

页面替换完成了逻辑内存和物理内存之间的分离--可以在较小的物理内存上提供较大的虚拟内存

Basic Page Replacement

  1. Find the location of the desired page on disk
  2. Find a free frame:
       -  If there is a free frame, use it
       -  If there is no free frame, use a page replacement algorithm to select a victim frame
      
    -  Write victim frame to disk if dirty
  3. Bring  the desired page into the (newly) free frame; update the page and frame tables
  4. Continue the process by restarting the instruction that caused the trap

Note now potentially 2 page transfers for page fault – increasing EAT

Page and Frame Replacement Algorithms

  • Frame-allocation algorithm determines
    • How many frames to give each process
    • Which frames to replace
  • Page-replacement algorithm
    • Want lowest page-fault rate on both first access and re-access
  • Evaluate algorithm by running it on a particular string of memory references (reference string) and computing the number of page faults on that string
    • String is just page numbers, not full addresses
    • Repeated access to the same page does not cause a page fault
    • Results depend on number of frames available

In all our examples, the reference string of referenced page numbers

帧分配算法决定

为每个进程分配多少帧 替换哪些帧

页面替换算法

希望首次访问和再次访问的页面故障率最低

在特定的内存引用字符串(引用字符串)上运行算法,并计算该字符串上的页面故障次数,以此评估算法

字符串只是页码,而不是完整地址

重复访问同一页面不会导致页面故障

结果取决于可用帧数

在我们的所有示例中,引用页码的引用字符串

First-In-First-Out (FIFO) Algorithm

  • Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1
  • 3 frames (3 pages can be in memory at a time per process)
  • page fault就是page frame发生多少次变化 每次从上往下记录,如果frame内数字已经满了,则从上往下先替换旧(指的是记录时间上的旧)的数字
  • 当记录数字里面已经有了的时候,Hit跳过,
  • Can vary by reference string: consider 1,2,3,4,1,2,5,1,2,3,4,5
    • Adding more frames can cause more page faults!
      • Belady’s Anomaly
  • How to track ages of pages?

Just use a FIFO queue

Optimal Algorithm

  • Replace page that will not be used for longest period of time
    • 9 is optimal for the example
  • How do you know this?
    • Can’t read the future

Used for measuring how well your algorithm performs

替换未来最长时间内不会被使用的页

不是一个可以在实际系统中实现的实际算法。

Least Recently Used (LRU) Algorithm

  • Use past knowledge rather than future
  • Replace page that has not been used in the most amount of time
  • Associate time of last use with each page
  • 12 faults – better than FIFO but worse than OPT
  • Generally good algorithm and frequently used

  • 类似FIFO 有一点不同从上往下先替换旧(指的是reference string排序位置上)的数字

替换未使用时间最长的页面

将最后使用时间与每个页面相关联

12 次故障--好于先进先出,但差于 OPT

  • Counter implementation
    • Every page entry has a counter; every time page is referenced through this entry, copy the clock into the counter
    • When a page needs to be changed, look at the counters to find smallest value
      • Search through table needed
  • Stack implementation
    • Keep a stack of page numbers in a double link form:
    • Page referenced:
      • move it to the top
      • requires 6 pointers to be changed
    • But each update more expensive

No search for replacement

计数器的实现

每个页面条目都有一个计数器;每次通过该条目引用页面时,都会将时钟复制到计数器中

需要更改页面时,查看计数器以找到最小值 搜索所需的表格

堆栈实现

以双链接形式保存页码堆栈:页面引用:移到最上面 需要更改 6 个指针

但每次更新成本更高

无法搜索替换

  • LRU and OPT are cases of stack algorithms that don’t have Belady’s Anomaly
  • Use Of A Stack to Record Most Recent Page References

 

LRU Approximation Algorithms

  • LRU needs special hardware and still slow
  • Reference bit
    • With each page associate a bit, initially = 0
    • When page is referenced bit set to 1
    • Replace any with reference bit = 0 (if one exists)
      • We do not know the order, however
  • Second-chance algorithm
    • Generally FIFO, plus hardware-provided reference bit
    • Clock replacement
    • If page to be replaced has
      • Reference bit = 0 -> replace it
      • reference bit = 1 then:
        • set reference bit 0, leave page in memory
        • replace next page, subject to same rules

LRU 需要特殊硬件,速度仍然很慢

参考位

每个页面关联一个位,初始值 = 0

当页面被引用时,位设置为 1

替换任何参考位 = 0 的页面(如果存在的话)

但我们不知道顺序

二次机会算法

一般为 FIFO,加上硬件提供的参考位

时钟替换

如果要替换的页面有

参考位 = 0 -> 替换

  • LRU and OPT are cases of stack algorithms that don’t have Belady’s Anomaly
  • Use Of A Stack to Record Most Recent Page References

LRU Approximation Algorithms

  • LRU needs special hardware and still slow
  • Reference bit
    • With each page associate a bit, initially = 0
    • When page is referenced bit set to 1
    • Replace any with reference bit = 0 (if one exists)
      • We do not know the order, however
  • Second-chance algorithm
    • Generally FIFO, plus hardware-provided reference bit
    • Clock replacement
    • If page to be replaced has
      • Reference bit = 0 -> replace it
      • reference bit = 1 then:
        • set reference bit 0, leave page in memory
        • replace next page, subject to same rules

LRU 需要特殊硬件,速度仍然很慢

参考位

每个页面关联一个位,初始值 = 0

当页面被引用时,位设置为 1

替换任何参考位 = 0 的页面(如果存在的话)

但我们不知道顺序

二次机会算法

一般为 FIFO,加上硬件提供的参考位

时钟替换

如果要替换的页面有

参考位 = 0 -> 替换

参考位 = 1,则

设置参考位 0,将页面保留在内存中

替换下一页,遵循相同规则

Enhanced Second-Chance Algorithm

  • Improve algorithm by using reference bit and modify bit (if available) in concert
  • Take ordered pair (reference, modify):
    • (0, 0) neither recently used not modified – best page to replace
    • (0, 1) not recently used but modified – not quite as good, must write out before replacement
    • (1, 0) recently used but clean – probably will be used again soon
    • (1, 1) recently used and modified – probably will be used again soon and need to write out before replacement
  • When page replacement called for, use the clock scheme  but use the four classes replace page in lowest non-empty class

Might need to search circular queue several times

协同使用参考位和修改位(如果有)来改进算法

取有序对(参考,修改):

(0, 0) 最近未使用也未修改 - 替换的最佳页面

(0, 1) 最近未使用但已修改--不太好,必须在替换前写出

(1,0) 最近使用过但没有修改--可能很快会再次使用

(1, 1) 最近使用过并修改过 - 可能很快会再次使用,需要在替换前写出

当需要替换页面时,使用时钟方案,但使用四个类 在最低的非空闲类中替换页面

可能需要多次搜索循环队列

Counting Algorithms

  • Keep a counter of the number of references that have been made to each page
    • Not common
  • Lease Frequently Used (LFU) Algorithm:
    •   Replaces page with smallest count
  • Most Frequently Used (MFU) Algorithm:
    • Based on the argument that the page with the smallest count was probably just brought in and has yet to be used

记录每页被引用的次数 不常用

租赁常用 (LFU) 算法:替换计数最小的页面

最常使用 (MFU) 算法: 基于这样一个论点,即计数最小的页面可能刚刚被引入,尚未被使用

Page-Buffering Algorithms

  • Keep a pool of free frames, always
    • Then frame available when needed, not found at fault time
    • Read page into free frame and select victim to evict and add to free pool
    • When convenient, evict victim
  • Possibly, keep list of modified pages
    • When backing store otherwise idle, write pages there and set to non-dirty
  • Possibly, keep free frame contents intact and note what is in them
    • If referenced again before reused, no need to load contents again from disk
    • Generally useful to reduce penalty if wrong victim frame selected 

始终保持一个空闲帧池

然后在需要时提供框架,而不是在故障发生时找到框架

将页面读入空闲帧,然后选择受害者,将其驱逐并添加到空闲帧池中

方便时,驱逐受害者

可能的话,保留已修改页面的列表

当备用存储空闲时,将页面写入备用存储,并设置为非脏页面

可能的话,保持空闲帧内容不变,并记录其中的内容

如果在重复使用前再次引用,则无需再次从磁盘加载内容

如果选择了错误的受害帧,一般有助于减少处罚 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1859669.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

ONLYOFFICE 桌面编辑器 8.1 发布:全新 PDF 编辑器、幻灯片版式、增强 RTL 支持及更多本地化选项

目录 什么是ONLYOFFICE? ONLYOFFICE 主要特点包括: 官网信息: 1. 功能齐全的 PDF 编辑器 1.1 编辑 PDF 文本 1.2 插入和修改对象 1.3 创建和填写表单 2. 幻灯片版式功能 2.1 快速应用幻灯片版式 2.2 动画窗格的改进 3. 文档编辑、…

交通 | 机器学习 + 大规模TSP/VRP求解

封面图来源:https://xkcd.com/399/ 推文作者:丁建辉,陈泰劼,张云天 本文针对旅行商问题(Travelling salesman problem, TSP)和车辆路径规划问题(Vehicle routing problem, VRP)这一类…

数据库精选题(五)(事务、并行控制与恢复系统)

🌈 个人主页:十二月的猫-CSDN博客 🔥 系列专栏: 🏀数据库 💪🏻 十二月的寒冬阻挡不了春天的脚步,十二点的黑夜遮蔽不住黎明的曙光 目录 前言 概论 事务 并发控制 恢复系统 三…

Python | Leetcode Python题解之第190题颠倒二进制位

题目&#xff1a; 题解&#xff1a; class Solution:# param n, an integer# return an integerdef reverseBits(self, n):n (n >> 16) | (n << 16);n ((n & 0xff00ff00) >> 8) | ((n & 0x00ff00ff) << 8);n ((n & 0xf0f0f0f0) >&g…

198.回溯算法:子集(力扣)

代码解决 class Solution { public:// 用于存储当前子集的临时向量vector<int> res;// 用于存储所有子集的结果向量vector<vector<int>> result;// 回溯函数void backtracing(vector<int>& nums, int index) {// 每次递归调用都将当前子集添加到结…

CBSD创建和管理bhyve容器Ubuntu@FreeBSD

首先&#xff0c;创建bhyve cbsd bconstruct-tui 然后启动 cbsd bstart bub22 启动后提示 init_systap: waiting for link: igb0 Looks like /usr/jails/vm/bub22/dsk1.vhd is empty. May be you want to boot from CD? [yes(1) or no(0)] yes确认 然后使用cbsd blogi…

“Cannot resolve ch.qos.logback:logback-classic:1.2.3”问题解决办法

当我们添加依赖配置时&#xff0c;通常会遇见如下错误&#xff1a; 这个问题是由于项目中使用了 logback-classic 版本1.2.3&#xff0c;但是无法从当前所配置的仓库中解析到这个特定的版本。可以尝试检查依赖配置&#xff0c;确保指定的仓库中包含了 logback-classic 版本1.2.…

数据中心 250KW 水冷负载组概述

该负载专为数据中心冷水机组调试和测试应用而设计, 是一款紧凑的便携式产品&#xff0c;具有无限功率和水流控制功能&#xff0c;可实现精确的温升设置与施加的功率。鹦鹉螺是完全可联网的&#xff0c;可以从远程站控制单个或多个单元。 使用带有触摸屏 HMI 的 PLC&#xff0c;…

内网使用nexus3搭建npm私库方法

内网使用nexus3搭建npm私库大致分为下载tgz和批量上传两个步骤。如下。 第一步&#xff0c;批量下载tgz依赖。 新建一个文件夹&#xff0c;比如download&#xff1b;拷贝出项目中package.json或者package-lock.json。放进download文件夹中&#xff1b;确保电脑本地已经安装好n…

打造坚固的SSH防护网:端口敲门入门指南

欢迎来到我的博客&#xff0c;代码的世界里&#xff0c;每一行都是一个故事 &#x1f38f;&#xff1a;你只管努力&#xff0c;剩下的交给时间 &#x1f3e0; &#xff1a;小破站 打造坚固的SSH防护网&#xff1a;端口敲门入门指南 前言什么是端口敲门端口敲门的优点1. 增强安全…

您的私人办公室!——ONLYOFFICE8.1版本桌面编辑器测评

onlyoffice是一款非常棒的办公软件&#xff0c;我们都知道PDF文件就像照片一样&#xff0c;处理起来非常的烦躁&#xff0c;就说转成word文件这个需求都很难享受的到&#xff0c;就算是转了&#xff0c;效果也是很一般&#xff0c;那么ONLYOFFICE在最新版本就解决了这个问题&am…

华为数通——STP-RSTP-MSTP生成树

STP 为了提高网络可靠性&#xff0c;交换机之间常常会进行设备冗余&#xff08;备份&#xff09;&#xff0c;但这样会给交换网络带来环路风险&#xff0c;导致广播风暴以及MAC地址表不稳定等问题。 STP&#xff1a;生成树协议的作用就是为了解决避免二层环路&#xff0c;解决…

51单片机定时炸弹-准确计时-两根线随机一根触发中断可“拆弹“(AT89C52)

一、设计介绍: 1、使用定时器按照精确时间读秒倒计时&#xff0c;倒计时在LCD1602中居中显示&#xff0c;格式为mm&#xff1a;ss&#xff0c;每秒变化一次 2、默认倒计时10分钟&#xff0c;时间到后显示“Time over”“&#xff08;&#xff08;&#xff08;Boom&#xff09…

Ansible-综合练习-生产案例

斌的招儿 网上教程大多都是官网模板化的教程和文档&#xff0c;这里小斌用自己实际生产环境使用的例子给大家做一个详解。涉及到一整套ansible的使用&#xff0c;对于roles的使用&#xff0c;也仅涉及到tasks和files目录&#xff0c;方便大家快速上手并规范化管理。 0.环境配置…

Spring(核心概念:IoC/DI思想)

目录 一、引言 &#xff08;1&#xff09;如今的代码书写现状 1、业务层 2、数据层 3、假如当项目上线发布之后&#xff0c;想把数据层的实现换一下 二、核心概念 &#xff08;1&#xff09;IoC&#xff08; Inversion of Control ) 控制反转 &#xff08;2&#xff09;…

XML 外部实体注入漏洞

XML&#xff08;可扩展标记语言&#xff09; XML 的定义 XML&#xff08;eXtensible Markup Language&#xff0c;扩展标记语言&#xff09;是一种用于描述结构化数据的标记语言&#xff0c;它类似于 HTML&#xff0c;但它的标签是自定义的。XML 的主要目的是传输和存储数据&…

刷题日记6.25

136. 只出现一次的数字 这道题考察的是异或算法&#xff0c;也是异或算法的一个典型作用例子。 注意题目要求实现线性时间复杂度算法解决&#xff0c;所以就不要想着排序或者用set数组之类的了。 先讲讲异或算法。 异或&#xff08;XOR&#xff09;是一种常用的位运算操作&am…

GIF转字符画

前言 上一次我们实现了静态图片转字符画&#xff1a; https://blog.csdn.net/weixin_54143563/article/details/139778645 由此我们不禁思考&#xff0c;对于动态的gif应该怎么转换呢&#xff1f; 思路 在网上我学习到了一种思路&#xff1a; 1.创建中间的临时文件夹tmp&a…

Web前端期末大作业--绿色自适应医疗健康医院网页设计(HTML+CSS+JavaScript+)实现

Toggle navigation Hospital 首页 关于我们医疗动态医疗资源联系我们 我们的服务 心脏监测 XXX的通道有许多变化&#xff0c;但大多数人以某种形式遭受了改变&#xff0c;通过注射幽默 康复治疗 XXX的通道有许多变化&#xff0c;但大多数人以某种形式遭受了改变&#xff0c;通…

Java技术栈总结:数据库MySQL篇

一、慢查询 1、常见情形 聚合查询 多表查询 表数据量过大查询 深度分页查询 2、定位慢查询 方案一、开源工具 调试工具&#xff1a;Arthas运维工具&#xff1a;Prometheus、Skywalking 方案二、MySQL自带慢日志 在MySQL配置文件 /etc/my.conf 中配置&#xff1a; # …