Flink任务优化分享

Flink任务优化分享

1.背景介绍

线上计算任务在某版本上线之后发现每日的任务时长都需要三个多小时才能完成,计算时间超过了预估时间,通过Dolphinscheduler的每日调度任务看,在数据层 dwd 的数据分段任务存在严重的性能问题,每天的计算耗时将近40分钟,并且随着数据量的上涨,时间越来越长,因此这个计算节点需要着重优化。

2.改进思路及实施

现在的大数据计算任务是用 flink 执行的,因此优化的入手点就是从 Flink History Server 上看任务的执行计划,找到耗时较多的节点以及是否有节点因为sql逻辑被重复执行,导致耗时较高。

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-GwHDHsdd-1690266698352)(/Users/apple/Documents/yangxin/develop/image-20230413173034642.png)]

如图所示,可以发现计算任务走了三个分叉,从sql最后的输出来看,只有两个insert表操作,所以这里至少有一条分叉是不必要的;然后就是找到分叉点的原因,为什么会导致任务分成了三个分支,这个就需要执行计划慢慢去理,界面上可以点开每个节点看到他的执行计算优化之后的结果,然后来判断这一节点对应了sql的哪一步。着重需要判断的就是产生分支的那个节点

Sort(
    orderBy=[tenant_id ASC, room_id ASC, msg_start_time ASC]
) -> 
Calc(
    select=[__etl_time__, date_id, tenant_id, brand_id, channel, channel_app_id, channel_session_type, msg_id, msg_start_time, msg_end_time, msg_from_id, msg_from_orig_id, 
        msg_from_nk, msg_from_role, msg_to_ids, msg_to_users, msg_type, msg_content, msg_detail, group_chat_info, dialogue_id, room_id, operation_flags, recording_properties, 
        asr_properties, metric_properties, tags, tag_properties, dialogue_properties, lastMsgEndTime, nextMsgStartTime, is_cut_by_msg_time, is_fit_specific_event, pre_is_fit_specific_event, fit_specific_row,
        CAST(FROM_UNIXTIME(w0$o0)) AS start_time,
        CAST(FROM_UNIXTIME(w0$o1)) AS end_time,
        CAST(w1$o0) AS fit_specific_rows,
        GenIsFitConsecutiveRowsAndTime(channel_session_type, tenant_id, CAST(w1$o0), CAST(CAST(FROM_UNIXTIME(w0$o0))), CAST(CAST(FROM_UNIXTIME(w0$o1))), is_fit_specific_event) AS is_fit_specific_flag,
        (is_cut_by_msg_time = _UTF-16LE'1':VARCHAR(2147483647) CHARACTER SET "UTF-16LE") AS $39, // 
        (GenIsFitConsecutiveRowsAndTime(channel_session_type, tenant_id, CAST(w1$o0), CAST(CAST(FROM_UNIXTIME(w0$o0))), CAST(CAST(FROM_UNIXTIME(w0$o1))), is_fit_specific_event) = 1) AS $40
    ]
) -> 
OverAggregate(
    partitionBy=[tenant_id, room_id],
    orderBy=[msg_start_time ASC],
    window#0=[
        LAG(is_fit_specific_flag) AS w0$o0
        RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
    ],
    select=[__etl_time__, date_id, tenant_id, brand_id, channel, channel_app_id, channel_session_type, msg_id, msg_start_time, msg_end_time, msg_from_id, msg_from_orig_id, 
        msg_from_nk, msg_from_role, msg_to_ids, msg_to_users, msg_type, msg_content, msg_detail, group_chat_info, dialogue_id, room_id, operation_flags, recording_properties, 
        asr_properties, metric_properties, tags, tag_properties, dialogue_properties, lastMsgEndTime, nextMsgStartTime, is_cut_by_msg_time, is_fit_specific_event, pre_is_fit_specific_event, fit_specific_row,
        start_time, end_time, fit_specific_rows, is_fit_specific_flag, 
        $39,    // 是否按时间切 
        $40,    // 当前条是否为 1
        w0$o0 -> pre_is_fit_specific_flag // 前一条是否满足特殊规则
    ]
) -> (
    Calc(
        select=[date_id, tenant_id, channel_session_type, msg_id, msg_start_time, room_id, tags,
            IF(($39 OR (w0$o0 IS NULL AND $40) OR ((w0$o0 <> is_fit_specific_flag) IS TRUE AND w0$o0 IS NOT NULL)), 1, 0) AS is_cut_flag,
            CAST(tenant_id) AS $8,
            CAST(msg_start_time) AS $9,
            GenCutPointTypeByFeature(channel_session_type, tenant_id, tags) AS $10
        ]
    ) -> 
    OverAggregate(
        partitionBy=[tenant_id, room_id],
        orderBy=[msg_start_time ASC],
        window#0=[
            COUNT(is_cut_flag) AS w0$o0,
            $SUM0(is_cut_flag) AS w0$o1
            RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ],
        select=[date_id, tenant_id, channel_session_type, msg_id, msg_start_time, room_id, tags, is_cut_flag, 
            $8, -> tenant_id
            $9, -> msg_start_time
            $10, -> 特征切分点: START/END/NO
            w0$o0, -> count
            w0$o1 -> sum
        ]
    ) -> 
    Calc(
        select=[
            CONCAT_WS(_UTF-16LE'-', $8, room_id, date_id, CAST(CASE((w0$o0 > 0:BIGINT), w0$o1, null:INTEGER))) AS dialogue_id1,
            channel_session_type, tenant_id, msg_id, $9 AS $f4, tags, $10 AS cutPointType
        ]
    ), 
    #####################
    CREATE TEMPORARY VIEW keep_cutpoint_view AS
    SELECT dialogue_id1, smoothRes.smoothResultVoMap
    FROM (
            SELECT dialogue_id1,
                    smoothCutPoint(channel_session_type, tenant_id, dialogue_id1, msg_id, msg_start_time, tags, cutPointType) AS smoothRes
            FROM gen_cut_type_by_feature_view
            GROUP BY dialogue_id1
    );
    #####################
    
    Calc(
        select=[__etl_time__, date_id, tenant_id, brand_id, channel, channel_app_id, channel_session_type, msg_id, msg_start_time, msg_end_time, msg_from_id, msg_from_orig_id, 
            msg_from_nk, msg_from_role, msg_to_ids, msg_to_users, msg_type, msg_content, msg_detail, group_chat_info, dialogue_id, room_id, operation_flags, recording_properties, 
            asr_properties, metric_properties, tags, tag_properties, dialogue_properties, lastMsgEndTime, nextMsgStartTime, is_cut_by_msg_time, is_fit_specific_event, pre_is_fit_specific_event, 
            fit_specific_row, start_time, end_time, fit_specific_rows, is_fit_specific_flag, 
            w0$o0 AS pre_is_fit_specific_flag, 
            CASE(w0$o0 IS NULL, is_fit_specific_flag, (w0$o0 <> is_fit_specific_flag), 1, 0) AS is_cut_by_specific, 
            IF(($39 OR (w0$o0 IS NULL AND $40) OR ((w0$o0 <> is_fit_specific_flag) IS TRUE AND w0$o0 IS NOT NULL)), 1, 0) AS is_cut_flag, 
            IF((IF(($39 OR (w0$o0 IS NULL AND $40) OR ((w0$o0 <> is_fit_specific_flag) IS TRUE AND w0$o0 IS NOT NULL)), 1, 0) = 1), _UTF-16LE'start', null:VARCHAR(2147483647) CHARACTER SET "UTF-16LE") AS $42,
            CAST(tenant_id) AS $43, 
            GenCutPointTypeByFeature(channel_session_type, tenant_id, tags) AS $44
        ]
    ) -> 
    OverAggregate(
        partitionBy=[tenant_id, room_id],
        orderBy=[msg_start_time ASC],
        window#0=[
            COUNT(is_cut_flag) AS w0$o0,
            $SUM0(is_cut_flag) AS w0$o1
            RANG BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW
        ], select=[__etl_time__, date_id, tenant_id, brand_id, channel, channel_app_id, channel_session_type, msg_id, msg_start_time, msg_end_time, msg_from_id, msg_from_orig_id, 
            msg_from_nk, msg_from_role, msg_to_ids, msg_to_users, msg_type, msg_content, msg_detail, group_chat_info, dialogue_id, room_id, operation_flags, recording_properties, 
            asr_properties, metric_properties, tags, tag_properties, dialogue_properties, lastMsgEndTime, nextMsgStartTime, is_cut_by_msg_time, is_fit_specific_event, pre_is_fit_specific_event, 
            fit_specific_row, start_time, end_time, fit_specific_rows, is_fit_specific_flag, pre_is_fit_specific_flag, is_cut_by_specific, is_cut_flag, 
            $42, -> cut_point_type
            $43, 
            $44, 
            w0$o0, 
            w0$o1
        ]
    ) -> 
    Calc(
        select=[date_id, tenant_id, brand_id, channel, channel_app_id, channel_session_type, msg_id, msg_start_time, msg_end_time, msg_from_id, msg_from_orig_id, msg_from_nk, 
            msg_from_role, msg_to_ids, msg_to_users, msg_type, msg_content, msg_detail, group_chat_info, room_id, operation_flags, recording_properties, asr_properties, metric_properties, tags, tag_properties, 
            dialogue_properties, 
            CONCAT_WS(_UTF-16LE'-', $43, room_id, date_id, CAST(CASE((w0$o0 > 0:BIGINT), w0$o1, null:INTEGER))) AS dialogue_id1, 
            $44 AS cutPointType
        ]
    )
)

######################
根据时间+特殊规则先生成一轮 dialogu_id1
特征的切分点命中被提前下推到这个阶段执行

BUG&优化点:
1. 平滑使用了 groupBy 再 join 会主表, 导致计算流走了分支, 导致部分计算逻辑重复执行了, 这一部分可以考虑用 over 聚合来做
  gen_fit_sprcific_flag_view -> gen_cut_flag_view -> gen_dialogue_id_by_cut_flag_view -> gen_cut_type_by_feature_view -> keep_cutpoint_view

2. CASE WHEN pre_is_fit_specific_flag IS NULL THEN is_fit_specific_flag
                    WHEN pre_is_fit_specific_flag <> is_fit_specific_flag THEN 1
                    WHEN pre_is_fit_specific_flag = is_fit_specific_flag THEN 0
                    ELSE 0
                   END AS is_cut_by_specific
    逻辑不对, 导致 GenIsFitConsecutiveRowsAndTime 被重复执行
3. IF(is_cut_flag = 1, 'start', CAST(NULL AS STRING)) AS cut_point_type, 需要判断一下是否还有必要

5. 
======================
Sort(
    orderBy=[dialogue_id1 ASC]
) -> 
SortAggregate(
    isMerge=[false], 
    groupBy=[dialogue_id1], 
    select=[dialogue_id1, 
        smoothCutPoint(channel_session_type, tenant_id, dialogue_id1, msg_id, $f4, tags, cutPointType) AS smoothRes
    ]
) -> 
Calc(
    select=[dialogue_id1, smoothRes.smoothResultVoMap AS smoothResultVoMap]
) -> (
    Correlate(
        invocation=[GetCutPointBySplit($cor7.smoothResultVoMap)],
        correlate=[table(GetCutPointBySplit($cor7.smoothResultVoMap))],
        select=[dialogue_id1,smoothResultVoMap,msgId,cutPointMap],
        rowType=[
            RecordType(
                VARCHAR(2147483647) dialogue_id1, 
                (VARCHAR(2147483647), (VARCHAR(2147483647), VARCHAR(2147483647)) MAP) MAP smoothResultVoMap,
                VARCHAR(2147483647) msgId,
                (VARCHAR(2147483647), VARCHAR(2147483647)) MAP cutPointMap
            )
        ], joinType=[INNER]
    ) -> 
    Calc(
        select=[dialogue_id1, msgId, ITEM(cutPointMap, _UTF-16LE'isKeep') AS isKeep]
    ),
    
    Correlate(
        invocation=[GetCutPointBySplit($cor9.smoothResultVoMap)],
        correlate=[table(GetCutPointBySplit($cor9.smoothResultVoMap))],
        select=[dialogue_id1,smoothResultVoMap,msgId,cutPointMap], 
        rowType=[
            RecordType(
                VARCHAR(2147483647) dialogue_id1, 
                (VARCHAR(2147483647), (VARCHAR(2147483647), VARCHAR(2147483647)) MAP) MAP smoothResultVoMap, 
                VARCHAR(2147483647) msgId, 
                (VARCHAR(2147483647), VARCHAR(2147483647)) MAP cutPointMap
            )
        ], joinType=[INNER]
    ) -> 
    Calc(
        select=[dialogue_id1, msgId, ITEM(cutPointMap, _UTF-16LE'isKeep') AS isKeep]
    ), 
    Correlate(
        invocation=[GetCutPointBySplit($cor8.smoothResultVoMap)], 
        correlate=[table(GetCutPointBySplit($cor8.smoothResultVoMap))], 
        select=[dialogue_id1,smoothResultVoMap,msgId,cutPointMap], 
        rowType=[
            RecordType(
                VARCHAR(2147483647) dialogue_id1, 
                (VARCHAR(2147483647), (VARCHAR(2147483647), VARCHAR(2147483647)) MAP) MAP smoothResultVoMap, 
                VARCHAR(2147483647) msgId, 
                (VARCHAR(2147483647), VARCHAR(2147483647)) MAP cutPointMap
            )
        ], joinType=[INNER]
    ) ->
    Calc(
        select=[dialogue_id1, msgId, ITEM(cutPointMap, _UTF-16LE'isKeep') AS isKeep]
    )
)

######################
计算平滑逻辑

优化点:
1. smoothCutPoint 很大的性能问题, 改成基于 over 聚合的 udaf, 优化掉 GROUPBY + LATERAL TABLE + JOIN

对应sql如下:

--根据配置文件特征数据对数据进行特征切分标记
CREATE TEMPORARY VIEW gen_cut_type_by_feature_view AS
SELECT *,
       GenCutPointTypeByFeature(channel_session_type, tenant_id, tags) AS cutPointType
FROM gen_dialogue_id_by_cut_flag_view;

CREATE TEMPORARY VIEW keep_cutpoint_view AS
SELECT dialogue_id1, smoothRes.smoothResultVoMap
FROM (
         SELECT dialogue_id1,
                smoothCutPoint(channel_session_type, tenant_id, dialogue_id1, msg_id, msg_start_time, tags, cutPointType) AS smoothRes
         FROM gen_cut_type_by_feature_view
         GROUP BY dialogue_id1
);


CREATE TEMPORARY VIEW keep_cutpoint_breakup AS
SELECT dialogue_id1, smoothResultVoMap, msgId, cutPointMap, cutPointMap['isKeep'] AS isKeep
FROM keep_cutpoint_view, LATERAL TABLE(GetCutPointBySplit(smoothResultVoMap)) AS T(msgId, cutPointMap);


CREATE TEMPORARY VIEW keep_cutpoint_join AS
SELECT t1.*,t2.isKeep, IF(t2.isKeep = '0', 'no', t1.cutPointType) AS curCutPointType, msg_start_time
FROM gen_cut_type_by_feature_view t1
LEFT JOIN keep_cutpoint_breakup t2 ON t1.dialogue_id1 = t2.dialogue_id1 AND t1.msg_id = t2.msgId;

CREATE TEMPORARY VIEW gen_dialogue_id_by_feature_view0 AS
SELECT
    date_id,
    tenant_id,
    brand_id,
    channel,
    channel_app_id,
    channel_session_type,
    msg_id,
    msg_start_time,
    msg_end_time,
    msg_from_id,
    msg_from_nk,
    msg_from_orig_id,
    msg_from_role,
    msg_to_ids,
    msg_to_users,
    msg_type,
    msg_content,
    msg_detail,
    group_chat_info,
    room_id,
    operation_flags,
    recording_properties,
    asr_properties,
    metric_properties,
    tags,
    tag_properties,
    dialogue_properties,
    dialogue_id1,
    cutPointType,
    curCutPointType,
    preCutPointType,
    isKeep,
    CONCAT_WS(
            '-',
            CAST(tenant_id AS STRING),
            room_id,
            date_id,
            CAST(
                    SUM(IF(preCutPointType IS NULL OR preCutPointType = 'end' OR curCutPointType = 'start', 1, 0)) OVER (PARTITION BY tenant_id, room_id, date_id ORDER BY msg_start_time)
                AS STRING)
        ) AS dialogue_id
FROM (
         SELECT
             date_id,
             tenant_id,
             brand_id,
             channel,
             channel_app_id,
             channel_session_type,
             msg_id,
             msg_start_time,
             msg_end_time,
             msg_from_id,
             msg_from_nk,
             msg_from_orig_id,
             msg_from_role,
             msg_to_ids,
             msg_to_users,
             msg_type,
             msg_content,
             msg_detail,
             group_chat_info,
             room_id,
             operation_flags,
             recording_properties,
             asr_properties,
             metric_properties,
             tags,
             tag_properties,
             dialogue_properties,
             dialogue_id1,
             cutPointType,
             curCutPointType,
             isKeep,
             LAG(curCutPointType) OVER ( PARTITION BY dialogue_id1 ORDER BY msg_start_time) AS preCutPointType
         FROM keep_cutpoint_join
     );

之前sql对于这个分段平滑逻辑的实现是,先根据idalogue_id group by数据,使用udaf去得到聚合结果,然后在通过msg_id将聚合结果join回原来的明细数据里,这种做法就会产生分岔,不仅性能差,而且会重复执行计算节点导致耗时上升。这种做法在后边的相关性聚合也是差不多的,这样一分析问题就找到了,就是要把聚合结果join回主表这种做法换一种更高效的方式实现,具体改进思路就是将原来这种方式改成基于 over 聚合的 udaf, 优化掉 GROUPBY + LATERAL TABLE + JOIN

优化之后的sql:

--根据配置文件特征数据对数据进行特征切分标记
CREATE TEMPORARY VIEW gen_cut_type_by_feature_view AS
SELECT *,
       GenCutPointTypeByFeature(channel_session_type, tenant_id, tags) AS cutPointType
FROM gen_dialogue_id_by_cut_flag_view;


CREATE TEMPORARY VIEW keep_cutpoint_view AS
SELECT *,
       smooth_result[msg_id]['is_keep'] AS isKeep,
       CASE WHEN smooth_result[msg_id]['is_keep'] = '0' THEN 'no' ELSE cutPointType END AS curCutPointType
FROM(
        SELECT *,
               smoothCutPoint(channel_session_type, tenant_id, dialogue_id1, msg_id, msg_start_time, tags, cutPointType) OVER ( PARTITION BY dialogue_id1) AS smooth_result
        FROM gen_cut_type_by_feature_view
    );

CREATE TEMPORARY VIEW gen_dialogue_id_by_feature_view0 AS
SELECT
    date_id,
    tenant_id,
    brand_id,
    channel,
    channel_app_id,
    channel_session_type,
    msg_id,
    msg_start_time,
    msg_end_time,
    msg_from_id,
    msg_from_nk,
    msg_from_orig_id,
    msg_from_role,
    msg_to_ids,
    msg_to_users,
    msg_type,
    msg_content,
    msg_detail,
    group_chat_info,
    room_id,
    operation_flags,
    recording_properties,
    asr_properties,
    metric_properties,
    tags,
    tag_properties,
    dialogue_properties,
    CONCAT_WS(
            '-',
            CAST(tenant_id AS STRING),
            room_id,
            date_id,
            CAST(
                    SUM( CASE WHEN dialogue_id1 <> preDialogueId OR preCutPointType IS NULL OR preCutPointType = 'end' OR curCutPointType = 'start' THEN 1 ELSE 0 END) OVER (PARTITION BY tenant_id, room_id, date_id ORDER BY msg_start_time)
                AS STRING)
        ) AS dialogue_id
FROM (
         SELECT
             date_id,
             tenant_id,
             brand_id,
             channel,
             channel_app_id,
             channel_session_type,
             msg_id,
             msg_start_time,
             msg_end_time,
             msg_from_id,
             msg_from_nk,
             msg_from_orig_id,
             msg_from_role,
             msg_to_ids,
             msg_to_users,
             msg_type,
             msg_content,
             msg_detail,
             group_chat_info,
             room_id,
             operation_flags,
             recording_properties,
             asr_properties,
             metric_properties,
             tags,
             tag_properties,
             dialogue_properties,
             dialogue_id1,
             cutPointType,
             curCutPointType,
             LAG(dialogue_id1) OVER ( PARTITION BY tenant_id, room_id, date_id ORDER BY msg_start_time) AS preDialogueId,
             LAG(curCutPointType) OVER ( PARTITION BY tenant_id, room_id, date_id ORDER BY msg_start_time) AS preCutPointType
         FROM keep_cutpoint_view
     );

相关性的优化也是一样的思路,改成基于 over 聚合的 udaf,减少聚合结果join回原表的这种操作

相关性sql对比:

CREATE TEMPORARY VIEW dialogue_relevant_view AS
SELECT
    `tenant_id`,
    `brand_id`,
    `channel`,
    `channel_app_id`,
    `channel_session_type`,
    `date_id`,
    dialogue_id as dialogue_id,
    res.relevant_config_version as relevant_config_version ,
    res.relevant_config as relevant_config ,
    res.metrics as metrics ,
    res.dialogue_relevant as dialogue_relevant
FROM (select dialogue_relevant_udaf(channel_session_type, tenant_id, msg_id, msg_start_time, msg_end_time, msg_from_role,tags) as res,
             `tenant_id`,
             `brand_id`,
             `channel`,
             `channel_app_id`,
             `channel_session_type`,
             `date_id`,`dialogue_id`
      from gen_dialogue_id_by_feature_view
      group by `tenant_id`,
               `brand_id`,
               `channel`,
               `channel_app_id`,
               `channel_session_type`,
               `date_id`,`dialogue_id`);

CREATE TEMPORARY VIEW dialogue_view_all AS
select
    NOW() as `__etl_time__`,
    a.date_id,
    a.tenant_id,
    a.brand_id,
    a.channel,
    a.channel_app_id,
    a.channel_session_type,
    a.msg_id,
    a.msg_start_time,
    a.msg_end_time,
    a.msg_from_id,
    a.msg_from_nk,
    a.msg_from_orig_id,
    a.msg_from_role,
    a.msg_to_ids,
    a.msg_to_users,
    a.msg_type,
    a.msg_content,
    a.msg_detail,
    a.group_chat_info,
    a.room_id,
    a.operation_flags,
    a.recording_properties,
    a.asr_properties,
    a.metric_properties,
    a.tags,
    a.tag_properties,
    map_put(map_put(a.dialogue_properties , 'dialogue_relevant' , b.dialogue_relevant),'relevant_config',b.relevant_config)  as dialogue_properties,
    a.dialogue_id1,
    a.cutPointType,
    a.curCutPointType,
    a.preCutPointType,
    a.isKeep,
    a.dialogue_id
from  gen_dialogue_id_by_feature_view  a
          left join dialogue_relevant_view b
                    on  a.tenant_id = b.tenant_id and
                        a.brand_id = b.brand_id and
                        a.channel = b.channel and
                        a.channel_app_id = b.channel_app_id and
                        a.channel_session_type = b.channel_session_type and
                        a.dialogue_id = b.dialogue_id;
                        
#####################################

CREATE TEMPORARY VIEW dialogue_view AS
select
    date_id,
    tenant_id,
    brand_id,
    channel,
    channel_app_id,
    channel_session_type,
    msg_id,
    msg_start_time,
    msg_end_time,
    msg_from_id,
    msg_from_nk,
    msg_from_orig_id,
    msg_from_role,
    msg_to_ids,
    msg_to_users,
    msg_type,
    msg_content,
    msg_detail,
    group_chat_info,
    room_id,
    operation_flags,
    recording_properties,
    asr_properties,
    metric_properties,
    tags,
    tag_properties,
    dialogue_properties,
    dialogue_id,
    dialogue_relevant_udaf(channel_session_type, tenant_id, msg_id, msg_start_time, msg_end_time, msg_from_role,tags) OVER (PARTITION BY `tenant_id`,
               `brand_id`,
               `channel`,
               `channel_app_id`,
               `channel_session_type`,
               `date_id`,`dialogue_id`) AS res
from gen_dialogue_id_by_feature_view ;

3.优化结果

优化之后的执行计划清爽很多,执行速度也有了明显提升,从原来的将近40分钟的计算时长,减少到7分钟,提升巨大

在这里插入图片描述

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

SQL基础使用

SQL的概述 SQL全称&#xff1a; Structured Query Language&#xff0c;结构化查询语言&#xff0c;用于访问和处理数据库的标准的计算机语言。 SQL语言1974年由Boyce和Chamberlin提出&#xff0c;并首先在IBM公司研制的关系数据库系统SystemR上实现。 经过多年发…

数值线性代数:奇异值分解SVD

本文记录计算矩阵奇异值分解SVD的原理与流程。 注1&#xff1a;限于研究水平&#xff0c;分析难免不当&#xff0c;欢迎批评指正。 零、预修 0.1 矩阵的奇异值 设列满秩矩阵&#xff0c;若的特征值为&#xff0c;则称为矩阵的奇异值。 0.2 SVD(分解)定理 设&#xff0c;则…

CTFshow-pwn入门-pwn67(nop sled空操作雪橇)

前言 本人由于今年考研可能更新的特别慢&#xff0c;不能把ctfshow的pwn入门题目的wp一一都写出来了&#xff0c;时间比较紧啊&#xff0c;只能做高数做累的时候做做pwn写写wp了&#xff0c;当然我之后只挑典型意义的题目写wp了&#xff0c;其余的题目就留到12月底考完之后再写…

基于OpenCV solvePnP函数估计头部姿势

人脸识别 文章目录 人脸识别一、姿势估计概述1、概述2、姿态估计3、在数学上表示相机运动4、姿势估计需要什么5、姿势估计算法6、Levenberg-Marquardt 优化 二、solvePnP函数1、函数原型2、参数详解 三、OpenCV源码1、源码路径 四、效果图像示例参考链接 一、姿势估计概述 1、…

寄存器分配:图着色算法

寄存器分配&#xff1a;图着色算法 背景活跃分析寄存器冲突图图着色算法溢出 背景 在编译器的中间表示中&#xff0c;一般会设定虚拟寄存器有无限多个&#xff08;方便优化&#xff09;&#xff0c;而真实的物理寄存器是有限的&#xff0c;因而编译器后端在将中间表示翻译成目…

centos7安装mysql数据库详细教程及常见问题解决

mysql数据库详细安装步骤 1.在root身份下输入执行命令&#xff1a; yum -y update 2.检查是否已经安装MySQL&#xff0c;输入以下命令并执行&#xff1a; mysql -v 如出现-bash: mysql: command not found 则说明没有安装mysql 也可以输入rpm -qa | grep -i mysql 查看是否已…

mac下安装vue cli脚手架并搭建一个简易项目

目录 1、确定本电脑下node和npm版本是否为项目所需版本。 2、下载vue脚手架 3、创建项目 1、下载node。 如果有node&#xff0c;打开终端&#xff0c;输入node -v和npm -v , 确保node和npm的版本&#xff0c;(这里可以根据自己的需求去选择&#xff0c;如果对最新版本的内容有…

python 源码中 PyId_stdout 如何定义的

python 源代码中遇到一个变量名 PyId_stdout&#xff0c;搜不到在哪里定义的&#xff0c;如下只能搜到引用的位置&#xff08;python3.8.10&#xff09;&#xff1a; 找了半天发现是用宏来构造的声明语句&#xff1a; // filepath: Include/cpython/object.h typedef struct …

Gradle build 失败后提示.lock文件,解决办法

在Gradle build失败之后时&#xff0c;有时候强制关闭AndroidStudio&#xff0c;再次打开build时&#xff0c;会提示各种.lock 文件问题&#xff0c;删除了一个还有下一个&#xff0c;而且路径不一样。 一般情况下是这两个文件夹下的lockfile影响继续build %GRADLE_HOME%/ca…

目标检测任务中常用的数据集格式(voc、coco、yolo)

一、Pascal VOC VOC数据集(Annotation的格式是xmI) Pascal VOC数据集是目标检测的常用的大规模数据集之一&#xff0c;从05年到12年都会举办比赛&#xff0c;比赛任务task&#xff1a; 分类Classification目标检测Object Detection语义分割Class Segmentation实例分割Object…

基于java+swing+mysql图书管理系统v8.0

基于javaswingmysql图书管理系统v8.0 一、系统介绍二、功能展示1.登陆及主页2.图书类别添加3.图书类别维护4.图书添加5.图书维护 三、系统实现1.BookManageMainFrame.java 四、其它1.其他系统实现 五、获取源码 一、系统介绍 该系统实现了用户登陆、图书类别管理(图书类别添加…

yolov5 onnx模型 转为 rknn模型

1、转换为rknn模型环境搭建 onnx模型需要转换为rknn模型才能在rv1126开发板上运行&#xff0c;所以需要先搭建转换环境 模型转换工具 模型转换相关文件下载&#xff1a; 网盘下载链接&#xff1a;百度网盘 请输入提取码 提取码&#xff1a;teuc 将其移动到虚拟机中&#xf…

基本排序算法

目录 一&#xff0c;插入排序 二&#xff0c;希尔排序 三&#xff0c;选择排序 四&#xff0c;冒泡排序 五&#xff0c;快排 5.1 Hoare法 5.2 挖坑法 5.3 指针法 5.4 非递归写法 六&#xff0c;归并排序 6.1 递归 6.2 非递归 一&#xff0c;插入排序 基本思想&…

CorelDraw怎么做立体字效果?CorelDraw制作漂亮的3d立体字教程

1、打开软件CorelDRAW 2019&#xff0c;用文本工具写上我们所需要的大标题。建议字体选用比较粗的适合做标题的字体。 2、给字填充颜色&#xff0c;此时填充的颜色就是以后立体字正面的颜色。我填充了红色&#xff0c;并加上了灰色的描边。 3、选中文本&#xff0c;单击界面左侧…

superset为何无法上传excel,csv等外部文件

superset为何无法上传excel&#xff0c;csv等外部文件 这是由于没有打开数据库的上传外部文件的权限 1.打开数据库连接设置&#xff0c;选择Allow file uploads to database 2.发现这里的上传链接都可以使用

c++ 类

类的引入 c 语言的结构体只能定义变量 但是 c的结构体除了定义变量之外&#xff0c;还可以定义函数。 感受感受&#xff1a; #define _CRT_SECURE_NO_WARNINGS 1//我们声明一个结构体 struct Stack {// c可以把函数写在结构体中//叫成员函数:// 如下&#xff1a;//c的写法&am…

股票回购不积极,遭分析师看空,汽车之家财务前景黯淡

来源&#xff1a;猛兽财经 作者&#xff1a;猛兽财经 第一季度财报后股价表现不佳 汽车之家&#xff08;ATHM&#xff09;于2023年5月11日公布了2023年第一季度业财报绩。 猛兽财经通过查询财报得知&#xff0c;汽车之家第一季度的实际营收为2.21亿美元&#xff0c;正常每股收…

uniapp实现预约时间选择弹窗组件

做了个组件&#xff0c;实现出当日预约时间组件&#xff0c;效果图如下 废话不多说&#xff0c;直接上代码&#xff0c;代码简单&#xff0c;参数自己任意改 <template><view class"inventory"><u-popup :show"show" :round"10"…

开源快速开发平台:做好数据管理,实现流程化办公!

做好数据管理&#xff0c;可以提升企业的办公协作效率&#xff0c;实现数字化转型。开源快速开发平台是深受企业喜爱的低代码开发平台&#xff0c;拥有多项典型功能&#xff0c;是可以打造自主可控快速开发平台&#xff0c;实现一对一框架定制的软件平台。在快节奏的社会中&…

Docker的安装与部署

Docker 基本概念介绍 通俗理解&#xff1a;镜像是类&#xff0c;容器是对象实例 仓库 应用商店、镜像 下载的应用安装程序、容器 应用程序 镜像(Image) 这里面保存了应用和需要的依赖环境 为什么需要多个镜像&#xff1f;当开发、构建和运行容器化应用程序时&#xff0c;我们…
最新文章