【Microsoft Azure 的1024种玩法】五十二.基于Azure Application Insight对Web应用进行实时链路跟踪

本文主要是介绍【Microsoft Azure 的1024种玩法】五十二.基于Azure Application Insight对Web应用进行实时链路跟踪,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

【简介】

Application Insight是Azure Monitor 中的一个用于可用性监控的功能服务,Application Insight最大的功能点在于能对Web站点应用进行实时监控的同时还能提供APM应用程序性能管理,可以在最大的程度上面协助站点开发人员及网站运维人员全面了解用户访问应用站点所做的具体操作以及Web站点应用的性能及可用性,本篇文章主要是分享如何通过Application Insight来对我们Web应用站点进行实时监控
在这里插入图片描述

【前期文章】

【Microsoft Azure 的1024种玩法】一.一分钟快速上手搭建宝塔管理面板
【Microsoft Azure 的1024种玩法】二.基于Azure云平台的安全攻防靶场系统构建
【Microsoft Azure 的1024种玩法】三.基于Azure云平台构建Discuz论坛
【Microsoft Azure 的1024种玩法】四. 利用Azure Virtual machines 打造个人专属云盘,速度吊打某云盘
【Microsoft Azure 的1024种玩法】五.基于Azure Cloud Shell 一站式创建Linux VM
【Microsoft Azure 的1024种玩法】六.使用Azure Cloud Shell对Linux VirtualMachines 进行生命周期管理
【Microsoft Azure 的1024种玩法】七.Azure云端搭建部署属于自己的维基百科
【Microsoft Azure 的1024种玩法】八. 基于Azure云端轻松打造一款好用的私有云笔记
【Microsoft Azure 的1024种玩法】九. Microsoft Azure云端轻松构建部署PostgreSQL数据库
【Microsoft Azure 的1024种玩法】十. 基于Azure App Service 快速上手部署 ASP.NET Web 应用
【Microsoft Azure 的1024种玩法】十一.手动对Azure磁盘进行IOPS性能压力测试
【Microsoft Azure 的1024种玩法】十二. 使用Auzre cloud 安装搭建docker+vulhub靶场
【Microsoft Azure 的1024种玩法】十三.Azure cloud|带你快速搭建DVWA靶场漏洞环境
【Microsoft Azure 的1024种玩法】十四.Azure DNS 在线域名委托解析操作指南
【Microsoft Azure 的1024种玩法】十五.通过Web浏览器对Auzre VM 服务器运维管理
【Microsoft Azure 的1024种玩法】十六.Cobaltstrike内网渗透工具在Azure Cloud中的部署使用
【Microsoft Azure 的1024种玩法】 十七.在Microsoft Azure上动手搭建专属私有文件同步服务]
【Microsoft Azure 的1024种玩法】 十八.快速创建Microsoft Azure SQL数据库初体验
【Microsoft Azure 的1024种玩法】 十九.使用Azure备份服务对虚拟机快速备份
【Microsoft Azure 的1024种玩法】 二十.Azure Multi-Factor Authentication多因素验证最佳实战
【Microsoft Azure 的1024种玩法】 二十一.利用Azure Blob Service 快速实现静态网站托管
【Microsoft Azure 的1024种玩法】 二十二.中国区Azure Cloud 多重身份验证最佳实践
【Microsoft Azure 的1024种玩法】 二十三.快速上手Azure Content Delivery Network 内容分发网络
【Microsoft Azure 的1024种玩法】二十四.通过Azure Front Door 的 Web 应用程序防火墙来对 OWASP TOP 10 威胁进行防御
【Microsoft Azure 的1024种玩法】 二十五.使用Azure CDN对Azure Blob 静态托管站点进行加速
【Microsoft Azure 的1024种玩法】二十六. 在Azure VM中手动部署Windows Admin Center管理平台
【Microsoft Azure 的1024种玩法】二十七. Azure Virtual Desktop虚拟桌面之快速创建配置(一)
【Microsoft Azure 的1024种玩法】二十八. 基于Azure Cloud搭建IPS入侵防御系统实现安全流量实时分析
【Microsoft Azure 的1024种玩法】二十九.基于Azure VM快速实现网络入侵检测 (IDS) 及网络安全监视 (NSM)
【Microsoft Azure 的1024种玩法】三十. 使用Azure Data Studio之快速上手连接管理Azure SQL 数据库(一)
【Microsoft Azure 的1024种玩法】三十一.使用Azure Logic App 创建基于计划定期执行邮件发送的自动化工作流
【Microsoft Azure 的1024种玩法】三十二. 利用 AzCopy来对Azure Blob Storage中的数据进行复制迁移
【Microsoft Azure 的1024种玩法】三十三.十分钟快速部署 Azure Kubernetes Service 群集
【Microsoft Azure 的1024种玩法】三十四.将本地数据文件快速迁移到Azure Blob云存储最佳实践
【Microsoft Azure 的1024种玩法】三十五.在Azure Virtual machines中手动部署Java Web
【Microsoft Azure 的1024种玩法】三十六.通过网络文件系统NFS协议快速将Blob 存储挂在Azure Virtual machines中
【Microsoft Azure 的1024种玩法】三十七.通过Azure Virtual Machines实现远程连接本地内网服务器(内网穿透)
【Microsoft Azure 的1024种玩法】三十八.通过Azure Function App函数应用实现对Azure Virtual Machines定时开关机
【Microsoft Azure 的1024种玩法】三十九.使用Auzre Media Services实现在线实时视频直播
【Microsoft Azure 的1024种玩法】四十.快速将阿里云DNS解析平滑迁移至Azure Zone实战操作
【Microsoft Azure 的1024种玩法】四十一. 将Windows Admin Center 网关注册到 Azure
【Microsoft Azure 的1024种玩法】四十二. 通过Windows Admin Center快速创建Azure Virtual Machines
【Microsoft Azure 的1024种玩法】四十三. 基于Azure云平台构建RTMP直播服务
【Microsoft Azure 的1024种玩法】四十五.在Azure中快速创建Azure AD Domain Services
【Microsoft Azure 的1024种玩法】四十六.将 Azure VM 实例添加到Azure AD Domain Service中
【Microsoft Azure 的1024种玩法】四十七.通过Azure Virtual machines搭建FTP应用服务
【Microsoft Azure 的1024种玩法】四十八.基于Azure Virtual Machines快速搭建SQL Server应用
【Microsoft Azure 的1024种玩法】四十九.在Azure中使用Azure VirtualMachines 搭建Microsoft SharePoint 2016
【Microsoft Azure 的1024种玩法】五十. 通过Azure文件共享将Azure File 挂载到本地机器实现文件实时共享
【Microsoft Azure 的1024种玩法】五十一.在Azure Virtual Machines 上装载 SMB Azure 文件共享
【Microsoft Azure 的1024种玩法】五十二.基于Azure Application Insight对Web应用进行实时链路跟踪

【操作步骤】

一.创建配置Application Insights服务

1.在菜单中搜索“Application Insights” 进入Application Insights资源
在这里插入图片描述
2.在Application Insights 页面中,点击“创建“
在这里插入图片描述
3.按照下列各图所示,去配置Application Insights,配置完毕后点击“查看+创建”
在这里插入图片描述
4.第一次创建会进行验证操作,验证完毕后,我们点击“创建” 去执行“创建”操作
在这里插入图片描述5.如下图所示,正在创建部署Application Insights
在这里插入图片描述
6.配置完毕以后,我们点击“转到资源”

7.在资源配置里面,我们即可看到相关的Application Insights 配置页面,此处我们需要关注下这个“检测密钥” 后续我们会用到
在这里插入图片描述

二. 将Application Insights JS SDK 集成到需要监测的网站中

  1. 参考复制如下代码,并将代码中的YOUR_INSTRUMENTATION_KEY_GOES_HERE替换成我们创建的Applictaion Insight服务里面的连接字串InstrumentationKey
<script type="text/javascript">!function(T,l,y){var S=T.location,u="script",k="instrumentationKey",D="ingestionendpoint",C="disableExceptionTracking",E="ai.device.",I="toLowerCase",b="crossOrigin",w="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"4",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[I](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),iKey:e,name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,p,l,u;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a<n.length;a++){var i=n[a].split("=");2===i.length&&(e[i[0][I]()]=i[1])}if(!e[D]){var r=e.endpointsuffix,o=r?e.location:null;e[D]="https://"+(o?o+".":"")+"dc."+(r||"services.visualstudio.com")}return e}(),c=s[k]||d[k]||"",p=s[D],l=p?p+"/v2/track":config.endpointUrl,(u=[]).push((n="SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)",a=t,i=l,(o=(r=v(c,"Exception")).data).baseType="ExceptionData",o.baseData.exceptions=[{typeName:"SDKLoadFailed",message:n.replace(/\./g,"-"),hasFullStack:!1,stack:n+"\nSnippet failed to load ["+a+"] -- Telemetry is disabled\nHelp Link: https://go.microsoft.com/fwlink/?linkid=2128109\nHost: "+(S&&S.pathname||"_unknown_")+"\nEndpoint: "+i,parsedStack:[]}],r)),u.push(function(e,t,n,a){var i=v(c,"Message"),r=i.data;r.baseType="MessageData";var o=r.baseData;return o.message='AI (Internal): 99 message:"'+("SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details) ("+n+")").replace(/\"/g,"")+'"',o.properties={endpoint:a},i}(0,0,t,l)),function(e,t){if(JSON){var n=T.fetch;if(n&&!y.useXhr)n(t,{method:w,body:JSON.stringify(e),mode:"cors"});else if(XMLHttpRequest){var a=new XMLHttpRequest;a.open(w,t),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(e))}}}(u,l))}function i(e,t){f||setTimeout(function(){!t&&m.core||a()},500)}var e=function(){var n=l.createElement(u);n.src=h;var e=y[b];return!e&&""!==e||"undefined"==n[b]||(n[b]=e),n.onload=i,n.onerror=a,n.onreadystatechange=function(e,t){"loaded"!==n.readyState&&"complete"!==n.readyState||i(0,t)},n}();y.ld<0?l.getElementsByTagName("head")[0].appendChild(e):setTimeout(function(){l.getElementsByTagName(u)[0].parentNode.appendChild(e)},y.ld||0)}try{m.cookie=l.cookie}catch(p){}function t(e){for(;e.length;)!function(t){m[t]=function(){var e=arguments;g||m.queue.push(function(){m[t].apply(m,e)})}}(e.pop())}var n="track",r="TrackPage",o="TrackEvent";t([n+"Event",n+"PageView",n+"Exception",n+"Trace",n+"DependencyData",n+"Metric",n+"PageViewPerformance","start"+r,"stop"+r,"start"+o,"stop"+o,"addTelemetryInitializer","setAuthenticatedUserContext","clearAuthenticatedUserContext","flush"]),m.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4};var s=(d.extensionConfig||{}).ApplicationInsightsAnalytics||{};if(!0!==d[C]&&!0!==s[C]){method="onerror",t(["_"+method]);var c=T[method];T[method]=function(e,t,n,a,i){var r=c&&c(e,t,n,a,i);return!0!==r&&m["_"+method]({message:e,url:t,lineNumber:n,columnNumber:a,error:i}),r},d.autoExceptionInstrumented=!0}return m}(y.cfg);(T[t]=n).queue&&0===n.queue.length&&n.trackPageView({})}(window,document,{src: "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js", // The SDK URL Source//name: "appInsights", // Global SDK Instance name defaults to "appInsights" when not supplied//ld: 0, // Defines the load delay (in ms) before attempting to load the sdk. -1 = block page load and add to head. (default) = 0ms load after timeout,//useXhr: 1, // Use XHR instead of fetch to report failures (if available),//crossOrigin: "anonymous", // When supplied this will add the provided value as the cross origin attribute on the script tag cfg: { // Application Insights ConfigurationinstrumentationKey: "YOUR_INSTRUMENTATION_KEY_GOES_HERE"/* ...Other Configuration Options... */}});</script>

2.关于Applictaion Insight服务里面的连接字串InstrumentationKey我们可以通过下图的方式进行查看

在这里插入图片描述
3.我们将已经替换连接字符串的Application Insights JS SDK 代码复制到我们应用页面中的代码前

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Document</title><script type="text/javascript">!function(T,l,y){var S=T.location,k="script",D="connectionString",C="ingestionendpoint",I="disableExceptionTracking",E="ai.device.",b="toLowerCase",w="crossOrigin",N="POST",e="appInsightsSDK",t=y.name||"appInsights";(y.name||T[e])&&(T[e]=t);var n=T[t]||function(d){var g=!1,f=!1,m={initialize:!0,queue:[],sv:"5",version:2,config:d};function v(e,t){var n={},a="Browser";return n[E+"id"]=a[b](),n[E+"type"]=a,n["ai.operation.name"]=S&&S.pathname||"_unknown_",n["ai.internal.sdkVersion"]="javascript:snippet_"+(m.sv||m.version),{time:function(){var e=new Date;function t(e){var t=""+e;return 1===t.length&&(t="0"+t),t}return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}(),name:"Microsoft.ApplicationInsights."+e.replace(/-/g,"")+"."+t,sampleRate:100,tags:n,data:{baseData:{ver:2}}}}var h=d.url||y.src;if(h){function a(e){var t,n,a,i,r,o,s,c,u,p,l;g=!0,m.queue=[],f||(f=!0,t=h,s=function(){var e={},t=d.connectionString;if(t)for(var n=t.split(";"),a=0;a<n.length;a++){var i=n[a].split("=");2===i.length&&(e[i[0][b]()]=i[1])}if(!e[C]){var r=e.endpointsuffix,o=r?e.location:null;e[C]="https://"+(o?o+".":"")+"dc."+(r||"services.visualstudio.com")}return e}(),c=s[D]||d[D]||"",u=s[C],p=u?u+"/v2/track":d.endpointUrl,(l=[]).push((n="SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details)",a=t,i=p,(o=(r=v(c,"Exception")).data).baseType="ExceptionData",o.baseData.exceptions=[{typeName:"SDKLoadFailed",message:n.replace(/\./g,"-"),hasFullStack:!1,stack:n+"\nSnippet failed to load ["+a+"] -- Telemetry is disabled\nHelp Link: https://go.microsoft.com/fwlink/?linkid=2128109\nHost: "+(S&&S.pathname||"_unknown_")+"\nEndpoint: "+i,parsedStack:[]}],r)),l.push(function(e,t,n,a){var i=v(c,"Message"),r=i.data;r.baseType="MessageData";var o=r.baseData;return o.message='AI (Internal): 99 message:"'+("SDK LOAD Failure: Failed to load Application Insights SDK script (See stack for details) ("+n+")").replace(/\"/g,"")+'"',o.properties={endpoint:a},i}(0,0,t,p)),function(e,t){if(JSON){var n=T.fetch;if(n&&!y.useXhr)n(t,{method:N,body:JSON.stringify(e),mode:"cors"});else if(XMLHttpRequest){var a=new XMLHttpRequest;a.open(N,t),a.setRequestHeader("Content-type","application/json"),a.send(JSON.stringify(e))}}}(l,p))}function i(e,t){f||setTimeout(function(){!t&&m.core||a()},500)}var e=function(){var n=l.createElement(k);n.src=h;var e=y[w];return!e&&""!==e||"undefined"==n[w]||(n[w]=e),n.onload=i,n.onerror=a,n.onreadystatechange=function(e,t){"loaded"!==n.readyState&&"complete"!==n.readyState||i(0,t)},n}();y.ld<0?l.getElementsByTagName("head")[0].appendChild(e):setTimeout(function(){l.getElementsByTagName(k)[0].parentNode.appendChild(e)},y.ld||0)}try{m.cookie=l.cookie}catch(p){}function t(e){for(;e.length;)!function(t){m[t]=function(){var e=arguments;g||m.queue.push(function(){m[t].apply(m,e)})}}(e.pop())}var n="track",r="TrackPage",o="TrackEvent";t([n+"Event",n+"PageView",n+"Exception",n+"Trace",n+"DependencyData",n+"Metric",n+"PageViewPerformance","start"+r,"stop"+r,"start"+o,"stop"+o,"addTelemetryInitializer","setAuthenticatedUserContext","clearAuthenticatedUserContext","flush"]),m.SeverityLevel={Verbose:0,Information:1,Warning:2,Error:3,Critical:4};var s=(d.extensionConfig||{}).ApplicationInsightsAnalytics||{};if(!0!==d[I]&&!0!==s[I]){var c="onerror";t(["_"+c]);var u=T[c];T[c]=function(e,t,n,a,i){var r=u&&u(e,t,n,a,i);return!0!==r&&m["_"+c]({message:e,url:t,lineNumber:n,columnNumber:a,error:i}),r},d.autoExceptionInstrumented=!0}return m}(y.cfg);function a(){y.onInit&&y.onInit(n)}(T[t]=n).queue&&0===n.queue.length?(n.queue.push(a),n.trackPageView({})):a()}(window,document,{src: "https://js.monitor.azure.com/scripts/b/ai.2.min.js", // The SDK URL Source// name: "appInsights", // Global SDK Instance name defaults to "appInsights" when not supplied// ld: 0, // Defines the load delay (in ms) before attempting to load the sdk. -1 = block page load and add to head. (default) = 0ms load after timeout,// useXhr: 1, // Use XHR instead of fetch to report failures (if available),crossOrigin: "anonymous", // When supplied this will add the provided value as the cross origin attribute on the script tag// onInit: null, // Once the application insights instance has loaded and initialized this callback function will be called with 1 argument -- the sdk instance (DO NOT ADD anything to the sdk.queue -- As they won't get called)cfg: { // Application Insights ConfigurationconnectionString: "InstrumentationKey=42715ff2-9038-41d1-98bd-533357349ade;IngestionEndpoint=https://eastasia-0.in.applicationinsights.azure.com/;LiveEndpoint=https://eastasia.livediagnostics.monitor.azure.com/"/* ...Other Configuration Options... */}});</script>
</head>
<body>this is test !!!!!
</body>
</html>

4.Application Insights JS SDK 代码复制到我们应用页面中的代码前,最终如下图所示:
在这里插入图片描述

5.配置完毕以后,我们按F12进入浏览器工具里,找到Network—Track——Headers 当Status Code为200时 证明我们的配置已经配置成功了

在这里插入图片描述

三.查看Application Insights指标数据

1.我们返回到我们创建的Application Insights中,找到“正在监视”——”指标“ 从指标中筛选相关的范围以及指标命名空间和度量值,如图所示为我们配置的有关关于Application Insights指标数据
在这里插入图片描述

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

这篇关于【Microsoft Azure 的1024种玩法】五十二.基于Azure Application Insight对Web应用进行实时链路跟踪的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/256012

相关文章

Python标准库之数据压缩和存档的应用详解

《Python标准库之数据压缩和存档的应用详解》在数据处理与存储领域,压缩和存档是提升效率的关键技术,Python标准库提供了一套完整的工具链,下面小编就来和大家简单介绍一下吧... 目录一、核心模块架构与设计哲学二、关键模块深度解析1.tarfile:专业级归档工具2.zipfile:跨平台归档首选3.

SQL Server跟踪自动统计信息更新实战指南

《SQLServer跟踪自动统计信息更新实战指南》本文详解SQLServer自动统计信息更新的跟踪方法,推荐使用扩展事件实时捕获更新操作及详细信息,同时结合系统视图快速检查统计信息状态,重点强调修... 目录SQL Server 如何跟踪自动统计信息更新:深入解析与实战指南 核心跟踪方法1️⃣ 利用系统目录

使用IDEA部署Docker应用指南分享

《使用IDEA部署Docker应用指南分享》本文介绍了使用IDEA部署Docker应用的四步流程:创建Dockerfile、配置IDEADocker连接、设置运行调试环境、构建运行镜像,并强调需准备本... 目录一、创建 dockerfile 配置文件二、配置 IDEA 的 Docker 连接三、配置 Do

Python进行JSON和Excel文件转换处理指南

《Python进行JSON和Excel文件转换处理指南》在数据交换与系统集成中,JSON与Excel是两种极为常见的数据格式,本文将介绍如何使用Python实现将JSON转换为格式化的Excel文件,... 目录将 jsON 导入为格式化 Excel将 Excel 导出为结构化 JSON处理嵌套 JSON:

深入浅出SpringBoot WebSocket构建实时应用全面指南

《深入浅出SpringBootWebSocket构建实时应用全面指南》WebSocket是一种在单个TCP连接上进行全双工通信的协议,这篇文章主要为大家详细介绍了SpringBoot如何集成WebS... 目录前言为什么需要 WebSocketWebSocket 是什么Spring Boot 如何简化 We

Java Stream流之GroupBy的用法及应用场景

《JavaStream流之GroupBy的用法及应用场景》本教程将详细介绍如何在Java中使用Stream流的groupby方法,包括基本用法和一些常见的实际应用场景,感兴趣的朋友一起看看吧... 目录Java Stream流之GroupBy的用法1. 前言2. 基础概念什么是 GroupBy?Stream

python中列表应用和扩展性实用详解

《python中列表应用和扩展性实用详解》文章介绍了Python列表的核心特性:有序数据集合,用[]定义,元素类型可不同,支持迭代、循环、切片,可执行增删改查、排序、推导式及嵌套操作,是常用的数据处理... 目录1、列表定义2、格式3、列表是可迭代对象4、列表的常见操作总结1、列表定义是处理一组有序项目的

C#中的Converter的具体应用

《C#中的Converter的具体应用》C#中的Converter提供了一种灵活的类型转换机制,本文详细介绍了Converter的基本概念、使用场景,具有一定的参考价值,感兴趣的可以了解一下... 目录Converter的基本概念1. Converter委托2. 使用场景布尔型转换示例示例1:简单的字符串到

Spring Boot Actuator应用监控与管理的详细步骤

《SpringBootActuator应用监控与管理的详细步骤》SpringBootActuator是SpringBoot的监控工具,提供健康检查、性能指标、日志管理等核心功能,支持自定义和扩展端... 目录一、 Spring Boot Actuator 概述二、 集成 Spring Boot Actuat

PyTorch中的词嵌入层(nn.Embedding)详解与实战应用示例

《PyTorch中的词嵌入层(nn.Embedding)详解与实战应用示例》词嵌入解决NLP维度灾难,捕捉语义关系,PyTorch的nn.Embedding模块提供灵活实现,支持参数配置、预训练及变长... 目录一、词嵌入(Word Embedding)简介为什么需要词嵌入?二、PyTorch中的nn.Em