EFK代替ELK方案7.17.3

news2024/12/24 8:59:26

文章目录

    • 一. 传统的ELK
    • 二. EFK
      • 2.1 安装elasticsearch
      • 2.2 服务端安装fileBeats
        • 2.2.1. 安装 `该也没有必要安装docker`,直接下载yum或官网jar包启动即可.
        • 2.2.2.编辑配置文件 filebeat-java-logback.yml
        • 2.2.3. es配置`common_log_pipeline`解析日志
      • 三.启动测试-logback-spring.xml配置


最近发现,logstash日志收集器本身的内存占用和es相当,这也是有一部分因为logstash用java开发,其jvm本身就是内存消耗大户.为了降本增效,发现用go开发的beats可以替代logstash.

ELK : 通常我们将服务器日志通过logback的http发送至logstash服务器统一处理,logstash采集处理后发送到elasticsearch服务器.
EFK: 通常我们将服务器日志保存到本机,本机启动filebeats,fliebeats采集处理发送至elasticsearch.

一. 传统的ELK

在这里插入图片描述

logstash+elasticsearch+Kibana(ELK)日志收集


二. EFK

在这里插入图片描述

logback+ fileBeats + elasticsearch + Kibana日志收集方案

2.1 安装elasticsearch

该docker安装只针对7.18以下版本. 7.18+默认开启生产模式

1. 安装
# 安装es
docker pull elasticsearch:7.17.3
mkdir -p /mydata/elasticsearch/config
mkdir -p /mydata/elasticsearch/data
echo "http.host: 0.0.0.0" >> /mydata/elasticsearch/config/elasticsearch.yml
chmod -R 777 /mydata/elasticsearch/

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
--restart=always --privileged=true \
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.17.3
2. 进入到es挂载目录elasticsearch.yml的挂载目录,添加以下内容
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
xpack.security.enabled: true
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl.enabled: true
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl.enabled: false

3. 重启es容器并进入es容器
4. 进入容器后执行以下命令 傻瓜式设置账号密码

./bin/elasticsearch-setup-passwords interactive

5. 重启es容器

2.2 服务端安装fileBeats

2.2.1. 安装 该也没有必要安装docker,直接下载yum或官网jar包启动即可.

强烈建议不要用docker,docker不保证不出错

# 安装beats
docker run -d --name=filebeat:7.17.3 docker.elastic.co/beats/filebeat:7.17.3 \
--privileged=true \ 
--restart=always \
-v /mydata/beats/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro \
-v /mydata/beats/lib/docker/containers:/var/lib/docker/containers:ro \
-v /mydata/beats/run/docker.sock:/var/run/docker.sock:ro \
-v /mydata/beats/log/messages:/var/log/messages \
-e --strict.perms=false \
-E output.elasticsearch.hosts=["elasticsearch:9200"]
# 安装管道
filebeat setup  --pipelines --modules system
2.2.2.编辑配置文件 filebeat-java-logback.yml

目的: 1.设置filebeat的抓取数据路径 2.设置输出目标,及使用何种预处理
以下是7.17.3到8.6的官方配置.只做增添.

###################### Filebeat Configuration Example #########################

# This file is an example configuration file highlighting only the most common
# options. The filebeat.reference.yml file from the same directory contains all the
# supported options with more comments. You can use it as a reference.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/filebeat/index.html

# For more available modules and options, please see the filebeat.reference.yml sample
# configuration file.

# ============================== Filebeat inputs ===============================

filebeat.inputs:

  # Each - is an input. Most options can be set at the input level, so
  # you can use different inputs for various configurations.
  # Below are the input-specific configurations.

  # filestream is an input for collecting log messages from files.
  - type: filestream
    encoding: utf-8
    # Unique ID among all inputs, an ID is required.
    id: my-filestream-id

    # Change to true to enable this input configuration.
    enabled: true

    # Paths that should be crawled and fetched. Glob based paths.
    paths:
      - c:/mydata/filebeat/logs/*.log
      #- /mydata/filebeat/logs/*.log
    # yyyy-MM-dd 时间格式开头的行,合并到上一行末
    multiline:
      pattern: '^\d{4}\-\d{2}\-\d{2}'
      negate: true
      match: after
    # Exclude lines. A list of regular expressions to match. It drops the lines that are
    # matching any regular expression from the list.
    # Line filtering happens after the parsers pipeline. If you would like to filter lines
    # before parsers, use include_message parser.
    #exclude_lines: ['^DBG']

    # Include lines. A list of regular expressions to match. It exports the lines that are
    # matching any regular expression from the list.
    # Line filtering happens after the parsers pipeline. If you would like to filter lines
    # before parsers, use include_message parser.
    #include_lines: ['^ERR', '^WARN']

    # Exclude files. A list of regular expressions to match. Filebeat drops the files that
    # are matching any regular expression from the list. By default, no files are dropped.
    #prospector.scanner.exclude_files: ['.gz$']

    # Optional additional fields. These fields can be freely picked
    # to add additional information to the crawled log files for filtering
    #fields:
    #  level: debug
    #  review: 1

# ============================== Filebeat modules ==============================

filebeat.config.modules:
  # Glob pattern for configuration loading
  path: ${path.config}/modules.d/*.yml

  # Set to true to enable config reloading
  reload.enabled: true

  # Period on which files under path should be checked for changes
  #reload.period: 10s

# ======================= Elasticsearch template setting =======================

setup.template.settings:
  index.number_of_shards: 1
  #index.codec: best_compression
  #_source.enabled: false
setup.template.name: "yqc"      # 设置一个新的模板,模板的名称
setup.template.pattern: "yqc-*" # 模板匹配那些索引,这里表示以yqc开头的所有的索引
setup.template.overwrite: true
setup.template.enabled: false
setup.ilm.enabled: false
#index.codec: best_compression
#_source.enabled: false

# ================================== General ===================================

# The name of the shipper that publishes the network data. It can be used to group
# all the transactions sent by a single shipper in the web interface.
#name:

# The tags of the shipper are included in their field with each
# transaction published.
#tags: ["service-X", "web-tier"]

# Optional fields that you can specify to add additional information to the
# output.
#fields:
#  env: staging

# ================================= Dashboards =================================
# These settings control loading the sample dashboards to the Kibana index. Loading
# the dashboards is disabled by default and can be enabled either by setting the
# options here or by using the `setup` command.
#setup.dashboards.enabled: false

# The URL from where to download the dashboard archive. By default, this URL
# has a value that is computed based on the Beat name and version. For released
# versions, this URL points to the dashboard archive on the artifacts.elastic.co
# website.
#setup.dashboards.url:

# =================================== Kibana ===================================

# Starting with Beats version 6.0.0, the dashboards are loaded via the Kibana API.
# This requires a Kibana endpoint configuration.
setup.kibana:

# Kibana Host
# Scheme and port can be left out and will be set to the default (http and 5601)
# In case you specify and additional path, the scheme is required: http://localhost:5601/path
# IPv6 addresses should always be defined as: https://[2001:db8::1]:5601
#host: "localhost:5601"

# Kibana Space ID
# ID of the Kibana Space into which the dashboards should be loaded. By default,
# the Default Space will be used.
#space.id:

# =============================== Elastic Cloud ================================

# These settings simplify using Filebeat with the Elastic Cloud (https://cloud.elastic.co/).

# The cloud.id setting overwrites the `output.elasticsearch.hosts` and
# `setup.kibana.host` options.
# You can find the `cloud.id` in the Elastic Cloud web UI.
#cloud.id:

# The cloud.auth setting overwrites the `output.elasticsearch.username` and
# `output.elasticsearch.password` settings. The format is `<user>:<pass>`.
#cloud.auth:

# ================================== Outputs ===================================

# Configure what output to use when sending the data collected by the beat.

# ---------------------------- Elasticsearch Output ----------------------------
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: [ "localhost:9200" ]
  username: "elastic"
  password: "elastic"
  # pipeline使用的是es的管道解析功能
  pipeline: "common_log_pipeline"
  encoding: utf-8
  indices:
    - index: "yqc-info-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        message: "INFO"
    - index: "yqc-error-%{[agent.version]}-%{+yyyy.MM.dd}"
      when.contains:
        message: "ERROR"
  # Protocol - either `http` (default) or `https`.
  #protocol: "https"

  # Authentication credentials - either API key or username/password.
  #api_key: "id:api_key"
  #username: "elastic"
  #password: "changeme"

  # ------------------------------ Logstash Output -------------------------------
  #output.logstash:
  # The Logstash hosts
  #hosts: ["localhost:5044"]

  # Optional SSL. By default is off.
  # List of root certificates for HTTPS server verifications
  #ssl.certificate_authorities: ["/etc/pki/root/ca.pem"]

  # Certificate for SSL client authentication
  #ssl.certificate: "/etc/pki/client/cert.pem"

  # Client Certificate Key
  #ssl.key: "/etc/pki/client/cert.key"

# ================================= Processors =================================
# pipeline使用的是es的解析功能,而processors是filebeats本身的功能
processors:
  - add_host_metadata:
      when.not.contains.tags: forwarded
  - add_cloud_metadata: ~
  - add_docker_metadata: ~
  - add_kubernetes_metadata: ~

    # ================================== Logging ===================================

    # Sets log level. The default log level is info.
    # Available log levels are: error, warning, info, debug
    #logging.level: debug

    # At debug level, you can selectively enable logging only for some components.
    # To enable all selectors, use ["*"]. Examples of other selectors are "beat",
    # "publisher", "service".
    #logging.selectors: ["*"]

    # ============================= X-Pack Monitoring ==============================
    # Filebeat can export internal metrics to a central Elasticsearch monitoring
    # cluster.  This requires xpack monitoring to be enabled in Elasticsearch.  The
    # reporting is disabled by default.

    # Set to true to enable the monitoring reporter.
    #monitoring.enabled: false

    # Sets the UUID of the Elasticsearch cluster under which monitoring data for this
    # Filebeat instance will appear in the Stack Monitoring UI. If output.elasticsearch
    # is enabled, the UUID is derived from the Elasticsearch cluster referenced by output.elasticsearch.
    #monitoring.cluster_uuid:

    # Uncomment to send the metrics to Elasticsearch. Most settings from the
    # Elasticsearch outputs are accepted here as well.
    # Note that the settings should point to your Elasticsearch *monitoring* cluster.
    # Any setting that is not set is automatically inherited from the Elasticsearch
    # output configuration, so if you have the Elasticsearch output configured such
    # that it is pointing to your Elasticsearch monitoring cluster, you can simply
    # uncomment the following line.
    #monitoring.elasticsearch:

    # ============================== Instrumentation ===============================

    # Instrumentation support for the filebeat.
    #instrumentation:
    # Set to true to enable instrumentation of filebeat.
    #enabled: false

    # Environment in which filebeat is running on (eg: staging, production, etc.)
    #environment: ""

    # APM Server hosts to report instrumentation results to.
    #hosts:
    #  - http://localhost:8200

    # API Key for the APM Server(s).
    # If api_key is set then secret_token will be ignored.
    #api_key:

    # Secret token for the APM Server(s).
    #secret_token:


# ================================= Migration ==================================

# This allows to enable 6.7 migration aliases
#migration.6_to_7.enabled: true


2.2.3. es配置common_log_pipeline解析日志

目的: 我们需要根据日志数据来自定义解析结果, 当然默认的也可以.自定义就需要使用pipeline功能

那如何确定日志数据被pipeline解析的格式? 答案是使用grok语法 grok的模拟解析工具在kibana有提供或在线grok工具. (请自行查阅grok语法)

日志打印格式

    <!-- 日志输出格式 -->
    <property name="log.console.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,GMT+8}-${applicationName}-%magenta(${IP})-%blue([%thread])-%highlight(%-5level)-%logger{20}-%yellow(%method)-%cyan(%msg)-%red(%exception%n)" />
    <property name="log.file.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,GMT+8}-${applicationName}-${ip}-[%thread]-%level-%logger{20}-%method-%msg-%exception%n" />

日志数据

2023-09-19 09:27:48.483 |vector-member |IP_IS_UNDEFINED |[main] |INFO |org.redisson.Version |logVersion |Redisson 3.20.0 |asdas

grok解析

在es中转义需要 \\ ,这样的话grok测试看不出来.这点就很奇怪.
在这里插入图片描述

在这里插入图片描述
您必须按照图二,双转义才能被es解析

%{TIMESTAMP_ISO8601:timestamp}\\s*\\|%{DATA:applicationName}\\s*\\|%{DATA:ip}\\s*\\|%{DATA:thread}\\s*\\|%{LOGLEVEL:log_level}\\s*\\|%{DATA:class}\\s*\\|%{GREEDYDATA:method}\\s*\\|%{GREEDYDATA:msg}\\s*\\|%{GREEDYDATA:exception_message}

对应的预处理方法 即数据被映射的数据项

GET _ingest/pipeline/common_log_pipeline
DELETE _ingest/pipeline/common_log_pipeline
PUT _ingest/pipeline/common_log_pipeline
{
  "description": "common_log_pipeline",
  "processors": [
      {
      "grok": {
        "field": "message",
        "patterns": [
          "%{TIMESTAMP_ISO8601:timestamp}\\s*\\|%{DATA:applicationName}\\s*\\|%{DATA:ip}\\s*\\|%{DATA:thread}\\s*\\|%{LOGLEVEL:log_level}\\s*\\|%{DATA:class}\\s*\\|%{GREEDYDATA:method}\\s*\\|%{GREEDYDATA:msg}\\s*\\|%{GREEDYDATA:exception_message}"
        ],
        "ignore_failure":true
      }
    },
    {
      "remove" : {
        "field" : "input"
      }
    },
    {
      "remove" : {
        "field" : "message"
      }
    },
    {
      "remove" : {
        "field" : "agent"
      }
    },
    {
      "remove" : {
        "field" : "ecs"
      }
    },
    {
      "remove" : {
        "field" : "host"
      }
    },
    {
      "remove" : {
        "field" : "log"
      }
    }
  ]
}

在这里插入图片描述

三.启动测试-logback-spring.xml配置

logback-spring.xml配置

<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true" scanPeriod="60 seconds" debug="false">
    <include resource="org/springframework/boot/logging/logback/base.xml"/>
    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>

    <springProperty scope="context" name="applicationName" source="spring.application.name" defaultValue="default"/>
    <!-- 日志文件路径 linux-->
    <property scope="context" name="LOG_PATH" value="/mydata/filebeat/logs"/>
    <!-- 日志输出IP 这个很简单.自定义即可-->
    <conversionRule conversionWord="IP" converterClass="com/vector/common/config/LogbackHostAddressPropertyDefiner" />
    <!-- 日志输出格式 -->
    <property name="log.console.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,GMT+8} |${applicationName} |%magenta(${IP}) |%blue([%thread]) |%highlight(%-5level) |%logger{20} |%yellow(%method) |%cyan(%msg) |%red(%exception%n)" />
    <property name="log.file.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS,GMT+8} |${applicationName} |${ip} |[%thread] |%level |%logger{20} |%method |%msg |%exception%n" />


    <!--输出到控制台-->
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>INFO</level>
        </filter>
        <withJansi>false</withJansi>
        <encoder>
            <pattern>${log.console.pattern}</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>
    <!-- 按照每天生成日志文件 -->
    <appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!--日志文件输出的文件名-->
            <FileNamePattern>${LOG_PATH}/yqc-info-%d{yyyy-MM-dd}.log</FileNamePattern>
            <!--日志文件保留天数-->
            <MaxHistory>30</MaxHistory>
        </rollingPolicy>
        <encoder charset="UTF-8" class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>${log.file.pattern}</pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <!-- 过滤的级别 -->
            <level>INFO</level>
            <!-- 匹配时的操作:接收(记录) -->
            <onMatch>ACCEPT</onMatch>
            <!-- 不匹配时的操作:拒绝(不记录) -->
            <onMismatch>DENY</onMismatch>
        </filter>
        <!--日志文件最大的大小-->
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>60MB</MaxFileSize>
        </triggeringPolicy>
    </appender>

    <appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!--日志文件输出的文件名-->
            <FileNamePattern>${LOG_PATH}/yqc-error-%d{yyyy-MM-dd}.log</FileNamePattern>
            <!--日志文件保留天数-->
            <MaxHistory>30</MaxHistory>
        </rollingPolicy>
        <encoder charset="UTF-8" class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>${log.file.pattern}</pattern>
        </encoder>
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <!-- 过滤的级别 -->
            <level>ERROR</level>
            <!-- 匹配时的操作:接收(记录) -->
            <onMatch>ACCEPT</onMatch>
            <!-- 不匹配时的操作:拒绝(不记录) -->
            <onMismatch>DENY</onMismatch>
        </filter>
        <!--日志文件最大的大小-->
        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
            <MaxFileSize>30MB</MaxFileSize>
        </triggeringPolicy>
    </appender>

    <!-- 日志输出级别 -->
    <logger name="*" level="info" />
    <!-- 线上环境,日志配置 -->
    <springProfile name="prod">
        <!--系统操作日志-->
        <root level="info">
            <appender-ref ref="FILE_INFO" />
            <appender-ref ref="FILE_ERROR" />
        </root>
    </springProfile>

    <!-- 本地、开发环境,日志配置 可以写logback支持的所有节点 -->
    <springProfile name="dev,test">
        <!--系统操作日志-->
        <root level="info">
            <appender-ref ref="CONSOLE" />
            <appender-ref ref="FILE_INFO" />
            <appender-ref ref="FILE_ERROR" />
        </root>
    </springProfile>

</configuration>

filebeat应该和服务器代码一起,利用filebeat采集服务器存储的日志文件发送到es.

# linux
./filebeat -e -c filebeat.yml
# windows
filebeat.exe -e -c filebeat.yml

在这里插入图片描述

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

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

相关文章

JavaWeb 学习笔记 6:会话跟踪

JavaWeb 学习笔记 6&#xff1a;会话跟踪 HTTP 协议本身是无状态的&#xff0c;所以不能跟踪会话状态。所以会有额外的技术用于跟踪会话&#xff1a; Cookie&#xff0c;客户端技术Session&#xff0c;服务端技术 1.Cookie 1.1.写入 Cookie 可以在服务端通过HttpServletRe…

如何使用Spring Security进行身份验证和授权

当您构建一个基于 Spring 框架的 Web 应用程序时&#xff0c;安全性是至关重要的。Spring Security 是 Spring 生态系统中用于处理身份验证和授权的框架。它提供了一种简单而强大的方式来保护您的应用程序&#xff0c;确保只有授权用户才能访问敏感资源。本文将介绍如何使用 Sp…

云计算安全:保护数字资产的前沿策略

文章目录 1. 云计算安全威胁1.1 数据泄露1.2 身份认证问题1.3 无法预测的网络攻击1.4 集中攻击 2. 云计算安全最佳实践2.1 身份和访问管理&#xff08;IAM&#xff09;2.2 数据加密2.3 安全审计和监控2.4 多重身份验证&#xff08;MFA&#xff09; 3. 安全自动化3.1 基础设施即…

【初试433分】中科院859学姐经验分享

这个系列会邀请往届学长学姐进行经验分享~欢迎后台回复经验分享&#xff0c;进行投稿&#xff01; 经验贴征集&#xff1a;前人栽树&#xff0c;后人乘凉&#xff0c;上岸同学也是看着经验贴一点一点过来的&#xff0c;有偿征集各位同学的经验分享&#xff0c;以此来帮助更多的…

一百八十四、大数据离线数仓完整流程——步骤三、在Hive中建基础库维度表并加载MySQL中的维度表数据

一、目的 经过6个月的奋斗&#xff0c;项目的离线数仓部分终于可以上线了&#xff0c;因此整理一下离线数仓的整个流程&#xff0c;既是大家提供一个案例经验&#xff0c;也是对自己近半年的工作进行一个总结。 二、数仓实施步骤 &#xff08;三&#xff09;步骤三、在Hive中…

优化类问题概述

数学建模系列文章&#xff1a; 以下是个人在准备数模国赛时候的一些模型算法和代码整理&#xff0c;有空会不断更新内容&#xff1a; 评价模型&#xff08;一&#xff09;层次分析法&#xff08;AHP&#xff09;,熵权法&#xff0c;TOPSIS分析 及其对应 PYTHON 实现代码和例题…

JVM之选择合适的垃圾收集器(CMS、G1)

1.JVM内存模型&#xff0c;栈、本地方法栈、程序计数器、堆、元空间、方法区、本地方法区&#xff0c;除程序计数器外&#xff0c;其他区域都能进行垃圾收集 2.栈&#xff0c;它的生命周期与线程相同&#xff0c;线程私有&#xff0c;会使用操作系统原生内存&#xff0c;方法…

智慧城市规划与建设中,经常看到的“智慧公厕”是什么?

在智慧城市、智慧机场、智慧园区、智慧服务区、智慧市政、智慧城管、智慧楼宇、智慧旅游等领域&#xff0c;经常看到的智慧公厕究竟是什么&#xff1f;让我们一起来揭秘“智慧公厕”这个常见于智慧城市建设项目的关键词。 从智慧公厕的诞生背景来看&#xff0c;由于智慧城市的…

JAVA 二叉树超详解(1)

树形结构 概念 树是一种非线性的数据结构&#xff0c;它是由n(n>0)个有限结点组成的一个具有层次关系的集合。把它叫做树是因为它看起来像一棵倒挂的树&#xff0c;也就是说它根朝上&#xff0c;而叶朝下的&#xff0c;具有以下的特点&#xff1a; 1.有一个特殊的结点&…

【C语言】错题本(4)

一. 题目及选项: 答案解析: 知识点: 字符型在内存中的数据存储 char类型数据在内存中的图示: unsigned char类型数据在内存中的图示: 二. 题目及选项: 答案解析: A: B: C: D: 三. 题目及选项: 答案解析: 数据在计算机中是先转换成补码,再进行运算的!

论文笔记:ViTGAN: Training GANs with Vision Transformers

2021 1 intro 论文研究的问题是&#xff1a;ViT是否可以在不使用卷积或池化的情况下完成图像生成任务 即不用CNN&#xff0c;而使用ViT来完成图像生成任务将ViT架构集成到GAN中&#xff0c;发现现有的GAN正则化方法与self-attention机制的交互很差&#xff0c;导致训练过程中…

windows上配置vscode C/C++代码跳转

windows上配置vscode C/C代码跳转 安装插件 C/C 官方的 C/C 插件&#xff0c;必备的插件&#xff0c;是代码跳转、自动补全、代码大纲显示等功能的基础。 Gtags C/C GNU Global GNU Global除了安装该插件之外&#xff0c;还需要在本地下载安装GNU Global工具。多看下插件…

智算创新,美格智能助力智慧支付加速发展

9月21日&#xff0c;以“智算引领创新未来”为主题的紫光展锐2023泛物联网终端生态论坛在深圳举行。作为紫光展锐重要战略合作伙伴&#xff0c;美格智能标准模组产品线总经理郭强华、高级产品总监刘伟鹏受邀出席论坛。美格智能基于紫光展锐5G、4G、智能SoC、Cat.1 bis等芯片平台…

系统集成|第十二章(笔记)

目录 第十二章 沟通管理12.1 沟通的基本概念12.2 主要过程12.2.1 规划沟通管理12.2.2 管理沟通12.2.3 控制沟通 12.3 常见问题 上篇&#xff1a;第十一章、项目人力资源管理 第十二章 沟通管理 沟通管理在项目计划、执行、监控过程中具有重要的作用&#xff0c;项目经理应该拿…

【笔试强训选择题】Day47.习题(错题)解析

作者简介&#xff1a;大家好&#xff0c;我是未央&#xff1b; 博客首页&#xff1a;未央.303 系列专栏&#xff1a;笔试强训选择题 每日一句&#xff1a;人的一生&#xff0c;可以有所作为的时机只有一次&#xff0c;那就是现在&#xff01;&#xff01;&#xff01;&#xff…

笔试强训

&#x1f449;&#x1f3fb; Day3 字符串中找出最长的字符串 mycode&#xff1a; #include <iostream> #include<vector>using namespace std;int main() {vector<string> v;string str;getline(cin,str);for(int i 0;i<str.size();i){string s;while(i…

手持式静电场测试仪的功能说明

手持式静电场测试仪是一种便携式的测试仪器&#xff0c;能够快速、准确地测量静电场的强度和分布情况。其主要功能包括&#xff1a; 测量静电场强度&#xff1a;手持式静电场测试仪可以测量静电场的强度&#xff0c;包括静电场的电压、电场强度、电势差等参数。 测量静电电荷&…

(搞定)排序数据结构(1)插入排序 选择排序+冒泡排序

目录 本章内容如下 一:插入排序 1.1插入排序 1.2希尔排序 二&#xff1a;选择排序 2.1选择排序 三:交换排序 3.1冒泡排序 一:插入排序 1.1直接插入排序 说到排序&#xff0c;其实在我们生活中非常常见&…

谈谈最近招人的感受!

最近折腾新的项目&#xff0c;面试了很多实习生小伙伴&#xff0c;我说说我的一些「面试」感受&#xff0c; 虽然是一个老生常谈的话题&#xff0c;但是依然提一下。 准时很重要&#xff1a;提前一点时间&#xff0c;踩个点&#xff0c;别迟到&#xff0c;面试的过程中由于每个…

Python 模拟刮刮乐小游戏

"""刮刮乐小游戏知识点&#xff1a;1、随机模块 random2、嵌套循环 while for3、条件语句/跳转语句 if / continue4、列表添加元素函数 append()"""# 随机模块 import randomwhile True:# 奖品信息prize_info [一等奖, 二等奖, 三等奖, 谢谢惠顾…