Mycat分库分表实时同步到GreatSQL

Vivado FPGA 工程模板:参数化消抖、PWM 与 XDC 约束 这份工程模板解决 FPGA 起步阶段的工程骨架与踩坑问题。含可综合的参数化按键消抖(两级同步消亚稳态)、参数化 PWM(0/满占空比边界修复)、顶层呼吸灯示例、XDC 时钟与 IO 约束模板、Tcl 一键建工程脚本。面向 STM32 开发者向 FPGA 扩展,换 Artix-7/Kintex/Zynq 只需改器件与引脚。 立即下载

这个事情怎么产生的

MyCat作为经典的分库分表中间件,在长时间内被广泛认为是管理超大MySQL数据库集合的有效解决方案。近来接到客户需求,需要将MyCat集群迁移到GreatSQL中,并且在一段时间内需要实时从MyCat中同步数据到GreatSQL中,全量同步数据比较容易操作,增量同步有如下两个棘手的问题:

  1. 多个server,不同的库名字,都要同步到GreatSQL一个库中,即同步关系如下
    server1:db1.tab->gdb:db.tab;
    server2:db2.tab->gdb:db.tab;
    server3:db3.tab->gdb:db.tab;
  2. ddl同步多次执行会冲突。当MyCat的表中添加一个索引、添加一个字段时,实际上是后端所有db都会执行这个DDL,同步到GreatSQL时,多次执行DDL,复制会异常中断。

为了解决上面两个问题,经过查询资料,发现有两个不常用,官方也不建议使用的功能,刚好能够满足需求

  1. 为解决库名映射问题:需要在配置文件中添加参数
    replicate_rewrite_db="channel_1:test_rep1->test_rep"
    replicate_rewrite_db="channel_2:test_rep2->test_rep"
    replicate_rewrite_db="channel_3:test_rep3->test_rep"
  2. 为了解决DDL同步后重复执行导致复制中断问题,在配置文件中添加
    slave-skip-errors=ddl_exist_errors

验证一下

为了简化问题,MyCat集群咱们就不搭建了,简化为多源同步复制问题。

1.初始化4个实例,同步关系如下

源端口源DB_NAME目标端口目标映射DBchannel_name
3306test_rep13309test_repchannel_3306
3307test_rep23309test_repchannel_3307
3308test_rep33309test_repchannel_3308

2.在3309的实例配置文件中,添加库映射关系配置和DDL冲突忽略参数

replicate_rewrite_db="channel_3306:test_rep1->test_rep"
replicate_rewrite_db="channel_3307:test_rep2->test_rep"
replicate_rewrite_db="channel_3308:test_rep3->test_rep"
slave-skip-errors=ddl_exist_errors

4.在3309实例中,配置三个channel

greatsql> change master to MASTER_HOST = '172.17.137.91',MASTER_USER = 'greatsql',MASTER_PASSWORD = 'greatsql',MASTER_PORT = 3306,MASTER_AUTO_POSITION = 1 FOR CHANNEL 'channel_3306';

greatsql> change master to MASTER_HOST = '172.17.137.91',MASTER_USER = 'greatsql',MASTER_PASSWORD = 'greatsql',MASTER_PORT = 3307,MASTER_AUTO_POSITION = 1 FOR CHANNEL 'channel_3307';

greatsql> change master to MASTER_HOST = '172.17.137.91',MASTER_USER = 'greatsql',MASTER_PASSWORD = 'greatsql',MASTER_PORT = 3308,MASTER_AUTO_POSITION = 1 FOR CHANNEL 'channel_3308';

greatsql> start slave;

3.检查channel配置状态

greatsql> show slave status \G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for source to send event
                  Master_Host: 172.17.137.91
                  Master_User: greatsql
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: binlog.000002
          Read_Master_Log_Pos: 1119
               Relay_Log_File: relaylog-channel_3306.000007
                Relay_Log_Pos: 397
        Relay_Master_Log_File: binlog.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1119
              Relay_Log_Space: 606
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 3306
                  Master_UUID: 5facacd7-9ed6-11ee-b76b-00163e5af5d6
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 
            Executed_Gtid_Set: 49b66af0-9ed6-11ee-ae4f-00163e5af5d6:3,
5a369d0b-9ed6-11ee-b3d1-00163e5af5d6:3,
5facacd7-9ed6-11ee-b76b-00163e5af5d6:1-4,
9a5f9c26-4262-11ee-85fd-00163e5af5d6:1-16571224
                Auto_Position: 1
         Replicate_Rewrite_DB: (test_rep1,test_rep)
                 Channel_Name: channel_3306
           Master_TLS_Version: 
       Master_public_key_path: 
        Get_master_public_key: 0
            Network_Namespace: 
*************************** 2. row ***************************
               Slave_IO_State: Waiting for source to send event
                  Master_Host: 172.17.137.91
                  Master_User: greatsql
                  Master_Port: 3307
                Connect_Retry: 60
              Master_Log_File: binlog.000002
          Read_Master_Log_Pos: 1119
               Relay_Log_File: relaylog-channel_3307.000004
                Relay_Log_Pos: 1034
        Relay_Master_Log_File: binlog.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1119
              Relay_Log_Space: 1243
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 3307
                  Master_UUID: 5a369d0b-9ed6-11ee-b3d1-00163e5af5d6
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 5a369d0b-9ed6-11ee-b3d1-00163e5af5d6:1-2:4
            Executed_Gtid_Set: 49b66af0-9ed6-11ee-ae4f-00163e5af5d6:3,
5a369d0b-9ed6-11ee-b3d1-00163e5af5d6:3,
5facacd7-9ed6-11ee-b76b-00163e5af5d6:1-4,
9a5f9c26-4262-11ee-85fd-00163e5af5d6:1-16571224
                Auto_Position: 1
         Replicate_Rewrite_DB: (test_rep2,test_rep)
                 Channel_Name: channel_3307
           Master_TLS_Version: 
       Master_public_key_path: 
        Get_master_public_key: 0
            Network_Namespace: 
*************************** 3. row ***************************
               Slave_IO_State: Waiting for source to send event
                  Master_Host: 172.17.137.91
                  Master_User: greatsql
                  Master_Port: 3308
                Connect_Retry: 60
              Master_Log_File: binlog.000002
          Read_Master_Log_Pos: 1119
               Relay_Log_File: relaylog-channel_3308.000004
                Relay_Log_Pos: 1034
        Relay_Master_Log_File: binlog.000002
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 1119
              Relay_Log_Space: 1243
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 3308
                  Master_UUID: 49b66af0-9ed6-11ee-ae4f-00163e5af5d6
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
           Master_Retry_Count: 86400
                  Master_Bind: 
      Last_IO_Error_Timestamp: 
     Last_SQL_Error_Timestamp: 
               Master_SSL_Crl: 
           Master_SSL_Crlpath: 
           Retrieved_Gtid_Set: 49b66af0-9ed6-11ee-ae4f-00163e5af5d6:1-2:4
            Executed_Gtid_Set: 49b66af0-9ed6-11ee-ae4f-00163e5af5d6:3,
5a369d0b-9ed6-11ee-b3d1-00163e5af5d6:3,
5facacd7-9ed6-11ee-b76b-00163e5af5d6:1-4,
9a5f9c26-4262-11ee-85fd-00163e5af5d6:1-16571224
                Auto_Position: 1
         Replicate_Rewrite_DB: (test_rep3,test_rep)
                 Channel_Name: channel_3308
           Master_TLS_Version: 
       Master_public_key_path: 
        Get_master_public_key: 0
            Network_Namespace: 
3 rows in set, 1 warning (0.00 sec)

在上面的输出中,可以重点关注如下字段信息,说明db转换映射成功

$ MYSQL_PWD=greatsql mysql -ugreatsql -h127.0.0.1 -P3309 -e 'show replica status \G'| grep -wE 'Replica_IO_Running|Replica_SQL_Running|Replicate_Rewrite_DB|Channel_Name'
           Replica_IO_Running: Yes
          Replica_SQL_Running: Yes
         Replicate_Rewrite_DB: (test_rep1,test_rep)
                 Channel_Name: channel_3306
           Replica_IO_Running: Yes
          Replica_SQL_Running: Yes
         Replicate_Rewrite_DB: (test_rep2,test_rep)
                 Channel_Name: channel_3307
           Replica_IO_Running: Yes
          Replica_SQL_Running: Yes
         Replicate_Rewrite_DB: (test_rep3,test_rep)
                 Channel_Name: channel_3308

在3309实例中,查询replica_skip_errors,确认复制异常跳过的错误码,设置为ddl_exist_errors会自动转换为如下错误码

greatsql> select @@replica_skip_errors;
+---------------------------------------------------+
| @@replica_skip_errors                             |
+---------------------------------------------------+
| 1007,1008,1050,1051,1054,1060,1061,1068,1091,1146 |
+---------------------------------------------------+
1 row in set (0.00 sec)

5.数据同步验证

  1. 在3309库中,创建database test_rep

这个库需要手动创建,是测试发现映射关系只对库下面的表生效,库不会自动转换创建。

  1. 在3306库中,创建database test_rep1,并且创建tab1表
    $ mysql -ugreatsql -h127.0.0.1 -p -P3306 -s
    

greatsql> create database test_rep1; greatsql> use test_rep1; greatsql> create table tab1(id int primary key auto_increment, cname varchar(10), age int);

3. 在3307库中,创建database test_rep2,并且创建tab1表

$ mysql -ugreatsql -h127.0.0.1 -p -P3307 -s

greatsql> create database test_rep2; greatsql> use test_rep2; greatsql> create table tab1(id int primary key auto_increment, cname varchar(10), age int);

4. 在3308库中,创建database test_rep3,并且创建tab1表

$ mysql -ugreatsql -h127.0.0.1 -p -P3308 -s

greatsql> create database test_rep3; greatsql> use test_rep3; greatsql> create table tab1(id int primary key auto_increment, cname varchar(10), age int);

5. 在3309中确认database及表的同步

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s

greatsql> show databases; Database information_schema mysql performance_schema sys test_db test_rep test_rep1 test_rep2 test_rep3

greatsql> show tables from test_rep; Tables_in_test_rep tab1 greatsql> show tables from test_rep1; greatsql> show tables from test_rep2; greatsql> show tables from test_rep3;

从上面的信息可以看出,在3309中,3306、3307、3308中创建的库均按照原有的名字进行了同步,但是表只同步在了3309映射的库test_rep中。

6. 分别在3306、3307、3308中插入一条记录

3306 : insert into test_rep1.tab1 values(1,'a',10); 3307 : insert into test_rep2.tab1 values(2,'b',20); 3308 : insert into test_rep3.tab1 values(3,'c',30);

然后在各自节点查询数据插入情况

$ mysql -ugreatsql -h127.0.0.1 -p -P3306 -s test_rep1 -e 'select * from tab1' id cname age 1 a 10

$ mysql -ugreatsql -h127.0.0.1 -p -P3307 -s test_rep2 -e 'select * from tab1' id cname age 2 b 20

$ mysql -ugreatsql -h127.0.0.1 -p -P3308 -s test_rep3 -e 'select * from tab1' id cname age 3 c 30

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s test_rep -e 'select * from tab1' id cname age 1 a 10 2 b 20 3 c 30

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s test_rep1 -e 'select * from tab1' ERROR 1146 (42S02) at line 1: Table 'test_rep1.tab1' doesn't exist

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s test_rep2 -e 'select * from tab1' ERROR 1146 (42S02) at line 1: Table 'test_rep2.tab1' doesn't exist

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s test_rep3 -e 'select * from tab1' ERROR 1146 (42S02) at line 1: Table 'test_rep3.tab1' doesn't exist


从上面的查询情况可以看出,3306、3307、3308节点中只有一条记录,并且记录都被同步到了3309的test_rep.tab1表中,而且在3309的test_rep1、test_rep2、test_rep3中是没有表存在的。

7. 分别在3306、3307、3308给表tab创建一个索引

greatsql> alter table tab1 add index idx_cname(cname);

8. 观察3309中表的索引情况,可以看到索引idx_cname被同步过来了

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s

greatsql> use test_rep greatsql> show create table tab1 \G *** 1. row *** Table: tab1 Create Table: CREATE TABLE tab1 ( id int NOT NULL AUTO_INCREMENT, cname varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, age int DEFAULT NULL, PRIMARY KEY (id), KEY idx_cname (cname) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.00 sec)

9. 分别在3306、3307、3308做update、delete操作

greatsql> update test_rep1.tab1 set age=110 where id=1; greatsql> update test_rep2.tab1 set age=120 where id=2; greatsql> update test_rep3.tab1 set age=130 where id=3;

greatsql> delete from test_rep1.tab1 where id=1; greatsql> delete from test_rep2.tab1 where id=1; greatsql> delete from test_rep3.tab1 where id=1;

查看3309的数据同步情况,确认数据被清理

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -s Welcome to the MySQL monitor. Commands end with ; or \g. greatsql> select * from test_rep.tab1;


10. 观察3个channel的同步情况,可以确认三个复制同步均正常

$ mysql -ugreatsql -h127.0.0.1 -p -P3309 -e 'show replica status \G'| grep -E 'Replica_IO_Running|Replica_SQL_Running|Channel_Name' greatsql: [Warning] Using a password on the command line interface can be insecure. Replica_IO_Running: Yes Replica_SQL_Running: Yes Replica_SQL_Running_State: Replica has read all relay log; waiting for more updates Channel_Name: channel_3306 Replica_IO_Running: Yes Replica_SQL_Running: Yes Replica_SQL_Running_State: Replica has read all relay log; waiting for more updates Channel_Name: channel_3307 Replica_IO_Running: Yes Replica_SQL_Running: Yes Replica_SQL_Running_State: Replica has read all relay log; waiting for more updates Channel_Name: channel_3308

``` 至此dml、ddl同步均验证。

方案缺陷

  1. 本方案中,业务访问MyCat的表名字,和server后端的表名字完全一致,只是库名字不相同,然后MyCat代理表名和实际server的表名字可以不相同,这种情况下,暂时无法映射处理
  2. MyCat代理的实际上是多个单独的库,如果这些库之前没有做自增主键步长处理,或者其他一些主键不重复策略,同步过程中,会存在主键冲突导致数据同步中断的情况,需要提前准备处理方案。

最后附上参考资料

Enjoy GreatSQL :)


关于GreatSQL

GreatSQL数据库是一款开源免费数据库,可在普通硬件上满足金融级应用场景,具有高可用、高性能、高兼容、高安全等特性,可作为MySQL或Percona Server for MySQL的理想可选替换。

相关链接

GreatSQL社区

Gitee

Github

Bilibili

技术交流群

微信:添加GreatSQL社区助手好友,微信号wanlidbc发送验证信息加群

QQ群:533341697

Enjoy GreatSQL :)

关于 GreatSQL

GreatSQL是适用于金融级应用的国内自主开源数据库,具备高性能、高可靠、高易用性、高安全等多个核心特性,可以作为MySQL或Percona Server的可选替换,用于线上生产环境,且完全免费并兼容MySQL或Percona Server。

相关链接: GreatSQL社区 Gitee GitHub Bilibili

GreatSQL社区:

image

社区有奖建议反馈: https://greatsql.cn/thread-54-1-1.html

社区博客有奖征稿详情: https://greatsql.cn/thread-100-1-1.html

(对文章有疑问或者有独到见解都可以去社区官网提出或分享哦~)

技术交流群:

微信&QQ群:

QQ群:533341697

微信群:添加GreatSQL社区助手(微信号:wanlidbc )好友,待社区助手拉您进群。

四旋翼无人机模糊自适应PID控制,俯仰姿态控制律设计研究(Matlab代码、Simulink仿真实现) 内容概要:本文围绕四旋翼无人机的俯仰姿态控制问题,深入研究了模糊自适应PID控制律的设计与实现。通过结合模糊逻辑系统的自适应能力与传统PID控制器的稳定性,构建了一种能够在复杂动态环境中有效应对外部扰动和模型不确定性的先进控制策略。研究详细阐述了控制系统的结构设计、模糊规则库的建立、隶属度函数的选取以及PID参数的在线调整机制,并利用Matlab/Simulink工具进行了完整的建模与仿真实验,验证了所提方法在响应速度、超调量和抗干扰能力等方面相较于传统PID控制的显著优越性。; 适合人群:具备自动控制理论基础和Matlab/Simulink仿真经验的自动化、航空航天及相关专业的本科生、研究生及科研人员。; 使用场景及目标:①学习和掌握模糊自适应PID控制器的设计原理与方法;②研究无人机姿态控制算法的性能提升途径;③完成相关课程设计、毕业设计或科研项目的仿真验证工作。; 阅读建议:建议读者结合Matlab代码与Simulink模型,深入理解控制算法的实现细节,并尝试调整系统参数和仿真条件,以探究不同因素对控制性能的影响,从而达到理论与实践相结合的学习目的。 立即下载

相关推荐

复现基于李雅普诺夫的多个欠驱动无人船协同路径跟踪Matlab仿真

内容概要:本文详细介绍了基于李雅普诺夫稳定性理论的多个欠驱动无人船协同路径跟踪控制方法的Matlab仿真研究。通过建立非线性动力学模型,设计分布式协同控制器,并利用李雅普诺夫函数严格证明系统的渐近稳定性,实现了多艘无人船在复杂海洋环境下的高精度路径跟踪与稳定编队保持。文中系统阐述了控制器的设计原理、稳定性分析过程、仿真参数配置及多种典型场景下的仿真实验结果,充分验证了该方法在提升编队协同性、抗外部干扰能力和鲁棒性方面的显著优势。; 适合人群:具备自动控制理论、非线性系统分析基础以及Matlab/Simulink仿真能力的研究生、科研人员,以及从事无人系统、船舶自动化、多智能体协同控制等领域研发工作的工程师。; 使用场景及目标:①用于多智能体系统协同控制算法的研究与教学示范;②为欠驱动船舶的路径跟踪控制、海上集群航行等实际工程应用提供可靠的算法设计思路与仿真验证平台;③支撑相关领域高水平论文撰写、科研项目申报与关键技术攻关。; 阅读建议:建议读者结合提供的Matlab代码逐模块研读,重点关注李雅普诺夫函数的构造技巧与控制器参数的整定方法,并尝试在不同环境扰动(如海流、风浪)下进行仿真实验,以深入理解系统的鲁棒性与适应性。

MySQL主从复制、读写分离(MayCat2)实现数据同步

MySQL主从又叫Replication、AB复制。简单讲就是A与B两台机器做主从后,在A上写数据,另外一台B也会跟着写数据,实现数据实时同步。有这样几个关键点:1)MySQL主从是基于binlog,主上需开启binlog才能进行主从;2)主从过程大概有3个步骤;3)主将更改操作记录到binlog里;4)从将主的binlog事件(SQL语句) 同步本机上并记录在relaylog里;5)从根据relaylog里面的SQL语句按顺序执行。

qq_53715074的博客 3459

HDRnet——双边滤波和仿射变换的摇身一变

layer层数越多,下采样得到的图越小,low-level features的好处是最后的grid会更coarser,最后的特征图的感受野也越多,非线性更好,表达力更强。所以最终grid是5维的[B,in*out,n,H,W],permute之后是[B,H,W,n,in*out],B是batchsize,n表示对guide的量化级数,in*out表示每个cell的变换系数。这部分的处理对象是低分辨率图,利用CNN进行特征提取(局部和全局),最后fuse得到grid,这里面包含了变换的系数。

zcg1942的博客 1588

MyCAT实现mysql8主从同步读写分离

配置文件位置mycat/conf/user/{用户名}.user.json。这个配置文件主要是用来配置MyCAT的登录用户的,也就是我们连接8066这个端口的用户信息。"ip":null,配置说明1)dialect:数据库(方言)类型2)ip:配置白名单使用,一般写null 如果要限制这个用户3)password:配置MyCAT用户的密码(明文)4)isolation:设置初始化的事务隔离级别REPEATED_READ:3,默认。

m0_73907449的博客 964

离散数学 --- 图论基础 --- 图的同构,通路与回路,可达性与最短通路

同一个图(这里的图是抽象的数学定义)可以有不同的图形表示方法1.重数:两点之间的平行边的个数1.得到 n!的过程,一个图中的一个结点在另一个图中对应的结点有n种可能(黄框中定义的图来讨论),这个对应好后下一个结点有 n - 1 种可能,再下一个有n-2种,直到最后一个为1,所有可能的结果就等于 n * (n - 1) *(n - 2)*....*1 = n!2.虽然说找对应结点很困难,但不是没有规律可循的。比如1.两个相互对应的结点的度数要相同;

qq_51947882的博客 7447

CRMEB商城系统任意文件下载漏洞(CVE-2024-52726)分析与修复

在Web应用安全领域,API接口安全是保障系统边界安全的核心环节。其原理在于通过签名验证、参数校验等机制,确保请求的合法性与完整性。这项技术的价值在于为系统间数据交互提供安全通道,防止未授权访问和数据泄露。典型的应用场景包括电商系统的对外数据接口、第三方服务集成等。然而,当签名验证逻辑存在缺陷或文件路径处理不当,便会引发严重的安全风险。本文以CRMEB开源商城系统为例,深入剖析其对外API模块中因签名验证绕过和路径遍历导致的任意文件下载漏洞。该漏洞允许攻击者下载服务器敏感文件,如数据库配置文件、日志和源码,

weixin_27722377的博客 383

SQL的同步

1。首先遇到的问题,其实是两个地方的线路如何沟通的问题,怎么样才可以保证网络的通畅和稳定是大多数人首先考虑的问题,如果没有稳定和通畅的网络环境,那么再好的数据库同步方案也是白搭。那么我推荐是这样的,首先通过调制解调器的方式不予考虑,原因是这样的,第一电话线路比较容易受到干扰,数据链路不稳定,容易断线。第二速度慢(56K),不适合于大规模数据的同步任务,第三费用昂贵,因为北京到上海的长途费用昂贵,如

enginetanmary的专栏 1205

第1章>>1.5:神电测控为什么开发LabVIEW ZYNQ FPGA软件工具包?(ZYNQ芯片的特点与优势)《LabVIEW ZYNQ FPGA宝典》

ZYNQ是赛灵思公司(Xilinx)推出的新一代全可编程片上系统(APSoC,All-Programmable SoC),它将处理器的软件可编程性与FPGA的硬件可编程性进行完美整合,以提供无与伦比的系统性能、灵活性与可扩展性。Zynq-7000系列是Xilinx于2010年4月推出的行业第一个可扩展处理平台,旨在为视频监视、汽车驾驶员辅助、工厂自动化、医疗器械等高端嵌入式应用提供所需的处理能力与计算性能。这款基于ARM处理器的SoC可满足复杂嵌入式系统的高性能、低功耗和多核处理能力等要求。

qq_40694786的博客 1660

Sql server数据同步2种方式 CDC(Change Data Capture )和CT (Change Tracking)(附详细操作流程)

文章目录一.Sql server二.特征以及优点:三.CDC四.CDC操作步骤(1)开启代理服务(Agent服务)(2)配置额外的磁盘空间(3)开启数据库级别的cdc (di 为数据库)(4)添加cdc专用的文件组和文件(5)开启表级别的cdc五.CDC展示(1)cdc表结构说明(2)展示:六. todo 从sql server 实时同步到不同类型数据库 oracle mysql postgresql的方案以及CT后面有时间再写 一.Sql server 为了应对数据库中DML(insert/upda

不是一枚开发 8万+

uniapp - 解决App端报错reportJSException >>>> exception function:createInstanceContext, exception:white sc

uni-app,安卓Android,苹果ios,安卓app端,苹果App端,uniapp苹果安卓app,uniApp报错,reportJSException>>>>exceptionfunction:createInstanceContext,exception:whitescreencausecreateinstanceContextfailed,运行自定义基座时白屏,uniapp项目运行白屏reportJSException,检查没问题依旧报错,第三方库插件,组件,uniapp打包调试

🏆 前端领域优质创作者 1万+

YOLOv12涨点改进 | 全网首发,Conv改进篇 | CVPR 2025 | YOLOv12引入FDConv频率动态卷积,含A2C2f_FDConv二次创新模块,能够捕捉更加丰富和复杂的特征信息

本文提出了一种改进YOLOv12目标检测模型的方法——频率动态卷积(FDConv)。FDConv通过增强卷积核的频率响应多样性,使模型能够更好地处理不同频率信息,从而提高检测精度。该方法包含三个关键组件:傅里叶离散权重(FDW)实现频率分组,核空间调制(KSM)动态调整频率响应,以及频率带调制(FBM)进行频域调节。实验结果表明,FDConv能以较少的参数增长(仅增加3.6M)显著提升模型性能,在目标检测、实例分割等任务中优于传统动态卷积方法。该方法可灵活集成到ResNet、ConvNeXt等多种架构中。

Ai缝合怪、助力小伙伴高效发论文 431

Mysql 主从同步状态检查

show slave status \G 参数详解 1 Slave_IO_State:SHOW PROCESSLIST输出的State字段的拷贝。 Master_User:被用于连接主服务器的当前用户。 Master_Port:当前的主服务器接口。 Connect_Retry:–master-connect-retry选项的当前值,连接重试时间 Master_Log_File:I/O线程当前正在读取的主服务器二进制日志文件的名称。 Read_Master_Log_Pos:在当前的主服务器二进制

qq_18629653的博客 4187

C# HttpClient完全攻略:从入门到精通只需5步

HttpClient是.NET框架中用于发送HTTP请求和接收HTTP响应的类。它基于异步编程模型,使得网络操作更加高效和灵活。

java专栏 1588

MyCat分库分表实时同步到GreatSQL

*GreatSQL社区原创内容未经授权不得随意使用,转载请联系小编并注明来源。这个事情怎么产生的MyCat作为经典的分库分表中间件,在长时间内被广泛认为是管理超大MySQL数据库集合的有效解决方案。近来接到客户需求,需要将MyCat集群迁移到GreatSQL中,并且在一段时间内需要实时从MyCat中同步数据到GreatSQL中,全量同步数据比较容易操作,增量同步有如下两个棘手的问题:多个serv...

老叶茶馆 184

2026数学建模国赛D题:时频冲突检测与消解 论文解析

最终无需撤销任何计划,共调整110个计划,其中频移43个、时移48个、间隔调整19个,总调整幅度528。附件模板只要求填写新增计划的频段区间和首次时间区间,没有要求填写宽度、间隔和次数,因此本文按附件中C类装备的统一需求特征处理:每个新增计划占用3个连续频段,持续2个时间单位,间隔8,使用12次。本文针对有限频带内大量周期性用频计划的时频冲突检测、单参数消解、无冲突条件下新增C类计划装载,以及允许调整间隔时长后的再次消解问题,建立了由占用展开、冲突图、组合动作集、精确约束满足和二维资源装箱组成的统一模型。

YOLO 195

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

MyCat 读写分离与分库分表

一、Mycat 简介 Mycat 是一个开源的数据库中间件,可以解决分布式数据库环境下的大多数问题,如读写分离、分库分表等,除此之外,它还具备以下特性: 支持 MySQL、Oracle、DB2、SQL Server、PostgreSQL 等数据库常见的 SQL 语法。 能够基于心跳机制进行自动地故障切换,支持读写分离,支持MySQL主从架构,以及 galera cluster 集群。 支持数据的...

黑白影的博客 716

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

MySQL做业务读写vip,一定要用开源组件吗

MySQL久经沙场,各种架构,各种生态组件,各种业务各种用法千奇百怪。今天盘点一下常用的高可用架构都有哪些,以及国产兼容MySQL产品的架构有那些变革。 1、主备复制架构:在数据多副本备份场景下,传统的主从复制架构中,一般从库作为主库数据的备份,执行异步或者半同步复制,当主库发生故障时,临时启用备库数据,对外提供...

weixin_41097431的博客 156

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

MyCAT 2实现mysql8主从同步读写分离

这个配置文件主要是用来配置MyCAT的登录用户的,也就是我们连接8066这个端口的用户信息。配置文件位置:mycat/conf/user/{用户名}.user.json"ip":null,配置说明:1)dialect:数据库(方言)类型2)ip:配置白名单使用,一般写null 如果要限制这个用户3)password:配置MyCAT用户的密码(明文)4)isolation:设置初始化的事务隔离级别REPEATED_READ:3,默认。

obboda的博客 1280

mysql查看主从同步状态的方法

mysql查看主从同步状态的方法

lizhengyu891231的博客 1万+

mycat mysql主从同步_Mycat+Mysql主从复制实现双机热备

Mycat+Mysql主从复制实现双机热备一、mysql主从配置原理双机热备的概念简单说一下,就是要保持两个数据库的状态自动同步。对任何一个数据库的操作都自动应用到另外一个数据库,始终保持两个数据库中的数据一致。 这样做有如下几点好处: 1. 可以做灾备,其中一个坏了可以切换到另一个。 2. 可以做负载均衡,可以将请求分摊到其中任何一台上,提高网站吞吐量。 对于异地热备,尤其适合灾备。 二、mys...

weixin_42515339的博客 1033

Mysql+Mycat实现数据库主从同步与读写分离

下载网站:www.SyncNavigator.CN客服QQ1793040---------------------------------------------------------- 关于HKROnline SyncNavigator 注册机价格的问题 HKROnline SyncNavigator 8.4.1 非破解版 注册机 授权激活教程 ...

weixin_49055101的博客 818

mycat 主从复制 步骤

启动命令: cd/home/mycat/app/mycat/bin/ ./mycat start 进入mycat数据库 mysql -umycat -pmycat -h127.0.0.1 -P8066 -DMycatSchema 设置master数据库 1、修改主服务器配置: #vi /etc/my.cnf binlog-do-db=db1

thertno的专栏 3300

使用mycat搭建实现mysql数据库集群管理

今天来使用mycat管理mysql集群, 随着数据量的提升, 我们如果把所有数据存储在一个数据库中, 对数据的各种操作就会变得非常的困难. 自然我们又想到了数据库也进行集群部署, 将一个数据库的数据分散到不同的数据库中存储, 进而提升数据操作的性能. 本文的定义是简洁快速的使用mycat, 让读者可以快速的入门mycat, 因此本文聚焦于mycat的安装, 使用, 简易配置, 常用配置文件和标签的...

面向星辰大海 4942
上一篇: GreatSQL 8.0.32-25新版本有奖体验!
下一篇: GreatSQL社区2023全年技术文章总结
GreatSQL社区
博客等级 码龄5年 1210粉丝 390原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址