2021高教社杯全国大学生数学建模竞赛C题 Python代码演示

目录

    • 问题一
      • 1.1 根据附件 1,对 402 家供应商的供货特征进行量化分析
        • 计算供货特征
        • 数据标准化
          • 对正向指标归一化
          • 对负向指标归一化
      • 1.2 建立反映保障企业生产重要性的数学模型
        • 熵权法
        • 熵权法-TOPSIS
        • AHP
      • 1.3 在此基础上确定 50 家最重要的供应商,并在论文中列表给出结果。
    • 问题二
      • 2.1 参考问题 1,该企业应至少选择多少家供应商供应原材料才可能满足生产的需求?
        • 遗传算法
        • 差异进化
        • 粒子群优化(PSO)

python">import pandas as pd
import warnings
warnings.filterwarnings("ignore")path = '/home/shiyu/Desktop/path_acdemic/ant/数模/历年题目/2021/'
d1 = pd.read_excel((path + '附件1 近5年402家供应商的相关数据.xlsx'), sheet_name='企业的订货量(m³)')
d2 = pd.read_excel((path + '附件1 近5年402家供应商的相关数据.xlsx'), sheet_name='供应商的供货量(m³)')
d3 = pd.read_excel((path + '附件2 近5年8家转运商的相关数据.xlsx'))

问题一

1.1 根据附件 1,对 402 家供应商的供货特征进行量化分析

https://dxs.moe.gov.cn/zx/a/hd_sxjm_sxjmlw_2021qgdxssxjmjslwzs/211025/1734085.shtml
在这里插入图片描述

计算供货特征

供货次数(正向)

python">d2_sub = d2.iloc[:,2:]
supply_times = d2_sub.apply(lambda x: sum(x!=0), axis=1)

平均供货量(正向)

python">supply_quantity_mean = d2_sub.apply(lambda x: sum(x), axis=1) / supply_times

单次最大供货量(正向)

python">supply_max = d2_sub.apply(lambda x: max(x), axis=1)

供货稳定性(负向)

python">d1_sub = d1.iloc[:,2:]
d12_sub = d1_sub.subtract(d2_sub) ** 2
supply_stability = d12_sub.apply(lambda x: sum(x), axis=1) / supply_times

供货连续性

  • 间隔次数(负向)
python">import numpy as npgap_times = [None] * d2_sub.shape[0]
for i in range(0,d2_sub.shape[0]):a = d2_sub.iloc[i,:] == 0gap_times[i] = (a&~np.r_[[False],a[:-1]]).sum() 
  • 平均间隔周数(负向)
python">gap_weeks_mean = [None] * d2_sub.shape[0]
for i in range(0,d2_sub.shape[0]):index = [0] + list(np.where(d2_sub.iloc[i,:] != 0)[0]) + [241]new = np.diff(index)gap_weeks_mean[i] = sum(new[np.where((new != 1) & (new != 0))])gap_weeks_mean = gap_weeks_mean / supply_times
  • 平均连续供货周数(正向)
python">supply_weeks_mean = [None] * d2_sub.shape[0]
for i in range(0,d2_sub.shape[0]):index = np.where(d2_sub.iloc[i,:] != 0)[0]new = np.where(np.diff(index) == 1)[0]supply_weeks_mean[i] = len(new) * 2 - len(np.where(np.diff(new) == 1)[0])supply_weeks_mean = supply_weeks_mean / supply_times

合理供货比例(正向)

python">df = pd.DataFrame(None, columns=list(d2_sub.columns),index=list(d2_sub.index))for i in range(0,d2_sub.shape[0]):for j in range(0,d2_sub.shape[1]):if d1_sub.iloc[i,j] == 0:df.iloc[i,j] = 0if (d2_sub.iloc[i,j] > d1_sub.iloc[i,j] * 0.8) and (d2_sub.iloc[i,j] < d1_sub.iloc[i,j] * 1.2):df.iloc[i,j] = Trueelse:df.iloc[i,j] = Falsesupply_proportion = df.apply(lambda x: sum(x), axis=1) / supply_times
数据标准化
python">df = pd.DataFrame({'供货次数': supply_times,'平均供货量': supply_quantity_mean,'单次最大供货量': supply_max,'供货稳定性': supply_stability,'间隔次数': gap_times,'平均间隔周数': gap_weeks_mean,'平均连续供货周数': supply_weeks_mean,'合理供货比例': supply_proportion})df.shape
(402, 8)
对正向指标归一化
python">df_positive = df[['供货次数','平均供货量','单次最大供货量','平均连续供货周数','合理供货比例']]
df_positive_norm = df_positive.apply(lambda x: (x-min(x)) / (max(x)-min(x)), axis=0)
df_positive_norm.head()
供货次数平均供货量单次最大供货量平均连续供货周数合理供货比例
00.1004180.0003280.0001350.3600000.360000
10.2928870.0009720.0017850.5774650.507042
20.7949790.0231570.0104410.9738220.727749
30.1338910.0003210.0001890.6363640.363636
40.4435150.0217270.0034351.0000000.859813
对负向指标归一化
python">df_negative = df[['供货稳定性','间隔次数','平均间隔周数']]
df_negative_norm = df_negative.apply(lambda x: (max(x)-x) / (max(x)-min(x)), axis=0)
df_negative_norm.head()
供货稳定性间隔次数平均间隔周数
00.9999990.8090910.960863
11.0000000.5909090.987411
20.9999880.8636360.998601
30.9999930.8090910.971365
41.0000000.9454550.994567
python"># merge data
df_norm = pd.concat([df_positive_norm, df_negative_norm], axis=1, join='inner')

1.2 建立反映保障企业生产重要性的数学模型

  • https://www.bilibili.com/read/cv12741665/
  • https://github.com/Valdecy/pyDecision
    在这里插入图片描述
熵权法

https://www.kaggle.com/code/alpayabbaszade/entropy-topsis

首先对供货连续性下的3个二级指标进行加权

python">supply_continuity = df_norm[['间隔次数','平均间隔周数','平均连续供货周数']]
python">#Normalize Decision matrix
def norm(X):return X/X.sum()supply_continuity_norm = norm(supply_continuity)
python">#Entropy Values
k = -(1/np.log(supply_continuity_norm.shape[0]))def entropy(X):return (X*np.log(X)).sum()*kentropy = entropy(supply_continuity_norm)#degree of differentiation
dod = 1 - entropy
w = dod/dod.sum()
weights = w.sort_values(ascending = False)
weights
平均连续供货周数    0.594747
间隔次数        0.384353
平均间隔周数      0.020900
dtype: float64
python">supply_continuity_weighted = supply_continuity['间隔次数']*weights.iloc[0] + supply_continuity['平均间隔周数']*weights.iloc[1] + supply_continuity['平均连续供货周数']*weights.iloc[2]
df_norm.drop(['间隔次数','平均间隔周数','平均连续供货周数'], axis=1, inplace=True)
df_norm['供货连续性'] = supply_continuity_weighted
df_norm.head(3)
供货次数平均供货量单次最大供货量合理供货比例供货稳定性供货连续性
00.1004180.0003280.0001350.3600000.9999990.858039
10.2928870.0009720.0017850.5070421.0000000.743025
20.7949790.0231570.0104410.7277490.9999880.917813

对6个一级指标进行加权

python">#Normalize Decision matrix
def norm(X):return X/X.sum()df_norm_new = norm(df_norm)#Entropy Values
k = -(1/np.log(df_norm_new.shape[0]))def entropy(X):return (X*np.log(X)).sum()*kentropy = entropy(df_norm_new)#degree of differentiation
dod = 1 - entropy
w = dod/dod.sum()
weights_entropy = w.sort_values(ascending = False)
weights_entropy
单次最大供货量    0.496440
平均供货量      0.392450
供货次数       0.091647
合理供货比例     0.016205
供货连续性      0.002825
供货稳定性      0.000433
dtype: float64
熵权法-TOPSIS
  • https://www.kaggle.com/code/alpayabbaszade/entropy-topsis
  • https://blog.csdn.net/qq_42374697/article/details/105901229
python">def norm(X):return X/np.sqrt((X**2).sum())norm_matrix = norm(df_norm)
w_norm_matrix = norm_matrix*wV_plus = w_norm_matrix.apply(max)
V_minus = w_norm_matrix.apply(min)S_plus = np.sqrt(((w_norm_matrix - V_plus)**2).apply(sum, axis = 1))
S_minus = np.sqrt(((w_norm_matrix - V_minus)**2).apply(sum, axis = 1))
scores = S_minus/(S_plus + S_minus)
python">d2['综合得分'] = scores * 100
output = d2[['供应商ID','综合得分']]# sort by scores
output = output.sort_values('综合得分', ascending=False)
output.iloc[0:50,:].to_csv('/home/shiyu/Desktop/path_acdemic/ant/数模/历年题目/2021/output/scores_top50.csv')
python">output.iloc[0:50,:].head()
供应商ID综合得分
200S20187.972335
347S34857.756055
139S14052.993102
150S15144.951646
373S37441.858722
python">output.to_csv('/home/shiyu/Desktop/path_acdemic/ant/数模/历年题目/2021/output/scores_all.csv')
AHP
  • https://www.mindtools.com/a7y139c/the-analytic-hierarchy-process-ahp
  • https://github.com/PhilipGriffith/AHPy
python">df_norm.head()
供货次数平均供货量单次最大供货量合理供货比例供货稳定性供货连续性
00.1004180.0003280.0001350.3600000.9999990.858039
10.2928870.0009720.0017850.5070421.0000000.743025
20.7949790.0231570.0104410.7277490.9999880.917813
30.1338910.0003210.0001890.3636360.9999930.867852
40.4435150.0217270.0034350.8598131.0000000.965471
python">import ahpy
comparisons = {('供货次数', '平均供货量'): 3, ('供货次数', '单次最大供货量'): 5, ('供货次数', '合理供货比例'): 5, ('供货次数', '供货稳定性'): 5, ('供货次数', '供货连续性'): 5, ('平均供货量', '单次最大供货量'): 5, ('平均供货量', '合理供货比例'): 3, ('平均供货量', '供货稳定性'): 3, ('平均供货量', '供货连续性'): 3,('单次最大供货量', '合理供货比例'): 1/3, ('单次最大供货量', '供货稳定性'): 1/3, ('单次最大供货量', '供货连续性'): 1/3,('合理供货比例', '供货稳定性'): 1, ('合理供货比例', '供货连续性'): 1,('供货稳定性', '供货连续性'): 1}
comparisons
{('供货次数', '平均供货量'): 3,('供货次数', '单次最大供货量'): 5,('供货次数', '合理供货比例'): 5,('供货次数', '供货稳定性'): 5,('供货次数', '供货连续性'): 5,('平均供货量', '单次最大供货量'): 5,('平均供货量', '合理供货比例'): 3,('平均供货量', '供货稳定性'): 3,('平均供货量', '供货连续性'): 3,('单次最大供货量', '合理供货比例'): 0.3333333333333333,('单次最大供货量', '供货稳定性'): 0.3333333333333333,('单次最大供货量', '供货连续性'): 0.3333333333333333,('合理供货比例', '供货稳定性'): 1,('合理供货比例', '供货连续性'): 1,('供货稳定性', '供货连续性'): 1}
python">cal = ahpy.Compare(name='Drinks', comparisons=comparisons, precision=3, random_index='saaty')
cal.target_weights
{'供货次数': 0.445,'平均供货量': 0.232,'合理供货比例': 0.093,'供货稳定性': 0.093,'供货连续性': 0.093,'单次最大供货量': 0.044}
python">cal.consistency_ratio
0.032

CR < 0.1, 可认为判断矩阵的一致性可以接受

1.3 在此基础上确定 50 家最重要的供应商,并在论文中列表给出结果。

将熵权法和AHP得到的权重进行平均,得到最终的指标权重,然后加权计算各供应商的得分

python">weights_ahp = pd.DataFrame.from_dict(cal.target_weights, orient='index',columns=['AHP权重'])
python">import statisticsresults = pd.concat([weights_ahp, weights_entropy], axis=1)
results.columns = ['AHP权重','熵权法权重']
results['最终权重'] = results.apply(lambda x: statistics.mean(x), axis=1)
results
AHP权重熵权法权重最终权重
供货次数0.4450.0916470.268324
平均供货量0.2320.3924500.312225
合理供货比例0.0930.0162050.054603
供货稳定性0.0930.0004330.046716
供货连续性0.0930.0028250.047912
单次最大供货量0.0440.4964400.270220
python">d2['综合得分2'] = (df_norm['供货次数']*0.268324 + df_norm['平均供货量']*0.312225 + df_norm['合理供货比例']*0.054603 + df_norm['供货稳定性']*0.046716 + df_norm['供货连续性']*0.047912 + df_norm['单次最大供货量']*0.270220)*300
output = d2[['供应商ID','综合得分2']]# sort by scores
output = output.sort_values('综合得分2', ascending=False)
output.iloc[0:50,:].to_csv('/home/shiyu/Desktop/path_acdemic/ant/数模/历年题目/2021/output/scores_top50_AHP&Entropy.csv')
python"># 对排名前10的供应商可视化
df = output.iloc[0:10,:]
df = df.sort_values(by='综合得分2')
df
供应商ID综合得分2
307S308160.745089
329S330164.460643
107S108174.260128
360S361174.874852
373S374175.082953
228S229179.242563
139S140196.710758
150S151197.078972
200S201199.599719
347S348200.332317
python"># Horizontal lollipop plot
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np# Linux show Chinese characters *** important
plt.rcParams['font.family'] = 'WenQuanYi Micro Hei' 
plt.rcParams['figure.dpi'] = 300
plt.rcParams['savefig.dpi'] = 300my_range=range(1,11)
plt.hlines(y=my_range, xmin=0, xmax=df['综合得分2'], color='skyblue')
plt.plot(df['综合得分2'], my_range, "o")# Add titles and axis names
plt.yticks(my_range, df['供应商ID'])
plt.title("综合得分前10的供应商")
plt.xlabel('供应商综合得分')
plt.ylabel('供应商ID')# Show the plot
plt.show()

在这里插入图片描述

问题二

Pyhon中智能算法的模块:

https://scikit-opt.github.io/scikit-opt/#/en/README

Python中优化的模块

https://docs.scipy.org/doc/scipy/tutorial/optimize.html

formular editor:

https://editor.codecogs.com/

2.1 参考问题 1,该企业应至少选择多少家供应商供应原材料才可能满足生产的需求?

在这里插入图片描述
在这里插入图片描述

平均损失率
α \alpha α

python">loss_rate = sum(d3.iloc[:,1:].apply(lambda x: sum(x) / sum(x!=0), axis=0)) / 240
loss_rate
1.3063532832341274

供货量 x ^ i , t \widehat{x}_{i,t} x i,t

python">supply_quantity_mean[:6]
0     1.960000
1     3.845070
2    68.785340
3     1.939394
4    64.598131
5     2.307692
dtype: float64

供应商得分 s i s_{i} si

python">scores = pd.read_csv('/home/shiyu/Desktop/path_acdemic/ant/数模/历年题目/2021/output/scores_all.csv')
scores = scores.iloc[:,1:]
python">index_A = np.where(d2['材料分类'] == 'A')[0]
index_B = np.where(d2['材料分类'] == 'B')[0]
index_C = np.where(d2['材料分类'] == 'C')[0]
python">import numpy as npdef func(y):# input y is a list with 402 dims# set y as inty = np.around(np.array(y))res = sum(y) / sum(y * scores['综合得分'])return res
python">constraint_eq = [lambda y: sum((np.around(np.array(y))[index_A] * supply_quantity_mean[index_A] * (1-loss_rate/100)) / 0.6) + sum((np.around(np.array(y))[index_B] * supply_quantity_mean[index_B] * (1-loss_rate/100)) / 0.66) + sum((np.around(np.array(y))[index_C] * supply_quantity_mean[index_C] * (1-loss_rate/100)) / 0.72) - 2.82 * 10**4
]
遗传算法
python">from sko.GA import GA
y_len = 402ga = GA(func=func, n_dim=y_len, size_pop=50, max_iter=800, prob_mut=0.001, lb=[0]*y_len, ub=[1]*y_len, precision=1,constraint_eq=constraint_eq)
best_y_ga = ga.run()
python">suppliers_index_ga = np.where(best_y_ga[0] == 1)[0].tolist()
suppliers_ga = d2.iloc[suppliers_index_ga,0:2]
print('选择的供应商数量:', suppliers_ga.shape[0])
选择的供应商数量: 210
差异进化
python">from sko.DE import DE
y_len = 402
de = DE(func=func, n_dim=y_len, size_pop=50, max_iter=800, lb=[0]*y_len, ub=[1]*y_len,constraint_eq=constraint_eq)best_y_de = de.run()
python">y_de = np.around(best_y_de[0])
suppliers_index_de = np.where(y_de == 1)[0].tolist()
suppliers_de = d2.iloc[suppliers_index_de,0:2]
print('选择的供应商数量:', suppliers_de.shape[0])
选择的供应商数量: 184
粒子群优化(PSO)
python">from sko.PSO import PSO
y_len = 402
pso = PSO(func=func, n_dim=y_len, pop=40, max_iter=150, lb=[0]*y_len, ub=[1]*y_len, constraint_eq=constraint_eq)
best_y_pso = pso.run()
python">y_pso = np.around(best_y_pso[0])
suppliers_index_pso = np.where(y_pso == 1)[0].tolist()
suppliers_pso = d2.iloc[suppliers_index_pso,0:2]
print('选择的供应商数量:', suppliers_pso.shape[0])
选择的供应商数量: 152
python">import matplotlib.pyplot as plt
# Linux show Chinese characters *** important
plt.rcParams['font.family'] = 'WenQuanYi Micro Hei' 
plt.rcParams['figure.dpi'] = 300
plt.rcParams['savefig.dpi'] = 300plt.plot(pso.gbest_y_hist)
plt.title("目标函数的迭代过程")
plt.xlabel('迭代次数')
plt.ylabel('目标函数值')
plt.show()

在这里插入图片描述


http://www.ppmy.cn/embedded/112699.html

相关文章

【计算机网络】第一章

一、计算机网络的各种定义 Internet&#xff1a;因特网&#xff08;外国资源&#xff09; internet&#xff1a;互联网络&#xff08;两个或两个以上的网络相互连接构成&#xff09;->专指某一种类型的网络 计算机网络&#xff1a;将分散在不同地理位置上的具有自主处理能力…

c#中的版本管理和描述

StringBuilder sb new StringBuilder(); sb.Append("1、开发框架选型&#xff0c;编程语言选型和开发控件选型&#xff0c;基础框架搭建"); sb.Append(Environment.NewLine); sb.Append("2、测试环境数据库中版本表结构和账号表结构设计&#xff1b;"); …

k8s中的存储

目录 一 configmap 1.1 configmap的功能 1.2 configmap的使用场景 1.3 configmap创建方式 1.3.1 字面值创建 1.3.2 通过文件创建 1.3.3 通过目录创建 1.3.4 通过yaml文件创建 1.3.5 configmap的使用方式 1.3.5.1 使用configmap填充环境变量 1.3.5.2 通过数据卷使用c…

PG表空间

目录标题 PG表空间PostgreSQL表空间的最佳实践是什么&#xff1f;如何在PostgreSQL中创建和管理自定义表空间&#xff1f;PostgreSQL表空间对数据库性能的具体影响有哪些&#xff1f;在PostgreSQL中&#xff0c;如何迁移数据到不同的表空间以优化存储布局&#xff1f;PostgreSQ…

大数据-130 - Flink CEP 详解 - CEP开发流程 与 案例实践:恶意登录检测实现

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; 目前已经更新到了&#xff1a; Hadoop&#xff08;已更完&#xff09;HDFS&#xff08;已更完&#xff09;MapReduce&#xff08;已更完&am…

【Go】-Gin框架

目录 Gin框架简介 简单示例 Gin渲染 HTML渲染 自定义模板函数 静态文件处理 使用模板继承 JSON渲染和XML渲染 获取参数 获取querystring参数 获取form参数 获取Path参数 c.Params.Get c.Params() 参数绑定 文件上传 单个文件上传 参数 多个文件上传 重定向…

VS Code 配置 Rust-Analyzer 报错

报错信息&#xff1a; Bootstrap Error" rust-analyzer requires glibc > 2.28 in latest build. 参考了好多地方&#xff0c; https://github.com/rust-lang/rust-analyzer/issues/11558 https://blog.csdn.net/aLingYun/article/details/120923694 https://rust-anal…

机器学习中的 K-均值聚类算法及其优缺点。

K-均值聚类算法是一种常用的无监督学习算法&#xff0c;用于将数据集划分为K个不重叠的簇。算法的过程通常分为以下几步&#xff1a; 随机选择K个点作为初始聚类中心。对数据集中的每个数据点&#xff0c;计算其与每个聚类中心的距离&#xff0c;并将数据点分配给距离最近的聚…

cmd修改游戏数据处理量大小

cmd修改游戏数据处理量大小 仅供参考 请备份处理 cmd修改系统处理数据大小 在Windows的命令提示符&#xff08;cmd&#xff09;中&#xff0c;修改系统处理文件的大小限制通常涉及修改注册表。以下是修改这些限制的步骤和示例代码。 请注意&#xff0c;修改注册表应该谨慎进行…

WPF的**逻辑树**和**可视树**。

WPF中有类似于前端技术中DOM&#xff08;文档对象模型&#xff09;的概念。在WPF中&#xff0c;这个概念被称为**逻辑树**和**可视树**。 1. **逻辑树**&#xff1a; - 逻辑树表示应用程序的结构&#xff0c;包括所有的控件和元素。它类似于前端中的DOM树&#xff0c;表示页…

力扣121-买卖股票的最佳时机(Java详细题解)

题目链接&#xff1a;121. 买卖股票的最佳时机 - 力扣&#xff08;LeetCode&#xff09; 前情提要&#xff1a; 因为本人最近都来刷dp类的题目所以该题就默认用dp方法来做。 dp五部曲。 1.确定dp数组和i下标的含义。 2.确定递推公式。 3.dp初始化。 4.确定dp的遍历顺序。…

【前端UI框架】VUE ElementUI 离线文档 可不联网打开

【前端UI框架】VUE ElementUI 离线文档 可不联网打开 Element - The worlds most popular Vue UI framework Element - The worlds most popular Vue UI framework 离线文档下载地址 https://download.csdn.net/download/G971005287W/89748138 https://download.csdn.net/do…

Python 解析 JSON 数据

1、有如下 JSON 数据&#xff0c;存放在 data.json 文件&#xff1a; [{"id":1, "name": "小王", "gender": "male", "score": 96.8}, {"id":2, "name": "小婷", "gender&qu…

random.randrange与torch.arange的用法

random.randrange 和 torch.arange 是两个在功能和应用上有明显差异的函数&#xff0c;它们分别属于 Python 的标准库 random 和 PyTorch 深度学习框架。这两个函数的使用场景和目的不同&#xff0c;我们将逐一介绍它们的功能和区别。 1. random.randrange random.randrange 是…

IAPP发布《2024年人工智能治理实践报告》

文章目录 前言一、黑箱问题►透明度、可理解性与可解释性二、法律和政策中的注意事项►欧盟的《通用数据保护条例》►欧盟的AI法案►NIST的AI风险管理框架►美国的第14110号行政命令►《生成式人工智能服务管理暂行办法》►新加坡的AI验证三、实施人工智能治理►模型卡与系统卡…

【运维方案】软件运维服务方案(word)

1.项目情况 2.服务简述 2.1服务内容 2.2服务方式 2.3服务要求 2.4服务流程 2.5工作流程 2.6业务关系 2.7培训 3.资源提供 3.1项目组成员 3.2服务保障 进主页学习更多获取更多资料&#xff5e;

Spring Boot-API网关问题

****### Spring Boot API 网关问题分析与解决方案 在微服务架构中&#xff0c;API 网关扮演着非常重要的角色。它位于客户端和微服务之间&#xff0c;充当所有外部请求的入口&#xff0c;负责请求的路由、聚合、鉴权、限流等功能。Spring Boot 提供了多种方式实现 API 网关&am…

【C++】入门基础(下)

Hi&#xff01;很高兴见到你~ 目录 7、引用 7.3 引用的使用&#xff08;实例&#xff09; 7.4 const引用 【第一分点】 【第二分点1】 【第二分点2】 7.5 指针和引用的关系&#xff08;面试点&#xff09; 8、inline 9、nullptr Relaxing Time&#xff01; ———…

Vue3.5+ 响应式 Props 解构

你好同学&#xff0c;我是沐爸&#xff0c;欢迎点赞、收藏、评论和关注。 在 Vue 3.5 中&#xff0c;响应式 Props 解构已经稳定并默认启用。这意味着在 <script setup> 中从 defineProps 调用解构的变量现在是响应式的。这一改进大大简化了声明带有默认值的 props 的方…

基于TCP发送北斗消息给船舶设备终端

文章目录 引言I 自定义动态数据交换协议信息交换接口通信格式消息发送指令状态码错误信息返回指令II Netty实现TCP客户端III Java 原始API实现TCP客户端知识扩展: 基于Netty的定位数据平台通信协议定位方式移动定位设备see also引言 需求:发送北斗消息给船舶设备终端 动态信…