Android12 WIFI 无法提供互联网连接

平台

RK3588 + Android 12

问题描述

ConnectivityService是Android系统中负责处理网络连接的服务之一。它负责管理设备的网络连接状态,包括Wi-Fi、移动数据、蓝牙等。
在Android系统中,ConnectivityService提供了一些关键功能,包括但不限于:

  1. 网络状态监测: 它监测设备的网络状态,包括连接到的网络类型(如Wi-Fi、移动数据)、网络是否可用等。
  2. 网络类型切换: 当设备从一个网络切换到另一个网络时,ConnectivityService负责协调这个过程,以确保应用程序可以继续正常工作。
  3. 网络连接管理: 它允许应用程序查询当前网络连接的状态,并可以请求建立或中断网络连接。
  4. 网络通知: 它可以向应用程序发送广播通知,以通知它们有关网络状态的变化。

本文主要记录两点:

  1. Android 12 的ConnectivityService源码路径和机构的一些变化
  2. Wifi连接中的"已连接到设备,但无法提供互联网连接"问题.
    在这里插入图片描述
    在这里插入图片描述
    在这里插入图片描述
    在连接到指定的WIFI热点后, 有时候会显示上面的提示信息, 大致的意思就是, 连上了但是上不了网

WIFI 设置

packages/apps/Settings/src/com/android/settings/network/NetworkProviderSettings.java

Can’t provide internet在哪里? 不在Settings 也不在 SettingsLib, 而是在WifiTrackerLib

frameworks/opt/net/wifi/libs/WifiTrackerLib/res/values/strings.xml

    <!-- Summary for connected wifi network without internet [CHAR LIMIT=NONE] --><string name="wifitrackerlib_wifi_connected_cannot_provide_internet">Connected to device. Can\'t provide internet.</string>

frameworks/opt/net/wifi/libs/WifiTrackerLib/src/com/android/wifitrackerlib/Utils.java
wifitrackerlib_wifi_connected_cannot_provide_internet

    static String getCurrentNetworkCapabilitiesInformation(Context context,NetworkCapabilities networkCapabilities) {if (context == null || networkCapabilities == null) {return "";}if (networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL)) {return context.getString(context.getResources().getIdentifier("network_available_sign_in", "string", "android"));}if (networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_PARTIAL_CONNECTIVITY)) {return context.getString(R.string.wifitrackerlib_wifi_limited_connection);}if (!networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED)) {if (networkCapabilities.isPrivateDnsBroken()) {return context.getString(R.string.wifitrackerlib_private_dns_broken);}return context.getString(R.string.wifitrackerlib_wifi_connected_cannot_provide_internet);}return "";}

ConnectivityManager.java 有几个, 需要注意不要改错

frameworks/layoutlib/bridge/src/android/net/ConnectivityManager.java
packages/modules/Connectivity/core/java/android/net/ConnectivityManager.java
packages/modules/Connectivity/framework/src/android/net/ConnectivityManager.java

ConnectivityService.java 同样有多个

packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java
packages/modules/Connectivity/services/core/java/com/android/server/ConnectivityService.java

如何单编译ConnectivityService 注意, 使用的是service.

mmm packages/modules/Connectivity/service/:service-connectivity
# 将会生成文件:
out/target/product/rk3588_s/system/apex/com.android.tethering/javalib/service-connectivity.jar

替换主板中的文件并重启即可

# 需注意,主板中有两个同名文件:
#	/apex/com.android.tethering/javalib/service-connectivity.jar
#	/system/apex/com.android.tethering.inprocess/javalib/service-connectivity.jar
# 不要搞错路径
## root 和 remount 之后
adb push service-connectivity.jar /system/apex/com.android.tethering.inprocess/javalib/

    在 Android 源代码中,com.android.tethering 通常用于处理网络共享(Tethering)的功能。网络共享允许设备通过不同的网络接口(如移动数据、Wi-Fi或蓝牙)与其他设备共享其网络连接。

具体来说,com.android.tethering 是 Android 框架的一部分,负责实现和管理网络共享的相关功能。这包括创建和管理 Wi-Fi 热点、USB 网络共享以及蓝牙网络共享等。

简单整理下Wifi列表中连接状态的数据传递:

NetworkProviderSettings WifiPickerTracker BaseWifiTracker ConnectivityManager CallbackHandler ConnectivityService NetworkStateTrackerHandler packages/apps/Settings getWifiEntries frameworks/opt/net/wifi/libs/WifiTrackerLib onStart packages/modules/Connectivity/service registerNetworkCallback sendRequestForNetwork trigger maybeHandleNetworkMonitorMessage handleNetworkTested updateCapabilities notifyNetworkCallbacks callCallbackForRequest handleMessage(CALLBACK_CAP_CHANGED) onCapabilitiesChanged handleNetworkCapabilitiesChanged NetworkProviderSettings WifiPickerTracker BaseWifiTracker ConnectivityManager CallbackHandler ConnectivityService NetworkStateTrackerHandler

修改

  1. 修改认证地址
    先看一段LOG:
PROBE_DNS www.google.cn 5055ms OK 220.181.174.226
PROBE_DNS www.google.cn 5059ms OK 220.181.174.226
PROBE_HTTP http://www.google.cn/generate_204 time=126ms ret=204 request={Connection=[close], User-Agent=[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36]} headers={null=[HTTP/1.1 204 No Content], Connection=[close], Content-Length=[0], Cross-Origin-Resource-Policy=[cross-origin], Date=[Tue, 05 Dec 2023 01:21:40 GMT], X-Android-Received-Millis=[1701739300483], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1701739300402]}
PROBE_HTTPS https://www.google.cn/generate_204 time=284ms ret=204 request={Connection=[close], User-Agent=[Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.32 Safari/537.36]} headers={null=[HTTP/1.1 204 No Content], Alt-Svc=[h3=":443"; ma=2592000,h3-29=":443"; ma=2592000], Connection=[close], Content-Length=[0], Cross-Origin-Resource-Policy=[cross-origin], Date=[Tue, 05 Dec 2023 01:21:40 GMT], X-Android-Received-Millis=[1701739300641], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1701739300521]}
PROBE_FALLBACK http://www.google.com/gen_204 Probe failed with exception java.net.ConnectException: Failed to connect to www.google.com/4.78.139.54:80
PROBE_FALLBACK http://www.google.com/gen_204 Probe failed with exception java.net.SocketTimeoutException: failed to connect to www.google.com/31.13.94.37 (port 80) from /192.168.1.86 (port 51118) after 10000ms

packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java

    @VisibleForTestingpublic NetworkMonitor(Context context, INetworkMonitorCallbacks cb, Network network,IpConnectivityLog logger, SharedLog validationLogs,@NonNull NetworkStackServiceManager serviceManager, Dependencies deps,@Nullable TcpSocketTracker tst) {// Add suffix indicating which NetworkMonitor we're talking about.super(TAG + "/" + network.toString());// ...mIsCaptivePortalCheckEnabled = getIsCaptivePortalCheckEnabled();mPrivateIpNoInternetEnabled = getIsPrivateIpNoInternetEnabled();mMetricsEnabled = deps.isFeatureEnabled(context, NAMESPACE_CONNECTIVITY,NetworkStackUtils.VALIDATION_METRICS_VERSION, true /* defaultEnabled */);mUseHttps = getUseHttpsValidation();mCaptivePortalUserAgent = getCaptivePortalUserAgent();mCaptivePortalHttpsUrls = makeCaptivePortalHttpsUrls();android.util.Log.d(TAG, "mCaptivePortalHttpsUrls[0]=" + mCaptivePortalHttpsUrls[0].toString());mCaptivePortalHttpUrls = makeCaptivePortalHttpUrls();mCaptivePortalFallbackUrls = makeCaptivePortalFallbackUrls();mCaptivePortalFallbackSpecs = makeCaptivePortalFallbackProbeSpecs();//....}private URL[] makeCaptivePortalHttpsUrls() {final URL testUrl = getTestUrl(TEST_CAPTIVE_PORTAL_HTTPS_URL);if (testUrl != null) return new URL[] { testUrl };final String firstUrl = getCaptivePortalServerHttpsUrl();try {final URL[] settingProviderUrls =combineCaptivePortalUrls(firstUrl, CAPTIVE_PORTAL_OTHER_HTTPS_URLS);// firstUrl will at least be default configuration, so default value in// getProbeUrlArrayConfig is actually never used.return getProbeUrlArrayConfig(settingProviderUrls,R.array.config_captive_portal_https_urls,DEFAULT_CAPTIVE_PORTAL_HTTPS_URLS, this::makeURL);} catch (Exception e) {// Don't let a misconfiguration bootloop the system.Log.e(TAG, "Error parsing configured https URLs", e);// Ensure URL aligned with legacy configuration.return new URL[]{makeURL(firstUrl)};}}private String getCaptivePortalServerHttpsUrl() {return getSettingFromResource(mCustomizedContext,R.string.config_captive_portal_https_url, CAPTIVE_PORTAL_HTTPS_URL,mCustomizedContext.getResources().getString(R.string.default_captive_portal_https_url));}

修改配置文件即可:

packages/modules/NetworkStack/res/values/config.xml

<!-- HTTP URL for network validation, to use for detecting captive portals. --><!-- default_captive_portal_http_url is not configured as overlayable soOEMs that wish to change captive_portal_http_url configuration mustdo so via configuring runtime resource overlay toconfig_captive_portal_http_url and *NOT* by changing or overlayingthis resource. It will break if the enforcement of overlayable starts.--><string name="default_captive_portal_http_url" translatable="false">http://connectivitycheck.gstatic.com/generate_204</string><!-- HTTPS URL for network validation, to use for confirming internet connectivity. --><!-- default_captive_portal_https_url is not configured as overlayable soOEMs that wish to change captive_portal_https_url configuration mustdo so via configuring runtime resource overlay toconfig_captive_portal_https_url and *NOT* by changing or overlayingthis resource. It will break if the enforcement of overlayable starts.--><string name="default_captive_portal_https_url" translatable="false">https://www.google.com/generate_204</string><!-- List of fallback URLs to use for detecting captive portals. --><!-- default_captive_portal_fallback_urls is not configured as overlayableso OEMs that wish to change captive_portal_fallback_urls configurationmust do so via configuring runtime resource overlay toconfig_captive_portal_fallback_urls and *NOT* by changing or overlayingthis resource. It will break if the enforcement of overlayable starts.--><string-array name="default_captive_portal_fallback_urls" translatable="false"><item>http://www.google.com/gen_204</item><item>http://play.googleapis.com/generate_204</item></string-array><!-- Configuration hooks for the above settings.Empty by default but may be overridden by RROs. --><integer name="config_captive_portal_dns_probe_timeout"></integer><!--suppress CheckTagEmptyBody: overlayable resource to use as configuration hook --><string name="config_captive_portal_http_url" translatable="false"></string><!--suppress CheckTagEmptyBody: overlayable resource to use as configuration hook --><string name="config_captive_portal_https_url" translatable="false"></string>

前面改了不生效, 注意:OVERLAY

device/rockchip/common/overlay/packages/modules/NetworkStack/res/values/config.xml

<string name="config_captive_portal_http_url" translatable="false">http://www.google.cn/generate_204</string>

编译:mmm packages/modules/NetworkStack/:InProcessNetworkStack

还可以尝试使用RRO的方式

vendor/rockchip/common/gms/RockchipNetworkStackConfigOverlay/res/values/config.xml

<string name="config_captive_portal_https_url" translatable="false">https://www.google.cn/generate_204</string>
  1. 自动确认保持连接
    通知的发出:
showNotification tag=ConnectivityNotification:100 event=NO_INTERNET transport=WLAN name=XXXX highPriority=true
 private void showNetworkNotification(NetworkAgentInfo nai, NotificationType type) {final String action;final boolean highPriority;switch (type) {case NO_INTERNET:action = ConnectivityManager.ACTION_PROMPT_UNVALIDATED;// High priority because it is only displayed for explicitly selected networks.highPriority = true;break;case PRIVATE_DNS_BROKEN:action = Settings.ACTION_WIRELESS_SETTINGS;// High priority because we should let user know why there is no internet.highPriority = true;break;case LOST_INTERNET:action = ConnectivityManager.ACTION_PROMPT_LOST_VALIDATION;// High priority because it could help the user avoid unexpected data usage.highPriority = true;break;case PARTIAL_CONNECTIVITY:action = ConnectivityManager.ACTION_PROMPT_PARTIAL_CONNECTIVITY;// Don't bother the user with a high-priority notification if the network was not// explicitly selected by the user.highPriority = nai.networkAgentConfig.explicitlySelected;break;default:Log.wtf(TAG, "Unknown notification type " + type);return;}Intent intent = new Intent(action);if (type != NotificationType.PRIVATE_DNS_BROKEN) {intent.putExtra(ConnectivityManager.EXTRA_NETWORK, nai.network);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);// Some OEMs have their own Settings package. Thus, need to get the current using// Settings package name instead of just use default name "com.android.settings".final String settingsPkgName = getSettingsPackageName(mContext.getPackageManager());intent.setClassName(settingsPkgName,settingsPkgName + ".wifi.WifiNoInternetDialog");}PendingIntent pendingIntent = PendingIntent.getActivity(mContext.createContextAsUser(UserHandle.CURRENT, 0 /* flags */),0 /* requestCode */,intent,PendingIntent.FLAG_CANCEL_CURRENT | PendingIntent.FLAG_IMMUTABLE);mNotifier.showNotification(nai.network.getNetId(), type, nai, null, pendingIntent, highPriority);}

点击通知后:

START u0 {act=android.net.action.PROMPT_UNVALIDATED flg=0x10000000 cmp=com.android.settings/.wifi.WifiNoInternetDialog (has extras)} from uid 1000

看Settings的清单:

packages/apps/Settings/AndroidManifest.xml

        <activity android:name=".wifi.WifiNoInternetDialog"android:clearTaskOnLaunch="true"android:excludeFromRecents="true"android:exported="true"android:permission="android.permission.NETWORK_STACK"android:theme="@*android:style/Theme.DeviceDefault.Dialog.Alert.DayNight"><!-- TODO: Consider removing below two intent filters.It seems like below two intent filters can be removed because when the notificationis clicked, this activity will be launched anyway. --><intent-filter><action android:name="android.net.action.PROMPT_UNVALIDATED" /><category android:name="android.intent.category.DEFAULT" /></intent-filter><intent-filter><action android:name="android.net.action.PROMPT_LOST_VALIDATION" /><category android:name="android.intent.category.DEFAULT" /></intent-filter><meta-data android:name="com.android.settings.PRIMARY_PROFILE_CONTROLLED"android:value="true" /></activity>

packages/apps/Settings/src/com/android/settings/wifi/WifiNoInternetDialog.java

    @Overridepublic void onClick(DialogInterface dialog, int which) {if (which != BUTTON_NEGATIVE && which != BUTTON_POSITIVE) return;final boolean always = mAlwaysAllow.isChecked();final String what, action;mButtonClicked = true;if (ACTION_PROMPT_UNVALIDATED.equals(mAction)) {what = "NO_INTERNET";final boolean accept = (which == BUTTON_POSITIVE);action = (accept ? "Connect" : "Ignore");mCM.setAcceptUnvalidated(mNetwork, accept, always);} else if (ACTION_PROMPT_PARTIAL_CONNECTIVITY.equals(mAction)) {what = "PARTIAL_CONNECTIVITY";final boolean accept = (which == BUTTON_POSITIVE);action = (accept ? "Connect" : "Ignore");mCM.setAcceptPartialConnectivity(mNetwork, accept, always);} else {what = "LOST_INTERNET";final boolean avoid = (which == BUTTON_POSITIVE);action = (avoid ? "Switch away" : "Get stuck");if (always) {Settings.Global.putString(mAlertParams.mContext.getContentResolver(),Settings.Global.NETWORK_AVOID_BAD_WIFI, avoid ? "1" : "0");} else if (avoid) {mCM.setAvoidUnvalidated(mNetwork);}}Log.d(TAG, what + ": " + action +  " network=" + mNetwork +(always ? " and remember" : ""));}

packages/modules/Connectivity/service/src/com/android/server/ConnectivityService.java

    @Overridepublic void setAcceptUnvalidated(Network network, boolean accept, boolean always) {enforceNetworkStackSettingsOrSetup();mHandler.sendMessage(mHandler.obtainMessage(EVENT_SET_ACCEPT_UNVALIDATED,encodeBool(accept), encodeBool(always), network));}private void handleSetAcceptUnvalidated(Network network, boolean accept, boolean always) {if (DBG) log("handleSetAcceptUnvalidated network=" + network +" accept=" + accept + " always=" + always);NetworkAgentInfo nai = getNetworkAgentInfoForNetwork(network);if (nai == null) {// Nothing to do.return;}if (nai.everValidated) {// The network validated while the dialog box was up. Take no action.return;}if (!nai.networkAgentConfig.explicitlySelected) {Log.wtf(TAG, "BUG: setAcceptUnvalidated non non-explicitly selected network");}if (accept != nai.networkAgentConfig.acceptUnvalidated) {nai.networkAgentConfig.acceptUnvalidated = accept;// If network becomes partial connectivity and user already accepted to use this// network, we should respect the user's option and don't need to popup the// PARTIAL_CONNECTIVITY notification to user again.nai.networkAgentConfig.acceptPartialConnectivity = accept;nai.updateScoreForNetworkAgentUpdate();rematchAllNetworksAndRequests();}if (always) {nai.onSaveAcceptUnvalidated(accept);}if (!accept) {// Tell the NetworkAgent to not automatically reconnect to the network.nai.onPreventAutomaticReconnect();// Teardown the network.teardownUnneededNetwork(nai);}}

增加属性控制, 不发送通知, 并执行保持连接:

    private void handlePromptUnvalidated(Network network) {//Force keep-connect for networkif("1".equals(android.os.SystemProperties.get("persist.sys.keepNetworkConnect"))){handleSetAcceptUnvalidated(network, true, true);return;}}
  1. 关闭网络测试

packages/modules/NetworkStack/src/com/android/server/connectivity/NetworkMonitor.java

//    public static final String CAPTIVE_PORTAL_MODE = "captive_portal_mode";
//    public static final int CAPTIVE_PORTAL_MODE_IGNORE = 0;
//    public static final int CAPTIVE_PORTAL_MODE_PROMPT = 1;private boolean getIsCaptivePortalCheckEnabled() {String symbol = CAPTIVE_PORTAL_MODE;int defaultValue = CAPTIVE_PORTAL_MODE_PROMPT;int mode = mDependencies.getSetting(mContext, symbol, defaultValue);return mode != CAPTIVE_PORTAL_MODE_IGNORE;}public static class Dependencies {//..../*** Get the value of a global integer setting.* @param symbol Name of the setting* @param defaultValue Value to return if the setting is not defined.*/public int getSetting(Context context, String symbol, int defaultValue) {return Settings.Global.getInt(context.getContentResolver(), symbol, defaultValue);}
adb shell settings put global captive_portal_mode 0

参考

ConnectivityService处理wifi连接
android 网络连接受限解决
android 网络重新连接时BaseActivity处理 android网络连接受限
android wif 去掉 双引号 原生安卓去掉wifi叉号
AndroidQ RRO(Runtime Resource Overlay)机制(1)

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

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

相关文章

Spring Boot Async:从入门到精通,原理详解与最佳实践

Spring Boot 的异步功能&#xff08;Async&#xff09;允许我们将某些任务异步执行&#xff0c;而不会阻塞主线程。这对于处理耗时的操作非常有用&#xff0c;如发送电子邮件、生成报表、调用外部 API 等。通过异步处理&#xff0c;我们可以释放主线程&#xff0c;让它继续处理…

低多边形游戏风格3D模型纹理贴图

在线工具推荐&#xff1a; 3D数字孪生场景编辑器 - GLTF/GLB材质纹理编辑器 - 3D模型在线转换 - Three.js AI自动纹理开发包 - YOLO 虚幻合成数据生成器 - 三维模型预览图生成器 - 3D模型语义搜索引擎 当谈到游戏角色的3D模型风格时&#xff0c;有几种不同的风格&#xf…

区块链实验室(29) - 关闭或删除FISCO日志

1. FISCO日志 缺省情况下&#xff0c;FISCO启动日志模块&#xff0c;日志记录的位置在节点目录中。以FISCO自带案例为例&#xff0c;4节点的FISCO网络&#xff0c;24个区块产生的日志大小&#xff0c;见下图所示。 2.关闭日志模块 当节点数量增大&#xff0c;区块高度增大时&…

【EI会议征稿中】第三届信号处理与通信安全国际学术会议(ICSPCS 2024)

第三届信号处理与通信安全国际学术会议&#xff08;ICSPCS 2024&#xff09; 2024 3rd International Conference on Signal Processing and Communication Security 信号处理和通信安全是现代信息技术应用的重要领域&#xff0c;近年来这两个领域的研究相互交叉促进&#xf…

InsCode:CSDN的创新代码分享平台,融合AI技术提升编程体验

InsCode AI Chat 能够让你通过聊天的方式帮你优化代码。 一&#xff1a;前言 InsCode 是csdn推出的一个代码分享网站 二、使用 AI 辅助完成代码 下面我们就从实践出发&#xff0c;基于 InsCode 的 AI辅助编程&#xff0c;写Python实现的计算器。 1.基于模板创建项目 这里我…

行业地位失守,业绩持续失速,科沃斯的故事不好讲

特劳特曾在《定位》一书中提到&#xff0c;为了在容量有限的消费者心智中占据品类&#xff0c;品牌最好的差异化就是成为第一&#xff0c;做品类领导者或开创者&#xff0c;销量遥遥领先&#xff1b;其次分化品类&#xff0c;做到细分品类的唯一&#xff0c;即细分品类的第一。…

Elon Musk艾隆・马斯克的聊天机器人Grok上线可以使用啦,为X Premium Plus订阅者推出

艾隆・马斯克旗下的 AI 初创公司X&#xff08;前身“推特”&#xff09;开发的 ChatGPT 竞争对手 Grok 已经在 X 平台上正式推出。Grok 是一个基于生成模型 Grok-1的聊天机器人&#xff0c;它能够回答问题并提供最新的信息。与其他聊天机器人不同&#xff0c;Grok 可以实时获取…

Java基础-IDEA下载、卸载、安装、使用

目录 1. IDEA下载2. IDEA卸载3. IDEA安装4. 基本使用 1. IDEA下载 IDEA下载网址 2. IDEA卸载 3. IDEA安装 更改IDEA安装目录 是否创建桌面图标 下一步 success&#xff01; 4. 基本使用 新建项目 新建模块 新建包 新建Java文件 编写代码 运行测试

【C语言】网络字节序和主机字节序

网络字节序和主机字节序是计算机中字节的两种排序方式&#xff0c;它们主要用于解决不同计算机之间数据通信的问题。 一、网络字节序 也被称为大端字节序&#xff0c;是一种标准的字节序。在网络通信中&#xff0c;如果两台主机的字节序不同&#xff0c;可能会导致数据解释的二…

shell条件测试

1.1.用途 为了能够正确处理Shell程序运行过程中遇到的各种情况&#xff0c;Linux Shell提供了一组测试运算符. 通过这些运算符&#xff0c;shell程序能够判断某种或者几个条件是否成立。 条件测试在各种流程控制语句&#xff0c;例如判断语句和循环语句中发挥了…

数据分析实例:基于电力大数据的中小型企业运营发展分析

前不久&#xff0c;帆软发起了【2023BI数据分析大赛】的活动&#xff0c;老李我也是这个大赛的评委。   今天跟大家分享的是基于电力大数据的中小型企业运营发展分析。 当我们去解读一份数据分析报告时&#xff0c;首先要了解这份报告的主要目的是什么&#xff0c;作者通过分…

class061 最小生成树【算法】

class061 最小生成树【算法】 2023-12-8 11:48:12 算法讲解061【必备】最小生成树 code1 P3366 【模板】最小生成树 // Kruskal算法模版&#xff08;洛谷&#xff09; // 静态空间实现 // 测试链接 : https://www.luogu.com.cn/problem/P3366 // 请同学们务必参考如下代码中…

【Linux】:线程(二)互斥

互斥与同步 一.线程的局部存储二.线程的分离三.互斥1.一些概念2.上锁3.锁的原理4.死锁 一.线程的局部存储 例子 可以看到全局变量是所有线程共享的&#xff0c;如果我们想要每个线程都单独访问g_val怎么办呢&#xff1f;其实我们可以在它前面加上__thread修饰。 这就相当于把g…

网络入门---网络编程初步认识和实践(使用udp协议)

目录标题 前言准备工作udpserver.hpp成员变量构造函数初始化函数(socket,bind)start函数(recvfrom) udpServer.ccudpClient.hpp构造函数初始化函数run函数(sendto) udpClient.cc测试 前言 在上一篇文章中我们初步的认识了端口号的作用&#xff0c;ip地址和MAC地址在网络通信时…

Python实现GUI图片浏览程序

Python实现GUI图片浏览程序 下面程序需要pillow库。pillow是 Python 的第三方图像处理库&#xff0c;需要安装才能实用。pillow是PIL&#xff08; Python Imaging Library&#xff09;基础上发展起来的&#xff0c;需要注意的是pillow库安装用pip install pillow&#xff0c;导…

【改进YOLOv8】融合可扩张残差(DWR)注意力模块的小麦病害检测系统

1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 研究背景与意义&#xff1a; 随着计算机视觉技术的快速发展&#xff0c;深度学习在图像识别和目标检测领域取得了巨大的突破。其中&#xff0c;YOLO&#xff08;You Only Look O…

TruLens RAG Triad 学习

TruLens RAG Triad 学习 0. 背景1. RAG 三元组2. TruLens 快速入门2-1. 安装依赖2-2. 初始化 OpenAI 认证信息2-3. 获取数据2-4. 创建向量存储2-5. 从头构建自定义 RAG2-6. 设置反馈函数2-7. 构建应用程序2-8. 运行应用程序0. 背景 近年来,RAG 架构已成为为大型语言模型 (LLM…

Nexus搭建npm私库(角色管理、上传脚本)

安装Nexus 官网下载 https://www.sonatype.com/products/sonatype-nexus-oss-download 进入官网下载&#xff0c;最新下载方式需要输入个人信息才能下载了 选择对应的系统进行下载 Windows 推荐也下载 UNIX 版本&#xff08;Windows 版本配置比较难改&#xff09; 如果没有下…

Qt 中的窗口类

目录 QWidget 设置父对象 窗口位置 测试代码 窗口尺寸 窗口标题和图标 信号 槽函数 QDialog 常用API QDialog的子类 QMessageBox QFileDialog QFontDialog QFontDialog类的静态API QColorDialog 颜色类 QColor 静态API函数 测试代码 QInputDialog 静态函数…

GPT4停止订阅付费了怎么办? 怎么升级ChatGPT plus?提供解决方案

11月中旬日OpenAI 暂时关闭所有的升级入口之后&#xff0c;很多小伙伴就真的在排队等待哦。其实有方法可以绕开排队&#xff0c;直接付费订阅升级GPT的。赶紧用起来立马“插队”成功&#xff01;亲测~~~ 一、登录ChatGPT账号 1、没有账号可以直接注册一个&#xff0c;流程超级…