说明:
1. 定期装载的周期为每天一次。
2. 每天装载自上次装载后的变化数据
3. 建立源数据库的过渡表用于CDC
4. 建立cdc_time表用于基于时间戳的CDC
5. 因为源库上只有订单销售表有时间属性,所以除了sales_order和sales_order_item拉取变化数据外,其它表都整体拉取到过渡区。实际环境中建议在源表设计上应该有created和last_updated两个时间戳类型的字段。
6. 下表汇总了源库各表的CDC方式

源数据库表

过渡表

抽取模式

city

city_stg

整体、拉取

province

province_stg

整体、拉取

customer

customer_stg

整体、拉取

product_catagory

product_catagory_stg

整体、拉取

product

product_stg

整体、拉取

sales_order

sales_order_stg

CDC(每天)、拉取

sales_order_item

sales_order_item_stg

CDC(每天)、拉取


使用下面的脚本建立过渡区表和cdc_time表。

CREATE TABLE province_stg (province_id varchar(2),province_name varchar(20)
) ;CREATE TABLE product_catagory_stg (product_catagory_id varchar(2),product_catagory_name varchar(20)
) ;CREATE TABLE city_stg (city_id varchar(4),city_name varchar(20),province_id varchar(2)
) ;CREATE TABLE customer_stg (customer_id int(11),customer_name varchar(20),city_id varchar(4),cust_post_code varchar(6),cust_address varchar(50),ship_post_code varchar(6),ship_address varchar(50)
) ;CREATE TABLE product_stg (product_id int(11),product_name varchar(20),unit_price decimal(10,4),product_catagory_id varchar(2)
) ;CREATE TABLE sales_order_stg (sales_order_id int(11),order_time datetime,entry_time datetime,customer_id int(11),amount decimal(12,4),allocate_time datetime,packing_time datetime,ship_time datetime,receive_time datetime
) ;CREATE TABLE sales_order_item_stg (sales_order_item_id int(11),sales_order_id int(11),product_id int(11),unit_price decimal(10,4),quantity int(11)
) ;CREATE TABLE cdc_time
(last_load date,current_load date
);-- 插入数据仓库开始日期
INSERT INTO cdc_time VALUES ('2015-03-01', '2015-03-01') ;
COMMIT ;

sales_order_item表是基于sales_order.sales_order_id更新的。为了避免对sales_order表的二次查询,希望在对sales_order做CDC时同时获取到sales_order_id用于后续的sales_order_item表的CDC。MySQL数据库本身没有提供类似于Oracle的returning这样的语法,所以用内存表+触发器的方式实现。使用下面的脚本建立内存表和sales_order_stg表上的insert触发器。

USE dv;-- 建立内存表
CREATE TABLE sales_order_stg_insert ENGINE MEMORY 
SELECT sales_order_id, entry_time, allocate_time, packing_time, ship_time, receive_time 
FROM sales_order_stg WHERE FALSE;-- 建立insert触发器
DELIMITER // DROP TRIGGER tr_sales_order_stg_insert_after //  
CREATE  TRIGGER tr_sales_order_stg_insert_after AFTER INSERT ON sales_order_stg   FOR EACH ROW BEGIN  INSERT INTO sales_order_stg_insert VALUES (NEW.sales_order_id, NEW.entry_time, NEW.allocate_time, NEW.packing_time, NEW.ship_time, NEW.receive_time);  END;  
//  DELIMITER ;

sales_order表的几个时间字段可能修改,所以

新增订单的条件是:
entry_time >= @last_load and entry_time < @current_load
修改订单版本的条件是:
entry_time < @last_load and (allocate_time >= @last_load and allocate_time < @current_load
or packing_time >= @last_load and packing_time < @current_load
or ship_time >= @last_load and ship_time < @current_load
or receive_time >= @last_load and receive_time < @current_load)
sales_order_item表只基于sales_order.sales_order_id的新增订单更新的。

使用下面的脚本进行每天定期装载。

use dv;-- 设置附属表的截止时间和生效时间
SET @pre_date = SUBDATE(CURRENT_DATE,1) ;
-- 设置CDC的上限时间
update cdc_time set current_load = current_date ;
select @last_load:=last_load,@current_load:=current_load from cdc_time;-- 装载过渡表
truncate table customer_stg;
truncate table city_stg;
truncate table province_stg;
truncate table product_stg;
truncate table product_catagory_stg;
truncate table sales_order_stg;
truncate table sales_order_item_stg;
truncate table sales_order_stg_insert;insert into province_stg select * from province;
insert into city_stg select * from city;
insert into customer_stg select * from customer;
insert into product_catagory_stg select * from product_catagory;
insert into product_stg select * from product;
insert into sales_order_stg
select a.* from sales_order a
where entry_time >= @last_load and entry_time < @current_load
or (entry_time < @last_load and (allocate_time >= @last_load and allocate_time < @current_loador packing_time >= @last_load and packing_time < @current_loador ship_time >= @last_load and ship_time < @current_loador receive_time >= @last_load and receive_time < @current_load));
insert into sales_order_item_stg
select a.* from sales_order_item a, sales_order_stg_insert b
where a.sales_order_id = b.sales_order_idand b.entry_time >= @last_load and b.entry_time < @current_load;/*** 装载中心表 ***/
insert into hub_product_catagory (product_catagory_id,record_source)  
select a.product_catagory_id,'source.product_catagory' 
from product_catagory_stg a left join hub_product_catagory b on a.product_catagory_id = b.product_catagory_id
where b.product_catagory_id is null;  insert into hub_customer (customer_id,record_source)  
select a.customer_id,'source.customer' 
from customer_stg a left join hub_customer b on a.customer_id = b.customer_id
where b.customer_id is null;  insert into hub_product (product_id,record_source)  
select a.product_id,'source.product' 
from product_stg a left join hub_product b on a.product_id = b.product_id
where b.product_id is null;  insert into hub_sales_order (sales_order_id,record_source)  
select sales_order_id,'source.sales_order' from sales_order_stg where entry_time >= @last_load and entry_time < @current_load; 
/*** 装载中心表 ***//*** 装载链接表 ***/
insert into link_order_customer (hub_sales_order_id,hub_customer_id,record_source)  
select hub_sales_order_id,hub_customer_id,'hub_sales_order,source.sales_order,hub_customer,source.customer'  
from hub_sales_order,sales_order_stg,hub_customer,customer_stg 
where hub_sales_order.sales_order_id = sales_order_stg.sales_order_id  and hub_customer.customer_id = customer_stg.customer_id  and sales_order_stg.customer_id = customer_stg.customer_idand sales_order_stg.entry_time >= @last_load and sales_order_stg.entry_time < @current_load;insert into link_order_product (hub_sales_order_id,hub_product_id,record_source)  
select hub_sales_order_id,hub_product_id,'hub_sales_order,hub_product,source.sales_order_item'  
from hub_sales_order,hub_product,sales_order_item_stg
where hub_sales_order.sales_order_id = sales_order_item_stg.sales_order_id  and hub_product.product_id = sales_order_item_stg.product_id;  insert into link_product_catagory (hub_product_id,hub_product_catagory_id,record_source)
select t1.hub_product_id hub_product_id, t1.hub_product_catagory_id hub_product_catagory_id,
'hub_product,product,hub_product_catagory' record_source
from 
(
select t2.hub_product_id hub_product_id, t3.hub_product_catagory_id hub_product_catagory_id
from product_stg t1, hub_product t2, hub_product_catagory t3
where t1.product_id = t2.product_id and t1.product_catagory_id = t3.product_catagory_id) t1
left join link_product_catagory t2 on t1.hub_product_id = t2.hub_product_id
where t2.hub_product_id is null;/*** 装载链接表 ***//*** 装载附属表 ***/
-- 客户附属表
-- 修改老版本的截止日期
update hub_customer t1, sat_customer t2, 
(select customer_id,customer_name,city_name,province_name,cust_post_code,cust_address,ship_post_code,ship_address
from customer_stg t1,city_stg t2,province_stg t3
where t1.city_id = t2.city_id and t2.province_id = t3.province_id) t3
set t2.load_end_dts = @pre_date
where t1.hub_customer_id = t2.hub_customer_id
and t2.load_end_dts = '2200-01-01'
and t1.customer_id = t3.customer_id
and md5(concat(t2.customer_name,t2.city_name,t2.province_name,t2.cust_post_code,t2.cust_address,t2.ship_post_code,t2.ship_address))
<> 
md5(concat(t3.customer_name,t3.city_name,t3.province_name,t3.cust_post_code,t3.cust_address,t3.ship_post_code,t3.ship_address));-- 新增版本
insert into sat_customer   
(hub_customer_id,  
load_end_dts,  
record_source,  
customer_name,  
city_name,  
province_name,  
cust_post_code,  
cust_address,  
ship_post_code,  
ship_address) 
select 
t1.hub_customer_id,  
'2200-01-01',  
'hub_customer,customer,city,province', 
t3.customer_name,  
t3.city_name,  
t3.province_name,  
t3.cust_post_code,  
t3.cust_address,  
t3.ship_post_code,  
t3.ship_address 
from 
hub_customer t1, sat_customer t2, 
(select customer_id,customer_name,city_name,province_name,cust_post_code,cust_address,ship_post_code,ship_address
from customer_stg t1,city_stg t2,province_stg t3
where t1.city_id = t2.city_id and t2.province_id = t3.province_id) t3
where t1.hub_customer_id = t2.hub_customer_id
and t1.customer_id = t3.customer_id
and md5(concat(t2.customer_name,t2.city_name,t2.province_name,t2.cust_post_code,t2.cust_address,t2.ship_post_code,t2.ship_address))
<> 
md5(concat(t3.customer_name,t3.city_name,t3.province_name,t3.cust_post_code,t3.cust_address,t3.ship_post_code,t3.ship_address))
and exists (select 1 from sat_customer where hub_customer_id = t1.hub_customer_id 
and load_end_dts = @pre_date)
and not exists (select 1 from sat_customer where hub_customer_id = t1.hub_customer_id 
and load_end_dts = '2200-01-01');-- 新增记录
insert into sat_customer   
(hub_customer_id,  
load_end_dts,  
record_source,  
customer_name,  
city_name,  
province_name,  
cust_post_code,  
cust_address,  
ship_post_code,  
ship_address)  
select  
t1.hub_customer_id,  
'2200-01-01',  
'hub_customer,customer,city,province',  
t2.customer_name,  
t2.city_name,  
t2.province_name,  
t2.cust_post_code,  
t2.cust_address,  
t2.ship_post_code,  
t2.ship_address 
from 
(select hub_customer.hub_customer_id, hub_customer.customer_id 
from hub_customer left join sat_customer 
on hub_customer.hub_customer_id = sat_customer.hub_customer_id
where sat_customer.hub_customer_id is null) t1,
(select customer_id,customer_name,city_name,province_name,cust_post_code,cust_address,ship_post_code,ship_address
from customer_stg t1,city_stg t2,province_stg t3
where t1.city_id = t2.city_id and t2.province_id = t3.province_id) t2
where t1.customer_id = t2.customer_id ; -- 订单_产品附属表
-- 新增记录
insert into sat_order_product   
(link_order_product_id,  
load_end_dts,  
record_source,  
unit_price,  
quantity  
)  
select   
t1.link_order_product_id,  
'2200-01-01',  
'link_order_product,hub_sales_order,hub_product,sales_order_item',  
t4.unit_price,  
t4.quantity  
from link_order_product t1,hub_sales_order t2,hub_product t3,sales_order_item_stg t4 
where t1.hub_sales_order_id = t2.hub_sales_order_id  and t1.hub_product_id = t3.hub_product_id  and t4.sales_order_id = t2.sales_order_id  and t4.product_id = t3.product_id;-- 产品附属表
-- 修改老版本的截止日期
update hub_product t1, sat_product t2, product_stg t3
set t2.load_end_dts = @pre_date
where t1.hub_product_id = t2.hub_product_id
and t2.load_end_dts = '2200-01-01'
and t1.product_id = t3.product_id
and md5(concat(t2.product_name,convert(t2.unit_price,char)))
<> 
md5(concat(t3.product_name,convert(t3.unit_price,char)));-- 新增版本
insert into sat_product 
(hub_product_id,  
load_end_dts,  
record_source,  
product_name,  
unit_price  
)  
select 
t1.hub_product_id,  
'2200-01-01',  
'hub_product,product', 
t3.product_name,  
t3.unit_price
from 
hub_product t1, sat_product t2, product_stg t3
where t1.hub_product_id = t2.hub_product_id
and t1.product_id = t3.product_id
and md5(concat(t2.product_name,convert(t2.unit_price,char)))
<> 
md5(concat(t3.product_name,convert(t3.unit_price,char)))
and exists (select 1 from sat_product where hub_product_id = t1.hub_product_id 
and load_end_dts = @pre_date)
and not exists (select 1 from sat_product where hub_product_id = t1.hub_product_id 
and load_end_dts = '2200-01-01');-- 新增记录
insert into sat_product  
(hub_product_id,  
load_end_dts,  
record_source,  
product_name,  
unit_price  
)  
select  
t1.hub_product_id,  
'2200-01-01',  
'hub_product,product',  
t2.product_name,  
t2.unit_price
from 
(select hub_product.hub_product_id, hub_product.product_id 
from hub_product left join sat_product 
on hub_product.hub_product_id = sat_product.hub_product_id
where sat_product.hub_product_id is null) t1,
(
select product_id,product_name,unit_price 
from product_stg) t2
where t1.product_id = t2.product_id ; -- 产品类型附属表
-- 修改老版本的截止日期
update hub_product_catagory t1, sat_product_catagory t2, product_catagory_stg t3
set t2.load_end_dts = @pre_date
where t1.hub_product_catagory_id = t2.hub_product_catagory_id
and t2.load_end_dts = '2200-01-01'
and t1.product_catagory_id = t3.product_catagory_id
and t2.product_catagory_name <> t3.product_catagory_name;-- 新增版本
insert into sat_product_catagory  
(hub_product_catagory_id,  
load_end_dts,  
record_source,  
product_catagory_name  
)   
select 
t1.hub_product_catagory_id,  
'2200-01-01',  
'hub_product_catagory,product_catagory',  
t3.product_catagory_name 
from 
hub_product_catagory t1, sat_product_catagory t2, product_catagory_stg t3
where t1.hub_product_catagory_id = t2.hub_product_catagory_id
and t1.product_catagory_id = t3.product_catagory_id
and t2.product_catagory_name <> t3.product_catagory_name
and exists (select 1 from sat_product_catagory where hub_product_catagory_id = t1.hub_product_catagory_id 
and load_end_dts = @pre_date)
and not exists (select 1 from sat_product_catagory where hub_product_catagory_id = t1.hub_product_catagory_id 
and load_end_dts = '2200-01-01');-- 新增记录
insert into sat_product_catagory  
(hub_product_catagory_id,  
load_end_dts,  
record_source,  
product_catagory_name  
)  
select  
t1.hub_product_catagory_id,  
'2200-01-01',  
'hub_product_catagory,product_catagory', 
t2.product_catagory_name
from 
(select hub_product_catagory.hub_product_catagory_id, hub_product_catagory.product_catagory_id 
from hub_product_catagory left join sat_product_catagory 
on hub_product_catagory.hub_product_catagory_id = sat_product_catagory.hub_product_catagory_id
where sat_product_catagory.hub_product_catagory_id is null) t1,
(
select product_catagory_id,product_catagory_name
from product_catagory_stg) t2
where t1.product_catagory_id = t2.product_catagory_id ; -- 销售订单附属表
-- 修改老版本的截止日期
update hub_sales_order t1, sat_sales_order t2, sales_order_stg t3
set t2.load_end_dts = @pre_date
where t1.hub_sales_order_id = t2.hub_sales_order_id
and t2.load_end_dts = '2200-01-01'
and t1.sales_order_id = t3.sales_order_id
and 
(t3.entry_time < @last_load and (t3.allocate_time >= @last_load and t3.allocate_time < @current_loador t3.packing_time >= @last_load and t3.packing_time < @current_loador t3.ship_time >= @last_load and t3.ship_time < @current_loador t3.receive_time >= @last_load and t3.receive_time < @current_load));-- 新增版本
insert into sat_sales_order  
(hub_sales_order_id,  
load_end_dts,  
record_source,  
order_time,  
entry_time,  
amount,  
allocate_time,  
packing_time,  
ship_time,  
receive_time  
) 
select 
t1.hub_sales_order_id,  
'2200-01-01',  
'hub_sales_order,sales_order',  
t3.order_time,  
t3.entry_time,  
t3.amount,  
t3.allocate_time,  
t3.packing_time,  
t3.ship_time,  
t3.receive_time 
from 
hub_sales_order t1, sat_sales_order t2, sales_order_stg t3
where t1.hub_sales_order_id = t2.hub_sales_order_id
and t1.sales_order_id = t3.sales_order_id
and 
(t3.entry_time < @last_load and (t3.allocate_time >= @last_load and t3.allocate_time < @current_loador t3.packing_time >= @last_load and t3.packing_time < @current_loador t3.ship_time >= @last_load and t3.ship_time < @current_loador t3.receive_time >= @last_load and t3.receive_time < @current_load))
and exists (select 1 from sat_sales_order where hub_sales_order_id = t1.hub_sales_order_id 
and load_end_dts = @pre_date)
and not exists (select 1 from sat_sales_order where hub_sales_order_id = t1.hub_sales_order_id 
and load_end_dts = '2200-01-01');-- 新增记录
insert into sat_sales_order  
(hub_sales_order_id,  
load_end_dts,  
record_source,  
order_time,  
entry_time,  
amount,  
allocate_time,  
packing_time,  
ship_time,  
receive_time  
) 
select   
t1.hub_sales_order_id,  
'2200-01-01',  
'hub_sales_order,sales_order',  
t2.order_time,  
t2.entry_time,  
t2.amount,  
t2.allocate_time,  
t2.packing_time,  
t2.ship_time,  
t2.receive_time   
from hub_sales_order t1,sales_order_stg t2 
where t1.sales_order_id = t2.sales_order_idand t2.entry_time >= @last_load and t2.entry_time < @current_load;-- 更新时间戳表的last_load字段
update cdc_time set last_load = current_load ;commit ;

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

如若内容造成侵权/违法违规/事实不符,请联系英文站点网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Java虚拟机栈(JVM Stack)详解与工作流程分析

Java虚拟机栈&#xff08;JVM Stack&#xff09;详解与工作流程分析 1. 虚拟机栈核心概念 基本特性 线程私有&#xff1a;每个线程在创建时都会分配一个独立的栈存储内容&#xff1a; 栈帧&#xff08;Stack Frame&#xff09;&#xff1a;每个方法调用对应一个栈帧 生命周期…

Sonarqube:Jenkins触发sonar扫描出现UnsupportedClassVersionError错误处理

文章目录 1、问题现象2、问题根因3、解决思路3.1 解决思路13.2 解决思路23.3 解决思路3 1、问题现象 问题现象&#xff1a;在每次Jenkins触发sonar扫描时&#xff0c;Sonar-scanner扫描器执行都会出现UnsupportedClassVersionError异常&#xff0c;如下&#xff1a; ERROR: …

Spark SQL to_json 函数介绍

目录 前言函数介绍参数说明示例 前言 在Apache Hive中&#xff0c;并没有内置的to_json函数。在Apache Spark SQL中确实有to_json函数,它可以用来将结构化数据&#xff08;如结构化类型或MAP类型&#xff09;转换为JSON字符串。这个功能对于需要将表格数据输出为JSON格式的场景…

《解锁前端潜力:自动化流程搭建秘籍》

当项目逐渐从萌芽走向繁茂&#xff0c;中期阶段对流程优化与效率提升的需求便愈发迫切。搭建一套自动化测试、持续集成与部署的完整流程&#xff0c;已然成为突破瓶颈、保障代码质量与上线效率的关键密钥。这不仅是技术的进阶&#xff0c;更是思维与协作模式的革新。在踏上构建…

计算机体系结构中的片上系统SoC是什么?

计算机体系结构中的片上系统SoC是什么&#xff1f; 片上系统&#xff08;SoC&#xff0c;System on Chip&#xff09; 是一种将计算机或其他电子系统的多个关键组件集成到单一芯片上的集成电路设计。它不仅仅是处理器&#xff08;CPU&#xff09;&#xff0c;而是将处理器、内…

linux虚拟机基础-磁盘扩容详细版本模拟实验

扩容实验参考上一篇博客&#xff1a; https://blog.csdn.net/wenxiaocsdn/article/details/141932877?spm1001.2014.3001.5502 LVM基础知识附录红帽官方文档 配置和管理逻辑卷 | Red Hat Enterprise Linux | 8 | Red Hat Documentation LVM逻辑结构图 LVM 管理命令速查表&…

hbase高可用部署

要实现HBase集群的高可用部署&#xff08;High Availability, HA&#xff09;&#xff0c;核心在于消除单点故障&#xff08;特别是HMaster节点&#xff09;&#xff0c;并确保数据冗余和服务自动恢复。以下是、关键步骤和配置要点&#xff1a; 一、核心配置步骤‌ ‌1.1 启用…

STM32F103ZET6开发板【项目工程创建】+具体实现步骤流程

硬件介绍 芯片为STM32F103ZET6 STM32F103 资源简介 STM32 的优异性 1&#xff0c;超低的价格。8 位机的价格&#xff0c;32 位机的性能&#xff0c;是 STM32 最大的优势。 2&#xff0c;超多的外设。STM32 拥有包括&#xff1a;FMC、TIMER、SPI、IIC、USB、CAN、IIS、SDIO、…

CyberGlove触觉反馈手套遥操作机器人灵巧手解决方案

CyberGlove触觉反馈手套确实可以实时捕捉运动信号和触觉反馈&#xff0c;并将其重新定位到人形机器人上。CyberGlove触觉反馈手套遥操作机器人是通过手套上的传感器捕捉手部动作&#xff0c;将信号传输给机器人&#xff0c;同时接收机器人反馈的触觉信息&#xff0c;实现远程操…

[C#]C# winform部署yolov13目标检测的onnx模型

yolov13官方框架&#xff1a;github.com/iMoonLab/yolov13/releases/tag/yolov13 【测试环境】 vs2019 netframework4.7.2 opencvsharp4.8.0 onnxruntime1.16.3 【效果展示】 【调用代码】 using System; using System.Collections.Generic; using System.ComponentMode…

创客匠人 AI 赋能:创始人 IP 打造的效率革命与信任重构

在注意力经济时代&#xff0c;创始人 IP 面临内容生产效率与信任构建的双重挑战。创客匠人 2025 年战略升级为 “IP 变现整体解决方案服务商”&#xff0c;其推出的 AI 销售信、免训数字人、智能客服三大工具&#xff0c;正通过技术重构破解行业痛点&#xff0c;为知识变现开辟…

飞轮储能VSG控制策略辅助双馈风机一次调频的仿真模型研究

以下是为您撰写的《飞轮储能VSG控制策略辅助双馈风机一次调频的仿真模型研究》技术报告,包含完整的理论分析、控制策略设计及MATLAB/Simulink仿真实现细节: 飞轮储能VSG控制策略辅助双馈风机一次调频的仿真模型研究 摘要 针对双馈感应发电机(DFIG)参与电网一次调频时存在…

临床开发计划:从实验室到市场的战略蓝图

一、临床开发计划概述 1.1 定义与重要性 1.1.1 CDP核心定义 临床开发计划(CDP)是药物、生物制品或医疗器械从实验室走向市场的核心路线图,详细规划临床研究及其策略、时间表和资源需求,以满足监管机构审批要求。 1.1.2 指导意义 CDP为开发团队提供清晰指引,指导资源规划…

【大模型实战】微调Qwen2.5 VL模型,增强目标检测任务。

文章目录 制作数据集使用微调的模型制作数据集 制作数据集 这个章节将详细解析一个将Labelme标注数据集转换为Qwen2.5-VL模型训练格式的Python脚本。该工具实现了图像大小调整、边界框坐标转换和数据格式标准化等功能。生成适用Qwen2.5-VL的数据集。 核心功能概述 图像处理&a…

【python实用小脚本-118】基于Flask的用户认证系统:app.py、forms.py与user.py解析

在当今的网络应用中&#xff0c;用户认证是一个不可或缺的功能。无论是社交平台、电商平台还是企业管理系统&#xff0c;都需要确保只有授权用户才能访问特定的资源。本文将详细介绍一个基于 Flask 框架的用户认证系统&#xff0c;该系统由三个主要文件组成&#xff1a;app.py、…

phpstudy apache伪静态.htaccess文件置空丢失问题解决

phpstudy apache伪静态.htaccess文件置空丢失 在使用phpstudy本地部署项目的时候&#xff0c;创建网站-根目录选择public等运行目录&#xff0c;并且点击确认后&#xff0c;会碰到原本项目中的apache伪静态.htaccess文件被置空丢失的问题&#xff0c;导致项目无法正常访问。 解…

【thinkphp5】Session和Cache记录微信accesstoken

记录一个项目实际遇到的坑&#xff0c;不要把token存放在session&#xff0c;要存在在cache里面&#xff01;&#xff01; 因为Session并不能设置expire过期时间&#xff0c;Session::set()方法第三个参数是作用域&#xff0c;而非过期时间&#xff01;&#xff01;&#xff0…

网络协议完全指南:从HTTP长短连接到TCP-UDP的深度对话

&#x1f310; 网络协议完全指南&#xff1a;从HTTP长短连接到TCP-UDP的深度对话 本文采用对话形式&#xff0c;通过小李和小王的问答&#xff0c;深入浅出地讲解网络协议、长短连接等核心概念&#xff0c;帮助读者建立完整的网络知识体系。 引言 在Java后端开发中&#xff0c…

04-StarRocks集群运维FAQ

StarRocks集群运维FAQ 概述 本文档整理了StarRocks集群运维过程中常见的问题和解决方案,涵盖了集群管理、节点维护、监控告警、故障处理等各个方面,帮助运维人员高效管理StarRocks集群。 集群管理FAQ Q1: 如何查看集群状态? A: 集群状态查看方法: 1. 查看FE节点状态 …

通过Prompt提示构建思维链

《DEEPSEEK原生应用与智能体开发实践 王晓华 书籍 图书》【摘要 书评 试读】- 京东图书 思维链技术开启了人工智能通向人类智能的崭新路径。它让模型不再仅仅是机械地执行指令&#xff0c;而是开始具备类似人类的思考方式&#xff0c;能够理解问题的本质&#xff0c;进行深层次…