主頁 >  其他 > Flink學習記錄--入門篇

Flink學習記錄--入門篇

2021-11-08 09:36:31 其他

前言

流式計算可能在日常不多見,主要統計一個階段內的PV、UV,在風控場景很常見,比如統計某個用戶一天內同地區下單總量來判斷該用戶是否為例外用戶,還有一些大資料處理場景,如將某一段時間生成的日志按需要加工后倒入到存盤DB中做查詢報表,為什么要學習Flink,因為最近碰到一些實時計算性能問題,其次也不太理解實時計算底層實作原理,這里拿當下很流行的開源工具Flink作為待學習物件,一步一步深入Flink底層探索實時計算奧秘,

第一個程式

導maven依賴,主要依賴項如下:

<properties>
        <blink.version>1.5.1</blink.version>
        <scala.binary.version>2.11</scala.binary.version>
        <blink-streaming.version>1.5.1</blink-streaming.version>
        <log4j.version>1.2.17</log4j.version>
        <slf4j-log4j.version>1.7.9</slf4j-log4j.version>
    </properties>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.alibaba.blink</groupId>
                <artifactId>flink-core</artifactId>
                <version>${blink.version}</version>
            </dependency>
            <dependency>
                <groupId>com.alibaba.blink</groupId>
                <artifactId>flink-clients_2.11</artifactId>
                <version>${blink.version}</version>
            </dependency>

            <!-- blink stream java -->
            <dependency>
                <groupId>com.alibaba.blink</groupId>
                <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
                <version>${blink-streaming.version}</version>
            </dependency>

            <dependency>
                <groupId>com.alibaba.blink</groupId>
                <artifactId>flink-test-utils-junit</artifactId>
                <version>${blink.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- logging framework -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>${log4j.version}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>${slf4j-log4j.version}</version>
            </dependency>

        </dependencies>
    </dependencyManagement>

這里引入比較干凈,只包含flink相關核心包+日志包,接下來開始使用flink API完成第一個Hello World程式,這里我用的是flink官方WordCount Demo,代碼如下:

package com.alibaba.security.blink;


import com.alibaba.security.blink.util.WordCountData;
import org.apache.flink.api.common.functions.FlatMapFunction;
import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.api.java.utils.ParameterTool;
import org.apache.flink.util.Collector;

public class WordCount {
    private final ParameterTool params;
    private final ExecutionEnvironment env;

    public WordCount(String[] args) {
        this.params = ParameterTool.fromArgs(args);
        this.env = ExecutionEnvironment.createLocalEnvironment();
        env.getConfig().setGlobalJobParameters(params);
    }

    public static void main(String[] args) throws Exception {
        WordCount wordCount = new WordCount(args);
        DataSet<String> dataSet = wordCount.getDataSetFromCommandLine();
        wordCount.executeFrom(dataSet);
    }

    private DataSet<String> getDataSetFromCommandLine() {
        DataSet<String> text;
        if (params.has("input")) {
            text = env.readTextFile(params.get("input"));
        } else {
            System.out.println("Executing WordCount example with default input data set.");
            System.out.println("Use --input to specify file input.");
            text = WordCountData.getDefaultTextLineDataSet(env);
        }
        return text;
    }

    private void executeFrom(DataSet<String> text) throws Exception {
        DataSet<Tuple2<String, Integer>> counts =
                text.flatMap(new Tokenizer())
                        .groupBy(0)
                        .sum(1);

        if (this.params.has("output")) {
            counts.writeAsCsv(this.params.get("output"), "\n", " ");
            env.execute("WordCount Example");
        } else {
            System.out.println("Printing result to stdout. Use --output to specify output path.");
            counts.print();
        }
    }

    public static final class Tokenizer implements FlatMapFunction<String, Tuple2<String, Integer>> {

        @Override
        public void flatMap(String value, Collector<Tuple2<String, Integer>> out) {
            // normalize and split the line
            String[] tokens = value.toLowerCase().split("\\W+");

            // emit the pairs
            for (String token : tokens) {
                if (token.length() > 0) {
                    out.collect(new Tuple2<String, Integer>(token, 1));
                }
            }
        }
    }

}

WordCountData.java代碼如下:

package com.alibaba.security.blink.util;

import org.apache.flink.api.java.DataSet;
import org.apache.flink.api.java.ExecutionEnvironment;

public class WordCountData {

    public static final String[] WORDS = new String[] {
            "To be, or not to be,--that is the question:--",
            "Whether 'tis nobler in the mind to suffer",
            "The slings and arrows of outrageous fortune",
            "Or to take arms against a sea of troubles,",
            "And by opposing end them?--To die,--to sleep,--",
            "No more; and by a sleep to say we end",
            "The heartache, and the thousand natural shocks",
            "That flesh is heir to,--'tis a consummation",
            "Devoutly to be wish'd. To die,--to sleep;--",
            "To sleep! perchance to dream:--ay, there's the rub;",
            "For in that sleep of death what dreams may come,",
            "When we have shuffled off this mortal coil,",
            "Must give us pause: there's the respect",
            "That makes calamity of so long life;",
            "For who would bear the whips and scorns of time,",
            "The oppressor's wrong, the proud man's contumely,",
            "The pangs of despis'd love, the law's delay,",
            "The insolence of office, and the spurns",
            "That patient merit of the unworthy takes,",
            "When he himself might his quietus make",
            "With a bare bodkin? who would these fardels bear,",
            "To grunt and sweat under a weary life,",
            "But that the dread of something after death,--",
            "The undiscover'd country, from whose bourn",
            "No traveller returns,--puzzles the will,",
            "And makes us rather bear those ills we have",
            "Than fly to others that we know not of?",
            "Thus conscience does make cowards of us all;",
            "And thus the native hue of resolution",
            "Is sicklied o'er with the pale cast of thought;",
            "And enterprises of great pith and moment,",
            "With this regard, their currents turn awry,",
            "And lose the name of action.--Soft you now!",
            "The fair Ophelia!--Nymph, in thy orisons",
            "Be all my sins remember'd."
    };

    public static DataSet<String> getDefaultTextLineDataSet(ExecutionEnvironment env) {
        return env.fromElements(WORDS);
    }
}

運行時如果加了命令列引數--input則從自定義輸入檔案中讀取內容,否則從WordCountData中讀取,

Flink代碼啟動通過org.apache.flink.api.java.ExecutionEnvironment#createLocalEnvironment()來完成,表示flink本地啟動,flink只能處理DataSet,因此任何資料想要在flink里處理,都要被轉換成DataSet,這里將文本轉化為DataSet通過調org.apache.flink.api.java.ExecutionEnvironment#readTextFile方法,下面executeFrom方法就是flink核心處理流程了,先將一行行文本打散轉化為Tuple2物件,Tuple2就是一個KV,然后對打散后的Tuple2集合進行groupBy,相同單詞將被groupBy一起,最后將所有相同單詞相加(sum),最終得到每個單詞出現次數,

API呼叫

flatMap

flatMap在java里用的也不多,主要用的還是map,這里我用jdk1.8 Stream API寫了一個flatMap demo

import org.apache.commons.lang3.tuple.Pair;
import java.util.Arrays;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

class Scratch {
    public static void main(String[] args) {
        String str = "abc,debf";
        String[] strArray = str.split(",");
        // 使用flatMap回傳多個元素(Stream)
        List<Object> result = Arrays.stream(strArray).flatMap(new Function<String, Stream<?>>() {
            @Override
            public Stream<?> apply(String s) {
                return Stream.of(s.split("b"));
            }
        }).collect(Collectors.toList());
        System.out.println(result);

        // 使用map方式只能回傳一個元素
        List<Pair<String, Integer>> tupleResultList = Arrays.stream(strArray).map(new Function<String, Pair<String, Integer>>() {
            @Override
            public Pair<String, Integer> apply(String s) {
                return Pair.of(s, s.length());
            }
        }).collect(Collectors.toList());
        System.out.println(tupleResultList);
    }
}

先將字串str拆分成一個陣列,然后遍歷陣列對資料中每個字串再進行切割,將切割后生成的字串陣列重新構建為一個Stream物件并回傳,也就是說flatMap做了一個一變多的事,一個流變成多個流了:

將Stream1中每個元素都遍歷一遍,然后將遍歷的每個元素又轉化成一個Stream物件,最終生成的就是一個Stream集合,

如果用map只能回傳一個元素

flink中flatMap和map也是一樣的道理,上面flink例子里用的是flatMap,將每行記錄轉化后的單詞都保存到Collector里,后面該Collector可以作為輸入執行groupBy操作,而如果是換成map該怎么寫呢?代碼如下


// 這里map每次方法呼叫只會回傳一個Tuple2物件
AggregateOperator<Tuple2<String, Integer>> firstSumResult = text.map(new MapFunction<String, Tuple2<String, Integer>>() {
            @Override
            public Tuple2<String, Integer> map(String value) throws Exception {
                String[] tokens = value.toLowerCase().split("\\W+");
                if (tokens.length > 0) {
                    return new Tuple2<String, Integer>(tokens[0], 1);
                }
                return null;
            }
        }).groupBy(0).sum(1);
List<Tuple2<String, Integer>> result = firstSumResult.collect();
result.forEach(e -> LOGGER.info("word={},count={}", e.f0, e.f1));

可以看出MapFunction#map是有回傳值的,且回傳值為單元素,后面groupBy都是針對map后生成的集合來操作,

因此如何選擇map與flatMap我個人認為:如果只是便利DataSet將一個物件轉化成另一個物件可以使用map函式,如果是一個物件轉化成多個物件,可以使用flatMap,

groupBy

groupBy也是DataSet提供的標準API之一,該方法有3個多載的方法,如下

groupBy(int... fields)

該方法只能對Tuple型別DataSet起作用,Tuple有哪些類呢?

使用該種groupBy方法舉個例子:

/**
 * @author shaoxian.ssx
 * @date 2021/11/7
 */
public class SimpleGroupBy {

    private final static Logger LOGGER = LoggerFactory.getLogger(SimpleGroupBy.class);

    public static void main(String[] args) throws Exception {
        LocalEnvironment env = ExecutionEnvironment.createLocalEnvironment();
        List<Tuple2<String, Integer>> list = new ArrayList<>(16);
        Random random = new Random();
        for (int i = 0; i < 16; i++) {
            int num = random.nextInt(20);
            list.add(new Tuple2<String, Integer>(String.valueOf(num), num));
        }
        LOGGER.info("listResult={}", list);

        List<Tuple2<String, Integer>> flinkRes = env.fromCollection(list).groupBy(0).sum(1).collect();
        LOGGER.info("flinkResult={}", flinkRes);
    }
}

輸出如下:

16:41:33,708 [ main] INFO com.alibaba.security.blink.SimpleGroupBy - listResult=[(1,1), (9,9), (14,14), (18,18), (1,1), (7,7), (16,16), (1,1), (4,4), (16,16), (15,15), (17,17), (16,16), (0,0), (12,12), (15,15)]

16:41:37,573 [ main] INFO com.alibaba.security.blink.SimpleGroupBy - flinkResult=[(12,12), (18,18), (9,9), (14,14), (15,30), (7,7), (16,48), (17,17), (4,4), (0,0), (1,3)]

通過上面groupBy例子可以看出,groupBy(int... fields) 方法僅針對DataSet型別為Tuple系列的資料源才有效,fields順序為Tuple中屬性位置,如Tuple第0號屬性,則引數為0,以此類推,

groupBy(String... fields)

該方法可以針對那些DataSet為POJO型別資料源,方法引數為POJO屬性且該屬性必須有公共的setter、getter方法,并且該POJO必須有一個默認無引數構造方法,舉個例子,獲取某個用戶所有下單IP個數,代碼如下:

/**
 * @author shaoxian.ssx
 * @date 2021/11/7
 */
public class SimpleGroupBy {

    private final static Logger LOGGER = LoggerFactory.getLogger(SimpleGroupBy.class);

    public static void main(String[] args) throws Exception {
        LocalEnvironment env = ExecutionEnvironment.createLocalEnvironment();
        Order order1 = new Order(1001L, "張三", "192.168.1.10");
        Order order2 = new Order(1002L, "李四", "192.168.1.212");
        Order order3 = new Order(1001L, "張三", "192.168.1.50");
        Order order4 = new Order(1003L, "王五", "192.168.1.71");
        DataSource<Order> dataSource = env.fromElements(order1, order2, order3, order4);
        List<Order> result = dataSource.groupBy("byrId").reduce(new ReduceFunction<Order>() {
            @Override
            public Order reduce(Order value1, Order value2) throws Exception {
                if (!value1.getIp().equals(value2.getIp())) {
                    value1.setIpCount(value1.getIpCount() + value2.getIpCount());
                    return value1;
                }
                return value1;
            }
        }).collect();
        result.forEach(e -> LOGGER.info("order={}", e));
    }

    /**
     * 必須為public型別,否則flink校驗型別會報錯
     */
    public static class Order {
        private Long byrId;
        private String name;
        private String ip;
        private int ipCount = 1;

        // 必須提供無引數構造方法
        public Order() {
        }

        public Order(Long byrId, String name, String ip) {
            this.byrId = byrId;
            this.name = name;
            this.ip = ip;
        }

        // 省略setter、getter方法...

        @Override
        public String toString() {
            return new StringJoiner(", ", Order.class.getSimpleName() + "[", "]")
                    .add("byrId=" + byrId)
                    .add("name='" + name + "'")
                    .add("ip='" + ip + "'")
                    .add("ipCount=" + ipCount)
                    .toString();
        }
    }
}

輸出結果如下:

17:08:02,922 [ main] INFO com.alibaba.security.blink.SimpleGroupBy - order=Order[byrId=1001, name='張三', ip='192.168.1.10', ipCount=2]
17:08:02,922 [ main] INFO com.alibaba.security.blink.SimpleGroupBy - order=Order[byrId=1003, name='王五', ip='192.168.1.71', ipCount=1]
17:08:02,922 [ main] INFO com.alibaba.security.blink.SimpleGroupBy - order=Order[byrId=1002, name='李四', ip='192.168.1.212', ipCount=1]

groupBy(KeySelector<T, K> keyExtractor)

該方法個人感覺跟上看屬性groupBy差不多,只是寫起來更好看點,也是針對POJO型別資料源,其實準確說是有public型別setter、getter方法屬性,例如Tuple2中f0、f1也可以用,還是用上面例子改用KeySelector如下:

// 告訴flink使用Order物件byrId值進行groupBy
        List<Order> result = dataSource.groupBy(new KeySelector<Order, Long>() {
            @Override
            public Long getKey(Order value) throws Exception {
                return value.getByrId();
            }
        }).reduce(new ReduceFunction<Order>() {
            @Override
            public Order reduce(Order value1, Order value2) throws Exception {
                if (!value1.getIp().equals(value2.getIp())) {
                    value1.setIpCount(value1.getIpCount() + value2.getIpCount());
                    return value1;
                }
                return value1;
            }
        }).collect();
        result.forEach(e -> LOGGER.info("order={}", e));

UnsortedGrouping

UnsortedGrouping為groupBy回傳物件,為什么要說groupBy呢?因為在流式計算中groupBy是最常見的場景,如groupBy商品ID來判斷哪個商品買的最多;groupBy地址來判斷哪個地方地址聚集度等等,一般sql寫完了group by后通常都要進行count,那flink在flink中怎么做呢?flink最終聚合計算調的方法都在這個UnsortedGrouping類中,count在這里為reduce操作,reduce計算邏輯封裝在ReduceFunction中,如上面統計所有訂單相同買家IP個數,在reduce中針對不同IP做了+1操作,在reduce執行完后,拿到的那個Order物件里ipCount就是最終累加后的總IP個數,當然這個UnsortedGrouping里還有很多有用方法,如maxBy、minBy、sum,這里寫個demo演示一下:

/**
 * @author shaoxian.ssx
 * @date 2021/11/7
 */
public class SimpleGroupBy {

    private final static Logger LOGGER = LoggerFactory.getLogger(SimpleGroupBy.class);

    public static void main(String[] args) throws Exception {
        LocalEnvironment env = ExecutionEnvironment.createLocalEnvironment();
        Order order1 = new Order(1001L, "張三", "192.168.1.10", 30d);
        Order order2 = new Order(1002L, "李四", "192.168.1.212", 27d);
        Order order3 = new Order(1001L, "張三", "192.168.1.50", 100d);
        Order order4 = new Order(1003L, "王五", "192.168.1.71", 30d);
        DataSource<Order> dataSource = env.fromElements(order1, order2, order3, order4);
        // 先使用map將Order轉化為Tuple型別,然后再按照買家ID進行groupBy,最后篩選出每組中金額最大的一筆訂單并輸出
        List<Tuple2<Double, Order>> result = dataSource.map(new MapFunction<Order, Tuple2<Double, Order>>() {
            @Override
            public Tuple2<Double, Order> map(Order value) throws Exception {
                return new Tuple2<>(value.getTotal(), value);
            }
        }).groupBy("f1.byrId").maxBy(0).collect();
        result.forEach(e -> LOGGER.info("order={}", e));
    }

    /**
     * 必須為public型別,否則flink校驗型別會報錯
     */
    public static class Order {
        private Long byrId;
        private String name;
        private String ip;
        // 訂單總金額
        private double total;
        private int ipCount = 1;

        // 必須提供無引數構造方法
        public Order() {
        }

        public Order(Long byrId, String name, String ip, double total) {
            this.byrId = byrId;
            this.name = name;
            this.ip = ip;
            this.total = total;
        }

        // 省略setter、getter方法...

        public void setTotal(double total) {
            this.total = total;
        }

        @Override
        public String toString() {
            return new StringJoiner(", ", Order.class.getSimpleName() + "[", "]")
                    .add("byrId=" + byrId)
                    .add("name='" + name + "'")
                    .add("ip='" + ip + "'")
                    .add("ipCount=" + ipCount)
                    .add("double=" + total)
                    .toString();
        }
    }
}

總結

今天學習的這些Demo及API也已入門flink,后續需要持續投入并帶來更多API呼叫探索及flink底層原理決議,

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

標籤:其他

上一篇:Python+Pandas:快速連接各種常用資料庫?滿足你的一切常用需求?

下一篇:大資料SPARK系列篇-1個經典的入門實體(單詞統計功能)

標籤雲
其他(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