[STUDY VLOG] Study scene # 33

  • LeetCode 183、189、190

  • Scallop Word Punch

  • Mooc Quiz 5, 6 and 7

  • Operating System Coursera Seventh Week Quiz

  • database:

    • Referential integrity
      • Referential integrity definition
        • Use foreign key phrase in create table to define which columns are foreign codes
        • Use the phrases "references" to indicate which tables the main codes refer to
      • Referential integrity checks and breach handling
        • Referential integrity breach handling: refusal to execute, cascade (cascade) operation, set to null
        • The timing of referential integrity check: when adding, deleting and modifying the referenced table and the reference table
    • User-defined integrity
      • Attributes:
        • Not null is not allowed
        • Column value is unique
        • Use check phrases to specify conditions that column values ​​should meet
        • Check timing: insert tuples or modify the value of attributes
      • Tuple: mutual constraint of different attributes
    • Integrity constraints named clauses and assertions
      • Integrity constraint naming clause
        • constraint <integrity constraint name> <integrity constraint>
      • Modify the integrity limit in the table
        • Use the alter table statement to modify the integrity limit in the table
        • Delete constraint: drop constraint constraint name
        • Can not be modified directly, need to delete first, then add: drop first and then add
      • Affirmation:
        • Use the create assertion <assert name> <check clause> statement to specify more general constraints through declarative assertions
        • Remove assertion: drop assertion <assert name>
    • Trigger: It is a special event-driven process defined by the user on the relational table
      • Define trigger
        • create trigger <trigger name> (must be in the same mode as the table name)
        • before / after <trigger event> on <table name>
        • referencing new/old row as <变量>
        • for each row/statement
        • when <trigger condition> (trigger action body)
      • Activation trigger
        • The order of multiple triggers: before trigger, sql statement, after trigger
      • Delete trigger
        • drop trigger <trigger name> on <table name>
        • Triggers that must exist and have permissions
  • Jiwang:

    • Transport layer definition and function
      • Above the network layer, transport layer
      • Function: Provide openable transmission service, connection multiplexing, serial number and flow control, error control and recovery
      • Topic of communication: application process (process is a program execution activity on the computer)
      • End-to-end communication: multiplexing and demultiplexing
      • port:
        • The process identifier PID in the operating system cannot be used to identify the port
        • The re-transport layer uses protocol port numbers, often referred to as ports
        • 16-bit identification with local meaning
        • kind:
          • Server: familiar with the port, the value is generally 0 ~ 1023
          • Customer Service: Temporary port number, the value is 1024 ~ 65535 Temporary use
    • Transport layer protocol
      • Features of UDP:
        • not connected
        • Do our best to deliver, do not guarantee reliability, and do not use congestion control
        • Message-oriented
        • Support one-to-one, one-to-many, many-to-one, many-to-many interactive communication
        • The header overhead is small, 8 bytes
      • UDP data format
      • TCP transmission control protocol: TCP oriented byte stream, connection-oriented, full-duplex communication, reliable delivery service
      • TCP connection means:
        • Socket socket: (ip address: port number)
        • Each TCP connection is uniquely determined by the two endpoints at both ends of the communication
      • TCP packet header format (20 bytes fixed)
        • Source port and destination port fields: 2 bytes each
        • Sequence number field: 4 bytes
        • Confirmation number: 4 bytes
        • Data offset (header length): 4 bits (calculated with 4 bytes)
        • Reserved: 6 bytes
        • Six flag bits: emergency, confirmation, push, reset, synchronization, termination
        • Window field: 2 bytes
        • Checksum: 2 bytes
        • Emergency pointer: 16 bits
        • Option field: variable length (maximum segment length MSS)
        • Padding field: make the total be an integer multiple of 4 bytes
  • operating system

    • Basic memory management solution
      • The entire process enters a continuous area in memory
        • Single continuous area: only one process is in memory at a time, simple, low memory utilization
        • Fixed partition: The memory space is divided into several areas, the size can be the same or different, the partition size is fixed, and each partition can only have one process
        • Variable partition: split allocation according to process needs, and the remaining becomes a new free partition
          • External fragmentation, resulting in reduced memory utilization
        • Debris (small, unusable free area)-> compaction technology, small fragments merge
          • Considerations when tightening: system overhead, mobile timing
      • A process is stored in a number of discrete areas in memory
        • Page storage management
          • The user address space is divided into equal-sized parts, called pages
          • Memory is also divided into areas of equal size, called page values
          • Allocation rules: page-based allocation, on-demand allocation, logically adjacent pages are not necessarily physically adjacent
          • Typical page size: 4k or 4M
          • Logical address: page number + in-page address (automatically completed by the system and transparent to users)
          • Related data structure and address translation:
            • Page table: page table items, an empty table for each process, stored in memory, the starting address is stored in PCB or register
            • Free memory management
            • Address translation (hardware support): CPU gets logical address (internal fragmentation), automatically divides page number and in-page address
        • Segment storage management:
          • User process address is divided according to its own logical relationship
          • The memory space is dynamically divided into several areas of unequal length
          • It can be allocated in segments to occupy continuous space and can be of different sizes
          • Logical address: segment number + address within segment (can not be automatically divided)
          • Related data structure and address conversion
            • Segment table: segment number, segment start address, segment length, one segment table per process, placed in memory
            • Physical memory management
            • Address translation (hardware): Calculate physical address (lookup table)
        • Segmented page storage management: the advantages of integrated paged and segmented solutions
          • User process division: first divided by segment, each segment is divided by page
          • Logical address: segment number + address within segment (page number + address within page)
          • Memory partition and allocation: same page
          • Data structure and related operations: segment table, page table, free area management, memory allocation and recovery
      • to sum up
    Program Pros and cons
    Single continuous area Only one user program is run at a time, and the user program monopolizes the memory
    Fixed partition The allocable memory space is divided into several consecutive areas, and each area is called a partition. The size of each partition can be the same or different. The size of the partition is fixed.
    Variable partition According to the needs of the process, divide the allocable memory space into a partition and assign it to the process
    Page style The user program address space is divided into equal-sized parts, called pages. The memory space is divided into areas of equal size according to the size of the page, called memory blocks (physical pages, page frames, page frames). Allocated in pages, logically adjacent pages are not necessarily physically adjacent
    Segment The user program address space is divided into several segments according to the logical relationship of the process itself, and the memory space is dynamically divided into several regions (variable partitions) of different lengths. Allocate memory in segments, each segment occupies continuous space in memory, and segments can be stored discontinuously
    Segment page User program address space: segment type; memory space: page type; allocation unit: page
    • Swap technology (smaller memory space runs larger memory)
      • Memory "expansion" technology:
        • Memory compaction technology
        • Covering technology: different parts of the program are replaced with each other in memory, the calling structure is clearly defined, and the programmer declares that the covering structure is automatically overwritten by the operating system
        • Swap technology: some temporarily moved to external storage, stack and heap, swap area
        • Virtual storage technology
Published 85 original articles · Like 30 · Visits 10,000+

Guess you like

Origin blog.csdn.net/weixin_44198992/article/details/105621076