当前位置: 首页 > news >正文

爬虫入门到精通_框架篇14(PySpider架构概述及用法详解)

官方文档
Sample Code:

from pyspider.libs.base_handler import *class Handler(BaseHandler):crawl_config = {}# minutes=24 * 60:每隔一天重新爬取@every(minutes=24 * 60)def on_start(self):self.crawl('http://scrapy.org/', callback=self.index_page)# age:过期时间@config(age=10 * 24 * 60 * 60)def index_page(self, response):for each in response.doc('a[href^="http"]').items():self.crawl(each.attr.href, callback=self.detail_page)def detail_page(self, response):return {"url": response.url,"title": response.doc('title').text(),}

1 架构(Architecture)

在这里插入图片描述
scheduler:调度器
feter:请求器,请求网页
processor:用来处理数据,处理的url可以重新调用调度器
monitor&webui:监视器与webUI

scheduler

维护request队列,默认是存储在本地的数据库

feter

在这里插入图片描述
可以用两种模式:一种是直接请求,一种是js的请求。

processor

处理数据,将url重新封装起来,可以重新调用调度器。

2 Command Line

Global Config

global options work for all subcommands.

Usage: pyspider [OPTIONS] COMMAND [ARGS]...A powerful spider system in python.Options:-c, --config FILENAME    a json file with default values for subcommands.{“webui”: {“port”:5001}}--logging-config TEXT    logging config file for built-in python loggingmodule  [default: pyspider/pyspider/logging.conf]--debug                  debug mode--queue-maxsize INTEGER  maxsize of queue--taskdb TEXT            database url for taskdb, default: sqlite--projectdb TEXT         database url for projectdb, default: sqlite--resultdb TEXT          database url for resultdb, default: sqlite--message-queue TEXT     connection url to message queue, default: builtinmultiprocessing.Queue--amqp-url TEXT          [deprecated] amqp url for rabbitmq. please use--message-queue instead.--beanstalk TEXT         [deprecated] beanstalk config for beanstalk queue.please use --message-queue instead.--phantomjs-proxy TEXT   phantomjs proxy ip:port--data-path TEXT         data dir path--version                Show the version and exit.--help                   Show this message and exit.

config

pyspider启动的时候的一些配置选项

{"taskdb": "mysql+taskdb://username:password@host:port/taskdb","projectdb": "mysql+projectdb://username:password@host:port/projectdb","resultdb": "mysql+resultdb://username:password@host:port/resultdb","message_queue": "amqp://username:password@host:port/%2F","webui": {"username": "some_name","password": "some_passwd","need-auth": true}
}

项目启动时,会生成上述3个db,在当前项目的data目录下
在这里插入图片描述
webui:指定好界面访问的用户名密码
在这里插入图片描述
在这里插入图片描述
此时弹出:
在这里插入图片描述

all

运行所有的组件

Usage: pyspider all [OPTIONS]Run all the components in subprocess or threadOptions:--fetcher-num INTEGER         instance num of fetcher--processor-num INTEGER       instance num of processor--result-worker-num INTEGER   instance num of result worker--run-in [subprocess|thread]  run each components in thread or subprocess.always using thread for windows.--help                        Show this message and exit.

在这里插入图片描述

one

在一个进程下运行所有的组件

Usage: pyspider one [OPTIONS] [SCRIPTS]...One mode not only means all-in-one, it runs every thing in one processover tornado.ioloop, for debug purposeOptions:-i, --interactive  enable interactive mode, you can choose crawl url.--phantomjs        enable phantomjs, will spawn a subprocess for phantomjs--help             Show this message and exit.

bench

请求测试

Usage: pyspider bench [OPTIONS]Run Benchmark test. In bench mode, in-memory sqlite database is usedinstead of on-disk sqlite database.Options:--fetcher-num INTEGER         instance num of fetcher--processor-num INTEGER       instance num of processor--result-worker-num INTEGER   instance num of result worker--run-in [subprocess|thread]  run each components in thread or subprocess.always using thread for windows.--total INTEGER               total url in test page--show INTEGER                show how many urls in a page--help                        Show this message and exit.

已下组件都是单独开启

scheduler

Usage: pyspider scheduler [OPTIONS]Run Scheduler, only one scheduler is allowed.Options:--xmlrpc / --no-xmlrpc--xmlrpc-host TEXT--xmlrpc-port INTEGER--inqueue-limit INTEGER  size limit of task queue for each project, taskswill been ignored when overflow--delete-time INTEGER    delete time before marked as delete--active-tasks INTEGER   active log size--loop-limit INTEGER     maximum number of tasks due with in a loop--scheduler-cls TEXT     scheduler class to be used.--help                   Show this message and exit.

phantomjs

Usage: run.py phantomjs [OPTIONS] [ARGS]...Run phantomjs fetcher if phantomjs is installed.Options:--phantomjs-path TEXT  phantomjs path--port INTEGER         phantomjs port--auto-restart TEXT    auto restart phantomjs if crashed--help                 Show this message and exit.

fetcher

Usage: pyspider fetcher [OPTIONS]Run Fetcher.Options:--xmlrpc / --no-xmlrpc--xmlrpc-host TEXT--xmlrpc-port INTEGER--poolsize INTEGER      max simultaneous fetches--proxy TEXT            proxy host:port--user-agent TEXT       user agent--timeout TEXT          default fetch timeout--fetcher-cls TEXT      Fetcher class to be used.--help                  Show this message and exit.

processor

Usage: pyspider processor [OPTIONS]Run Processor.Options:--processor-cls TEXT  Processor class to be used.--help                Show this message and exit.

result_worker

Usage: pyspider result_worker [OPTIONS]Run result worker.Options:--result-cls TEXT  ResultWorker class to be used.--help             Show this message and exit.

webui

Usage: pyspider webui [OPTIONS]Run WebUIOptions:--host TEXT            webui bind to host--port INTEGER         webui bind to host--cdn TEXT             js/css cdn server--scheduler-rpc TEXT   xmlrpc path of scheduler--fetcher-rpc TEXT     xmlrpc path of fetcher--max-rate FLOAT       max rate for each project--max-burst FLOAT      max burst for each project--username TEXT        username of lock -ed projects--password TEXT        password of lock -ed projects--need-auth            need username and password--webui-instance TEXT  webui Flask Application instance to be used.--help                 Show this message and exit.

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

3 API Reference

self.crawl(url, **kwargs)

self.crawl is the main interface to tell pyspider which url(s) should be crawled.
发起请求的函数

Parameters:

url

the url or url list to be crawled.
请求的网页

callback

the method to parse the response. _default: call _
回调函数

def on_start(self):self.crawl('http://scrapy.org/', callback=self.index_page)

the following parameters are optional

age

the period of validity of the task. The page would be regarded as not modified during the period. default: -1(never recrawl)
请求的过期时间,单位秒,过期了才重新请求

@config(age=10 * 24 * 60 * 60)
def index_page(self, response):...

Every pages parsed by the callback index_page would be regarded not changed within 10 days. If you submit the task within 10 days since last crawled it would be discarded.

priority

the priority of task to be scheduled, higher the better. default: 0
指定爬取优先级.

def index_page(self):self.crawl('http://www.example.org/page2.html', callback=self.index_page)self.crawl('http://www.example.org/233.html', callback=self.detail_page,priority=1)

The page 233.html would be crawled before page2.html. Use this parameter can do a BFS and reduce the number of tasks in queue(which may cost more memory resources).

exetime

the executed time of task in unix timestamp. default: 0(immediately)
指定执行时间

import time
def on_start(self):self.crawl('http://www.example.org/', callback=self.callback,exetime=time.time()+30*60)

The page would be crawled 30 minutes later.

retries

retry times while failed. default: 3
失败之后的重试次数,默认时3,最大10.

itag

a marker from frontier page to reveal the potential modification of the task. It will be compared to its last value, recrawl when it’s changed. default: None
标识符,

def index_page(self, response):for item in response.doc('.item').items():self.crawl(item.find('a').attr.url, callback=self.detail_page,itag=item.find('.update-time').text())

In the sample, .update-time is used as itag. If it’s not changed, the request would be discarded.
如果没有改变,不进行重新爬取

Or you can use itag with Handler.crawl_config to specify the script version if you want to restart all of the tasks.

class Handler(BaseHandler):crawl_config = {'itag': 'v223'}

Change the value of itag after you modified the script and click run button again. It doesn’t matter if not set before.

auto_recrawl

when enabled, task would be recrawled every age time. default: False
自动重爬,如果开启,age过期后自动重爬。

def on_start(self):self.crawl('http://www.example.org/', callback=self.callback,age=5*60*60, auto_recrawl=True)

The page would be restarted every age 5 hours.

method

HTTP method to use. default: GET
HTTP的请求方法。

params

dictionary of URL parameters to append to the URL.
get请求的一些参数.

def on_start(self):self.crawl('http://httpbin.org/get', callback=self.callback,params={'a': 123, 'b': 'c'})self.crawl('http://httpbin.org/get?a=123&b=c', callback=self.callback)

The two requests are the same.

data

the body to attach to the request. If a dictionary is provided, form-encoding will take place.
post请求的一些data.

def on_start(self):self.crawl('http://httpbin.org/post', callback=self.callback,method='POST', data={'a': 123, 'b': 'c'})

files

dictionary of {field: {filename: ‘content’}} files to multipart upload.
上传的文件.

user_agent

the User-Agent of the request

headers

dictionary of headers to send.

cookies

dictionary of cookies to attach to this request.

connect_timeout

timeout for initial connection in seconds. default: 20

timeout

maximum time in seconds to fetch the page. default: 120

allow_redirects

follow 30x redirect default: True
一些网页的302的跳转是否重定向设置.

validate_cert

For HTTPS requests, validate the server’s certificate? default: True
HTTPS的证书请求忽略.

proxy

proxy server of username:password@hostname:port to use, only http proxy is supported currently.

class Handler(BaseHandler):crawl_config = {'proxy': 'localhost:8080'}

Handler.crawl_config can be used with proxy to set a proxy for whole project.
设置代理.

etag

use HTTP Etag mechanism to pass the process if the content of the page is not changed. default: True
判断页面更新爬取情况.

last_modified

use HTTP Last-Modified header mechanism to pass the process if the content of the page is not changed. default: True

fetch_type

set to js to enable JavaScript fetcher. default: None
设置为js请求.渲染查找后的页面.

js_script

JavaScript run before or after page loaded, should been wrapped by a function like function() { document.write(“binux”); }.
网页爬取后,执行脚本.

def on_start(self):self.crawl('http://www.example.org/', callback=self.callback,fetch_type='js', js_script='''function() {window.scrollTo(0,document.body.scrollHeight);return 123;}''')

The script would scroll the page to bottom. The value returned in function could be captured via Response.js_script_result.

js_run_at

run JavaScript specified via js_script at document-start or document-end. default: document-end
把脚本加到当我document前面还是后面.

js_viewport_width/js_viewport_height

set the size of the viewport for the JavaScript fetcher of the layout process.
JS视窗的大小.

load_images

load images when JavaScript fetcher enabled. default: False
加载时是否加载图片.

save

a object pass to the callback method, can be visit via response.save.
用来在多个函数直接传递变量的参数

def on_start(self):self.crawl('http://www.example.org/', callback=self.callback,save={'a': 123})def callback(self, response):return response.save['a']

123 would be returned in callback

taskid

unique id to identify the task, default is the MD5 check code of the URL, can be overridden by method def get_taskid(self, task)
指定task的唯一标识码,ruquest队列的消息去重.

import json
from pyspider.libs.utils import md5string
def get_taskid(self, task):return md5string(task['url']+json.dumps(task['fetch'].get('data', '')))

Only url is md5 -ed as taskid by default, the code above add data of POST request as part of taskid.

force_update

force update task params even if the task is in ACTIVE status.
强制更新.

cancel

cancel a task, should be used with force_update to cancel a active task. To cancel an auto_recrawl task, you should set auto_recrawl=False as well.
取消任务.

@config(**kwargs)

default parameters of self.crawl when use the decorated method as callback. For example:
config里可以传递参数.

@config(age=15*60)
def index_page(self, response):self.crawl('http://www.example.org/list-1.html', callback=self.index_page)self.crawl('http://www.example.org/product-233', callback=self.detail_page)@config(age=10*24*60*60)
def detail_page(self, response):return {...}

age of list-1.html is 15min while the age of product-233.html is 10days. Because the callback of product-233.html is detail_page, means it’s a detail_page so it shares the config of detail_page.

Handler.crawl_config = {}

default parameters of self.crawl for the whole project. The parameters in crawl_config for scheduler (priority, retries, exetime, age, itag, force_update, auto_recrawl, cancel) will be joined when the task created, the parameters for fetcher and processor will be joined when executed. You can use this mechanism to change the fetch config (e.g. cookies) afterwards.
将一些配置放入其中,使其全局生效.

class Handler(BaseHandler):crawl_config = {'headers': {'User-Agent': 'GoogleBot',}}...

Response

Response.url

final URL.

Response.text

Content of response, in unicode.
返回网页源代码.
if Response.encoding is None and chardet module is available, encoding of content will be guessed.

Response.content

Content of response, in bytes.
返回网页源代码,二进制.

Response.doc

A PyQuery object of the response’s content. Links have made as absolute by default.
网页解析,调用 PyQuery的解析库.
Refer to the documentation of PyQuery: https://pythonhosted.org/pyquery/

It’s important that I will repeat, refer to the documentation of PyQuery: https://pythonhosted.org/pyquery/

Response.etree

A lxml object of the response’s content.
返回lxml对象

Response.json

The JSON-encoded content of the response, if any.
转换为Json格式.

Response.status_code

状态码:200,300等等.

Response.orig_url

If there is any redirection during the request, here is the url you just submit via self.crawl.
有重定向,就显示最原始的url.

Response.headers

A case insensitive dict holds the headers of response.

Response.cookies

Response.error

Messages when fetch error

Response.time

Time used during fetching.

Response.ok

True if status_code is 200 and no error.
判断请求是否OK.

Response.encoding

Encoding of Response.content.
用来指定编码
If Response.encoding is None, encoding will be guessed by header or content or chardet(if available).
Set encoding of content manually will overwrite the guessed encoding.

Response.save

The object saved by self.crawl API
指定不同函数直接传递参数.

Response.js_script_result

content returned by JS script
接受JS script的结果.

Response.raise_for_status()

Raise HTTPError if status code is not 200 or Response.error exists.
抛出一些错误.

self.send_message

部署过程中,消除队列的配置.

@every(minutes=0, seconds=0)

定时爬取中用的比较多.
method will been called every minutes or seconds

@every(minutes=24 * 60)
def on_start(self):for url in urllist:self.crawl(url, callback=self.index_page)

一天执行一次
The urls would be restarted every 24 hours. Note that, if age is also used and the period is longer then @every, the crawl request would be discarded as it’s regarded as not changed:

@every(minutes=24 * 60)
def on_start(self):self.crawl('http://www.example.org/', callback=self.index_page)@config(age=10 * 24 * 60 * 60)
def index_page(self):...

Even though the crawl request triggered every day, but it’s discard and only restarted every 10 days.

4 Frequently Asked Questions

Unreadable Code (乱码) Returned from Phantomjs

Phantomjs doesn’t support gzip, don’t set Accept-Encoding header with gzip.

How to Delete a Project?

set group to delete and status to STOP then wait 24 hours. You can change the time before a project deleted via
scheduler.DELETE_TIME.
status to STOP:
在这里插入图片描述
group to delete:
在这里插入图片描述

How to Restart a Project?

Why
It happens after you modified a script, and wants to crawl everything again with new strategy. But as the age of urls are not expired. Scheduler will discard all of the new requests.
Solution
1.Create a new project.
2.Using a itag within Handler.crawl_config to specify the version of your script.

What does the progress bar mean on the dashboard?

When mouse move onto the progress bar, you can see the explaintions.
For 5m, 1h, 1d the number are the events triggered in 5m, 1h, 1d. For all progress bar, they are the number of total tasks in correspond status.
Only the tasks in DEBUG/RUNNING status will show the progress.
在这里插入图片描述

相关文章:

爬虫入门到精通_框架篇14(PySpider架构概述及用法详解)

官方文档 Sample Code: from pyspider.libs.base_handler import *class Handler(BaseHandler):crawl_config {}# minutes24 * 60:每隔一天重新爬取every(minutes24 * 60)def on_start(self):self.crawl(http://scrapy.org/, callbackself.index_page)…...

WPF DataGrid常用属性

AlternationCount属性:表示有几行不同的颜色来回替换,如果设置2则表示有两个颜色交替循环 AutoGenerateColumns属性:是否生成列 CanUserAddRows属性:用户是否可以添加行 CanUserDeleteRows属性:用户是否可以删除行 …...

鸿蒙Harmony应用开发—ArkTS声明式开发(基础手势:Stepper)

步骤导航器组件,适用于引导用户按照步骤完成任务的导航场景。 说明: 该组件从API Version 8开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。 子组件 仅能包含子组件StepperItem。 接口 Stepper(value?: { index?…...

Python基础语法:基本数据类型(列表)

现实世界中总是存在一组一组的事物。"组"的概念作为基本数据类型的一种,它也是来源于我们去解决现实生活中的一些问题而产生的。它需要有“组”这样的一个数据类型来丰富我们的基本数据类型。 那么在Python中如何来表示“组”的概念呢? 在Py…...

神经网络线性量化方法简介

可点此跳转看全篇 目录 神经网络量化量化的必要性量化方法简介线性对称量化线性非对称量化方法神经网络量化 量化的必要性 NetworkModel size (MB)GFLOPSAlexNet2330.7VGG-1652815.5VGG-1954819.6ResNet-50983.9ResNet-1011707.6ResNet-15223011.3GoogleNet271.6InceptionV38…...

阿里云k8s内OSS报错UnKnownHost。

这个问题就是链接不上oss属于网络问题: 1.排查服务器 在服务器(ecs)上直接ping oss地址看是否能够通。 不通就要修改dns和hosts(这个不说,自己网上查) 2.排查容器 进去ping一下你的容器是否能访问到oss…...

nginx的使用,homebrew安装及使用nginx。

Nginx 是一个高性能的 HTTP 和反向代理服务器,它提供了诸如 IMAP、POP3 和 SMTP 等邮件代理服务。以下是 Nginx 的主要作用:12345 作为 Web 服务器。Nginx 能够以较少的系统资源提供高效率的服务,尤其在高并发连接下表现出色。1…...

计算机等级考试:信息安全技术 知识点六

1、P2DR模型是美国ISS公司提出的动态网络安全体系的代表模型,可用数学公式表达为Pt>DtRt,其中Pt表示:系统防护时间。 2、美国联邦政府颁布数字签名标准(Digital Signature Standard,DSS)的年份是1994 3、密码分析者(攻击者)已…...

vue provide 与 inject使用

在vue项目中,如果遇到跨组件多层次传值的话,一般会用到vuex,或者其他第三方共享状态管理模式,如pinia等,但是对于父组件与多层次孙子组件时,建议使用provide 与 inject,与之其他方式相比&#x…...

Vue3.0 所采用的 Composition Api 与 Vue2.x 使用的 Options Api 有什么不同?

开始之前 Composition API 可以说是Vue3的最大特点,那么为什么要推出Composition Api,解决了什么问题? 通常使用Vue2开发的项目,普遍会存在以下问题: 代码的可读性随着组件变大而变差每一种代码复用的方式&#xff…...

php集成修改数据库的字段

1.界面效果 2.代码 <?phpecho <form action"" method"post"><label for"table">表名:</label><input type"text" id"table" name"table"><br><div id"fieldsContaine…...

爬虫技术之正则提取静态页面数据

第一天 简单示例 在爬虫过程中&#xff0c;我们获取到了页面之后&#xff0c;通常需要做的就是解析数据&#xff0c;将数据持久化到数据库为我所用。如何又快又准确得提取有效数据&#xff1f;这是一门技术&#xff0c;看了我的博客之前可能略有难度&#xff0c;但各位大师看…...

字符串匹配算法:暴力匹配、KMP 算法、Boyer-Moore 算法、Rabin-Karp 算法

字符串匹配算法 字符串匹配算法是在一个字符串&#xff08;称为文本&#xff09;中查找另一个字符串&#xff08;称为模式&#xff09;出现的位置或者是否存在的算法。常见的字符串匹配算法包括暴力匹配、KMP算法、Boyer-Moore算法和Rabin-Karp算法。下面是对这些算法的简要介…...

微信小程序接入百度地图(微信小程序插件)使用文档

第一步配置域名 :在微信公众平台登录后配置服务域名称:https://apis.map.qq.com 第二步申请密钥 申请开发者密钥申请地址 第三步使用插件 选择添加插件 搜索腾讯位置服务地图选点 选择要授权的小程序 授权完毕会在这里显示插件信息 第四步查看使用文档 跳转至文…...

如果需要在Log4j中记录特定的异常信息,应该如何实现?如何动态地更改Log4j的日志级别?

如果需要在Log4j中记录特定的异常信息&#xff0c;应该如何实现&#xff1f; 在Log4j中记录特定的异常信息&#xff0c;你可以使用Logger类的error、warn、info等方法&#xff0c;这些方法通常接受一个字符串消息和一个Throwable对象&#xff08;如异常&#xff09;作为参数。下…...

Rust入门:C++和Rust动态库(dll)的相互调用

无论是C调用Rust动态库还是Rust调用C动态库&#xff0c;其操作基本都是一样地简单&#xff0c;基本和C调用C的动态库没什么区别&#xff0c;只需要列出所需要导入的函数&#xff0c;并链接到相应的lib文件即可。 这里&#xff0c;在windows中&#xff0c;我们以dll动态库为例说…...

第三篇【传奇开心果系列】Python的自动化办公库技术点案例示例:深度解读Pandas股票市场数据分析

传奇开心果博文系列 系列博文目录Python的自动化办公库技术点案例示例系列 博文目录前言一、Pandas进行股票市场数据分析常见步骤和示例代码1. 加载数据2. 数据清洗和准备3. 分析股票价格和交易量4. 财务数据分析 二、扩展思路介绍1. 技术指标分析2. 波动性分析3. 相关性分析4.…...

3.11笔记2

目前使用的格里高利历闰年的规则如下&#xff1a; 公元年分非4的倍数&#xff0c;为平年。公元年分为4的倍数但非100的倍数&#xff0c;为闰年。公元年分为100的倍数但非400的倍数&#xff0c;为平年。公元年分为400的倍数为闰年。 请用一个表达式 (不能添加括号) 判断某一年…...

web服务器基础

目录 web服务器简介 (1)什么是www (2)网址及HTTP简介 (3)http协议请求的工作流程 主配置文件内的参数 目录标签 缺点 虚拟主机vhosts 示例的格式如下 实例 多IP实现多网页 修改监听端口号 hosts文件及域名解析 修改hosts文件内缓存格式 实现效果 实现多域名解析IP地址 在linux…...

矢量图片转换软件Vector Magic mac中文版功能特色

Vector Magic mac中文版是一款非常流行的矢量图片转换软件&#xff0c;它的功能特色主要体现在以下几个方面&#xff1a; 首先&#xff0c;Vector Magic mac中文版拥有出色的矢量转换能力。它采用世界上最好的全彩色自动描摹器&#xff0c;能够将JPG、PNG、BMP和GIF等位图图像…...

[特殊字符] 智能合约中的数据是如何在区块链中保持一致的?

&#x1f9e0; 智能合约中的数据是如何在区块链中保持一致的&#xff1f; 为什么所有区块链节点都能得出相同结果&#xff1f;合约调用这么复杂&#xff0c;状态真能保持一致吗&#xff1f;本篇带你从底层视角理解“状态一致性”的真相。 一、智能合约的数据存储在哪里&#xf…...

【Linux】C语言执行shell指令

在C语言中执行Shell指令 在C语言中&#xff0c;有几种方法可以执行Shell指令&#xff1a; 1. 使用system()函数 这是最简单的方法&#xff0c;包含在stdlib.h头文件中&#xff1a; #include <stdlib.h>int main() {system("ls -l"); // 执行ls -l命令retu…...

安宝特方案丨XRSOP人员作业标准化管理平台:AR智慧点检验收套件

在选煤厂、化工厂、钢铁厂等过程生产型企业&#xff0c;其生产设备的运行效率和非计划停机对工业制造效益有较大影响。 随着企业自动化和智能化建设的推进&#xff0c;需提前预防假检、错检、漏检&#xff0c;推动智慧生产运维系统数据的流动和现场赋能应用。同时&#xff0c;…...

抖音增长新引擎:品融电商,一站式全案代运营领跑者

抖音增长新引擎&#xff1a;品融电商&#xff0c;一站式全案代运营领跑者 在抖音这个日活超7亿的流量汪洋中&#xff0c;品牌如何破浪前行&#xff1f;自建团队成本高、效果难控&#xff1b;碎片化运营又难成合力——这正是许多企业面临的增长困局。品融电商以「抖音全案代运营…...

家政维修平台实战20:权限设计

目录 1 获取工人信息2 搭建工人入口3 权限判断总结 目前我们已经搭建好了基础的用户体系&#xff0c;主要是分成几个表&#xff0c;用户表我们是记录用户的基础信息&#xff0c;包括手机、昵称、头像。而工人和员工各有各的表。那么就有一个问题&#xff0c;不同的角色&#xf…...

JDK 17 新特性

#JDK 17 新特性 /**************** 文本块 *****************/ python/scala中早就支持&#xff0c;不稀奇 String json “”" { “name”: “Java”, “version”: 17 } “”"; /**************** Switch 语句 -> 表达式 *****************/ 挺好的&#xff…...

浅谈不同二分算法的查找情况

二分算法原理比较简单&#xff0c;但是实际的算法模板却有很多&#xff0c;这一切都源于二分查找问题中的复杂情况和二分算法的边界处理&#xff0c;以下是博主对一些二分算法查找的情况分析。 需要说明的是&#xff0c;以下二分算法都是基于有序序列为升序有序的情况&#xf…...

【C++从零实现Json-Rpc框架】第六弹 —— 服务端模块划分

一、项目背景回顾 前五弹完成了Json-Rpc协议解析、请求处理、客户端调用等基础模块搭建。 本弹重点聚焦于服务端的模块划分与架构设计&#xff0c;提升代码结构的可维护性与扩展性。 二、服务端模块设计目标 高内聚低耦合&#xff1a;各模块职责清晰&#xff0c;便于独立开发…...

Pinocchio 库详解及其在足式机器人上的应用

Pinocchio 库详解及其在足式机器人上的应用 Pinocchio (Pinocchio is not only a nose) 是一个开源的 C 库&#xff0c;专门用于快速计算机器人模型的正向运动学、逆向运动学、雅可比矩阵、动力学和动力学导数。它主要关注效率和准确性&#xff0c;并提供了一个通用的框架&…...

[免费]微信小程序问卷调查系统(SpringBoot后端+Vue管理端)【论文+源码+SQL脚本】

大家好&#xff0c;我是java1234_小锋老师&#xff0c;看到一个不错的微信小程序问卷调查系统(SpringBoot后端Vue管理端)【论文源码SQL脚本】&#xff0c;分享下哈。 项目视频演示 【免费】微信小程序问卷调查系统(SpringBoot后端Vue管理端) Java毕业设计_哔哩哔哩_bilibili 项…...