Android Camera调用流程

一个流程图画的非常好的文章

http://blog.csdn.net/lushengchu_luis/article/details/11033095

1、Packages/apps/到framework 打开Camera

  1. ./packages/apps/Camera/src/com/android/camera/Camera.java

进来第一个肯定是onCreate(Bundle icicle) {

这里是开始了一个Camera的线程

//start camera opening process
mCameraStartUpThread = new CameraStartUpThread();
CameraStarUpThread是一个类
/// M: open camera process functions @{private class CameraStartUpThread extends Thread {//上面的注释就写着open camera process functions 打开相机进程的函数Util.openCamera(Camera.this, isPIPMode(getCurrentMode()));//这一句就是用Util这个类来打开相机进程了
./packages/apps/Camera/src/com/android/camera/Util.java
//这里面还有打开摄像头的函数openCamera
public static void openCamera(Activity activity, boolean isPIP)throws CameraHardwareException, CameraDisabledException {Log.i(TAG,"openCamera begin isPIP = " + isPIP);// Check if device policy has disabled the camera.DevicePolicyManager dpm = (DevicePolicyManager) activity.getSystemService(Context.DEVICE_POLICY_SERVICE);if (dpm.getCameraDisabled(null)) {throw new CameraDisabledException();}if (isPIP) {retryOpen(activity, OPEN_RETRY_COUNT, CameraHolder.instance().getBackCameraId());retryOpen(activity, OPEN_RETRY_COUNT, CameraHolder.instance().getFrontCameraId());} else {int currentCameraId = ((com.android.camera.Camera)activity).getCameraId();retryOpen(activity, OPEN_RETRY_COUNT, currentCameraId);}Log.i(TAG,"openCamera end");}//这里面又会调用一个retryOpen函数private static CameraManager.CameraProxy retryOpen(Activity activity, int count, int cameraId) //这个函数最终会调用open函数来打开摄像头try {if (activity instanceof ActivityBase) {CameraProxy cameraProxy = CameraHolder.instance().open(cameraId);return cameraProxy;} else {return CameraHolder.instance().open(cameraId);}........}

2. 这里面的CameraHolder.instance().open调用了下面的open函数

./packages/apps/Camera/src/com/android/camera/CameraHolder.java

public CameraProxy open(int cameraId)throws CameraHardwareException {Log.i(TAG, "CameraHolder open cameraId = " + cameraId);assertError(cameraId != UNKONW_ID);if (mMockCameraInfo == null) {//这里又有一个open函数return getCameraProxyWrapper(cameraId).open();} else {if (mMockCamera == null) {throw new RuntimeException();}getCameraProxyWrapper(cameraId).insertMockCameraProxy(mMockCamera[cameraId]);return mMockCamera[cameraId];}}public synchronized CameraProxy open()throws CameraHardwareException {Log.i(TAG, "CameraProxyWrapper open mCameraOpened = " + mCameraOpened + " mCameraId = " + mCameraId);assertError(!mCameraOpened);if (mCameraProxy == null) {try {Log.i(TAG, "open camera " + mCameraId);mCameraProxy = mCameraManager.cameraOpen(mCameraId);//现在又跑到一个mCameraManager.cameraOpen里面来了//看一下下面这个函数,这个函数就是app里面最终调用到framework里面的接口
// Open camera synchronously. This method is invoked in the context of a// background thread.CameraProxy cameraOpen(int cameraId) {// Cannot open camera in mCameraHandler, otherwise all camera events// will be routed to mCameraHandler looper, which in turn will call// event handler like Camera.onFaceDetection, which in turn will modify// UI and cause exception like this:// CalledFromWrongThreadException: Only the original thread that created// a view hierarchy can touch its views.MMProfileManager.startProfileCameraOpen();mCamera = FrameworksClassFactory.openCamera(cameraId);MMProfileManager.stopProfileCameraOpen();if (mCamera != null) {mParametersIsDirty = true;if (mParamsToSet == null) {mParamsToSet = mCamera.getParameters();}mCameraProxy = new CameraProxy();return mCameraProxy;} else {return null;}//./packages/apps/Camera/src/com/mediatek/camera/FrameworksClassFactory.java//代码的路径 camera.open这里就是跑到framework里面去了public static ICamera openCamera(int cameraId) {if (MOCK_CAMERA) {return MockCamera.open(cameraId);} else {Camera camera = Camera.open(cameraId);if (null == camera) {Log.e(TAG, "openCamera:got null hardware camera!");return null;}// wrap it with ICamerareturn new AndroidCamera(camera);}}

2、Framework open到jni调用流程

  1. 还是open这个接口

代码路径:./frameworks/base/core/java/android/hardware/Camera.java

    public static Camera open(int cameraId) {if (!isPermissionGranted()) {return null;}return new Camera(cameraId);}
//这里的return new Camera就是在下面进行了初始化
//填充一些参数Camera(int cameraId) {mShutterCallback = null;mRawImageCallback = null;mJpegCallback = null;mPreviewCallback = null;mPreviewRawDumpCallback = null;mPostviewCallback = null;mUsingPreviewAllocation = false;mZoomListener = null;Looper looper;if ((looper = Looper.myLooper()) != null) {mEventHandler = new EventHandler(this, looper);} else if ((looper = Looper.getMainLooper()) != null) {mEventHandler = new EventHandler(this, looper);} else {mEventHandler = null;}String packageName = ActivityThread.currentPackageName();native_setup(new WeakReference<Camera>(this), cameraId, packageName);}//这个native_setup就是打开摄像头的关键了
  1. jni的调用接口
    看到这个native 函数说明这个函数是在jni接口,用的是c++代码实现的,so,我们继续找
    private native final void native_setup(Object camera_this, int cameraId,
    终于我们在./frameworks/base/core/jni/android_hardware_Camera.cpp
    这里面找到了这个函数,然后我们看一下这个函数
static JNINativeMethod camMethods[] = {{ "getNumberOfCameras","()I",(void *)android_hardware_Camera_getNumberOfCameras },{ "_getCameraInfo","(ILandroid/hardware/Camera$CameraInfo;)V",(void*)android_hardware_Camera_getCameraInfo },{ "native_setup","(Ljava/lang/Object;ILjava/lang/String;)V",(void*)android_hardware_Camera_native_setup },//从这里可以看出来,实现这个函数的真正函数是android_hardware_Camera_native_setup//所以我们继续找一下这个函数在哪里{ "native_release","()V",

3. 下面就是打开摄像头的jni代码,app调用open的时候就会调用到这个位置

// connect to camera service
static void android_hardware_Camera_native_setup(JNIEnv *env, jobject thiz,jobject weak_this, jint cameraId, jstring clientPackageName)
{// Convert jstring to String16const char16_t *rawClientName = env->GetStringChars(clientPackageName, NULL);jsize rawClientNameLen = env->GetStringLength(clientPackageName);String16 clientName(rawClientName, rawClientNameLen);env->ReleaseStringChars(clientPackageName, rawClientName);sp<Camera> camera = Camera::connect(cameraId, clientName,Camera::USE_CALLING_UID);
//不相关的代码就不加进来了
//sp<Camera> camera = Camera::connect(cameraId, clientName,
//这句代码应该是从camera jni连接到camera client的关键   上面有个clientName也说明了这点         
.......
}

3、Android camera Client和camera service调用流程

我只知道spCamera>是一个强指针引用,具体是多厉害百度一下更好
从client的代码里面 
frameworks/av/camera/Camera.cpp

sp<Camera> Camera::connect(int cameraId, const String16& clientPackageName,int clientUid)
{return CameraBaseT::connect(cameraId, clientPackageName, clientUid);//CameraBaseT::connect这个又是从哪里来的,而且都是c++这可是难倒了我//不太好办
}
//在./frameworks/av/include/camera/CameraBase.h:113:    
//typedef CameraBase<TCam>         CameraBaseT;
//里面有一个typedef 好了,那我们下一句就应该去找CameraBase<TCam>这个东西
//找到在这个位置
//./frameworks/av/camera/CameraBase.cpp:94:sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId,
sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId,const String16& clientPackageName,int clientUid)
{ALOGV("%s: connect", __FUNCTION__);sp<TCam> c = new TCam(cameraId);sp<TCamCallbacks> cl = c;status_t status = NO_ERROR;//下一步就应该到getCameraService这里来了//这时候我们就要到cameraservice.java里面去看代码了const sp<ICameraService>& cs = getCameraService();if (cs != 0) {TCamConnectService fnConnectService = TCamTraits::fnConnectService;status = (cs.get()->*fnConnectService)(cl, cameraId, clientPackageName, clientUid,/*out*/ c->mCamera);}if (status == OK && c->mCamera != 0) {c->mCamera->asBinder()->linkToDeath(c);c->mStatus = NO_ERROR;} else {ALOGW("An error occurred while connecting to camera: %d", cameraId);c.clear();}return c;
}

为了查看它的调用流程,我加了一点日志在connect函数里面,加的日志代码如下

template <typename TCam, typename TCamTraits>
sp<TCam> CameraBase<TCam, TCamTraits>::connect(int cameraId,const String16& clientPackageName,int clientUid)
{ALOGD("%s: weiqifa connect 23", __FUNCTION__);sp<TCam> c = new TCam(cameraId);sp<TCamCallbacks> cl = c;status_t status = NO_ERROR;const sp<ICameraService>& cs = getCameraService();if (cs != 0) {TCamConnectService fnConnectService = TCamTraits::fnConnectService;status = (cs.get()->*fnConnectService)(cl, cameraId, clientPackageName, clientUid,/*out*/ c->mCamera);ALOGD("%s: weiqifa connect 234", __FUNCTION__);//ALOGD("cs.get()->*fnConnectService %s: weiqifawe", *(cs.get()->*fnConnectService));}if (status == OK && c->mCamera != 0) {c->mCamera->asBinder()->linkToDeath(c);c->mStatus = NO_ERROR;} else {ALOGW("An error occurred while connecting to camera: %d", cameraId);c.clear();}return c;
}

这里写图片描述
我们可以看到CameraBase: connect: weiqifa connect 234这句话已经打印出来了
然后我们也可以看到CameraService::connect X 打印出来了
然后我们也可以看到CameraClient: CameraClient::initialize X这个也打印出来了
上面的三个日志还是非常重要的

看一下cameraservice.cpp的connect函数,service是服务端,client是客户端,那么客户端的实现在服务端应该有一个对应的函数

status_t CameraService::connect(const sp<ICameraClient>& cameraClient,int cameraId,const String16& clientPackageName,int clientUid,.....switch(deviceVersion) {case CAMERA_DEVICE_API_VERSION_1_0:client = new CameraClient(this, cameraClient,//new CameraClient 这个new了一个这个东西,那么CameraClient里面的东西就会被调用了clientPackageName, cameraId,facing, callingPid, clientUid, getpid());
./frameworks/av/services/camera/libcameraservice/api1/CameraClient.cpp:73:
status_t CameraClient::initialize(camera_module_t *module) {int callingPid = getCallingPid();status_t res;////看到这里的时候我突然看到了open的函数//但是有个问题很奇怪这个函数是谁调用了呢?谁让他运行的??????LOG1("CameraClient::initialize E (pid %d, id %d)", callingPid, mCameraId);res = mHardware->initialize(&module->common);//这句还是比较关键的mHardware->initialize就是要获取硬件设备的一些东东啊//......LOG1("CameraClient::initialize X (pid %d, id %d)", callingPid, mCameraId);return OK;

./frameworks/av/services/camera/libcameraservice/device1/CameraHardwareInterface.h

status_t initialize(hw_module_t *module){ALOGI("Opening camera %s", mName.string());//通过这几句话去打开设备int rc = module->methods->open(module, mName.string(),(hw_device_t **)&mDevice);if (rc != OK) {ALOGE("Could not open camera %s: %d", mName.string(), rc);return rc;}initHalPreviewWindow();return rc;}//日志里面也有这样的打印01-01 22:23:00.999868   191   748 I CameraClient: Opening camera 0     

我们下一步就是要去找到hw_module_t这个结构体,找到了这个结构体就可以往下走

libcameraservice.so里面调用

void CameraService::onFirstRef()
{LOG1("CameraService::onFirstRef weiqifa");BnCameraService::onFirstRef();if (hw_get_module(CAMERA_HARDWARE_MODULE_ID,(const hw_module_t **)&mModule) < 0) {ALOGE("Could not load camera HAL module");mNumberOfCameras = 0;}else {ALOGI("Loaded \"%s\" camera module", mModule->common.name);mNumberOfCameras = mModule->get_number_of_cameras();if (mNumberOfCameras > MAX_CAMERAS) {ALOGE("Number of cameras(%d) > MAX_CAMERAS(%d).",mNumberOfCameras, MAX_CAMERAS);mNumberOfCameras = MAX_CAMERAS;}//for (int i = 0; i < mNumberOfCameras; i++) {for (int i = 0; i < MAX_CAMERAS; i++) { // workaround for MATVLOG1("setCameraFree(%d)", i);setCameraFree(i);}if (mModule->common.module_api_version >=CAMERA_MODULE_API_VERSION_2_1) {mModule->set_callbacks(this);}CameraDeviceFactory::registerService(this);}
}

hw_get_module(CAMERA_HARDWARE_MODULE_ID这个是加载硬件hardware层对应的东东,具体可以查看链接hw_get_module获取硬件模块

看一下CAMERA_HARDWARE_MODULE_ID

hardware/libhardware/include/hardware/camera_common.h:35:#define CAMERA_HARDWARE_MODULE_ID "camera"

看一下我们打印出来的日志

weiqifa@weiqifa-Inspiron-3847:~/weiqifa/log$ grep -wrn "CameraService::onFirstRef" ./
./mobilelog/APLog_2010_0105_214945/main_log.boot:922:01-05 22:49:08.208839   194   194 D CameraService: CameraService::onFirstRef weiqifa
weiqifa@weiqifa-Inspiron-3847:~/weiqifa/log$ 

4、Android camera Hardware调用

hardware肯定是属于平台的特性,所以我们这里就要找到平台特性的东西了。
从libcameraservice下来

if (hw_get_module(CAMERA_HARDWARE_MODULE_ID,(const hw_module_t **)&mModule) < 0) {ALOGE("Could not load camera HAL module");mNumberOfCameras = 0;}

hw_get_module这个东西就是获取hardware下面的内容的东西。具体的可以看一下链接
hw_get_module
然后我们就找到了这个地方
./mediatek/hardware/mtkcam/module/module.h

static
camera_module
get_camera_module()
{camera_module module = {
        common: {
             tag:                   HARDWARE_MODULE_TAG, 
             module_api_version:    CAMERA_MODULE_API_VERSION_2_1, 
             hal_api_version:       HARDWARE_HAL_API_VERSION, 
             id:                    CAMERA_HARDWARE_MODULE_ID, 
             name:                  "MediaTek Camera Module", 
             author:                "MediaTek", 
             methods:               get_module_methods(), 
             dso:                   NULL, 
             reserved:              {0}, }, 
        get_number_of_cameras:      get_number_of_cameras, 
        get_camera_info:            get_camera_info, 
        set_callbacks:              set_callbacks, };return  module;
}

里面的methods: get_module_methods()这个就是我们hardware的open函数

open_device(hw_module_t const* module, const char* name, hw_device_t** device)
{return  NSCam::getCamDeviceManager()->open(module, name, device);
}static
hw_module_methods_t*
get_module_methods()
{statichw_module_methods_t_methods ={open: open_device};return  &_methods;
}

open_device就会找到NScam::getCamDeviceManager()->open
NSCam这个是一个命名空间,我看了网上的解释,更像是类引用,后面我再跟进去找到open的地方

./mediatek/hardware/mtkcam/devicemgr/CamDeviceManagerBase.cpp

status_t
CamDeviceManagerBase::
open(hw_module_t const* module, char const* name, hw_device_t** device
)
{RWLock::AutoWLock _l(mRWLock);//return  openDeviceLocked(module, name, device);
}

这里调用到了openDeviceLocked 我们找到这个地方
./mediatek/hardware/mtkcam/devicemgr/CamDeviceManagerBase.openDevice.cpp

/*************************************************************************************************************************************************************/
status_t
CamDeviceManagerBase::
openDeviceLocked(hw_module_t const* module, char const* name, hw_device_t** device
)
{status_t status = OK;sp<ICamDevice> pDevice = NULL;int32_t const i4OpenId = (name != NULL) ? ::atoi(name) : -1;//String8 const s8ClientAppMode = queryClientAppMode();uint32_t const version = determineOpenDeviceVersionLocked(s8ClientAppMode, i4OpenId);//MY_LOGD("+ mOpenMap.size:%d mEnumMap.size:%d", mOpenMap.size(), mEnumMap.size());////  [1] check to see whether it's ready to open.if  ( OK != (status = validateOpenLocked(i4OpenId)) ){return  status;}////  [2] get platformIPlatform*const pPlatform = getPlatform();if  ( ! pPlatform ){MY_LOGE("No Platform");return  NAME_NOT_FOUND;}////  [3] create device based on device version.if  ( version == CAMERA_DEVICE_API_VERSION_1_0 ){pDevice = pPlatform->createCam1Device(s8ClientAppMode.string(), i4OpenId);}elseif  ( version >= CAMERA_DEVICE_API_VERSION_3_0 ){MY_LOGE("Unsupported version:0x%x >= CAMERA_DEVICE_API_VERSION_3_0", version);return  UNKNOWN_ERROR;}else{MY_LOGE("Unsupported version:0x%x", version);return  UNKNOWN_ERROR;}//if  ( pDevice == 0 ){MY_LOGE("device creation failure");return  NO_MEMORY;}////  [4] open device successfully.{*device = const_cast<hw_device_t*>(pDevice->get_hw_device());//pDevice->set_hw_module(module);pDevice->set_module_callbacks(mpModuleCallbacks);pDevice->setDeviceManager(this);//attachDeviceLocked(pDevice);}//return  OK;
}

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

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

相关文章

【Pytorch神经网络实战案例】29 【代码汇总】GitSet模型进行步态与身份识别(CASIA-B数据集)

1 GaitSet_DataLoader.py import numpy as np # 引入基础库 import os import torch.utils.data as tordata from PIL import Image from tqdm import tqdm import random# 1.1定义函数&#xff0c;加载文件夹的文件名称# load_data函数&#xff0c; 分为3个步骤&#xff1a;…

linq from 多个sum_快手重拳打击劣质电商 7月以来封禁700多个团伙账号

何为劣质电商&#xff1f;炒作演戏&#xff1f;PK售卖劣质商品&#xff1f;私下交易&#xff1f;夸大其词&#xff1f;……在快手电商的定义里&#xff0c;有上述不良行为的&#xff0c;都可以定义为劣质电商。快手电商站内官方号“快手卖货助手”日前发布第 11 期“自售或PK销…

win10怎么更改账户名称_Win10邮件功能如何查看邮件

win10的用户当中&#xff0c;一方面有说系统臃肿的&#xff0c;另外一方面有说功能多了不少&#xff0c;好用。不管是出于前者还是后者&#xff0c;win10功能确实多了不少&#xff0c;尤其是一些比较常用的功能&#xff0c;比如说邮箱功能&#xff0c;一般用户可能会选择登录网…

AttributeError: ‘set‘ object has no attribute ‘items‘

AttributeError: ‘set’ object has no attribute ‘items’ 出现这个问题&#xff0c;原因可能是定义的header有问题 正确如下&#xff1a; header{“key”&#xff1a;“value”} 如果是直接在请求数据中复制&#xff0c;很有可能会忽略键和值的冒号。

使用eclipse以及Juint进行测试

打开eclipse后&#xff0c;点击左上角的File&#xff0c;新建一个project&#xff0c;命名为testJunit&#xff0c;然后在src目录下新建两个包&#xff0c;分别命名为TestScore和Test(这是文件夹里没有文件所以是白色)。 在TestScore中新建一个class&#xff0c;命名为Score.ja…

excel单元格下拉选项怎么设置_单元格下拉效果怎么实现?

单元格右边的下拉菜单怎么做的&#xff1f;感觉逼格略有提升啊上视频单元格下来效果https://www.zhihu.com/video/1249633577441800192

电脑如何测网速_物联网卡的网速到底怎么样呢

最近不少朋友发私信问我&#xff0c;物联网卡网速到底怎么样&#xff0c;和手机卡的网速有没有什么区别&#xff1f;其实关于网速这个问题&#xff0c;我已经重复解释了很多遍。只要是走公网的流量卡&#xff0c;在不限速的情况下&#xff0c;基本是和你手机卡网速是一致的&…

dll可以在linux下使用吗_Linux下安装和使用杀毒软件AntiVir

小白玩转智能数据湖&#xff0c;20分钟开发实时豆瓣评分Top20电影的脚本&#xff01;>>> 提起计算机病毒来&#xff0c;可谓人人皆知&#xff0c;有些吃过病毒苦头的人更是有点谈虎色变的感觉。其实无论对于企业还是个人&#xff0c;病毒的危害都是不可避免的&#xf…

[转]微信小程序登录逻辑梳理

本文转自&#xff1a;http://www.jianshu.com/p/d9996cafdb31 官方文档 文档相关地址: 用户登录 获取用户数据 用户数据的签名验证和加解密 登录时序图.png微信两个api所拿到的信息:login和getUserInfo 返回的信息.png注册/登录 小程序端: 通过上面wx.login和wx.getUserInfo两个…

转一篇写的比较好的camera文档[Camera 图像处理原理分析]

色彩篇&#xff08;一&#xff09; 1 前言 做为拍照手机的核心模块之一&#xff0c;camera sensor效果的调整&#xff0c;涉及到众多的参数&#xff0c;如果对基本的光学原理及sensor软/硬件对图像处理的原理能有深入的理解和把握的话&#xff0c;对我们的工作将会起…

201521123061 《Java程序设计》第三周学习总结

1. 本章学习总结 2. 书面作业 **Q1.代码阅读 public class Test1 { private int i 1;//这行不能修改 private static int j 2; public static void main(String[] args) {geti();Test1getj(); }public static void geti() {System.out.println(i); }public static void getj(…

自带flash的浏览器_解决Flash插件已被屏蔽的问题(谷歌、火狐、IE、Edge)

病症&#xff0c;浏览器界面中显示 adobe flash player 已被屏蔽&#xff1a;作为产品运营&#xff0c;作为经常必须可能要接触到Flash/Html5视频应用的人来员&#xff1b;作为曾开发过flash产品的我来说&#xff0c;这题&#xff0c;我会。并且&#xff0c;提供三种解决方式。…

numpy数组中冒号[:,:,0]与[...,0]的区别

先随机产生一个[3,4,5]的numpy数组。则该x维度是3&#xff0c;shape是&#xff08;3,4,5&#xff09;&#xff0c;总共包含60个元素。 x[:,:,0] 意思是对数组x切片&#xff0c;可以想象成一个正方体数据&#xff0c;每次切下一个面的数据。第二维取0则得出来[3,4]大小的数组&am…

苹果忘记开机密码_苹果电脑忘记开机密码快速恢复的方法!

很多用户不经常使用电脑&#xff0c;或者粗心大意忘记自己设置的电脑开机密码&#xff01;&#xff01;&#xff01;这可怎么办呢&#xff1f;今天小编就来和大家分享【Mac电脑忘记开机密码快速恢复的方法教程&#xff01;】有需要的的用户不要错过哦&#xff01;步骤一&#x…

Web框架 Bottle 、Flask 、Tornado

Bottle Flask Tornado Python的WEB框架 Bottle Bottle是一个快速、简洁、轻量级的基于WSIG的微型Web框架&#xff0c;此框架只由一个 .py 文件&#xff0c;除了Python的标准库外&#xff0c;其不依赖任何其他模块。 pip install bottle easy_install bottle apt-get install py…

【Pytorch神经网络理论篇】 36 NLP中常见的任务+BERT模型+发展阶段+数据集

同学你好&#xff01;本文章于2021年末编写&#xff0c;获得广泛的好评&#xff01; 故在2022年末对本系列进行填充与更新&#xff0c;欢迎大家订阅最新的专栏&#xff0c;获取基于Pytorch1.10版本的理论代码(2023版)实现&#xff0c; Pytorch深度学习理论篇(2023版)目录地址…

win7关机快捷键_1个U盘+1款软件,电脑小白也能在家轻松重装win7系统

U盘重装系统&#xff0c;顾名思义就是将U盘插入笔记本后&#xff0c;对电脑进行重装系统。但是我们得清楚一个事情&#xff0c;所谓的U盘并不是普通的U盘&#xff0c;是一个装有PE镜像文件的启动盘。也许很多人还不懂&#xff0c;今天我就来给大家介绍一下如何用1个U盘1款软件&…

cmd导入mysql文件

之所以要使用CMD&#xff08;命令行&#xff09;导入Mysql文件&#xff08;.sql文件形式&#xff09;也许是你还没遇到过 Mysql图形管理工具都无法正常导入sql文件。在网上找了很多的网友提供的资料来看几乎都是显示 所用工具限制&#xff0c;这里我就不多说了。 如下&#xff…

【Pytorch神经网络实战案例】30 jieba库分词+训练中文词向量

1 安装jieba 1.1 安装 pip install jieba 1.2 测试 import jieba seg_list jieba.cut("谭家和谭家和") for i in seg_list:printf(i); 1.3 词向量 在NLP中&#xff0c;一般都会将该任务中涉及的词训练成词向量&#xff0c;然后让每个词以词向量的形式型的输入…