nginx基础组件的使用

文章目录

  • 一、Nginx 的相关组件介绍
    • 1.1、ngx_palloc相关源码
    • 1.2、ngx_array组件的相关源码
    • 1.3、ngx_array的数据结构
    • 1.4、ngx_cycle简介和相关源码
    • 1.5、ngx_list相关源码
    • 1.6、ngx_list 的数据结构
  • 二、Nginx 组件的使用
    • 2.1、makefile的编写
    • 2.2、ngx_palloc+ngx_array的使用
    • 2.3、ngx_palloc+ngx_list的使用
  • 总结

一、Nginx 的相关组件介绍

Nginx自己实现了一个内存池组件。Nginx作为服务器,当客户端 TCP连接 &HTTP请求 到来时,Nginx会为该连接创建一个专属的内存池;这个内存池的生命周期是连接建立时创建,连接断开时销毁。客户端和Nginx通信的所有数据和操作(HTTP协议解析、HTTP数据解析等)都在内存池中完成。

1.1、ngx_palloc相关源码

/src/core/ngx_palloc.h。(相关实现在/src/core/ngx_palloc.c文件)


#ifndef _NGX_PALLOC_H_INCLUDED_
#define _NGX_PALLOC_H_INCLUDED_


#include <ngx_config.h>
#include <ngx_core.h>


/*
 * NGX_MAX_ALLOC_FROM_POOL should be (ngx_pagesize - 1), i.e. 4095 on x86.
 * On Windows NT it decreases a number of locked pages in a kernel.
 */
#define NGX_MAX_ALLOC_FROM_POOL  (ngx_pagesize - 1)

#define NGX_DEFAULT_POOL_SIZE    (16 * 1024)

#define NGX_POOL_ALIGNMENT       16
#define NGX_MIN_POOL_SIZE                                                     \
    ngx_align((sizeof(ngx_pool_t) + 2 * sizeof(ngx_pool_large_t)),            \
              NGX_POOL_ALIGNMENT)


typedef void (*ngx_pool_cleanup_pt)(void *data);

typedef struct ngx_pool_cleanup_s  ngx_pool_cleanup_t;

struct ngx_pool_cleanup_s {
    ngx_pool_cleanup_pt   handler;
    void                 *data;
    ngx_pool_cleanup_t   *next;
};


typedef struct ngx_pool_large_s  ngx_pool_large_t;

struct ngx_pool_large_s {
    ngx_pool_large_t     *next;
    void                 *alloc;
};


typedef struct {
    u_char               *last;
    u_char               *end;
    ngx_pool_t           *next;
    ngx_uint_t            failed;
} ngx_pool_data_t;


struct ngx_pool_s {
    ngx_pool_data_t       d;
    size_t                max;
    ngx_pool_t           *current;
    ngx_chain_t          *chain;
    ngx_pool_large_t     *large;
    ngx_pool_cleanup_t   *cleanup;
    ngx_log_t            *log;
};


typedef struct {
    ngx_fd_t              fd;
    u_char               *name;
    ngx_log_t            *log;
} ngx_pool_cleanup_file_t;


ngx_pool_t *ngx_create_pool(size_t size, ngx_log_t *log);
void ngx_destroy_pool(ngx_pool_t *pool);
void ngx_reset_pool(ngx_pool_t *pool);

void *ngx_palloc(ngx_pool_t *pool, size_t size);
void *ngx_pnalloc(ngx_pool_t *pool, size_t size);
void *ngx_pcalloc(ngx_pool_t *pool, size_t size);
void *ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment);
ngx_int_t ngx_pfree(ngx_pool_t *pool, void *p);


ngx_pool_cleanup_t *ngx_pool_cleanup_add(ngx_pool_t *p, size_t size);
void ngx_pool_run_cleanup_file(ngx_pool_t *p, ngx_fd_t fd);
void ngx_pool_cleanup_file(void *data);
void ngx_pool_delete_file(void *data);


#endif /* _NGX_PALLOC_H_INCLUDED_ */

/src/core/ngx_palloc.c

void *
ngx_array_push(ngx_array_t *a)
{
    void        *elt, *new;
    size_t       size;
    ngx_pool_t  *p;

    if (a->nelts == a->nalloc) {

        /* the array is full */

        size = a->size * a->nalloc;

        p = a->pool;

        if ((u_char *) a->elts + size == p->d.last
            && p->d.last + a->size <= p->d.end)
        {
            /*
             * the array allocation is the last in the pool
             * and there is space for new allocation
             */

            p->d.last += a->size;
            a->nalloc++;

        } else {
            /* allocate a new array */

            new = ngx_palloc(p, 2 * size);
            if (new == NULL) {
                return NULL;
            }

            ngx_memcpy(new, a->elts, size);
            a->elts = new;
            a->nalloc *= 2;
        }
    }

    elt = (u_char *) a->elts + a->size * a->nelts;
    a->nelts++;

    return elt;
}

/src/core/ngx_core.h

// ...
typedef struct ngx_pool_s            ngx_pool_t;
// ...

1.2、ngx_array组件的相关源码

/src/core/ngx_array.h


/*
 * Copyright (C) Igor Sysoev
 * Copyright (C) Nginx, Inc.
 */


#ifndef _NGX_ARRAY_H_INCLUDED_
#define _NGX_ARRAY_H_INCLUDED_


#include <ngx_config.h>
#include <ngx_core.h>


typedef struct {
    void        *elts;
    ngx_uint_t   nelts;
    size_t       size;
    ngx_uint_t   nalloc;
    ngx_pool_t  *pool;
} ngx_array_t;


ngx_array_t *ngx_array_create(ngx_pool_t *p, ngx_uint_t n, size_t size);
void ngx_array_destroy(ngx_array_t *a);
void *ngx_array_push(ngx_array_t *a);
void *ngx_array_push_n(ngx_array_t *a, ngx_uint_t n);


static ngx_inline ngx_int_t
ngx_array_init(ngx_array_t *array, ngx_pool_t *pool, ngx_uint_t n, size_t size)
{
    /*
     * set "array->nelts" before "array->elts", otherwise MSVC thinks
     * that "array->nelts" may be used without having been initialized
     */

    array->nelts = 0;
    array->size = size;
    array->nalloc = n;
    array->pool = pool;

    array->elts = ngx_palloc(pool, n * size);
    if (array->elts == NULL) {
        return NGX_ERROR;
    }

    return NGX_OK;
}


#endif /* _NGX_ARRAY_H_INCLUDED_ */

1.3、ngx_array的数据结构

typedef struct {
    void        *elts;
    ngx_uint_t   nelts;
    size_t       size;
    ngx_uint_t   nalloc;
    ngx_pool_t  *pool;
} ngx_array_t;

elts:指向内存数据的指针。
nelts:指示已使用了多少个元素。
size:数组元素的大小。
nalloc:分配的元素数量。
pool:内存池。

array在内存里的布局:
在这里插入图片描述

1.4、ngx_cycle简介和相关源码

Nginx的每个进程内部都有一个自己的ngx_cycle。

/src/core/ngx_cycle.h


#ifndef _NGX_CYCLE_H_INCLUDED_
#define _NGX_CYCLE_H_INCLUDED_


#include <ngx_config.h>
#include <ngx_core.h>


#ifndef NGX_CYCLE_POOL_SIZE
#define NGX_CYCLE_POOL_SIZE     NGX_DEFAULT_POOL_SIZE
#endif


#define NGX_DEBUG_POINTS_STOP   1
#define NGX_DEBUG_POINTS_ABORT  2


typedef struct ngx_shm_zone_s  ngx_shm_zone_t;

typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone, void *data);

struct ngx_shm_zone_s {
    void                     *data;
    ngx_shm_t                 shm;
    ngx_shm_zone_init_pt      init;
    void                     *tag;
    ngx_uint_t                noreuse;  /* unsigned  noreuse:1; */
};


struct ngx_cycle_s {
    // ...
};


typedef struct {
    // ...
} ngx_core_conf_t;


#define ngx_is_init_cycle(cycle)  (cycle->conf_ctx == NULL)


ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle);
ngx_int_t ngx_create_pidfile(ngx_str_t *name, ngx_log_t *log);
void ngx_delete_pidfile(ngx_cycle_t *cycle);
ngx_int_t ngx_signal_process(ngx_cycle_t *cycle, char *sig);
void ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user);
char **ngx_set_environment(ngx_cycle_t *cycle, ngx_uint_t *last);
ngx_pid_t ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv);
ngx_cpuset_t *ngx_get_cpu_affinity(ngx_uint_t n);
ngx_shm_zone_t *ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name,
    size_t size, void *tag);
void ngx_set_shutdown_timer(ngx_cycle_t *cycle);


extern volatile ngx_cycle_t  *ngx_cycle;
extern ngx_array_t            ngx_old_cycles;
extern ngx_module_t           ngx_core_module;
extern ngx_uint_t             ngx_test_config;
extern ngx_uint_t             ngx_dump_config;
extern ngx_uint_t             ngx_quiet_mode;


#endif /* _NGX_CYCLE_H_INCLUDED_ */

1.5、ngx_list相关源码

/src/core/ngx_list.h


#ifndef _NGX_LIST_H_INCLUDED_
#define _NGX_LIST_H_INCLUDED_


#include <ngx_config.h>
#include <ngx_core.h>


typedef struct ngx_list_part_s  ngx_list_part_t;

struct ngx_list_part_s {
    void             *elts;
    ngx_uint_t        nelts;
    ngx_list_part_t  *next;
};


typedef struct {
    ngx_list_part_t  *last;
    ngx_list_part_t   part;
    size_t            size;
    ngx_uint_t        nalloc;
    ngx_pool_t       *pool;
} ngx_list_t;


ngx_list_t *ngx_list_create(ngx_pool_t *pool, ngx_uint_t n, size_t size);

static ngx_inline ngx_int_t
ngx_list_init(ngx_list_t *list, ngx_pool_t *pool, ngx_uint_t n, size_t size)
{
    list->part.elts = ngx_palloc(pool, n * size);
    if (list->part.elts == NULL) {
        return NGX_ERROR;
    }

    list->part.nelts = 0;
    list->part.next = NULL;
    list->last = &list->part;
    list->size = size;
    list->nalloc = n;
    list->pool = pool;

    return NGX_OK;
}


/*
 *
 *  the iteration through the list:
 *
 *  part = &list.part;
 *  data = part->elts;
 *
 *  for (i = 0 ;; i++) {
 *
 *      if (i >= part->nelts) {
 *          if (part->next == NULL) {
 *              break;
 *          }
 *
 *          part = part->next;
 *          data = part->elts;
 *          i = 0;
 *      }
 *
 *      ...  data[i] ...
 *
 *  }
 */


void *ngx_list_push(ngx_list_t *list);


#endif /* _NGX_LIST_H_INCLUDED_ */

1.6、ngx_list 的数据结构

typedef struct ngx_list_part_s  ngx_list_part_t;

struct ngx_list_part_s {
    void             *elts;
    ngx_uint_t        nelts;
    ngx_list_part_t  *next;
};


typedef struct {
    ngx_list_part_t  *last;
    ngx_list_part_t   part;
    size_t            size;
    ngx_uint_t        nalloc;
    ngx_pool_t       *pool;
} ngx_list_t;

elts:指向内存数据的指针。
nelts:指示已使用了多少个元素。
size:数组元素的大小。
nalloc:分配的元素数量。
pool:内存池。

list 在内存里的布局:
在这里插入图片描述

二、Nginx 组件的使用

Nginx的内存池分成大小块,小块是要么不释放要么全部释放。ngx_create_pool(size_t size, ngx_log_t *log)里的size就是用来区分大小块的,大于size的就是大块,否则就是小块。

2.1、makefile的编写

CXX = gcc
CXXFLAGS += -g -Wall -Wextra

NGX_ROOT = /home/fly/workspace/nginx-1.13.7

TARGETS = ngx_code
TARGETS_C_FILE = $(TARGETS).c

CLEANUP = rm -f $(TARGETS) *.o

all: $(TARGETS)

clean:
	$(CLEANUP)

CORE_INCS = -I. \
	-I$(NGX_ROOT)/src/core \
	-I$(NGX_ROOT)/src/event \
	-I$(NGX_ROOT)/src/event/modules \
	-I$(NGX_ROOT)/src/os/unix \
	-I$(NGX_ROOT)/objs \
	-I$(NGX_ROOT)/../pcre-8.41 \
	-I$(NGX_ROOT)/../openssl-1.1.0g/include/ \

NGX_PALLOC = $(NGX_ROOT)/objs/src/core/ngx_palloc.o
NGX_STRING = $(NGX_ROOT)/objs/src/core/ngx_string.o
NGX_ALLOC = $(NGX_ROOT)/objs/src/os/unix/ngx_alloc.o
NGX_ARRAY = $(NGX_ROOT)/objs/src/core/ngx_array.o
NGX_HASH = $(NGX_ROOT)/objs/src/core/ngx_hash.o
NGX_LIST = $(NGX_ROOT)/objs/src/core/ngx_list.o
NGX_QUEUE = $(NGX_ROOT)/objs/src/core/ngx_queue.o


$(TARGETS): $(TARGETS_C_FILE)
	$(CXX) $(CXXFLAGS) $(CORE_INCS) $(NGX_PALLOC) $(NGX_STRING)
	 $(NGX_ALLOC) $(NGX_ARRAY) $(NGX_LIST) $(NGX_QUEUE)  $(NGX_HASH) $^ -o $@

注意nginx的源码路径以及所需库的路径,要写正确的。

2.2、ngx_palloc+ngx_array的使用

#include <stdio.h>

#include "ngx_config.h"
#include "ngx_conf_file.h"
#include "nginx.h"
#include "ngx_core.h"
#include "ngx_string.h"
#include "ngx_palloc.h"
#include "ngx_array.h"
//#include "ngx_hash.h"

typedef struct {
	int id;
	int level;
}ngx_fly_t;

// 打印内存池的数据信息
void print_pool(ngx_pool_t *pool)
{
	while (pool)
	{
		printf("avail pool memory size: %ld\n\n",
			pool->d.end - pool->d.last);
		pool=pool->d.next;
	}
}


volatile ngx_cycle_t *ngx_cycle;

#define unused(x)	(x)=(x)
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
	const char *fmt, ...)
{
	unused(level);
	unused(log);
	unused(err);
	unused(fmt);
}


int main()
{
	ngx_str_t str = ngx_string("Hello World!");

	printf("string length: %ld\n", str.len);
	printf("string: %s\n", str.data);

	// 创建内存池
	ngx_pool_t *pool;

	pool = ngx_create_pool(1024, NULL);

	print_pool(pool);

	// 创建数组
	/*
	* nalloc = 32
	* size = sizeof(ngx_fly_t)
	* pool = pool
	*/
	ngx_array_t *arr = ngx_array_create(pool, 32, sizeof(ngx_fly_t));
	print_pool(pool);
	ngx_fly_t *t1 = ngx_array_push(arr); // 拿出内存
	t1->id = 101;  //赋值
	t1->level = 1; //赋值
	print_pool(pool);
	ngx_fly_t *t2 = ngx_array_push(arr); // 拿出内存
	t2->id = 102;  //赋值
	t2->level = 3; //赋值
	print_pool(pool);
	return 0;
}

使用makefile来编译,执行结果:

$ ./ngx_code

string length: 12
string: Hello World!
avail pool memory size: 944

avail pool memory size: 648

avail pool memory size: 648

avail pool memory size: 648

可以看到:

  1. 代码中分配的内存池是1024,分配之后只有944可以用,有80字节被使用了。这80字节其实是被内存池的头占用了(ngx_pool_t)。
  2. 分配完一个32的数组后,内存池还剩余的内存为648,也就是32*8=256被分配给了数据。
  3. 数组内存分配好之后,使用数组元素已经不会再去申请内存池的内存。
  4. 如果数组元素用完了,还调用ngx_array_push会怎么样?从ngx_array.c的源码中可以发现,它会动态扩容数组,重新分配2*size。

2.3、ngx_palloc+ngx_list的使用

#include <stdio.h>

#include "ngx_config.h"
#include "ngx_conf_file.h"
#include "nginx.h"
#include "ngx_core.h"
#include "ngx_string.h"
#include "ngx_palloc.h"
#include "ngx_array.h"
//#include "ngx_hash.h"

typedef struct {
	int id;
	int level;
}ngx_fly_t;

// 打印内存池的数据信息
void print_pool(ngx_pool_t *pool)
{
	while (pool)
	{
		printf("avail pool memory size: %ld\n\n",
			pool->d.end - pool->d.last);
		pool=pool->d.next;
	}
}


volatile ngx_cycle_t *ngx_cycle;

#define unused(x)	(x)=(x)
void ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,
	const char *fmt, ...)
{
	unused(level);
	unused(log);
	unused(err);
	unused(fmt);
}


int main()
{
	ngx_str_t str = ngx_string("Hello World!");

	printf("string length: %ld\n", str.len);
	printf("string: %s\n", str.data);

	// 创建内存池
	ngx_pool_t *pool;

	pool = ngx_create_pool(1024, NULL);

	print_pool(pool);

	ngx_list_t *list=ngx_list_create(pool, 32, sizeof(ngx_fly_t));

	print_pool(pool);

	ngx_fly_t *t3 = ngx_list_push(list); // 拿出内存
	t3->id = 103;  //赋值
	t3->level = 3; //赋值
	print_pool(pool);
	ngx_fly_t *t4 = ngx_list_push(list); // 拿出内存
	t4->id = 104;  //赋值
	t4->level = 4; //赋值
	print_pool(pool);

	return 0;
}

使用makefile来编译,执行结果:

$ ./ngx_code

string length: 12
string: Hello World!
avail pool memory size: 944

avail pool memory size: 632

avail pool memory size: 632

avail pool memory size: 632

可以发现,ngx_list相比ngx_array少了(648 − 632 = 16)字节,从源码的ngx_list_create()函数可以发现,是因为多了一个ngx_list_t的头数据。

总结

这里对ngx_string、ngx_array、ngx_list做了简单介绍和提供使用示例,其他的nginx基础组件的使用(比如dequeue、hash、log等等)也是类似的。

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【代码随想录】刷题笔记Day33

前言 Day33虽说是一个月&#xff0c;但是从第一篇开始实际上已经过了8个月了&#xff0c;得抓紧啊 46. 全排列 - 力扣&#xff08;LeetCode&#xff09; 前面组合就强调过差别了&#xff0c;这道题是排序&#xff0c;因此每次要从头到尾扫&#xff0c;结合used数组 class So…

ky10 server aarch64 离线安装openssl3.1.4

离线程序 https://gitcode.net/zengliguang/ky10_aarch64_openssl_install.git 输入下面命令执行离线安装脚本 source openssl_offline_install.sh 安装完成

对比学习15篇顶会论文及代码合集,2023最新

对比学习&#xff08;contrastive learning&#xff09;是现在无监督学习中一种常用的学习机制&#xff0c;它可以在没有标签的数据上进行学习&#xff0c;避免依赖大量标签数据&#xff0c;从而帮助我们更好地理解和利用数据集中的信息&#xff0c;提高模型的性能和表现。 作…

做医疗影像心脏方面的看过来:医学图像重建的心脏 MRI 数据集

本文发布了CMRxRecon数据集&#xff0c;包括来自 300 名受试者的多对比度、多视图、多切片和多通道 CMR 成像数据&#xff0c;还由经验丰富的放射科医生提供了所有受试者的心肌和心室的手动分割。单位&#xff1a;复旦, 香港理工大学, 厦大等 心脏磁共振成像&#xff08;CMR&a…

线程池有几种创建方式?

程序员的公众号&#xff1a;源1024&#xff0c;获取更多资料&#xff0c;无加密无套路&#xff01; 最近整理了一波电子书籍资料&#xff0c;包含《Effective Java中文版 第2版》《深入JAVA虚拟机》&#xff0c;《重构改善既有代码设计》&#xff0c;《MySQL高性能-第3版》&…

【开源】基于微信小程序的音乐平台

项目编号&#xff1a; S 055 &#xff0c;文末获取源码。 \color{red}{项目编号&#xff1a;S055&#xff0c;文末获取源码。} 项目编号&#xff1a;S055&#xff0c;文末获取源码。 目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块三、系统展示 四、核心代码4.1 查询单首…

(02)vite环境变量配置

文章目录 将开发环境和生产环境区分开环境变量vite处理环境变量loadEnv 业务代码需要使用环境变量.env.env.development.env.test修改VITE_前缀 将开发环境和生产环境区分开 分别创建三个vite 的配置文件&#xff0c;并将它们引入vite.config.js vite.base.config.js import…

【OpenGauss源码学习 —— 列存储(ColumnTableSample)】

执行算子&#xff08;ColumnTableSample&#xff09; 概述ColumnTableSample 类ColumnTableSample::ColumnTableSample 构造函数ColumnTableSample::~ColumnTableSample 析构函数ExecCStoreScan 函数ColumnTableSample::scanVecSample 函数ColumnTableSample::getMaxOffset 函数…

「Qt Widget中文示例指南」如何创建一个计算器?(一)

Qt 是目前最先进、最完整的跨平台C开发工具。它不仅完全实现了一次编写&#xff0c;所有平台无差别运行&#xff0c;更提供了几乎所有开发过程中需要用到的工具。如今&#xff0c;Qt已被运用于超过70个行业、数千家企业&#xff0c;支持数百万设备及应用。 本文将展示如何使用…

快速幂极简写法快速幂求逆元

快速幂原理介绍 快速幂模板 int qmi(int a, int k, int p) {int res 1;while (k) {//后面的a其实是底数与其指数的运算结果了&#xff0c;是不断迭代的//第一个a其实就是a的2的0次方if (k & 1) res (res * a) % p;a (a * a) % p;//注意&#xff0c;a是一个不断变化的过…

聊一聊Linux动态链接和GOT、PLT

共享动态库是现代系统的一个重要组成部分&#xff0c;大家肯定都不陌生&#xff0c;但是通常对背后的一些细节上的实现机制了解得不够深入。当然&#xff0c;网上有很多关于这方面的文章。希望这篇文章能够以一种与其他文章不同的角度呈现&#xff0c;可以对你产生一点启发。 …

【开源】基于Vue和SpringBoot的服装店库存管理系统

项目编号&#xff1a; S 052 &#xff0c;文末获取源码。 \color{red}{项目编号&#xff1a;S052&#xff0c;文末获取源码。} 项目编号&#xff1a;S052&#xff0c;文末获取源码。 目录 一、摘要1.1 项目介绍1.2 项目录屏 二、功能模块2.1 数据中心模块2.2 角色管理模块2.3 服…

什么是Jmeter ?Jmeter使用的原理步骤是什么?

1.1 什么是 JMeter Apache JMeter 是 Apache 组织开发的基于 Java 的压力测试工具。用于对软件做压力测试&#xff0c;它最初被设计用于 Web 应用测试&#xff0c;但后来扩展到其他测试领域。 它可以用于测试静态和动态资源&#xff0c;例如静态文件、Java 小服务程序、CGI 脚本…

Continuity” of stochastic integral wrt Brownian motion

See https://imathworks.com/math/math-continuity-of-stochastic-integral-wrt-brownian-motion/

5.基于飞蛾扑火算法(MFO)优化的VMD参数(MFO-VMD)

代码的使用说明 基于飞蛾扑火算法优化的VMD参数 优化算法代码原理 飞蛾扑火优化算法&#xff08;Moth-Flame Optimization&#xff0c;MFO&#xff09;是一种新型元启发式优化算法&#xff0c;该算法是受飞蛾围绕火焰飞行启发而提出的&#xff0c;具有搜索速度快、寻优能力强的…

梯度引导的分子生成扩散模型- GaUDI 评测

GaUDI模型来自于以色列理工Tomer Weiss的2023年发表在预印本ChemRxiv上的工作 《Guided Diffusion for Inverse Molecular Design》。原文链接&#xff1a;Guided Diffusion for Inverse Molecular Design | Materials Chemistry | ChemRxiv | Cambridge Open Engage GaUDI模型…

LeSS敏捷框架高效生产力实践

每个团队可能都有一套适合自己的敏捷方法&#xff0c;本文介绍了ResponseTap工程团队通过采用LeSS框架、引入准备周&#xff0c;从而提升迭代冲刺研发效能的实践。原文: LeSS Agile, More Productive — Part 1: Pain[1], LeSS Agile, More Productive — Part 2: Promise, LeS…

开源的进销存系统都有哪些?

开源的进销存系统有很多&#xff0c;以下是其中一些比较流行的: OpenERP&#xff1a;一个集成了多个业务功能的开源ERP软件&#xff0c;可以实现进销存管理&#xff0c;会计&#xff0c;仓库管理&#xff0c;销售管理等业务功能。 Odoo&#xff1a;是OpenERP的一个分支&#x…

【智能优化算法】从蚁群到动物园

目录 引言蚁群优化算法&#xff08;ACO&#xff09;ACO 机理ACO 模型描述ACO 移动策略 粒子群优化算法&#xff08;PSO&#xff09;PSO 机理PSO 模型描述 萤火虫群优化算法&#xff08;GSO&#xff09;GSO 机理GSO 模型描述 群智能优化算法 引言 21世纪&#xff0c;人类社会已经…