System analysts practice daily knowledge points of wrong questions 2

Embedded system --- multi-core cpu

Multi-core is the abbreviation of multi-microprocessor core, which is to package two or more independent processors and integrate them into one circuit. A multi-core processor is a single chip (also known as a silicon core) that plugs directly into a single processor socket, but where the operating system utilizes all associated resources to treat each of its execution cores as a discrete logical processor. By dividing tasks among multiple execution cores, multicore processors can perform more tasks in a given clock cycle.

Compared with multi-cpu, multi-core can reduce the power consumption and volume of the system very well.

In multi-core technology, the computer can execute multiple processes at the same time; in the operating system, multiple threads can also execute concurrently

The hardware structures of smp\bmp\mp processor systems are different, and which structure to use needs to consider this factor.

Computer composition and architecture---CISC, RISC

The computer system is a complex of hardware and software, which can be regarded as a multi-level hierarchical structure divided by function. The division of this structure is conducive to correctly understanding the working process of the computer system and clarifying the role of software and hardware in the system. status and role.

  1. Hardwired logic level: This is the core of the computer, consisting of logic circuits such as gates and flip-flops.
  2. Microprogram level, the machine language at this level is a microinstruction set, and microprograms written by programmers using microinstructions are generally directly executed by hardware
  3. Traditional machine level, the machine language at this level is the instruction set of the machine, and the program written by the programmer with machine instructions can be interpreted by the program
  4. The operating system level, from the perspective of the basic functions of the operating system, on the one hand, it directly manages the hardware and software resources in traditional machines, and on the other hand, it is an extension of traditional machines.
  5. Assembly language level, this level of machine language is assembly language, and the program that completes assembly language translation is called assembler
  6. High-level language level: The machine language at this level is a variety of high-level languages, and compilers are usually used to complete high-level language translation work
  7. Application language level: This level is specially designed to make the computer meet a certain purpose. Therefore, the machine language at this level is a variety of problem-oriented application languages.

Computer system foundation --- assembly line

  1. Pipeline cycle: 3t
  2. The throughput rate of the pipeline is: number of instructions/pipeline execution time.
  3. The theoretical formula for calculating pipeline execution time is: sequential execution time of the first instruction + (number of instructions - 1) * cycle.
  4. The reciprocal of the pipeline's maximum throughput pipeline cycle
  5. Pipeline speedup = Execution time without pipeline/Execution time with pipeline

Multi-level storage structure:

  1. Content-based access is the most basic feature of associative storage, and Cache is a very classic associative storage.
  2. The mapping between Cache and main memory is done by hardware, and its purpose is to increase the speed.

Computer composition and architecture --- Cache

  1. Random algorithm (Random algorithm RAND). This is the simplest replacement algorithm. The random method completely ignores the past, present, and future usage of the Cache block, and simply selects a block to replace it based on a random number.
  2. First in first out (First In First Out FIFO) algorithm. The order of elimination is determined by the order of transfer into the Cache, that is, when an update is required, the block that first enters the Cache is used as the replaced block. This method requires a record for each block, recording the order in which they entered the cache. This method is easy to implement, and the system overhead is small. Its disadvantage is that some frequently used program blocks (such as cycle programs) may be replaced.
  3. Least Recenlty Used LRU (Least Recenlty Used LRU) algorithm. The LRU algorithm uses the least recently used block of the cup as the replaced block. This replacement method needs to record the usage of each block in the cache at any time, so as to determine which block is the least recently used block. The LRU algorithm is relatively reasonable, but it is more complicated to implement and has a large system overhead. It is usually necessary to set a hardware or software calculator called an "age counter" for each block to record its usage.
  4. The least frequently used page replacement (Least Frequently used LFU) algorithm requires that the page with the smallest number of references be replaced during page replacement, because the page that is frequently used should have a larger number of references. However, some pages are used a lot at the beginning, but will not be used later. Such pages will remain in the memory for a long time, so the reference calculation register can be shifted to the right by one bit at regular intervals to form an exponentially decaying average number of uses. The complexity and counter size of LFU are larger than that of LRU. LRU only pays attention to the recent visits, while LFU will count the accumulated visits as the basis for elimination.

Operating system knowledge---device management

The time to access a database should be: seek time + rotation delay time + transmission time.

According to the meaning of the question: the rotation delay time and transmission time of each block need 102ms in total, and it takes 10ms for the head to move from one track to another, but the average distance between logically adjacent databases is 10 tracks, that is, after reading a data block to The seek time to the next database takes 100ms. That is, the time to access a database should be 202ms. Therefore, it takes 100*202=20200 to read 100 files;

Computer system basics---disk management:

When a process requests to read a disk, the operating system first performs arm shift scheduling and then spin scheduling. Then according to the sector number from small to large;

Computer composition and architecture---disk storage

Basic knowledge of system disk optimization: the system read record is 33/11=3ms. In the first case, after the system reads and processes the record R0, it will go to the beginning of the record R2, so in order to read the record R1, the disk must make another revolution, which takes 33ms (30ms to the beginning of R1, 3ms to finish reading R1, the time for exactly one turn) This one, the total time to process 11 records is 366ms, because the time to process the first 10 records (ie R0;;;R9) is 10*(33+3)=360ms, read The time for recording R10 and processing record R10 is 6ms, so the total time for processing 11 records=360ms+6ms=36ms.

The second case: if the information distribution is optimized, when the record R0 is read out and the recording ends, the magnetic head just rotates to the beginning of the R1 record, and R1 can be read and processed immediately, so the total number of 11 records processed The time is: 11* (3 read records + 3 processing records) = 66ms

System Configuration and Performance Evaluation---Performance Evaluation

  1. Real programs, kernel programs, small benchmark programs, synthetic benchmark programs. The evaluation accuracy is in descending order. Among them, the most accurate evaluation is the real program. The most frequently used part of the core program in the application program is used as the standard program for evaluating the performance of the computer system, which is called the benchmark test program. Benchmark program method is a better method for testing system performance that is unanimously recognized at present.

Operating system---deadlock and banker's algorithm

The condition that the system will not cause deadlock is: the total number of system resources >= the number of processes * (the number of resources required by each process - 1) + 1

Bring in the formula: the total number of system resources >=5*(3-1)+1, that is to say, the total number of system resources must be at least 11 in order for the system to avoid deadlock.

Operating system --- process resource map

In the figure, R1 and R2 represent resources, and P1-P3 represent processes. The arrow pointing from the resource to the process indicates that a resource is allocated to the process, and the arrow pointing from the process to the resource indicates that the process wants to apply for this resource (note that each arrow only represents a resource or a resource request). For example, R1 has a total of 2 resources, and allocates one of these two resources to P1 and the other to P3, and P2 applies for one resource from R1 at this time.

Let's start to analyze the blocking point. The so-called blocking point is to start executing from this process, which will cause the program to fall into a deadlock and fail to execute.

  1. Try to execute P1 first: P1 has applied for a resource from R2. R2 has a total of 3 resources, 2 of which have been allocated, and 1 is left, so he can satisfy P1's application and allocate resources to P1. After P1 allocates resources, it can complete the execution and release all the resources it occupies. The following P2 and P3 can be executed, so P1 is a non-blocking point.
  2. Try to execute P2 first: P2 has applied for a resource from R1. R1 has a total of 2 resources, and all of them have been allocated. Therefore, the current resource application of P2 cannot be satisfied. Since it cannot be satisfied, it cannot be executed naturally, which is the blocking point.
  3. Try to execute P3 first: P3 applies for 1 resource from R2. R2 has a total of 3 resources, 2 of which have been allocated, and 1 is left, so he can satisfy P3's application and allocate resources to P3. After P3 allocates resources, it can complete the execution and release all the resources it occupies. The following P1 and P2 can be executed, so P3 is a non-blocking point.

Embedded system---embedded processor

  1. The Harvard structure is a memory structure that separates program instruction storage and data storage. The Harvard structure is a parallel architecture. Its main feature is that the program and data are stored in different storage spaces, that is, the program memory and the data memory are two independent memories, and each memory is independently addressed and accessed independently.
  2. Corresponding to the two memories are the 4 buses of the system: the data bus and the address bus of the program and data. This separation of program bus and data bus allows instruction words (from program memory) and operands (from data memory) to be obtained simultaneously within one machine cycle, thereby increasing execution speed and data throughput. And because the program and data are stored in two separate physical spaces, address fetching and execution can be completely separated and overlapped. The central processing unit first reads the content of the program instruction in the program instruction memory, and obtains the data address after decoding, and then reads the data in the corresponding data memory, and performs the next operation (usually execution). Program instruction storage and data storage are separated, allowing instructions and data to have different data widths.
  3. The Harvard architecture can simultaneously obtain instruction words and operands within one machine cycle, but cannot access memory multiple times within one machine cycle.

Embedded system---bus and interface

IEEE-1394 can usually connect 63 devices in a tree or daisy chain topology. These 63 devices can be connected to other buses. Now each 1394 device supports 1023 bridge buses to connect with other nodes. Interconnect 63*1023=64449 nodes.

Embedded Systems:

  1. According to the system's sensitivity to time, embedded systems can be divided into: embedded systems, embedded real-time systems, strong real-time systems, and weak real-time systems.
  2. From the perspective of security requirements, embedded systems can be divided into: safety-critical systems, non-safety-critical systems

Features of embedded operating systems:

The embedded operating system runs in the embedded smart chip environment, and performs unified coordination, processing, command and control of the entire smart chip and the various components and devices it operates and controls.

  1. miniaturization. From the perspective of performance and cost, it is hoped to occupy less resources and less system code, such as less memory, short word length, limited running speed, and less energy (using tiny batteries)
  2. Customizable: In consideration of reducing costs and shortening the R&D cycle, it is required that the embedded operating system map can run on different microprocessors, and can be configured structurally and functionally according to hardware changes to meet different application requirements
  3. Real-time: Embedded operating systems are mainly used in process control, data acquisition, transmission communication, multimedia information, and occasions that require rapid response in key areas, so the requirements for real-time are high
  4. Reliability: System components, modules, and architecture must achieve proper reliability, and fault-tolerant and fail-safe measures must be provided for critical applications
  5. Ease of portability: In order to improve the portability of the system, the underlying design technology of the hardware abstraction layer (HardWare Abstraction Level HAL) and the board support package (Board Support Package BSP) is usually used

Embedded system --- process scheduling

  1. For multi-core CPUs, optimizing the operating system task scheduling algorithm is the key to ensuring efficiency. General task scheduling algorithms include global queue scheduling and local queue scheduling.
    1. The global task scheduling algorithm means that the operating system maintains a global task waiting queue. When a CPU core is idle in the system, the operating system selects a ready task from the global task waiting queue to start executing on this core. The advantage of this approach is high CPU core utilization.
    2. Partial task scheduling algorithm: It means that the operating system maintains a local task waiting queue for each CPU core. When a CPU core is idle in the system, it selects the appropriate task from the core's task waiting queue for execution. This method The advantage is that the task basically does not need to switch between multiple CPU cores, which is conducive to improving the local cache hit rate of the CPU core.
    3. At present, most multi-core CPU operating systems use a task scheduling algorithm based on global queues.

Database system --- database schema

  1. The database usually adopts a three-level module structure, in which the view corresponds to the external mode, the basic table corresponds to the mode, and the storage file corresponds to the internal mode
  2. The independence of data is guaranteed by the secondary image function of DBMS, and the independence of data includes the physical independence of data and the logical independence of data.
    1. Physical independence of data: When the internal schema of the database changes, the logical structure of the data remains unchanged. In order to ensure that the program can run correctly, it is necessary to modify the image of the conceptual mode and the internal mode.
    2. The logical independence of data means that the user's application program and the logical structure of the database are independent of each other. After the logical structure of the data changes, the user program does not need to be modified. However, in order to ensure that the application can run correctly, it is necessary to modify the image between the external module and the conceptual model.

The writing of the index modifies the physical structure of the database, not the simple logical design. The internal mode specifies the physical organization of data on the storage medium and the record addressing mode.

The meaning of two-phase commit writing is governed by the following two rules:

  1. If only one participant withdraws a transaction, the coordinator must make a global withdrawal decision.
  2. The coordinator can only make a global commit decision if all participants agree to commit the transaction.

Database system---relational algebra

Natural connection, mainly on the left side, remove duplicate columns

Database System---Normalization Theory

  1. To solve this kind of problem, it is more appropriate to use the graphical method. The following is the diagram drawn by the graphical method:

A and D are nodes with zero in-degree, and they must be part of the candidate key. But only A and D can't act as candidate keys, so other attributes need to be added; after adding B, ABD can traverse the whole graph and act as a candidate key; after adding C, ACD can also traverse the whole graph, so both ABD and ACD are candidate key.

After finding the candidate key, all attributes including any candidate key are the main attributes, so ABCD is the main attribute

Database system---database security control

The grant and revoke statements are used in SQL to grant or revoke the operation authority to the data from the user.

The grant statement grants permissions to the user, and the revoke statement revokes the permissions already granted to the user.

The general format of the grant statement is:

grant "authority" on "object name" to "user" with grant option

With grant option means: granting and canceling permissions are cascaded. For example, when using with grant option for object authorization, the granted user can also grant secondary object permissions to other users or roles, but the administrator withdraws the with grant option When an authorized user object permission is granted, the permission becomes invalid due to propagation. And with public can assign permissions to all users

Database system---concurrency control

  1. Integrity refers to the correctness and compatibility of the database, and it prevents legal users from adding semantically inconsistent data to the database when using the database. Ensure that the data is correct and avoid illegal updates. The concurrency control in the question stem refers to that in a system shared by multiple users, many users may operate on the same data at the same time, so illegal updates must be avoided to ensure that the integrity is not damaged.

Data control functions include the control of the security, integrity, concurrency and recovery of data in the database. in:

  1. Security (security) refers to protecting the database from malicious access, that is, preventing data leakage, alteration or destruction caused by illegal use. In this way, users can only process data according to the regulations. For example, different permissions are divided. Some users can only have the permission to read data, and some users have the permission to modify data. Users can only be within the scope of specified permissions. Manipulate the database.
  2. Integrity refers to the correctness and compatibility of the database. It prevents legal users from adding semantically inconsistent data to the database when using the database, ensures that the data in the database is correct, and avoids illegal updates.
  3. Concurrency control means that in a system shared by multiple users, many users may operate on the same data at the same time. The concurrency control subsystem of the DBMS is responsible for coordinating the execution of concurrent transactions, ensuring that the integrity of the database is not damaged, and preventing users from obtaining incorrect data.
  4. The four types of failures in the recovery from failure database are internal transaction failures, system failures, media failures, and computer viruses. Fault recovery mainly refers to recovering the database itself, that is, restoring the database to a correct state or a consistent state after the fault causes the current state of the database to be inconsistent. The principle of recovery is very simple, that is, to establish redundant data (redundancy)

Computer network---tcp, ip protocol family

E-mail protocols usually include smtp and pop3, where smtp is an e-mail sending protocol and pop3 is an e-mail receiving protocol

  1. MIME, Multipurpose Internet Mail Extensions, is an Internet standard that extends the email standard to support; non-ascii character text; attachments in non-text format (binary, sound, image, etc.); message bodies consisting of multiple parts ; header information containing non-acsii characters (header infromation)
  2. The pop3 protocol allows email clients to download emails on the server, but perform operations on the client side (such as moving emails, marking them as read, etc.). It will not be fed back to the server. For example, if one of the emails is received by the client and moved to another folder, these emails on the mailbox server will not be moved at the same time.
  3. The operation of the IMAP client will be fed back to the server, and the operation on the mail will also be performed correspondingly on the mail on the server.

The role of the DNS protocol: to resolve the domain name (URL) into an IP address, this process is called DNS domain name resolution. The client sends a domain name query request to the DNS server; then the DNS server informs the client of the IP address of the Web server; finally, the client communicates with the Web server.

The ARP protocol resolves the IP address into a MAC address;

There is currently no clear protocol for resolving hostnames to IP addresses.

Guess you like

Origin blog.csdn.net/qq_25580555/article/details/129789364