`
caobihole
  • 浏览: 953111 次
文章分类
社区版块
存档分类
最新评论

AndroidICS4.0---->LockScreen锁屏流程【Android源码解析九】

 
阅读更多

先来说说LockScreen分类;

一、无锁屏;

二、锁屏:

1、UnLockScreen:

图案锁、 PIN锁, 密码锁;

2、LockScreen:

波纹锁;


转载请表明出处:http://blog.csdn.net/wdaming1986/article/details/7753206

有图有真相------>


接着我们来看看LockScreen的时序图:

综上所述:

1、createUnlockScreenFor()方法创建的是UnLockScreen界面,代码如下:

 View createUnlockScreenFor(UnlockMode unlockMode) {
        View unlockView = null;

        if (DEBUG) Log.d(TAG,
                "createUnlockScreenFor(" + unlockMode + "): mEnableFallback=" + mEnableFallback);

        if (unlockMode == UnlockMode.Pattern) {
            PatternUnlockScreen view = new PatternUnlockScreen(
                    mContext,
                    mConfiguration,
                    mLockPatternUtils,
                    mUpdateMonitor,
                    mKeyguardScreenCallback,
                    mUpdateMonitor.getFailedAttempts());
            view.setEnableFallback(mEnableFallback);
            unlockView = view;
        } else if (unlockMode == UnlockMode.SimPuk) {
            unlockView = new SimPukUnlockScreen(
                    mContext,
                    mConfiguration,
                    mUpdateMonitor,
                    mKeyguardScreenCallback,
                    mLockPatternUtils, MSimTelephonyManager.getDefault().getDefaultSubscription());
        } else if (unlockMode == UnlockMode.SimPin) {
            unlockView = new SimUnlockScreen(
                    mContext,
                    mConfiguration,
                    mUpdateMonitor,
                    mKeyguardScreenCallback,
                    mLockPatternUtils);
        } else if (unlockMode == UnlockMode.Account) {
            try {
                unlockView = new AccountUnlockScreen(
                        mContext,
                        mConfiguration,
                        mUpdateMonitor,
                        mKeyguardScreenCallback,
                        mLockPatternUtils);
            } catch (IllegalStateException e) {
                Log.i(TAG, "Couldn't instantiate AccountUnlockScreen"
                      + " (IAccountsService isn't available)");
                // TODO: Need a more general way to provide a
                // platform-specific fallback UI here.
                // For now, if we can't display the account login
                // unlock UI, just bring back the regular "Pattern" unlock mode.

                // (We do this by simply returning a regular UnlockScreen
                // here.  This means that the user will still see the
                // regular pattern unlock UI, regardless of the value of
                // mUnlockScreenMode or whether or not we're in the
                // "permanently locked" state.)
                return createUnlockScreenFor(UnlockMode.Pattern);
            }
        } else if (unlockMode == UnlockMode.Password) {
            unlockView = new PasswordUnlockScreen(
                    mContext,
                    mConfiguration,
                    mLockPatternUtils,
                    mUpdateMonitor,
                    mKeyguardScreenCallback);
        } else {
            throw new IllegalArgumentException("unknown unlock mode " + unlockMode);
        }
        initializeTransportControlView(unlockView);
        initializeFaceLockAreaView(unlockView); // Only shows view if FaceLock is enabled

        mUnlockScreenMode = unlockMode;
        return unlockView;
    }


2、createLockScreen()就是创建LockScreen界面:

View createLockScreen() {
    	/*View lockView = new LockScreen(
                mContext,
                mConfiguration,
                mLockPatternUtils,
                mUpdateMonitor,
                mKeyguardScreenCallback);
         initializeTransportControlView(lockView);
         return lockView;*/
    	
    	long lockscreenType = 0;
    	try{
    		lockscreenType = android.provider.Settings.Secure.
    				getLong(mContext.getContentResolver(), "lockscreen.disabled");
    	}catch(Exception e){
    		e.printStackTrace();
    	}
    	View lockView = null;
         lockView = new LockScreen(
    				mContext,
    				mConfiguration,
    				mLockPatternUtils,
    				mUpdateMonitor,
    				mKeyguardScreenCallback);  	
         initializeTransportControlView(lockView);
        return lockView;
}


我们来看看锁屏界面的流程:

step 1:创建LockScreen.java类——>先看看构造函数:

 LockScreen(Context context, Configuration configuration, LockPatternUtils lockPatternUtils,
            KeyguardUpdateMonitor updateMonitor,
            KeyguardScreenCallback callback) {
        super(context);
        mLockPatternUtils = lockPatternUtils;
        mUpdateMonitor = updateMonitor;
        mCallback = callback;

        mEnableMenuKeyInLockScreen = shouldEnableMenuKey();

        mCreationOrientation = configuration.orientation;

        mKeyboardHidden = configuration.hardKeyboardHidden;

        if (LockPatternKeyguardView.DEBUG_CONFIGURATION) {
            Log.v(TAG, "***** CREATING LOCK SCREEN", new RuntimeException());
            Log.v(TAG, "Cur orient=" + mCreationOrientation
                    + " res orient=" + context.getResources().getConfiguration().orientation);
        }

        final LayoutInflater inflater = LayoutInflater.from(context);
        if (DBG) Log.v(TAG, "Creation orientation = " + mCreationOrientation);
        if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock, this, true);
        } else {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock_land, this, true);
        }

        if (TelephonyManager.getDefault().isMultiSimEnabled()) {
            mStatusViewManager = new MSimKeyguardStatusViewManager(this, mUpdateMonitor,
                    mLockPatternUtils, mCallback, false);
        } else {
            mStatusViewManager = new KeyguardStatusViewManager(this, mUpdateMonitor,
                    mLockPatternUtils, mCallback, false);
        }

        setFocusable(true);
        setFocusableInTouchMode(true);
        setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);

        mAudioManager = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
        // modify by wangxianming in 2012-06-22
        if (mAudioManager != null) {
        	mSilentMode = isSilentMode();
        }

        mUnlockWidget = findViewById(R.id.unlock_widget);
        if (mUnlockWidget instanceof SlidingTab) {
            SlidingTab slidingTabView = (SlidingTab) mUnlockWidget;
            slidingTabView.setHoldAfterTrigger(true, false);
            slidingTabView.setLeftHintText(R.string.lockscreen_unlock_label);
            slidingTabView.setLeftTabResources(
                    R.drawable.ic_jog_dial_unlock,
                    R.drawable.jog_tab_target_green,
                    R.drawable.jog_tab_bar_left_unlock,
                    R.drawable.jog_tab_left_unlock);
            SlidingTabMethods slidingTabMethods = new SlidingTabMethods(slidingTabView);
            slidingTabView.setOnTriggerListener(slidingTabMethods);
            mUnlockWidgetMethods = slidingTabMethods;
        } else if (mUnlockWidget instanceof WaveView) {
            WaveView waveView = (WaveView) mUnlockWidget;
            WaveViewMethods waveViewMethods = new WaveViewMethods(waveView);
            waveView.setOnTriggerListener(waveViewMethods);
            mUnlockWidgetMethods = waveViewMethods;
        } else if (mUnlockWidget instanceof MultiWaveView) {
            MultiWaveView multiWaveView = (MultiWaveView) mUnlockWidget;
            MultiWaveViewMethods multiWaveViewMethods = new MultiWaveViewMethods(multiWaveView);
            multiWaveView.setOnTriggerListener(multiWaveViewMethods);
            mUnlockWidgetMethods = multiWaveViewMethods;
        } else {
            throw new IllegalStateException("Unrecognized unlock widget: " + mUnlockWidget);
        }

        // Update widget with initial ring state
        mUnlockWidgetMethods.updateResources();

        if (DBG) Log.v(TAG, "*** LockScreen accel is "
                + (mUnlockWidget.isHardwareAccelerated() ? "on":"off"));
    }


Step 2:在Step 1步骤中根据横竖屏来加载横竖屏的布局:

if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock, this, true);
        } else {
            inflater.inflate(R.layout.keyguard_screen_tab_unlock_land, this, true);
        }


Step 3:来看看竖屏的布局文件的代码:

<GridLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal">
    <!-- 锁屏界面加载数字时钟 -->
    <com.android.internal.widget.DigitalClock android:id="@+id/time"
        android:layout_marginTop="@dimen/keyguard_lockscreen_status_line_clockfont_top_margin"
        android:layout_marginBottom="12dip"
        android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
        android:layout_gravity="right">

        <!-- Because we can't have multi-tone fonts, we render two TextViews, one on
        top of the other. Hence the redundant layout... -->
        <TextView android:id="@+id/timeDisplayBackground"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:ellipsize="none"
            android:textSize="@dimen/keyguard_lockscreen_clock_font_size"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_marginBottom="6dip"
            android:textColor="@color/lockscreen_clock_background"
            />

        <TextView android:id="@+id/timeDisplayForeground"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:ellipsize="none"
            android:textSize="@dimen/keyguard_lockscreen_clock_font_size"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:layout_marginBottom="6dip"
            android:textColor="@color/lockscreen_clock_foreground"
            android:layout_alignLeft="@id/timeDisplayBackground"
            android:layout_alignTop="@id/timeDisplayBackground"
            />

    </com.android.internal.widget.DigitalClock>

    <LinearLayout
        android:orientation="horizontal"
        android:layout_gravity="right"
        android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin">
        <!-- 锁屏界面加载日期 -->
        <TextView
            android:id="@+id/date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
            />
        <!-- 锁屏界面加载闹钟状态 -->
        <TextView
            android:id="@+id/alarm_status"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="16dip"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
            android:drawablePadding="4dip"
            />

    </LinearLayout>
    <!-- 锁屏界面加载充电状态 -->
    <TextView
        android:id="@+id/status1"
        android:layout_gravity="right"
        android:layout_marginRight="@dimen/keyguard_lockscreen_status_line_font_right_margin"
        android:singleLine="true"
        android:ellipsize="marquee"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
        android:drawablePadding="4dip"
        />

    <Space android:layout_gravity="fill" />
        <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="302dip">
        <!-- 锁屏界面加载波纹的锁屏 -->
        <com.android.internal.widget.multiwaveview.MultiWaveView
            android:id="@+id/unlock_widget"
            android:orientation="horizontal"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_alignParentBottom="true"

            android:targetDrawables="@array/lockscreen_targets_with_camera"
            android:targetDescriptions="@array/lockscreen_target_descriptions_with_camera"
            android:directionDescriptions="@array/lockscreen_direction_descriptions"
            android:handleDrawable="@drawable/ic_lockscreen_handle"
            android:waveDrawable="@drawable/ic_lockscreen_outerring"
            android:outerRadius="@dimen/multiwaveview_target_placement_radius"
            android:snapMargin="@dimen/multiwaveview_snap_margin"
            android:hitRadius="@dimen/multiwaveview_hit_radius"
            android:rightChevronDrawable="@drawable/ic_lockscreen_chevron_right"
            android:horizontalOffset="0dip"
            android:verticalOffset="60dip"
            android:feedbackCount="3"
            android:vibrationDuration="20"
            />
        <!-- 锁屏界面加载运营商状态 -->
        <TextView
            android:id="@+id/carrier"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="12dip"
            android:gravity="center_horizontal"
            android:singleLine="true"
            android:ellipsize="marquee"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
            android:textColor="?android:attr/textColorSecondary"
            />

    </RelativeLayout>

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        style="?android:attr/buttonBarStyle"
        android:gravity="center"
        android:weightSum="2">
        <!-- 锁屏界面加载紧急拨号按钮 -->
        <Button android:id="@+id/emergencyCallButton"
            android:layout_gravity="center_horizontal"
            android:layout_width="0dip"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            style="?android:attr/buttonBarButtonStyle"
            android:textSize="@dimen/keyguard_lockscreen_status_line_font_size"
            android:text="@*android:string/lockscreen_emergency_call"
            android:drawableLeft="@*android:drawable/lockscreen_emergency_button"
            android:drawablePadding="0dip"
            android:visibility="gone"
        />

    </LinearLayout>

</GridLayout>


Step 4:在Step 3中重点看com.android.internal.widget.multiwaveview.MultiWaveView这个自定义的view,这个view是处理ICS4.0锁屏的拖拽的功能,具体代码如下:

 public MultiWaveView(Context context, AttributeSet attrs) {
        super(context, attrs);
        Resources res = context.getResources();
。。。 。。。
加载资源
。。。 。。。
}

通过onMeasure()来计算自定义view的大小:

 protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final int minimumWidth = getSuggestedMinimumWidth();
        final int minimumHeight = getSuggestedMinimumHeight();
        int viewWidth = resolveMeasured(widthMeasureSpec, minimumWidth);
        int viewHeight = resolveMeasured(heightMeasureSpec, minimumHeight);
        setMeasuredDimension(viewWidth, viewHeight);
    }


通过onLayout()来加载布局:

 protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        final int width = right - left;
        final int height = bottom - top;
        float newWaveCenterX = mHorizontalOffset + Math.max(width, mOuterRing.getWidth() ) / 2;
        float newWaveCenterY = mVerticalOffset + Math.max(height, mOuterRing.getHeight()) / 2;
        if (newWaveCenterX != mWaveCenterX || newWaveCenterY != mWaveCenterY) {
            if (mWaveCenterX == 0 && mWaveCenterY == 0) {
                performInitialLayout(newWaveCenterX, newWaveCenterY);
            }
            mWaveCenterX = newWaveCenterX;
            mWaveCenterY = newWaveCenterY;

            mOuterRing.setX(mWaveCenterX);
            mOuterRing.setY(Math.max(mWaveCenterY, mWaveCenterY));

            updateTargetPositions();
        }
        if (DEBUG) dump();
    }


Step 5:来看看触摸屏幕时的事件处理onTouchEvent()代码如下:

 @Override
    public boolean onTouchEvent(MotionEvent event) {
        final int action = event.getAction();

        boolean handled = false;
        switch (action) {
            case MotionEvent.ACTION_DOWN:
                handleDown(event);
                handled = true;
                break;

            case MotionEvent.ACTION_MOVE:
                handleMove(event);
                handled = true;
                break;

            case MotionEvent.ACTION_UP:
                handleMove(event);
                handleUp(event);
                handled = true;
                break;

            case MotionEvent.ACTION_CANCEL:
                handleMove(event);
                handled = true;
                break;
        }
        invalidate();
        return handled ? true : super.onTouchEvent(event);
    }


通过handleMove()来处理移动事件:

 private void handleMove(MotionEvent event) {
        if (!mDragging) {
            trySwitchToFirstTouchState(event);
            return;
        }

        int activeTarget = -1;
        final int historySize = event.getHistorySize();
        for (int k = 0; k < historySize + 1; k++) {
            float x = k < historySize ? event.getHistoricalX(k) : event.getX();
            float y = k < historySize ? event.getHistoricalY(k) : event.getY();
            float tx = x - mWaveCenterX;
            float ty = y - mWaveCenterY;
            float touchRadius = (float) Math.sqrt(dist2(tx, ty));
            final float scale = touchRadius > mOuterRadius ? mOuterRadius / touchRadius : 1.0f;
            float limitX = mWaveCenterX + tx * scale;
            float limitY = mWaveCenterY + ty * scale;

            boolean singleTarget = mTargetDrawables.size() == 1;
            if (singleTarget) {
                // Snap to outer ring if there's only one target
                float snapRadius = mOuterRadius - mSnapMargin;
                if (touchRadius > snapRadius) {
                    activeTarget = 0;
                    x = limitX;
                    y = limitY;
                }
            } else {
                // If there's more than one target, snap to the closest one less than hitRadius away.
                float best = Float.MAX_VALUE;
                final float hitRadius2 = mHitRadius * mHitRadius;
                for (int i = 0; i < mTargetDrawables.size(); i++) {
                    // Snap to the first target in range
                    TargetDrawable target = mTargetDrawables.get(i);
                    float dx = limitX - target.getX();
                    float dy = limitY - target.getY();
                    float dist2 = dx*dx + dy*dy;
                    if (target.isValid() && dist2 < hitRadius2 && dist2 < best) {
                        activeTarget = i;
                        best = dist2;
                    }
                }
                x = limitX;
                y = limitY;
            }
            if (activeTarget != -1) {
                switchToState(STATE_SNAP, x,y);
                float newX = singleTarget ? limitX : mTargetDrawables.get(activeTarget).getX();
                float newY = singleTarget ? limitY : mTargetDrawables.get(activeTarget).getY();
                moveHandleTo(newX, newY, false);
                TargetDrawable currentTarget = mTargetDrawables.get(activeTarget);
                if (currentTarget.hasState(TargetDrawable.STATE_FOCUSED)) {
                    currentTarget.setState(TargetDrawable.STATE_FOCUSED);
                    mHandleDrawable.setAlpha(0.0f);
                }
            } else {
                switchToState(STATE_TRACKING, x, y);
                moveHandleTo(x, y, false);
                mHandleDrawable.setAlpha(1.0f);
            }
        }

        // Draw handle outside parent's bounds
        invalidateGlobalRegion(mHandleDrawable);

        if (mActiveTarget != activeTarget && activeTarget != -1) {
            dispatchGrabbedEvent(activeTarget);
            if (AccessibilityManager.getInstance(mContext).isEnabled()) {
                String targetContentDescription = getTargetDescription(activeTarget);
                announceText(targetContentDescription);
            }
        }
        mActiveTarget = activeTarget;
    }

以上主要工作是绘制拖拽的参数以及绘制出来。通过invalidate()来主动刷屏幕;

在onDraw()方法中实现绘制图形,代码如下:

    @Override
    protected void onDraw(Canvas canvas) {
        mOuterRing.draw(canvas);
        for (TargetDrawable target : mTargetDrawables) {
            if (target != null) {
                target.draw(canvas);
            }
        }
        for (TargetDrawable target : mChevronDrawables) {
            if (target != null) {
                target.draw(canvas);
            }
        }
        mHandleDrawable.draw(canvas);
    }


在handleMove()方法中——>trySwitchToFirstTouchState(event);——>switchToState()——>doFinish();

——>setGrabbedState() ————>mOnTriggerListener.onGrabbedStateChange(this, mGrabbedState);

设置回调。

Step 6:LockScreen.java中有个内部类,监听这个移动事件的状态,——> 代码如下:

 class MultiWaveViewMethods implements MultiWaveView.OnTriggerListener,
            UnlockWidgetCommonMethods {

        private final MultiWaveView mMultiWaveView;
        private boolean mCameraDisabled;

        MultiWaveViewMethods(MultiWaveView multiWaveView) {
            mMultiWaveView = multiWaveView;
            final boolean cameraDisabled = mLockPatternUtils.getDevicePolicyManager()
                    .getCameraDisabled(null);
            if (cameraDisabled) {
                Log.v(TAG, "Camera disabled by Device Policy");
                mCameraDisabled = true;
            } else {
                // Camera is enabled if resource is initially defined for MultiWaveView
                // in the lockscreen layout file
                mCameraDisabled = mMultiWaveView.getTargetResourceId()
                        != R.array.lockscreen_targets_with_camera;
            }
        }

        public void updateResources() {
            int resId;
            if (mCameraDisabled) {
                // Fall back to showing ring/silence if camera is disabled by DPM...
                resId = mSilentMode ? R.array.lockscreen_targets_when_silent
                    : R.array.lockscreen_targets_when_soundon;
            } else {
                resId = R.array.lockscreen_targets_with_camera;
            }
            mMultiWaveView.setTargetResources(resId);
        }

        public void onGrabbed(View v, int handle) {

        }

        public void onReleased(View v, int handle) {

        }

        public void onTrigger(View v, int target) {
            if (target == 0 || target == 1) { // 0 = unlock/portrait, 1 = unlock/landscape
                mCallback.goToUnlockScreen();
            } else if (target == 2 || target == 3) { // 2 = alt/portrait, 3 = alt/landscape
                if (!mCameraDisabled) {
                    // Start the Camera
                    Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
                    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                    mContext.startActivity(intent);
                    mCallback.goToUnlockScreen();
                } else {
                    toggleRingMode();
                    mUnlockWidgetMethods.updateResources();
                    mCallback.pokeWakelock();
                }
            }
        }

        public void onGrabbedStateChange(View v, int handle) {
            // Don't poke the wake lock when returning to a state where the handle is
            // not grabbed since that can happen when the system (instead of the user)
            // cancels the grab.
            if (handle != MultiWaveView.OnTriggerListener.NO_HANDLE) {
                mCallback.pokeWakelock();
            }
        }

        public View getView() {
            return mMultiWaveView;
        }

        public void reset(boolean animate) {
            mMultiWaveView.reset(animate);
        }

        public void ping() {
            mMultiWaveView.ping();
        }
    }


重点看public void onTrigger()这个方法,用于处理拖拽启动那个activity,一个启动camera,一个正常解锁。

锁屏的大概这个流程就是这个样子了,大家应该会一目了然了。由于时间仓促,难免有点纰漏,希望大家指正错误,如有不解的地方,欢迎留言探讨!!!



分享到:
评论

相关推荐

    AndroidICS关机跟重新启动功能研究

    一&gt;、Android重启功能  在androidjava层执行shell命令来完成。但是笔者在开发测试中同样的代码发现用Eng编译出的版本可以重新启动,user版本不能完成重启,挂在关机那个界面。  /********************************...

    毕业设计基于STC12C5A、SIM800C、GPS的汽车防盗报警系统源码.zip

    STC12C5A通过GPS模块获取当前定位信息,如果车辆发生异常震动或车主打来电话(主动请求定位),将通过GSM发送一条定位短信到车主手机,车主点击链接默认打开网页版定位,如果有安装高德地图APP将在APP中打开并展示汽车当前位置 GPS模块可以使用多家的GPS模块,需要注意的是,当前程序对应的是GPS北斗双模芯片,故只解析 GNRMC数据,如果你使用GPS芯片则应改为GPRMC数据即可。 系统在初始化的时候会持续短鸣,每初始化成功一部分后将长鸣一声,如果持续短鸣很久(超过20分钟),建议通过串口助手查看系统输出的调试信息,系统串口默认输出从初始化开始的所有运行状态信息。 不过更建议你使用SIM868模块,集成GPS.GSM.GPRS,使用更加方便

    基于tensorflow2.x卷积神经网络字符型验证码识别.zip

    基于tensorflow2.x卷积神经网络字符型验证码识别 卷积神经网络(Convolutional Neural Networks, CNNs 或 ConvNets)是一类深度神经网络,特别擅长处理图像相关的机器学习和深度学习任务。它们的名称来源于网络中使用了一种叫做卷积的数学运算。以下是卷积神经网络的一些关键组件和特性: 卷积层(Convolutional Layer): 卷积层是CNN的核心组件。它们通过一组可学习的滤波器(或称为卷积核、卷积器)在输入图像(或上一层的输出特征图)上滑动来工作。 滤波器和图像之间的卷积操作生成输出特征图,该特征图反映了滤波器所捕捉的局部图像特性(如边缘、角点等)。 通过使用多个滤波器,卷积层可以提取输入图像中的多种特征。 激活函数(Activation Function): 在卷积操作之后,通常会应用一个激活函数(如ReLU、Sigmoid或tanh)来增加网络的非线性。 池化层(Pooling Layer): 池化层通常位于卷积层之后,用于降低特征图的维度(空间尺寸),减少计算量和参数数量,同时保持特征的空间层次结构。 常见的池化操作包括最大池化(Max Pooling)和平均池化(Average Pooling)。 全连接层(Fully Connected Layer): 在CNN的末端,通常会有几层全连接层(也称为密集层或线性层)。这些层中的每个神经元都与前一层的所有神经元连接。 全连接层通常用于对提取的特征进行分类或回归。 训练过程: CNN的训练过程与其他深度学习模型类似,通过反向传播算法和梯度下降(或其变种)来优化网络参数(如滤波器权重和偏置)。 训练数据通常被分为多个批次(mini-batches),并在每个批次上迭代更新网络参数。 应用: CNN在计算机视觉领域有着广泛的应用,包括图像分类、目标检测、图像分割、人脸识别等。 它们也已被扩展到处理其他类型的数据,如文本(通过卷积一维序列)和音频(通过卷积时间序列)。 随着深度学习技术的发展,卷积神经网络的结构和设计也在不断演变,出现了许多新的变体和改进,如残差网络(ResNet)、深度卷积生成对抗网络(DCGAN)等。

    【三维装箱】遗传和模拟退火算法求解三维装箱优化问题【含Matlab源码 031期】.zip

    【三维装箱】遗传和模拟退火算法求解三维装箱优化问题【含Matlab源码 031期】.zip

    自己编写的python 程序计算cpk/ppk

    cpk&ppk python 小程序,品友点评

    基于Springboot开发的分布式抽奖系统.zip

    基于springboot的java毕业&课程设计

    课设毕设基于SpringBoot+Vue的影城管理系统 LW+PPT+源码可运行.zip

    课设毕设基于SpringBoot+Vue的影城管理系统 LW+PPT+源码可运行.zip

    MC教育版(免登录版)

    MC教育版(免登录版)

    农作物叶片病害分类和分割数据集【数据集+标签】

    包含13993张数据和对应的13993张mask分割模版,数据集用不同目录保存,也可以用作分类数据集 类别包含:桃子、辣椒、覆盆子、大豆、南瓜、草莓

    基于vue+springboot二手交易网站.zip

    基于springboot的java毕业&课程设计

    【三维装箱】遗传算法求解三维装箱优化问题【含Matlab源码 3408期】.zip

    【三维装箱】遗传算法求解三维装箱优化问题【含Matlab源码 3408期】.zip

    基于javaspring 开发框架的培训教程 TP1.zip

    基于javaspring 开发框架的培训教程 TP1.zip

    信号和系统 MATLAB 代码:探索信号生成、系统建模、傅立叶分析、滤波器设计、采样和控制系统仿真.zip

    1.版本:matlab2014/2019a/2021a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

    医院网上预约系统设计与开发/毕业设计

    医院网上预约系统设计与开发/毕业设计 JSP基于SSM网上医院预约挂号系统 科室信息: 科室id,科室名称,科室介绍,成立日期,负责人 医生信息: 医生工号,登录密码,所在科室,医生姓名,性别,医生照片,出生日期,医生职位,工作经验,联系方式,擅长,医生介绍 病人信息: 病人id,医生,病人姓名,性别,身份证号,联系电话,病人病例,登记时间 预约信息: 预约id,预约用户,预约医生,预约日期,时段,联系电话,下单时间,处理状态,医生回复 新闻信息: 新闻id,新闻标题,新闻图片,新闻内容,新闻日期,新闻来源 留言: 留言id,留言标题,留言内容,留言人,留言时间,管理回复,回复时间 用户: 用户名,登录密码,姓名,性别,出生日期,用户照片,联系电话,邮箱,家庭地址,注册时间

    企业数据治理之数据质量治理方案.pptx

    企业数据治理之数据质量治理方案

    MySQL8.4.0 LTS(mysql-8.4.0-10.fc38.x86-64.rpm-bundle.tar)

    MySQL8.4.0 LTS(mysql-8.4.0-10.fc38.x86_64.rpm-bundle.tar)适用于Linux Fedora 38 (x86, 64-bit)

    1659 jsp游乐园管理系统Myeclipse开发mysql数据库web结构java编程计算机网页项目源码

    一、源码特点 java 医疗数据管理系统 是一套完善的web设计系统,对理解JSP java编程开发语言有帮助采用了数据模型进行区块链设计,系统具有完整的源代码和数据库,系统采用web模式,系统主要采用B/S模式开发。开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql,使用java语言开发。 二、功能介绍 如博客中介绍 三、注意事项 1、管理员账号:admin 密码:admin 数据库配置文件DBO.java ,权限包括管理员,用户 2、开发环境为TOMCAT7.0,Myeclipse8.5开发,数据库为Mysql,使用java语言开发。 3、数据库文件名是jspyly 系统名称yly 4、地址:http://127.0.0.1:8080/yly/qt/index.jsp

    基于SpringBoot 搭建的番茄短视频-后台管理系统.zip

    基于springboot的java毕业&课程设计

    54.医院分诊管理系统的设计与实现-基于SSM框架+ Mysql+Java设计与实现(可运行源码+数据库+lw)毕业设计管理系统

    可运行源码(含数据库脚本)+开发文档+lw(高分毕设项目) java期末大作业毕业设计项目管理系统计算机软件工程大数据专业 内容概要:通过陆丰市医院门诊分诊系统设计的研究背景、研究的意义和目的,通过运用java语言和ssm框架来建立一款分诊管理系统,能够帮助医院提高工作效率,减少工作中出现的错误率。设计出挂号管理、排队候诊管理以及叫号管理等多个子模块,绘制出实体关系图,利用MySQL技术建立数据库达成了软件与数据库的互通。最后对工作进行了总结和展望。 关键词:分诊管理系统;功能建模;java 全套项目源码+详尽文档,一站式解决您的学习与项目需求。 适用人群: 计算机、通信、人工智能、自动化等专业的学生、老师及从业者。 使用场景及目标: 无论是毕设、期末大作业还是课程设计,一键下载,轻松部署,助您轻松完成项目。 项目代码经过调试测试,确保直接运行,节省您的时间和精力。 其他说明: 项目整体具有较高的学习借鉴价值,基础能力强的可以在此基础上修改调整,以实现不同的功能。

Global site tag (gtag.js) - Google Analytics