主頁 >  其他 > 自己撰寫平滑加權輪詢演算法,實作反向代理集群服務的平滑分配

自己撰寫平滑加權輪詢演算法,實作反向代理集群服務的平滑分配

2022-04-15 07:49:01 其他

學會了負載均衡演算法,卻沒有用起來?

今天就來實戰一遍,感受下平滑加權輪詢演算法的魅力,

通過Java語言,自己撰寫的平滑加權輪詢演算法,結合執行緒池和Socket 網路編程等,實作了反向代理集群服務的平滑分配,并通過降權/提權實作宕機服務的”剔除“和緩沖恢復,

1.理解全程序

1.1.概述

需要具備的知識

  • Socket網路編程
  • 反向代理的理解
  • 平滑加權輪詢演算法的理解
  • 執行緒池的理解

目的:實作Socket 集群服務的平滑加權輪詢負載,

業務實作:客戶端通過用戶名來查詢集群服務中的用戶資訊,

1.2.整個流程

  1. 客戶端發起Socket請求給反向代理的Socket服務(客戶端并不知道服務端是反向代理服務器)
  2. 反向代理服務器接收到Socket服務請求
  3. 執行緒池開啟服務執行緒去處理請求
  4. 執行緒服務通過平滑加權輪詢演算法尋找當前權重最高的下游服務
  5. 通過負載均衡演算法回傳的服務節點資訊來創建Socket請求
  6. 反向代理服務器使用客戶端信息,發起Socket請求給下游服務
  7. Socket集群服務節點收到Socket請求,查詢用戶資訊,再將處理結果回傳給反向代理服務器
  8. 反向代理服務器再將結果回傳給客戶端,

image

幾個細節點

  • 使用反向代理服務,對客戶端無感,客戶端并不知道具體訪問了哪個真實服務器;
  • 反向代理服務器每次訪問下游服務失敗時,就會降低該下游服務器器的有效權重;每次訪問下游服務成功時,就會提高該下游服務器的有效權重(不超過配置的權重值);
  • 平滑加權輪詢演算法會對宕機服務降權和提權,起到”剔除“宕機服務和緩沖恢復宕機服務的效果;
  • 反向代理服務器重啟后,所有配置恢復為配置引數;
  • 反向代理服務器使用執行緒池發布Socket服務,支持多個客戶端同時請求同時分發,

2.代碼實作

2.1.節點類

用于保存服務節點相關資訊

package com.yty.proxy.lba;


public class Node implements Comparable<Node>{
    private String ip;
    private Integer port;
    private final Integer weight;
    private Integer effectiveWeight;
    private Integer currentWeight;
    // 默認權重為:1
    public Node(String ip,Integer port){
        this(ip,port,1);
    }

    public Node(String ip,Integer port, Integer weight){
        this.ip = ip;
        this.port = port;
        this.weight = weight;
        this.effectiveWeight = weight;
        this.currentWeight = weight;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Integer getWeight() {
        return weight;
    }

    public Integer getEffectiveWeight() {
        return effectiveWeight;
    }

    public void setEffectiveWeight(Integer effectiveWeight) {
        this.effectiveWeight = effectiveWeight;
    }

    public Integer getCurrentWeight() {
        return currentWeight;
    }

    public void setCurrentWeight(Integer currentWeight) {
        this.currentWeight = currentWeight;
    }
    // 每成功一次,恢復有效權重1,不超過配置的起始權重
    public void onInvokeSuccess(){
        if(effectiveWeight < weight) effectiveWeight++;
    }
    // 每失敗一次,有效權重減少1,無底線的減少
    public void onInvokeFault(){
        effectiveWeight--;
    }

    @Override
    public int compareTo(Node node) {
        return currentWeight > node.currentWeight ? 1 : (currentWeight.equals(node.currentWeight) ? 0 : -1);
    }

    @Override
    public String toString() {
        return "Node{" +
                "ip='" + ip + '\'' +
                ", port=" + port +
                ", weight=" + weight +
                ", effectiveWeight=" + effectiveWeight +
                ", currentWeight=" + currentWeight +
                '}';
    }
}

2.2.代理配置類

一般都是放在組態檔中配置,然后讀取指定key的組態檔資訊來完成配置,模擬為了簡單就直接寫代碼里了,

package com.yty.proxy;

import com.yty.proxy.lba.Node;

import java.util.ArrayList;
import java.util.List;

public class ProxyConfig {

    private static List<Node> nodes = new ArrayList<>();
    // 在組態檔中讀取:節點集合資訊,如果在同一臺服務器測驗,那就將ip配成一樣
    static {
        nodes.add(new Node("192.168.233.100",8001,2));
        nodes.add(new Node("127.0.0.1",8002,5));
        nodes.add(new Node("127.0.0.1",8003,3));
    }
    public static List<Node> getProxyConfig(){
        return nodes;
    }
}

2.3.負載均衡演算法介面

package com.yty.proxy.lba;

public interface Robin {

    Node selectNode();
}

2.4.平滑加權輪詢演算法

詳細介紹可以閱讀前兩篇負載均衡演算法的文章

package com.yty.proxy.lba;

import com.yty.proxy.ProxyConfig;
import java.util.List;

/**
 * 加權輪詢演算法:平滑加權輪詢演算法
 */
public class WeightedRoundRobin implements Robin {

    private static List<Node> nodes;
    // 讀取配置資訊
    static {
        nodes = ProxyConfig.getProxyConfig();
    }
    /**
     * 按照當前權重(currentWeight)最大值獲取IP
     * @return Node
     */
    public Node selectNode(){
        if (nodes ==null || nodes.size()<=0) return null;
        if (nodes.size() == 1)  return nodes.get(0);

        // 權重之和
        Integer totalWeight = 0;
        for(Node node : nodes){
            totalWeight += node.getEffectiveWeight();
        }

        synchronized (nodes){
            // 選出當前權重最大的節點
            Node nodeOfMaxWeight = null;
            for (Node node : nodes) {
                if (nodeOfMaxWeight == null)
                    nodeOfMaxWeight = node;
                else
                    nodeOfMaxWeight = nodeOfMaxWeight.compareTo(node) > 0 ? nodeOfMaxWeight : node;
            }
            // 平滑負載均衡
            nodeOfMaxWeight.setCurrentWeight(nodeOfMaxWeight.getCurrentWeight() - totalWeight);
            nodes.forEach(node -> node.setCurrentWeight(node.getCurrentWeight()+node.getEffectiveWeight()));
            return nodeOfMaxWeight;
        }
    }

}

2.5.代理服務執行緒類

用于處理代理服務請求的執行緒類,不同請求創建不同執行緒來處理

package com.yty.proxy;

import java.io.*;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class ProxyServerThread implements Runnable {
    private Socket proxySocket;
    private OutputStream proxyOut;
    private InputStream proxyIn;
    private Socket socket;
    private OutputStream serverOut;
    private InputStream serverIn;
    public ProxyServerThread(Socket proxySocket) throws IOException {
        this.proxySocket = proxySocket;
        this.proxySocket.setSoTimeout(6000);
        this.proxyOut = proxySocket.getOutputStream();
        this.proxyIn = proxySocket.getInputStream();
    }

    @Override
    public void run() {
        try {
            this.proxyService();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            this.close();
        }
    }

    private void proxyService() throws IOException {
        // 代理接收客戶端請求
        byte[] proxyDataBytes =null;
        proxyDataBytes = getData(proxyIn);
        System.out.println("代理收到請求資料:"+new String(proxyDataBytes));
        if (proxyDataBytes == null){
            proxyOut.write("請求內容例外".getBytes());
        }

        byte[] serverData = https://www.cnblogs.com/dennyLee2025/archive/2022/04/15/this.dispatcherService(proxyDataBytes);

        // 代理回應客戶端
        assert serverData != null;
        proxyOut.write(serverData);
        proxySocket.shutdownOutput();
        System.out.println("代理回應客戶端資料:"+new String(proxyDataBytes));
    }

    private byte[] dispatcherService(byte[] proxyDataBytes){
        // 選擇節點:發送請求和接收回應資訊
        Robin wrr = new WeightedRoundRobin();
        Node node = wrr.selectNode();
        byte[] serverData = https://www.cnblogs.com/dennyLee2025/archive/2022/04/15/null;
        try {
            this.socket = new Socket(node.getIp(), node.getPort());
            socket.setSoTimeout(6000);
            serverIn = socket.getInputStream();
            serverOut= socket.getOutputStream();
            serverOut.write(proxyDataBytes);
            socket.shutdownOutput();
            serverData = getData(serverIn);
            System.out.println("真實服務端回應資料:"+ new String(serverData));
            node.onInvokeSuccess();//提權
        } catch (IOException e) {
            node.onInvokeFault();//降權
            serverData = "https://www.cnblogs.com/dennyLee2025/archive/2022/04/15/代理的下游服務器例外".getBytes();
        }
        System.out.println("負載均衡到:" + node);
        return serverData;
    }

    private byte[] getData(InputStream in) throws IOException {
        List<Byte> byteList = new ArrayList<>();
        int temp = -1;
        while (true) {
            temp = in.read();
            if (temp != -1)
                byteList.add((byte) temp);
            else
                break;
        }
        byte[] bytes = new byte[byteList.size()];
        for (int i=0;i<byteList.size();i++){
            bytes[i]=byteList.get(i);
        }
        return bytes;
    }

    private void close() {
        try {
            if (proxySocket!=null){
                proxySocket.shutdownInput();
                proxySocket.close();
            }
            if (socket!=null){
                socket.shutdownInput();
                socket.close();
            }
        }catch (IOException e){
            e.printStackTrace();
            System.out.println("代理服務關閉socket資源例外");
        }
    }
}

2.6.代理服務類

通過執行緒池來管理代理服務執行緒,不同的請求分發到不同執行緒處理,這里用的是newCachedThreadPool 執行緒池,

代理服務器在本地啟動,這里也可以新建一個類來啟動服務,這樣可以啟動多個代理服務,這里為了簡單就直接在本類的main方法啟動,可以對比后面的業務服務類,業務服務類就是這么起的,因為要放到不同的服務器啟動業務服務,

package com.yty.proxy;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ProxyServer {
    private final Integer port;
    private ServerSocket serverSocket;
    public ProxyServer(Integer port) {
        this.port = port;
    }

    public void start(){
        ExecutorService threadPool = Executors.newCachedThreadPool();
        try {
            serverSocket = new ServerSocket(port);
            while (true){
                Socket socket = serverSocket.accept();
                threadPool.execute(new ProxyServerThread(socket));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }


    public static void main(String[] args) {
        Integer proxyPort=8000;
        ProxyServer proxyServer = new ProxyServer(proxyPort);
        System.out.println("開啟代理服務……");
        proxyServer.start();
    }
}

2.7.業務物體類

package com.yty.proxy.server;

public class MyUser {
    private String name;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public MyUser(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public MyUser() {
    }

    @Override
    public String toString() {
        return "{" +"name='" + name + '\'' + ", age=" + age + '}';
    }
}

2.8.業務類

處理具體業務的類,通過用戶名稱簡單獲取資訊

package com.yty.proxy.server;

import java.util.ArrayList;
import java.util.List;

public class MyUserService {
    private static List<MyUser> list = new ArrayList<>();

    static{
        list.add(new MyUser("張三",18));
        list.add(new MyUser("張三豐",38));
        list.add(new MyUser("小白",18));
    }
    public MyUser findByUsername(String username){
        for (MyUser user:list){
            if (user.getName().equals(username)){
                return user;
            }
        }
        return null;
    }
}

2.9.業務服務執行緒類

用于處理業務服務請求的執行緒類,不同請求創建不同執行緒來處理

package com.yty.proxy.server;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class SocketServerThread implements Runnable {
    private Socket socket;
    private OutputStream serverOut;
    private InputStream serverIn;
    public SocketServerThread(Socket socket) throws IOException {
        this.socket = socket;
        socket.setSoTimeout(6000);
        this.serverOut = socket.getOutputStream();
        this.serverIn = socket.getInputStream();
    }

    @Override
    public void run() {
        try {
            this.service();
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            this.close();
        }
    }
    private void service() throws IOException {
        // 接收客戶端請求
        byte[] dataBytes =null;
        dataBytes = getData(serverIn);
        if (dataBytes == null){
            serverOut.write("請求內容例外".getBytes());
        }
        String username = new String(dataBytes);
        System.out.println("收到請求資料:"+username);

        // 具體業務代碼
        MyUserService myUserService = new MyUserService();
        MyUser user = myUserService.findByUsername(new String(dataBytes));
        String serverData = "https://www.cnblogs.com/dennyLee2025/archive/2022/04/15/沒有查詢到用戶" + username + "的資料";
        if(user!=null){
            serverData = https://www.cnblogs.com/dennyLee2025/archive/2022/04/15/user.toString();
            serverOut.write(user.toString().getBytes());
        }
        System.out.println("回應客戶端資料:" + serverData);
    }

    private byte[] getData(InputStream in) throws IOException {
        List<Byte> byteList = new ArrayList<>();
        int temp = -1;
        while (true) {
            temp = in.read();
            if (temp != -1)
                byteList.add((byte) temp);
            else
                break;
        }
        byte[] bytes = new byte[byteList.size()];
        for (int i=0;i<byteList.size();i++){
            bytes[i]=byteList.get(i);
        }
        return bytes;
    }

    private void close() {
        try {
            if (socket!=null){
                socket.shutdownInput();
                socket.shutdownOutput();
                socket.close();
            }
        }catch (IOException e){
            e.printStackTrace();
            System.out.println("服務關閉socket資源例外");
        }
    }
}

2.10.業務服務類

通過執行緒池來管理業務服務執行緒,不同的請求分發到不同執行緒處理,這里用的也是newCachedThreadPool 執行緒池,

package com.yty.proxy.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class SocketServer {
    private final Integer port;
    private ServerSocket serverSocket;
    private Integer threads = 3;


    public SocketServer(Integer port) {
        this.port = port;
    }

    public void start(){
        ExecutorService threadPool = Executors.newFixedThreadPool(threads);
        try {
            serverSocket = new ServerSocket(port);
            while (true){
                Socket socket = serverSocket.accept();
                threadPool.execute(new SocketServerThread(socket));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}

2.11.啟動三個業務服務(服務集群)

本次測驗是分在兩臺服務器測驗,1臺【192.168.233.100】、另外都是本地【127.0.0.1】,如果覺得麻煩,那就都配成本地【127.0.0.1】,然后起服務都在本地起,

服務1:在IP為192.168.233.100 的服務器啟動

package com.yty.proxy.test;
import com.yty.proxy.server.SocketServer;
public class StartServer1 {
    public static void main(String[] args) {
        System.out.println("開啟后端服務8001……");
        new SocketServer(8001).start();
    }
}

服務2:在本地服務器啟動

package com.yty.proxy.test;
import com.yty.proxy.server.SocketServer;
public class StartServer2 {
    public static void main(String[] args) {
        System.out.println("開啟后端服務8002……");
        new SocketServer(8002).start();
    }
}

服務3:在本地服務器啟動

package com.yty.proxy.test;
import com.yty.proxy.server.SocketServer;
public class StartServer3 {
    public static void main(String[] args) {
        System.out.println("開啟后端服務8003……");
        new SocketServer(8003).start();
    }
}

2.12.客戶端

package com.yty.proxy.test;

import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;

public class Client {
    public static void main(String[] args) throws IOException {
        String ip = "127.0.0.1";
        int port = 8000;
        Socket socket = new Socket(ip, port);
        socket.setSoTimeout(6000);
        OutputStream out = socket.getOutputStream();
        InputStream in = socket.getInputStream();
        // 發送資料
        out.write("小白".getBytes());
        out.flush();
        socket.shutdownOutput();
        // 讀取資料
        byte[] data = https://www.cnblogs.com/dennyLee2025/archive/2022/04/15/new Client().getData(in);
        System.out.println("回應資料:"+new String(data));
        out.close();
    }

    private byte[] getData(InputStream in) throws IOException {
        BufferedInputStream bin = new BufferedInputStream(in);
        List<Byte> byteList = new ArrayList<>();
        while (true) {
            int temp = bin.read();
            if (temp != -1)
                byteList.add((byte) temp);
            else
                break;
        }
        byte[] bytes = new byte[byteList.size()];
        for (int i=0;i<byteList.size();i++){
            bytes[i]=byteList.get(i);
        }
        return bytes;
    }
}

3.開始測驗

3.1.啟動所有服務

在代理配置類(ProxyConfig)中指定的服務器啟動三個業務服務;

在你喜歡的服務器中啟動代理服務(ProxyServer),這里在本地啟動【127.0.0.1】;

客戶端在本地測驗咯(IP必須是代理服務器的IP,這里測驗的代理服務器IP是【127.0.0.1】,

所有服務啟動后的截圖:

image

3.2.客戶端發起第一次請求

正常命中權重最高的節點2服務:節點資訊在代理服務器中列印出來了【127.0.0.1、8002】,這些日志資訊正常情況是寫入到日志檔案,這里只在控制臺列印出來,

image

3.3.客戶端發起第二次請求

改了用戶名再請求試試,發現忘記列印請求資料了……

第二次命中節點3服務,跟平滑加權演算法預定的結果一樣,

image

3.4.客戶端發起第三次請求

這次命中了節點2:192.168.233.100,8001的服務,到此可以看到平滑加權輪詢演算法正常運作中,

image

3.5.客戶端發起第四次請求(測驗降權)

通過平滑加權輪詢演算法運算,我們知道這次肯定命中節點2服務,所以,在發起請求前,先關閉節點2服務,再由客戶端發起請求,

image

細心的應該發現,有效權重沒變小啊,是不是降權有問題?

其實不是,是列印資訊的位置沒放對……,要在下次訪問才可以看到上一次的降權結果,額,有點呆(上面的代碼我已經改了),

image

3.6.客戶端發起第N次請求(測驗提權)

先把宕機的服務啟動起來,然后多測驗幾次,看看測驗結果,可以看到,權重降低后又提起來了,說明測驗提權成功,

image

還有兩個點沒測:第一個是一直降權后,會不會出現宕機的服務不再分配到?這就起到”剔除“宕機服務的效果?第二個是服務恢復后,會不會出現宕機再起的服務需要慢慢恢復權重,直到一定值后才可以分配到?

4.結論

使用自己撰寫的平滑加權輪詢演算法,結合執行緒池和Socket 網路編程等,實作了反向代理集群服務的平滑分配,并通過降權/提權實作宕機服務的”剔除“和緩沖恢復,

image

Java實作平滑加權輪詢演算法--降權和提權

Java實作負載均衡演算法--輪詢和加權輪詢

Java往期文章

Java全堆疊學習路線、學習資源和面試題一條龍

我心里優秀架構師是怎樣的?

免費下載經典編程書籍

更多優質文章,請關注WX公眾號:Java全堆疊布道師

image

原創不易,三聯支持!!!

轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/458229.html

標籤:其他

上一篇:【深度學習 論文篇 02-1 】YOLOv1論文精讀

下一篇:博客生涯的反思

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 網閘典型架構簡述

    網閘架構一般分為兩種:三主機的三系統架構網閘和雙主機的2+1架構網閘。 三主機架構分別為內端機、外端機和仲裁機。三機無論從軟體和硬體上均各自獨立。首先從硬體上來看,三機都用各自獨立的主板、記憶體及存盤設備。從軟體上來看,三機有各自獨立的作業系統。這樣能達到完全的三機獨立。對于“2+1”系統,“2”分為 ......

    uj5u.com 2020-09-10 02:00:44 more
  • 如何從xshell上傳檔案到centos linux虛擬機里

    如何從xshell上傳檔案到centos linux虛擬機里及:虛擬機CentOs下執行 yum -y install lrzsz命令,出現錯誤:鏡像無法找到軟體包 前言 一、安裝lrzsz步驟 二、上傳檔案 三、遇到的問題及解決方案 總結 前言 提示:其實很簡單,往虛擬機上安裝一個上傳檔案的工具 ......

    uj5u.com 2020-09-10 02:00:47 more
  • 一、SQLMAP入門

    一、SQLMAP入門 1、判斷是否存在注入 sqlmap.py -u 網址/id=1 id=1不可缺少。當注入點后面的引數大于兩個時。需要加雙引號, sqlmap.py -u "網址/id=1&uid=1" 2、判斷文本中的請求是否存在注入 從文本中加載http請求,SQLMAP可以從一個文本檔案中 ......

    uj5u.com 2020-09-10 02:00:50 more
  • Metasploit 簡單使用教程

    metasploit 簡單使用教程 浩先生, 2020-08-28 16:18:25 分類專欄: kail 網路安全 linux 文章標簽: linux資訊安全 編輯 著作權 metasploit 使用教程 前言 一、Metasploit是什么? 二、準備作業 三、具體步驟 前言 Msfconsole ......

    uj5u.com 2020-09-10 02:00:53 more
  • 游戲逆向之驅動層與用戶層通訊

    驅動層代碼: #pragma once #include <ntifs.h> #define add_code CTL_CODE(FILE_DEVICE_UNKNOWN,0x800,METHOD_BUFFERED,FILE_ANY_ACCESS) /* 更多游戲逆向視頻www.yxfzedu.com ......

    uj5u.com 2020-09-10 02:00:56 more
  • 北斗電力時鐘(北斗授時服務器)讓網路資料更精準

    北斗電力時鐘(北斗授時服務器)讓網路資料更精準 北斗電力時鐘(北斗授時服務器)讓網路資料更精準 京準電子科技官微——ahjzsz 近幾年,資訊技術的得了快速發展,互聯網在逐漸普及,其在人們生活和生產中都得到了廣泛應用,并且取得了不錯的應用效果。計算機網路資訊在電力系統中的應用,一方面使電力系統的運行 ......

    uj5u.com 2020-09-10 02:01:03 more
  • 【CTF】CTFHub 技能樹 彩蛋 writeup

    ?碎碎念 CTFHub:https://www.ctfhub.com/ 筆者入門CTF時時剛開始刷的是bugku的舊平臺,后來才有了CTFHub。 感覺不論是網頁UI設計,還是題目質量,賽事跟蹤,工具軟體都做得很不錯。 而且因為獨到的金幣制度的確讓人有一種想去刷題賺金幣的感覺。 個人還是非常喜歡這個 ......

    uj5u.com 2020-09-10 02:04:05 more
  • 02windows基礎操作

    我學到了一下幾點 Windows系統目錄結構與滲透的作用 常見Windows的服務詳解 Windows埠詳解 常用的Windows注冊表詳解 hacker DOS命令詳解(net user / type /md /rd/ dir /cd /net use copy、批處理 等) 利用dos命令制作 ......

    uj5u.com 2020-09-10 02:04:18 more
  • 03.Linux基礎操作

    我學到了以下幾點 01Linux系統介紹02系統安裝,密碼啊破解03Linux常用命令04LAMP 01LINUX windows: win03 8 12 16 19 配置不繁瑣 Linux:redhat,centos(紅帽社區版),Ubuntu server,suse unix:金融機構,證券,銀 ......

    uj5u.com 2020-09-10 02:04:30 more
  • 05HTML

    01HTML介紹 02頭部標簽講解03基礎標簽講解04表單標簽講解 HTML前段語言 js1.了解代碼2.根據代碼 懂得挖掘漏洞 (POST注入/XSS漏洞上傳)3.黑帽seo 白帽seo 客戶網站被黑帽植入劫持代碼如何處理4.熟悉html表單 <html><head><title>TDK標題,描述 ......

    uj5u.com 2020-09-10 02:04:36 more
最新发布
  • 2023年最新微信小程式抓包教程

    01 開門見山 隔一個月發一篇文章,不過分。 首先回顧一下《微信系結手機號資料庫被脫庫事件》,我也是第一時間得知了這個訊息,然后跟蹤了整件事情的經過。下面是這起事件的相關截圖以及近日流出的一萬條資料樣本: 個人認為這件事也沒什么,還不如關注一下之前45億快遞資料查詢渠道疑似在近日復活的訊息。 訊息是 ......

    uj5u.com 2023-04-20 08:48:24 more
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:47:46 more
  • vulnhub_Earth

    前言 靶機地址->>>vulnhub_Earth 攻擊機ip:192.168.20.121 靶機ip:192.168.20.122 參考文章 https://www.cnblogs.com/Jing-X/archive/2022/04/03/16097695.html https://www.cnb ......

    uj5u.com 2023-04-20 07:46:20 more
  • 從4k到42k,軟體測驗工程師的漲薪史,給我看哭了

    清明節一過,盲猜大家已經無心上班,在數著日子準備過五一,但一想到銀行卡里的余額……瞬間心情就不美麗了。最近,2023年高校畢業生就業調查顯示,本科畢業月平均起薪為5825元。調查一出,便有很多同學表示自己又被平均了。看著這一資料,不免讓人想到前不久中國青年報的一項調查:近六成大學生認為畢業10年內會 ......

    uj5u.com 2023-04-20 07:44:00 more
  • 最新版本 Stable Diffusion 開源 AI 繪畫工具之中文自動提詞篇

    🎈 標簽生成器 由于輸入正向提示詞 prompt 和反向提示詞 negative prompt 都是使用英文,所以對學習母語的我們非常不友好 使用網址:https://tinygeeker.github.io/p/ai-prompt-generator 這個網址是為了讓大家在使用 AI 繪畫的時候 ......

    uj5u.com 2023-04-20 07:43:36 more
  • 漫談前端自動化測驗演進之路及測驗工具分析

    隨著前端技術的不斷發展和應用程式的日益復雜,前端自動化測驗也在不斷演進。隨著 Web 應用程式變得越來越復雜,自動化測驗的需求也越來越高。如今,自動化測驗已經成為 Web 應用程式開發程序中不可或缺的一部分,它們可以幫助開發人員更快地發現和修復錯誤,提高應用程式的性能和可靠性。 ......

    uj5u.com 2023-04-20 07:43:16 more
  • CANN開發實踐:4個DVPP記憶體問題的典型案例解讀

    摘要:由于DVPP媒體資料處理功能對存放輸入、輸出資料的記憶體有更高的要求(例如,記憶體首地址128位元組對齊),因此需呼叫專用的記憶體申請介面,那么本期就分享幾個關于DVPP記憶體問題的典型案例,并給出原因分析及解決方法。 本文分享自華為云社區《FAQ_DVPP記憶體問題案例》,作者:昇騰CANN。 DVPP ......

    uj5u.com 2023-04-20 07:43:03 more
  • msf學習

    msf學習 以kali自帶的msf為例 一、msf核心模塊與功能 msf模塊都放在/usr/share/metasploit-framework/modules目錄下 1、auxiliary 輔助模塊,輔助滲透(埠掃描、登錄密碼爆破、漏洞驗證等) 2、encoders 編碼器模塊,主要包含各種編碼 ......

    uj5u.com 2023-04-20 07:42:59 more
  • Halcon軟體安裝與界面簡介

    1. 下載Halcon17版本到到本地 2. 雙擊安裝包后 3. 步驟如下 1.2 Halcon軟體安裝 界面分為四大塊 1. Halcon的五個助手 1) 影像采集助手:與相機連接,設定相機引數,采集影像 2) 標定助手:九點標定或是其它的標定,生成標定檔案及內參外參,可以將像素單位轉換為長度單位 ......

    uj5u.com 2023-04-20 07:42:17 more
  • 在MacOS下使用Unity3D開發游戲

    第一次發博客,先發一下我的游戲開發環境吧。 去年2月份買了一臺MacBookPro2021 M1pro(以下簡稱mbp),這一年來一直在用mbp開發游戲。我大致分享一下我的開發工具以及使用體驗。 1、Unity 官網鏈接: https://unity.cn/releases 我一般使用的Apple ......

    uj5u.com 2023-04-20 07:40:19 more