kong 网关和spring cloud gateway网关性能测试对比

该测试只是简单在同一台机器设备对spring cloud gateway网关和kong网关进行对比,受限于笔者所拥有的资源,此处仅做简单评测。
一、使用spring boot 的auth-service作为服务提供者
该服务提供了一个/health接口,接口返回"OK",运行的地址为:192.168.188.108:8174
二、使用kong 网关代理该服务
2.1、创建service
curl -i -s -X POST http://localhost:8001/services --data name=auth-service --data url='http://192.168.188.108:8174'
2.2. 给服务绑定route
curl -i -X POST http://localhost:8001/services/auth-service/routes --data 'paths[]=/auth-service' --data name=auth-service_route
2.3、测试通过kong网关来进行访问
[root@localhost ~]# curl -X GET http://192.168.188.101:8000/auth-service/health
ok
2.4、使用upstream来进行负载均衡
- 创建upstream
curl -X POST http://localhost:8001/upstreams --data name=auth_upstream
- 给upstream绑定目标服务
curl -X POST http://localhost:8001/upstreams/auth_upstream/targets --data target='192.168.188.108:8174'
curl -X POST http://localhost:8001/upstreams/auth_upstream/targets --data target='192.168.188.108:8176'
- 更新service指定的url地址
curl -X PATCH http://localhost:8001/services/auth-service --data host='auth_upstream'
三、搭建spring cloud 的gateway网关环境
<?xml version="1.0" encoding="UTF-8"?>
<!--suppress MavenPropertyInParent -->
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>api-module-gateways</artifactId><groupId>com.api</groupId><version>${env.project.version}</version></parent><modelVersion>4.0.0</modelVersion><artifactId>manager-gateway</artifactId><packaging>jar</packaging><description>后台管理网关</description><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target></properties><!-- 具体的jar包依赖 --><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId><exclusions><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-logging</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-gateway</artifactId></dependency><!-- 注册中心与配置中心 --><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId></dependency><dependency><groupId>com.alibaba.cloud</groupId><artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-openfeign-core</artifactId></dependency><dependency><groupId>io.github.openfeign</groupId><artifactId>feign-okhttp</artifactId></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><scope>provided</scope></dependency></dependencies><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>2.1.0.RELEASE</version><executions><execution><goals><goal>repackage</goal></goals></execution></executions></plugin></plugins></build></project>
bootstrap.yaml
server:port: 8171
spring:cloud:gateway:discovery:locator:enabled: true routes:- id: auth-serviceuri: lb://auth-servicepredicates:- Path=/auth-service/**filters:- RewritePath=/auth-service/(?<path>.*), /$\{path}
feign:client:config:default:connectTimeout: 10000readTimeout: 10000
open:gateway:excludes: skipUrl:- /config/all/content- /auth/manager/captcha- /auth/manager/login- /auth/manager/isAlreadylogin- /config/dick/selectAllDick- /config/menu/selectTreeDick- /health
测试接口能否正常使用:
curl -X GET http://192.168.188.108:8171/auth-service/health
四、性能测试对比
4.1、1000个请求、100并发场景
-
kong 网关
[root@localhost wrk-4.2.0]# ab -n 1000 -c 100 http://192.168.188.101:8000/auth-service/health This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.101 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requestsServer Software: kong/3.9.0.0-enterprise-edition Server Hostname: 192.168.188.101 Server Port: 8000Document Path: /auth-service/health Document Length: 2 bytesConcurrency Level: 100 Time taken for tests: 0.321 seconds Complete requests: 1000 Failed requests: 0 Write errors: 0 Total transferred: 325331 bytes HTML transferred: 2000 bytes Requests per second: 3112.66 [#/sec] (mean) Time per request: 32.127 [ms] (mean) Time per request: 0.321 [ms] (mean, across all concurrent requests) Transfer rate: 988.91 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max Connect: 1 8 3.9 8 17 Processing: 3 21 9.9 18 67 Waiting: 3 19 9.3 15 62 Total: 10 29 10.8 28 79Percentage of the requests served within a certain time (ms)50% 2866% 3075% 3380% 3690% 4495% 4898% 6299% 70100% 79 (longest request) -
spring cloud gateway
[root@localhost wrk-4.2.0]# ab -n 1000 -c 100 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.108 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requestsServer Software:
Server Hostname: 192.168.188.108
Server Port: 8171Document Path: /auth-service/health
Document Length: 2 bytesConcurrency Level: 100
Time taken for tests: 0.676 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 182000 bytes
HTML transferred: 2000 bytes
Requests per second: 1478.79 [#/sec] (mean)
Time per request: 67.623 [ms] (mean)
Time per request: 0.676 [ms] (mean, across all concurrent requests)
Transfer rate: 262.83 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max
Connect: 0 9 7.2 7 32
Processing: 13 55 19.6 50 108
Waiting: 12 53 18.5 50 104
Total: 24 63 18.4 57 113Percentage of the requests served within a certain time (ms)50% 5766% 6975% 7880% 8290% 9095% 9898% 10599% 111100% 113 (longest request)
4.2、10000个请求、100并发场景
-
kong网关
[root@localhost wrk-4.2.0]# ab -n 10000 -c 100 http://192.168.188.101:8000/auth-service/health This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.101 (be patient) Completed 1000 requests Completed 2000 requests Completed 3000 requests Completed 4000 requests Completed 5000 requests Completed 6000 requests Completed 7000 requests Completed 8000 requests Completed 9000 requests Completed 10000 requests Finished 10000 requestsServer Software: kong/3.9.0.0-enterprise-edition Server Hostname: 192.168.188.101 Server Port: 8000Document Path: /auth-service/health Document Length: 2 bytesConcurrency Level: 100 Time taken for tests: 1.549 seconds Complete requests: 10000 Failed requests: 0 Write errors: 0 Total transferred: 3250520 bytes HTML transferred: 20000 bytes Requests per second: 6455.87 [#/sec] (mean) Time per request: 15.490 [ms] (mean) Time per request: 0.155 [ms] (mean, across all concurrent requests) Transfer rate: 2049.31 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max Connect: 1 5 2.0 5 13 Processing: 2 10 4.4 10 44 Waiting: 2 10 4.0 9 42 Total: 4 15 5.0 14 49Percentage of the requests served within a certain time (ms)50% 1466% 1675% 1880% 1990% 2395% 2598% 2899% 31100% 49 (longest request) -
spring cloud gateway
[root@localhost wrk-4.2.0]# ab -n 10000 -c 100 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.108 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requestsServer Software:
Server Hostname: 192.168.188.108
Server Port: 8171Document Path: /auth-service/health
Document Length: 2 bytesConcurrency Level: 100
Time taken for tests: 4.399 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 1820000 bytes
HTML transferred: 20000 bytes
Requests per second: 2273.37 [#/sec] (mean)
Time per request: 43.988 [ms] (mean)
Time per request: 0.440 [ms] (mean, across all concurrent requests)
Transfer rate: 404.06 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max
Connect: 0 4 4.7 2 36
Processing: 6 40 9.5 39 89
Waiting: 6 39 9.7 38 89
Total: 13 44 8.7 42 91Percentage of the requests served within a certain time (ms)50% 4266% 4575% 4780% 4990% 5595% 5998% 6699% 72100% 91 (longest request)
4.3、100000个请求、500并发场景
-
kong网关
[root@localhost wrk-4.2.0]# ab -n 100000 -c 500 http://192.168.188.101:8000/auth-service/health This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.101 (be patient) Completed 10000 requests Completed 20000 requests Completed 30000 requests Completed 40000 requests Completed 50000 requests Completed 60000 requests Completed 70000 requests Completed 80000 requests Completed 90000 requests Completed 100000 requests Finished 100000 requestsServer Software: kong/3.9.0.0-enterprise-edition Server Hostname: 192.168.188.101 Server Port: 8000Document Path: /auth-service/health Document Length: 2 bytesConcurrency Level: 500 Time taken for tests: 14.316 seconds Complete requests: 100000 Failed requests: 0 Write errors: 0 Total transferred: 32598168 bytes HTML transferred: 200000 bytes Requests per second: 6985.06 [#/sec] (mean) Time per request: 71.581 [ms] (mean) Time per request: 0.143 [ms] (mean, across all concurrent requests) Transfer rate: 2223.64 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max Connect: 0 33 64.3 29 3032 Processing: 13 38 18.7 35 353 Waiting: 3 37 18.5 35 352 Total: 23 70 67.0 65 3067Percentage of the requests served within a certain time (ms)50% 6566% 6775% 6980% 7190% 7595% 8198% 9399% 120100% 3067 (longest request) -
spring cloud gateway
[root@localhost wrk-4.2.0]# ab -n 100000 -c 500 http://192.168.188.108:8171/auth-service/health
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/Benchmarking 192.168.188.108 (be patient)
Completed 10000 requests
Completed 20000 requests
Completed 30000 requests
Completed 40000 requests
Completed 50000 requests
Completed 60000 requests
Completed 70000 requests
Completed 80000 requests
Completed 90000 requests
Completed 100000 requests
Finished 100000 requestsServer Software:
Server Hostname: 192.168.188.108
Server Port: 8171Document Path: /auth-service/health
Document Length: 2 bytesConcurrency Level: 500
Time taken for tests: 41.851 seconds
Complete requests: 100000
Failed requests: 0
Write errors: 0
Total transferred: 18200000 bytes
HTML transferred: 200000 bytes
Requests per second: 2389.42 [#/sec] (mean)
Time per request: 209.256 [ms] (mean)
Time per request: 0.419 [ms] (mean, across all concurrent requests)
Transfer rate: 424.68 [Kbytes/sec] receivedConnection Times (ms)min mean[+/-sd] median max
Connect: 0 130 711.8 2 15067
Processing: 7 73 13.3 71 285
Waiting: 6 73 13.0 70 234
Total: 19 203 712.8 74 15156Percentage of the requests served within a certain time (ms)50% 7466% 7775% 8180% 8490% 10495% 107898% 307299% 3093100% 15156 (longest request)
| kong网关与Spring cloud网关的性能对比 | |||
|---|---|---|---|
| 测试场景 | 指标 | Kong 网关 | Spring Cloud Gateway |
| 十万 请求, 10并发 | 请求完成时间 (秒) | 37.815 | 53.754 |
| 每秒请求数 (#/sec) | 2644.48 | 1860.34 | |
| 平均每个请求时间 (ms) | 3.781 | 5.375 | |
| 传输速率 (Kbytes/sec) | 839.31 | 330.65 | |
| 50% 响应时间 (ms) | 3 | 5 | |
| 95% 响应时间 (ms) | 8 | 7 | |
| 最大响应时间 (ms) | 20 | 83 | |
| 十万 请求, 50并发 | 请求完成时间 (秒) | 17.018 | 39.327 |
| 每秒请求数 (#/sec) | 5876.28 | 2542.79 | |
| 平均每个请求时间 (ms) | 8.509 | 19.663 | |
| 传输速率 (Kbytes/sec) | 1865.07 | 451.94 | |
| 50% 响应时间 (ms) | 8 | 19 | |
| 95% 响应时间 (ms) | 13 | 26 | |
| 最大响应时间 (ms) | 59 | 162 | |
| 十万 请求, 100 并发 | 请求完成时间 (秒) | 15.573 | 39.906 |
| 每秒请求数 (#/sec) | 6421.28 | 2505.89 | |
| 平均每个请求时间 (ms) | 15.573 | 39.906 | |
| 传输速率 (Kbytes/sec) | 2031.99 | 445.38 | |
| 50% 响应时间 (ms) | 15 | 38 | |
| 95% 响应时间 (ms) | 25 | 55 | |
| 最大响应时间 (ms) | 76 | 183 | |
| 十万 请求, 200 并发 | 请求完成时间 (秒) | 14.861 | 41.003 |
| 每秒请求数 (#/sec) | 6729.09 | 2438.82 | |
| 平均每个请求时间 (ms) | 29.722 | 82.007 | |
| 传输速率 (Kbytes/sec) | 2049.31 | 433.46 | |
| 50% 响应时间 (ms) | 29 | 79 | |
| 95% 响应时间 (ms) | 42 | 98 | |
| 最大响应时间 (ms) | 120 | 212 | |
| 十万 请求, 500 并发 | 请求完成时间 (秒) | 15.054 | 43.48 |
| 每秒请求数 (#/sec) | 6642.81 | 2299.91 | |
| 平均每个请求时间 (ms) | 75.269 | 217.4 | |
| 传输速率 (Kbytes/sec) | 2108.14 | 408.77 | |
| 50% 响应时间 (ms) | 68 | 81 | |
| 95% 响应时间 (ms) | 96 | 1091 | |
| 最大响应时间 (ms) | 1111 | 15144 | |
| Kong 网关在高并发情况下整体性能优于 Spring Cloud Gateway,主要体现在更快的响应时间、更高的每秒请求数以及较低的延迟波动。 |
相关文章:
kong 网关和spring cloud gateway网关性能测试对比
该测试只是简单在同一台机器设备对spring cloud gateway网关和kong网关进行对比,受限于笔者所拥有的资源,此处仅做简单评测。 一、使用spring boot 的auth-service作为服务提供者 该服务提供了一个/health接口,接口返回"OK"&…...
【2024 CSDN博客之星】个人收获分享
目录 [ C 语言 ] [ 数据结构 ] [ 算法 ] [ C ] [Linux] [Mysql] [Redis 文档学习] [Docker 云原生] [Git] [Qt] 转眼间大学就过了一年半,这一年半间好像习惯了,开心了那就学会吧,不开心了学会吧就开心了......期间在学习上面也走了…...
Codeforces Round 998 (Div. 3)(部分题解)
补题链接 A. Fibonacciness 思路:了解清楚题意,求得是最大的斐波那契的度,数组只有5个数(最多度为3),能列出其对应的式子 或 或 #include <bits/stdc.h> using namespace std; #define int long long void solve() {int …...
[创业之路-261]:《向流程设计要效率》-1-流程体系的建立是一场全方位的变革,一定会遇到各种阻力,需要全方位、系统性地进行流程管理
目录 一、思想和思维方式的转变 1.1 使能流程的战略 1.2 使能流程的组织 1. 流程决定组织 2. 基于流程分配责权利与资源 3. 从“管控”到“赋能” 1.3 使能流程的人才 1. 人才战略:从职能导向到流程导向 2. 能力模型:从职能专家到作战专家 3. …...
深入理解 Spring 的 Lazy Loading:原理、实现与应用场景
延迟加载(Lazy Loading)是 Spring 容器管理 Bean 的一种策略,指 只有在需要时(调用 getBean() 方法获取 Bean 时)才会实例化该 Bean。这是 Spring 提供的一种优化机制,用于提高启动效率和降低资源占用。 1.…...
扬帆数据结构算法之雅舟航程,漫步C++幽谷——LeetCode刷题之移除链表元素、反转链表、找中间节点、合并有序链表、链表的回文结构
人无完人,持之以恒,方能见真我!!! 共同进步!! 文章目录 一、移除链表元素思路一思路二 二、合并两个有序链表思路:优化: 三、反转链表思路一思路二 四、链表的中间节点思…...
【unity游戏开发之InputSystem——02】InputAction的使用介绍(基于unity6开发介绍)
文章目录 一、InputAction简介1、InputAction是什么?2、示例 二、InputAction参数相关1、点击齿轮1.1 Actions 动作(1)动作类型(Action Type)(2)初始状态检查(Initial State Check&a…...
Excel常用功能总结
Excel 是微软办公软件套装中的一个重要组件,用于数据处理和分析。以下是一些 Excel 的常用功能总结: 基本操作 1.单元格操作:选择、插入、删除单元格、行或列。 2.数据输入:输入文本、数字、日期和时间。 3.格式设置:设…...
【go语言】变量和常量
一、变量 1.1 变量的定义 程序 : 我们向电脑说了一段话,需要电脑才能理解 (沟通机制 ,xxx语言 -- 汇编 -- 机器码),电脑实际上识别的是机器码 : 0 1 1 1 0 1 (高低电频)…...
Node.js——express中间件(全局中间件、路由中间件、静态资源中间件)
个人简介 👀个人主页: 前端杂货铺 🙋♂️学习方向: 主攻前端方向,正逐渐往全干发展 📃个人状态: 研发工程师,现效力于中国工业软件事业 🚀人生格言: 积跬步…...
大语言模型的语境中“越狱”和思维链
大语言模型的语境中“越狱”和思维链 越狱(Jailbreaking) 含义:在大语言模型的语境中,“越狱”是指用户试图绕过语言模型的安全限制和使用规则,让模型生成违反伦理道德、包含有害内容(如暴力、歧视、恶意软件代码等)的输出。这些安全限制是由模型开发者设置的,目的是确…...
JAVA学习记录4
文章为个人学习记录,仅供参考,如有错误请指出。 上期说到IDEA的安装,具体的使用方法就不记录了。这篇主要记录一些基础语法。 类型转换-自动类型转换 类型范围小的变量,可以直接赋值给类型范围大的变量。 在表达式中&…...
手机网络性能测试仪器介绍
手机网络性能测试仪器是用于检测和评估手机网络性能的精密设备。这些仪器通常具备多种测试功能,以确保手机在不同网络环境下的表现都能得到准确评估。以下是对手机网络性能测试仪器的详细介绍: 一、主要类型 手机综合测试仪:如R&SCMU200…...
vue3+ts watch 整理
watch() 一共可以接受三个参数,侦听数据源、回调函数和配置选项 作用:监视数据的变化(和Vue2中的watch作用一致) 特点:Vue3中的watch只能监视以下四种数据: ref定义的数据。 reactive定义的数据。 函数返…...
【Elasticsearch入门到落地】6、索引库的操作
接上篇《5、安装IK分词器》 上一篇我们进行了IK分词器的安装与测试,本篇我们来学习ElasticSearch的索引库的操作,学习mapping映射属性以及CRUD操作。 一、前情回顾 我们在前几篇学习了ElasticSearch的基本概念,并动手搭建了ElasticSearch环…...
Java TCP可靠传输(1)
TCP 可靠传输 一. 确认应答 由发送方填充,再由接收方在序号的基础上1,填充到确认序号中,来表示已经接收到前面发送的,表明下一个从哪个位置发送。 二. 超时重传 数据在网络上传输时会经过很多网络设备,如果其中一个…...
ipad和macbook同步zotero文献附件失败的解决办法
背景:我所有的文献及其附件pdf都是在台式机(windows系统),想要把这些文献同步到云上,然后再从云上同步到平板和其他笔记本电脑比如macbook。文献同步虽已成功,但文献附件都无法打开。 平板报错如下…...
linux-ubuntu学习笔记碎记
~指/home/user_name这个目录 查看软件安装目录:whereis vim 查看当前路径:pwd 终端中键入ctrls会挂起终端,即终端不响应键鼠;ctrlq可以恢复。 和虚拟机开启共享文件夹互传文件 点击桌面,按ctrlaltt,开…...
RV1126+FFMPEG推流项目(11)编码音视频数据 + FFMPEG时间戳处理
本节介绍本章节主要讲解的是push_server_thread线程的具体处理流程, push_server_thread这个线程的主要功能是通过时间戳比较,来处理音频、视频的数据并最终推流到SRT、RTMP、UDP、RTSP服务器 push_server_thread:流程如下 上图,…...
人工智能的出现,给生命科学领域的研究带来全新的视角|行业前沿·25-01-22
小罗碎碎念 今天和大家分享一份白皮书,系统总结并陈述人工智能在生命科学领域的应用。 人工智能在生命科学领域的应用,具体包括——单细胞转录组、疾病诊疗、医疗文本处理、RNA结构预测等多个方面,通过这份报告,我们可以详细了解相…...
智慧工地云平台源码,基于微服务架构+Java+Spring Cloud +UniApp +MySql
智慧工地管理云平台系统,智慧工地全套源码,java版智慧工地源码,支持PC端、大屏端、移动端。 智慧工地聚焦建筑行业的市场需求,提供“平台网络终端”的整体解决方案,提供劳务管理、视频管理、智能监测、绿色施工、安全管…...
汽车生产虚拟实训中的技能提升与生产优化
在制造业蓬勃发展的大背景下,虚拟教学实训宛如一颗璀璨的新星,正发挥着不可或缺且日益凸显的关键作用,源源不断地为企业的稳健前行与创新发展注入磅礴强大的动力。就以汽车制造企业这一极具代表性的行业主体为例,汽车生产线上各类…...
【git】把本地更改提交远程新分支feature_g
创建并切换新分支 git checkout -b feature_g 添加并提交更改 git add . git commit -m “实现图片上传功能” 推送到远程 git push -u origin feature_g...
OPENCV形态学基础之二腐蚀
一.腐蚀的原理 (图1) 数学表达式:dst(x,y) erode(src(x,y)) min(x,y)src(xx,yy) 腐蚀也是图像形态学的基本功能之一,腐蚀跟膨胀属于反向操作,膨胀是把图像图像变大,而腐蚀就是把图像变小。腐蚀后的图像变小变暗淡。 腐蚀…...
基于Java+VUE+MariaDB实现(Web)仿小米商城
仿小米商城 环境安装 nodejs maven JDK11 运行 mvn clean install -DskipTestscd adminmvn spring-boot:runcd ../webmvn spring-boot:runcd ../xiaomi-store-admin-vuenpm installnpm run servecd ../xiaomi-store-vuenpm installnpm run serve 注意:运行前…...
为什么要创建 Vue 实例
核心原因:Vue 需要一个「控制中心」来驱动整个应用 你可以把 Vue 实例想象成你应用的**「大脑」或「引擎」。它负责协调模板、数据、逻辑和行为,将它们变成一个活的、可交互的应用**。没有这个实例,你的代码只是一堆静态的 HTML、JavaScript 变量和函数,无法「活」起来。 …...
OD 算法题 B卷【正整数到Excel编号之间的转换】
文章目录 正整数到Excel编号之间的转换 正整数到Excel编号之间的转换 excel的列编号是这样的:a b c … z aa ab ac… az ba bb bc…yz za zb zc …zz aaa aab aac…; 分别代表以下的编号1 2 3 … 26 27 28 29… 52 53 54 55… 676 677 678 679 … 702 703 704 705;…...
【p2p、分布式,区块链笔记 MESH】Bluetooth蓝牙通信 BLE Mesh协议的拓扑结构 定向转发机制
目录 节点的功能承载层(GATT/Adv)局限性: 拓扑关系定向转发机制定向转发意义 CG 节点的功能 节点的功能由节点支持的特性和功能决定。所有节点都能够发送和接收网格消息。节点还可以选择支持一个或多个附加功能,如 Configuration …...
归并排序:分治思想的高效排序
目录 基本原理 流程图解 实现方法 递归实现 非递归实现 演示过程 时间复杂度 基本原理 归并排序(Merge Sort)是一种基于分治思想的排序算法,由约翰冯诺伊曼在1945年提出。其核心思想包括: 分割(Divide):将待排序数组递归地分成两个子…...
Canal环境搭建并实现和ES数据同步
作者:田超凡 日期:2025年6月7日 Canal安装,启动端口11111、8082: 安装canal-deployer服务端: https://github.com/alibaba/canal/releases/1.1.7/canal.deployer-1.1.7.tar.gz cd /opt/homebrew/etc mkdir canal…...
