使用 Flask 构建基于 Dify 的企业资金投向与客户分类评估系统

使用 Flask 构建基于 Dify 的企业资金投向与客户分类评估系统

  • 前言
  • 一、🧩 技术栈
  • 二、📦 项目结构概览
  • 三、 🔧 核心功能模块说明
    • 1 配置参数
    • 2 请求封装函数
      • ✅ 功能说明:
    • 3 Prompt 构造函数
    • 4 Flask 路由定义
        • 🏠 首页路由 `/`
        • 📥 评估接口 `/evaluate`
        • 🧪 健康检查 `/health`
    • 🛠️ 运行方式
    • 🧪 示例请求体(JSON)
    • 💡 可扩展性建议
    • 📝 总结


前言

在金融、银行等对公业务中,准确判断企业的经营范围与其资金投向、客户分类是否匹配至关重要。本文将介绍如何使用 Python 和 Dify(一个强大的 LLM 应用开发平台)构建一个自动化的评估服务。

我们将通过 Flask 搭建一个 Web 接口,接收用户的输入信息,调用 Dify 提供的 API 来分析企业的资金投向和客户分类是否合理,并返回结构化结果。


一、🧩 技术栈

  • Python 3.10+
  • Flask:用于构建 Web 后端服务
  • Requests:用于调用 Dify API
  • JSON:处理数据解析和格式化输出
  • Dify AI 平台:提供大模型推理能力
  • 前端模板引擎 Jinja2:渲染评估表单页面

二、📦 项目结构概览

main_by_dify_v2.py          # 主程序文件
templates/
└── evaluation_form.html   # 表单页面模板

三、 🔧 核心功能模块说明

1 配置参数

API_URL = "http://localhost/v1/chat-messages"
API_KEY = "app-***"  # 替换为你的API密钥

[API_URL]是 Dify 提供的接口地址。
[API_KEY]是你在 Dify 平台上创建应用时获取的访问令牌。

2 请求封装函数

[ask_dify]该函数负责向 Dify 发送请求并处理响应:

def ask_dify(question: str, user_id: str = "user_123") -> Dict[str, Any]:headers = {"Authorization": f"Bearer {API_KEY}","Content-Type": "application/json"}payload = {"inputs": {},"query": question,"response_mode": "blocking","user": user_id}response = requests.post(API_URL, json=payload, headers=headers, timeout=30)response.raise_for_status()data = response.json()if 'answer' not in data:raise ValueError("API response missing 'answer' field")data_dict = json.loads(data['answer'])required_fields = ["funding_direction", "customer_category"]for field in required_fields:if field not in data_dict:raise KeyError(f"API response missing required field: {field}")return {'status': 'success','message': '评估完成','funding_evaluation': data_dict["funding_direction"],'category_evaluation': data_dict["customer_category"]}

✅ 功能说明:

  • 使用 requests 发起 POST 请求
  • 设置超时时间防止挂起
  • 对响应进行 JSON 解析
  • 校验关键字段是否存在

3 Prompt 构造函数

generate_prompt

构造符合要求的提示词内容,确保大模型能返回结构化结果:

def generate_prompt(customer_info: str, funding_direction: str, customer_category: str) -> str:return f"""#角色你是一名对公业务专家#核心任务基于经营范围,分析客户的资金投向与行内类别是否正确。不用输出think过程经营范围为: {json.dumps(customer_info)}资金投向为: {json.dumps(funding_direction)}行内类别为: {json.dumps(customer_category)}#输出规范{{"funding_direction": "分析资金投向是否正确,如果不正确,请给出分析原因", "customer_category": "分析行内类别是否正确,如果不正确,请给出分析原因"}}"""

4 Flask 路由定义

🏠 首页路由 /
@app.route('/')
def index() -> str:return render_template('evaluation_form.html')

渲染 HTML 页面,提供用户输入表单。

📥 评估接口 /evaluate
@app.route('/evaluate', methods=['POST'])
def evaluate_route() -> Any:try:data = request.get_json()prompt = generate_prompt(data['customer_info'],data['funding_direction'],data['customer_category'])result = ask_dify(prompt)return jsonify(result)except ValueError as e:return jsonify({'status': 'error', 'message': str(e)}), 400except Exception as e:return jsonify({'status': 'error', 'message': f"评估失败: {str(e)}"}), 500

处理用户提交的数据,生成提示词并调用 Dify 接口,返回结构化评估结果。

🧪 健康检查 /health
@app.route('/health', methods=['GET'])
def health_check() -> Dict[str, str]:return {"status": "healthy"}

用于监控服务运行状态。


🛠️ 运行方式

python main_by_dify_v2.py --port 5000 --host 0.0.0.0 --debug

启动后访问 http://localhost:5000 即可打开评估表单页面。


🧪 示例请求体(JSON)

{"customer_info": "计算机软件开发与销售","funding_direction": "投资人工智能研发","customer_category": "科技型企业"
}

💡 可扩展性建议

  • 将代码拆分为多个模块(如 routes.py, services.py, utils.py
  • 添加单元测试(推荐使用 pytest
  • 支持异步响应模式(Dify 支持 streaming 和 async 模式)
  • 使用 gunicorn + nginx 部署生产环境
  • 引入 Redis 缓存历史评估结果

📝 总结

通过本文我们实现了一个基于 Flask 和 Dify 的企业资金投向与客户分类评估系统。它具备以下特点:

  • 接口清晰、响应结构化
  • 支持 JSON 输入输出
  • 易于扩展和维护
  • 利用大模型能力自动化评估复杂业务逻辑

未来你可以根据业务需求进一步扩展此系统,例如支持多语言、增强安全机制、引入审计日志等。


📌 完整代码
main_by_dify_v2

import requests
from flask import Flask, render_template, request, jsonify
import logging
import json
from typing import Dict, Any, Optional
import argparse# 配置常量
API_URL = "http://0.0.0.0/v1/chat-messages"
API_KEY = "app-***"  # 替换为你的API密钥# 初始化 Flask 应用
app = Flask(__name__)
app.logger.setLevel(logging.INFO)def ask_dify(question: str, user_id: str = "user_123") -> Dict[str, Any]:"""向Dify API发送查询并处理响应Args:question: 要查询的问题user_id: 用户标识符Returns:包含评估结果的字典Raises:Exception: 当API请求失败或响应格式不正确时"""headers = {"Authorization": f"Bearer {API_KEY}","Content-Type": "application/json"}payload = {"inputs": {},"query": question,"response_mode": "blocking","user": user_id}try:response = requests.post(API_URL, json=payload, headers=headers, timeout=1000)response.raise_for_status()  # 检查HTTP错误data = response.json()app.logger.debug("Received API response: %s", data)if 'answer' not in data:raise ValueError("API response missing 'answer' field")data_dict = json.loads(data['answer'])required_fields = ["funding_direction", "customer_category"]for field in required_fields:if field not in data_dict:raise KeyError(f"API response missing required field: {field}")return {'status': 'success','message': '评估完成','funding_evaluation': data_dict["funding_direction"],'category_evaluation': data_dict["customer_category"]}except requests.exceptions.RequestException as e:app.logger.error("API request failed: %s", str(e))raise Exception(f"API请求失败: {str(e)}")except json.JSONDecodeError as e:app.logger.error("Failed to parse API response: %s", str(e))raise Exception("API响应解析失败")def generate_prompt(customer_info: str, funding_direction: str, customer_category: str) -> str:"""生成用于评估的提示文本Args:customer_info: 客户经营范围信息funding_direction: 资金投向customer_category: 客户分类Returns:格式化后的提示文本"""return f"""#角色你是一名对公业务专家#核心任务基于经营范围,分析客户的资金投向与行内类别是否正确。不用输出think过程经营范围为: {customer_info}资金投向为: {funding_direction}行内类别为: {customer_category}#输出规范{{"funding_direction": "分析资金投向是否正确,如果不正确,请给出分析原因", "customer_category": "分析行内类别是否正确,如果不正确,请给出分析原因"}}"""@app.route('/')
def index() -> str:"""显示评估表单页面"""return render_template('evaluation_form.html')@app.route('/evaluate', methods=['POST'])
def evaluate_route() -> Any:"""处理评估请求的后端接口Returns:JSON响应: 包含评估结果或错误信息"""try:data = request.get_json()if not data:raise ValueError("请求体为空或不是有效的JSON")required_fields = ['customer_info', 'funding_direction', 'customer_category']for field in required_fields:if field not in data:raise ValueError(f"缺少必要字段: {field}")app.logger.info("Processing evaluation request for customer: %s",data.get('customer_info', 'unknown'))prompt = generate_prompt(data['customer_info'],data['funding_direction'],data['customer_category'])result = ask_dify(prompt)return jsonify(result)except ValueError as e:app.logger.warning("Invalid request: %s", str(e))return jsonify({'status': 'error','message': str(e)}), 400except Exception as e:app.logger.error("Evaluation failed: %s", str(e), exc_info=True)return jsonify({'status': 'error','message': f"评估失败: {str(e)}"}), 500@app.route('/health', methods=['GET'])
def health_check() -> Dict[str, str]:"""健康检查接口"""return {"status": "healthy"}def parse_args() -> argparse.Namespace:"""解析命令行参数"""parser = argparse.ArgumentParser(description="Run the evaluation service")parser.add_argument('--port', type=int, default=5006, help="Port to run the server on")parser.add_argument('--host', default='0.0.0.0', help="Host to bind the server to")parser.add_argument('--debug', action='store_true', help="Run in debug mode")return parser.parse_args()if __name__ == '__main__':args = parse_args()app.run(host=args.host, port=args.port, debug=args.debug)

evaluation_form.html

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>用户价值评估</title><script src="https://code.jquery.com/jquery-3.6.0.min.js"></script><style>* {box-sizing: border-box;font-family: "Microsoft YaHei", "PingFang SC", sans-serif;}body {background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);min-height: 100vh;margin: 0;padding: 20px;display: flex;justify-content: center;align-items: center;}.evaluation-card {width: 100%;max-width: 900px;background: white;border-radius: 16px;box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);overflow: hidden;}.card-header {background: linear-gradient(to right, #3498db, #2c3e50);color: white;padding: 25px 40px;box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);}.card-title {margin: 0;font-size: 28px;font-weight: 600;letter-spacing: 0.5px;}.card-subtitle {margin: 8px 0 0;opacity: 0.9;font-weight: 400;font-size: 16px;}.card-body {padding: 40px;}.form-grid {display: grid;grid-template-columns: 150px 1fr;gap: 25px;align-items: center;}.form-label {font-weight: 600;font-size: 16px;color: #2c3e50;text-align: right;padding-right: 10px;}.form-control-group {display: flex;flex-direction: column;gap: 5px;}.text-input, .textarea-input {width: 100%;padding: 14px;border: 1px solid #dce4ec;border-radius: 8px;font-size: 15px;transition: all 0.3s ease;}.text-input:focus, .textarea-input:focus {border-color: #3498db;outline: none;box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);}.text-input::placeholder, .textarea-input::placeholder {color: #a0aec0;}.textarea-input {height: 120px;resize: vertical;line-height: 1.5;}.evaluation-result {margin-top: 35px;display: none;}.result-container {background: #f8f9fa;border-left: 4px solid #3498db;border-radius: 0 6px 6px 0;padding: 20px;margin-top: 10px;}.result-title {display: block;font-weight: 600;margin-bottom: 8px;color: #2c3e50;}/* 添加CSS样式 */
.result-container {width: 100%; /* 宽度自适应容器 */max-width: 600px; /* 建议在银行系统设置固定宽度 */max-height: 300px; /* 控制最大高度 */overflow-y: auto; /* 垂直滚动条 */border: 1px solid #e0e0e0; /* 银行系统常见的浅灰色边框 */border-radius: 4px;background-color: #f8f9fa; /* 银行常用的浅灰背景 */margin-top: 8px;padding: 12px;box-shadow: inset 0 1px 2px rgba(0,0,0,0.05); /* 内阴影增强可读性 */
}.result-content {white-space: pre-wrap; /* 保留空白同时自动换行 */word-wrap: break-word; /* 强制长单词换行 */word-break: break-word; /* 支持中文换行 */font-family: 'SimSun', 'Microsoft YaHei', sans-serif; /* 银行常用字体 */font-size: 14px;line-height: 1.6;color: #333; /* 银行系统常用深灰文字 */
}.card-footer {padding: 0 40px 30px;display: flex;justify-content: center;}.evaluate-button {background: linear-gradient(to right, #3498db, #2c3e50);color: white;border: none;padding: 14px 50px;font-size: 18px;font-weight: 500;border-radius: 8px;cursor: pointer;box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);transition: all 0.3s ease;display: flex;align-items: center;gap: 10px;}.evaluate-button:hover {transform: translateY(-2px);box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);}.evaluate-button:active {transform: translateY(1px);}.evaluate-button i {font-size: 20px;}.feedback-message {text-align: center;margin-top: 20px;padding: 15px;border-radius: 8px;font-size: 16px;}.success { background-color: #dff0d8; color: #3c763d; border: 1px solid #d6e9c6; }.error { background-color: #f2dede; color: #a94442; border: 1px solid #ebccd1; }.processing { background-color: #d9edf7; color: #31708f; border: 1px solid #bce8f1; }</style>
</head>
<body><div class="evaluation-card"><div class="card-header"><h1 class="card-title">客户评估助手</h1><p class="card-subtitle">基于大模型的智能分析与风险评估</p></div><div class="card-body"><form class="form-grid" id="evaluationForm"><!-- 第1行:客户名称 --><label class="form-label" for="customerName">客户名称</label><div class="form-control-group"><input type="text" class="text-input" id="customerName" placeholder="请输入客户名称"></div><!-- 第2行:客户资料 --><label class="form-label" for="customerInfo">客户资料</label><div class="form-control-group"><textarea class="textarea-input" id="customerInfo" placeholder="请输入客户资料"></textarea></div><!-- 第3行:资金投向 --><label class="form-label" for="fundingDirection">资金投向</label><div class="form-control-group"><input type="text" class="text-input" id="fundingDirection" placeholder="请输入资金投向"><!-- 资金投向评估结果 --><div class="evaluation-result" id="fundingResult"><span class="result-title">大模型评估结果:</span><div class="result-container"><!--  <input type="textarea" class="text-input" id="fundingEvaluation" readonly>--><div class="result-content" id="fundingEvaluation"></div></div></div></div><!-- 第4行:客户类别 --><label class="form-label" for="customerCategory">客户类别</label><div class="form-control-group"><input type="text" class="text-input" id="customerCategory" placeholder="请输入客户类别"><!-- 客户类别评估结果 --><div class="evaluation-result" id="categoryResult"><span class="result-title">大模型评估结果:</span><div class="result-container"><!--   <input type="text" class="text-input" id="categoryEvaluation" readonly>--><div class="result-content" id="categoryEvaluation"></div></div></div></div><!-- 反馈消息 --><div class="feedback-message" id="formFeedback"></div></form></div><div class="card-footer"><button class="evaluate-button" id="evaluateBtn"><i>📊</i> 开始评估</button></div></div><script>$(document).ready(function() {$('#evaluateBtn').click(function() {// 收集表单数据const formData = {customer_name: $('#customerName').val().trim(),customer_info: $('#customerInfo').val().trim(),funding_direction: $('#fundingDirection').val().trim(),customer_category: $('#customerCategory').val().trim()};// 表单验证const feedback = $('#formFeedback');let isValid = true;feedback.removeClass().text('');// 清除之前的错误标记$('.text-input, .textarea-input').css('border-color', '#dce4ec');// 检查客户名称if (!formData.customer_name) {$('#customerName').css('border-color', '#e74c3c');showFeedback('请填写客户名称', 'error');isValid = false;}// 检查客户资料if (!formData.customer_info) {$('#customerInfo').css('border-color', '#e74c3c');if (!isValid) showFeedback('请填写所有必填项', 'error');else showFeedback('请填写客户资料', 'error');isValid = false;}// 检查资金投向if (!formData.funding_direction) {$('#fundingDirection').css('border-color', '#e74c3c');if (!isValid) showFeedback('请填写所有必填项', 'error');isValid = false;}// 检查客户类别if (!formData.customer_category) {$('#customerCategory').css('border-color', '#e74c3c');if (!isValid) showFeedback('请填写所有必填项', 'error');isValid = false;}if (!isValid) return;// 显示处理中状态showFeedback('正在使用大模型分析中,请稍候...', 'processing');// 发送评估请求$.ajax({type: "POST",url: "/evaluate",contentType: "application/json",data: JSON.stringify(formData),success: function(response) {// 显示评估结果$('#fundingEvaluation').val(response.funding_evaluation);document.getElementById('fundingEvaluation').innerText = response.funding_evaluation;$('#categoryEvaluation').val(response.category_evaluation);document.getElementById('categoryEvaluation').innerText = response.category_evaluation;// 显示结果区域$('#fundingResult').show();$('#categoryResult').show();// 成功反馈showFeedback(response.message + ' ✅', 'success');},error: function(xhr) {const errorMsg = xhr.responseJSON?.error || '评估请求失败,请重试';showFeedback('错误: ' + errorMsg, 'error');}});});// 输入框改变时移除错误标记$('.text-input, .textarea-input').on('input', function() {$(this).css('border-color', '#dce4ec');});function showFeedback(message, type) {const feedback = $('#formFeedback');feedback.text(message).removeClass().addClass('feedback-message ' + type);}});</script>
</body>
</html>

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

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

相关文章

深入解析 AAC AudioSpecificConfig 在 RTSP/RTMP 播放器中的核心作用

在音视频开发中&#xff0c;“能播”往往只是第一步&#xff0c;**“能正确、稳定、高质量地播”**才是衡量一款播放器成熟度的真正标准。尤其是在面对 AAC 音频流时&#xff0c;很多开发者容易忽视一个极其关键但看似微小的配置段 —— AAC Audio Specific Config&#xff08;…

Redis在项目中的使用

Redis&#xff08;Remote Dictionary Server&#xff0c;远程字典服务&#xff09;是一个开源的键值存储系统&#xff0c;通常用作数据库、缓存或消息传递系统。在项目中&#xff0c;Redis 可以发挥多种作用&#xff0c;以下是一些常见的使用场景&#xff1a; 1. 缓存 减少数据…

使用 collected 向 TDengine 写入数据

collectd 是一个用来收集系统性能的守护进程。collectd 提供各种存储方式来存储不同值的机制。它会在系统运行和存储信息时周期性的统计系统的相关统计信息。利用这些信息有助于查找当前系统性能瓶颈和预测系统未来的负载等。 只需要将 collectd 的配置指向运行 taosAdapter 的…

greeenplum7.2几个问题的解决方案

问题1systemd-modules-load.service报错 systemd-modules-load.service: 这个服务负责加载内核模块。在容器环境下&#xff0c;除非特别需要&#xff0c;否则通常不需要加载额外的内核模块。 auditd.service: 审计守护进程&#xff08;Audit Daemon&#xff09;&#xff0c;用…

AppInventor2 MQTT教程之 - EasyIoT 平台接入

之前发过一次MQTT超级入门教程&#xff0c;使用巴法云作为测试平台&#xff0c;详见&#xff1a; App Inventor 2 MQTT拓展入门&#xff08;保姆级教程&#xff09; 这里介绍MQTT接入另一家IoT平台&#xff1a;EasyIoT。 网址&#xff1a;https://iot.dfrobot.com.cn/&#…

打造企业级 AI 能力中台:Prompt DSL 管理与多模型前端架构

关键点 AI 能力中台&#xff1a;企业级 AI 能力中台整合多模型接入、Prompt 管理和组件复用&#xff0c;为跨团队协作提供高效前端架构。Prompt DSL 管理&#xff1a;通过领域特定语言&#xff08;DSL&#xff09;标准化 Prompt 设计&#xff0c;支持动态配置和复用。多模型统…

NumPy 安装使用教程

一、NumPy 简介 NumPy&#xff08;Numerical Python&#xff09;是 Python 中用于进行科学计算的基础库之一。它提供了高效的多维数组对象 ndarray&#xff0c;以及用于数组操作、线性代数、傅里叶变换、随机数等丰富的函数。 二、安装 NumPy 2.1 使用 pip 安装&#xff08;推…

LeetCode Hot 100 哈希【Java和Golang解法】

1.两数之和 1.两数之和 Java解法 class Solution {public int[] twoSum(int[] nums, int target) {Map<Integer, Integer> record new HashMap<>();for(int i 0; i < nums.length; i) {int temp target - nums[i];if (record.containsKey(temp)) {return n…

MySQL(108)如何进行分片合并?

分片合并&#xff08;Sharding Merge&#xff09;是指在分布式数据库系统中&#xff0c;将不同分片上的查询结果进行整合&#xff0c;以获得完整的查询结果。实现分片合并主要包括以下几个步骤&#xff1a; 查询所有相关分片&#xff1a;在所有相关分片上执行查询&#xff0c;…

轻量化5G加速上车!移远通信发布车规级RedCap模组AG53xC系列

6月26日&#xff0c;全球领先的物联网和车联网整体解决方案供应商移远通信宣布&#xff0c;重磅发布其首款车规级5G RedCap模组AG53xC系列。 该模组基于高通SA510M平台打造&#xff0c;支持3GPP R17标准&#xff0c;在成本性能平衡、硬件兼容、软件架构等方面表现优异&#xf…

如何在Ubuntu 20.04云服务器上安装RabbitMQ?

如何在Ubuntu 20.04云服务器上安装RabbitMQ&#xff1f; https://www.zhaomu.com/help/detail-824.html springboot 配置文件 spring.application.namerabbitmq-hellospring.rabbitmq.hostlocalhost spring.rabbitmq.port5672 spring.rabbitmq.usernameguest spring.rabbitm…

爬虫实战之图片及人物信息爬取

爬虫对于许多Python初学者来说都是一个好玩有趣的技能,但大多数人都是从网上得来的经验,会认为学习爬虫是件很难的事,像处理反爬机制以及反反爬,总是让人望而却步,今天我们来进行爬虫实操,需要注意爬虫本身并不违法,但恶意爬取文件将会涉及相关法律,为避免不必要的纠纷,本文采取…

vscode、openocd 使用

常用命令&#xff1a; # 先连接OpenOCD到硬件调试器&#xff0c;打开powershell命令行窗口, 会输出连接端口信息 # openocd -f <接口配置文件> -f <目标芯片配置文件> openocd -f D:/program/xpack-openocd/openocd/scripts/interface/stlink-v2.cfg -f D:/progra…

HTTP 协议深入理解

在 Web 服务与 API 设计中&#xff0c;HTTP 协议是客户端与服务器通信的基石。本文从协议演进、核心机制、缓存策略、安全特性及面试高频问题五个维度&#xff0c;系统解析 HTTP 的底层原理与工程实践。 一、HTTP 协议演进与版本差异 1.1 版本特性对比 版本发布年份核心改进局…

ABP VNext + Twilio:全渠道通知服务(SMS/Email/WhatsApp)

ABP VNext Twilio&#xff1a;全渠道通知服务&#xff08;SMS/Email/WhatsApp&#xff09; &#x1f680; &#x1f4da; 目录 ABP VNext Twilio&#xff1a;全渠道通知服务&#xff08;SMS/Email/WhatsApp&#xff09; &#x1f680;一、引言 ✨二、环境与依赖 &#x1f6e0…

电脑一体机,收银机画面显示不全——深入解析 BIOS 配置电脑分辨率——东方仙盟

在电脑的复杂体系中&#xff0c;BIOS&#xff08;基本输入输出系统&#xff09;虽深藏幕后&#xff0c;但其对电脑分辨率的配置却有着至关重要的影响。理解 BIOS 配置电脑分辨率的作用与意义&#xff0c;有助于我们更深入地挖掘电脑的性能潜力&#xff0c;优化视觉体验。 一、…

arm系统移植

目录 1. 流程2. 概念2.1 设备树2.2 根文件系统2.3 文件说明 3. 交叉编译链3.1 作用3.2 在linux下配置 4. tftp4.1 作用4.2 安装过程 5. nfs5.1 作用5.2 安装过程 6. 配置开发板7. linux下的uboot镜像烧写到SD卡中7.1 生成uboot二进制文件&#xff0c;二进制文件就是裸机程序。7…

量子算法入门——5.Qiskit库介绍与简单应用(2)

参考资料&#xff1a; 【【零基础入门量子计算】】 来自b站up&#xff1a;溴锑锑跃迁 建议关注他的更多高质量文章&#xff1a;CSDN&#xff1a;【溴锑锑跃迁】 &#xff08;实际上只带一点点原创&#xff0c;绝大部分资料来自这位大佬&#xff09; 跟着视频我手打了一遍notebo…

前端如何优雅地实现一个“请求队列”,避免服务器被卡死?

有这样一些场景&#xff1a; 页面一加载&#xff0c;需要同时发 10 个请求&#xff0c;结果页面卡住&#xff0c;服务器也快崩了。用户可以批量操作&#xff0c;一次点击触发了几十个上传文件的请求&#xff0c;浏览器直接转圈圈。 当后端处理不过来时&#xff0c;前端一股脑…

SSL/TLS协议信息泄露漏洞(CVE-2016-2183)、SSL/TLS RC4 信息泄露漏洞(CVE-2013-2566)修复方法

目录 一、问题原因二、整改步骤 一、问题原因 通过绿盟漏洞检测工具扫描发现Windows系统存在SSL/TLS协议信息泄露漏洞(CVE-2016-2183)、SSL/TLS RC4 信息泄露漏洞(CVE-2013-2566)、SSL/TLS 受诫礼(BAR-MITZVAH)攻击漏洞(CVE-2015-2808)。 二、整改步骤 使用gpedit.msc进入组…