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

Opensips安装配置(以下操作均已centOS 6.3系统为准)

1.      安装依赖软件:

a)        Yum update //更新系统到最新

b)        安装以下所需依赖软件
gcc
bison
flex
make
openssl
libmysqlclient-dev
mysql-server

c)        安装radiusclient:

1.        wget  http://pkgs.repoforge.org/radiusclient-ng/radiusclient-ng-0.5.6-5.el6.rf.x86_64.rpm

2.        rpm -ivfradiusclient-ng-0.5.6-5.el6.rf.x86_64.rpm

3.        wget  http://pkgs.repoforge.org/radiusclient-ng/radiusclient-ng-devel-0.5.6-5.el6.rf.x86_64.rpm

4.        rpm -ivfradiusclient-ng-devel-0.5.6-5.el6.rf.x86_64.rpm

5.        wget  http://pkgs.repoforge.org/radiusclient-ng/radiusclient-ng-utils-0.5.6-5.el6.rf.x86_64.rpm

6.        rpm -ivfradiusclient-ng-utils-0.5.6-5.el6.rf.x86_64.rpm

d)        安装xmlrpc3-
yum –y install *xmlrpc3*

e)        安装perl:

1.        yum install *perl*MySQL*

2.        yum install *perl*Front*

3.        yum install *perl*Read*

f)         安装start-stop-daemon

1.        wget  http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz

2.        tar zxf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz

3.        mvapps/sys-utils/start-stop-daemon-IR1_9_18-2/ ./

4.        rm -rf apps

5.        cdstart-stop-daemon-IR1_9_18-2/

6.        cc start-stop-daemon.c -ostart-stop-daemon

7.        cp start-stop-daemon /usr/bin/start-stop-daemon

2.      安装opensips

a)        cd /usr/src

b)        下载opensips源码:
wget http://opensips.org/pub/opensips/1.6.0/src/opensips-1.6.0-tls_src.tar.gz

c)        解压缩源码:
tar -xf opensips-1.6.0-tls_src.tar.gz

d)        cd opensips-1.6.0-tls

e)        编译并安装:
make prefix=/ all include_modules="db_mysql aaa_radius"
make prefix=/ install include_modules="db_mysql aaa_radius"

f)         创建运行目录
mkdir /var/run/opensips

3.      配置系统运行环境

a)        添加opensips运行文件到linux启动项

                                      i.             cd/usr/src/opensips-1.6.0-tls/packaging/debian

                                    ii.             cp opensips.default/etc/default/opensips

                                   iii.             cp opensips.init /etc/init.d/opensips

b)        修改/etc/opensips/opensips.cfg

                                      i.             vim /etc/opensips/opensips.cfg

                                    ii.             删掉fork=no行,即便有注释也删掉

c)        赋予opensips.init文件正确权限

                                      i.             cd /etc/init.d

                                    ii.             chmod 755 opensips

d)        编辑/etc/default/opensips

                                      i.             vim /etc/default/opensips

                                    ii.             修改如下(红色字体):
# Set to yes to enable opensips, once configured properly.
RUN_OPENSIPS=yes
# User to run as
USER=root
# Group to run as
GROUP=root
# Amount of memory to allocate for the running OpenSIPS server (in Mb)
MEMORY=128

e)        编辑/etc/init.d/opensips,配置正确的opensips路径

                                      i.             vim /etc/init.d/opensips

                                    ii.             修改如下(红色字体)
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/sbin/opensips
NAME=opensips
DESC=opensips
HOMEDIR=/var/run/opensips
PIDFILE=$HOMEDIR/$NAME.pid

4.      独立Log文件

a)        修改/etc/rsyslog.conf

                                      i.             vim /etc/rsyslog.conf

                                    ii.             在文件最后添加一条:
local0.*                                               /var/log/opensips.log

b)        重启rsyslog服务:
service rsyslog restart

5.      启动opensips

a)        启动opensips服务:
/etc/init.d/opensips start|stop|restart

6.      配置mysql认证支持

a)        确认db_mysql.so正常存在
ls /lib/opensips/modules/db_mysql.so

b)        修改/etc/opensips/opensipsctlrc文件,去掉如下内容的注释:
SIp_DoMAIN=115.28.38.216
DBENGINE=MYSQL
DBHoST=localhost
DBNAME=opensips
DBRWUSER=opensips
DBRWpW="opensipsrw"
DBRoUSER=opensipsro
DBRopW=opensipsro
ALIASES_TYPE="DB"
oSIpS_FIFo="/tmp/opensips_fifo"

c)        创建opensips的数据库
opensipsdbctl create
输入如下(注意红色字,一律选y):
Opensips:~# opensipsdbctl create
MySqL password for root:
INFO: test server charset
INFO: creating database opensips ...
INFO: Core Opensips tables successfully created.
Install presence related tables?(y/n): y
INFO: creatingpresence tables into opensips ...
INFO: Presence tables successfully created.
Install tables for imc cpl siptracedomainpolicy carrierroute? (y/n): y

d)        编辑/etc/opensips/opensips.cfg
修改如下(去掉如下代码的注释)
#loadmodule "db_mysql.so"
#loadmodule "auth.so"
#loadmodule "auth_db.so"
#modparam("usrloc", "db_mode", 2)
#modparam("usrloc", "db_url",
# "mysql://opensips:opensipsrw@localhost/opensips")
#modparam("auth_db", "calculate_ha1", yes)
#modparam("auth_db", "password_column","password")
#modparam("auth_db", "db_url",
# "mysql://opensips:opensipsrw@localhost/opensips")
#modparam("auth_db", "load_credentials", "")
##if (!(method=="REGISTER") && from_uri==myself) /*nomultidomain version*/
##{
## if (!proxy_authorize("", "subscriber")) {
## proxy_challenge("", "0");
## exit;
## }
## if (!db_check_from()) {
## sl_send_reply("403","Forbidden auth ID");
## exit;
## }
##
## consume_credentials();
## # caller authenticated
##}
#authenticate the REGISTER requests
(uncomment to enable auth)
##if (!www_authorize("", "subscriber"))
##{
## www_challenge("", "0");
## exit;
##}
##
##if (!db_check_to())
##{
## sl_send_reply("403","Forbidden auth ID");
## exit;
##}

e)        重启opensips服务
/etc/init.d/opensips restart

f)         添加两个用户
opensipsctl add 1000 1000
opensipsctl add 1001 1001

g)        客户端可进行登录验证

7.      配置RTPProxy处理NAT

a)        下载并安装RTPProxy

1.        cd /usr/src

2.        wgethttp://b2bua.org/chrome/site/rtpproxy-1.2.0.tar.gz

3.        tar –xzvf rtpproxy-1.2.0.tar.gz

4.        cd rtpproxy-1.2.0

5.        ./configure

6.        make

7.        make install

b)        运行RTPProxy
rtpproxy -l 115.28.38.216 -a 10.144.59.80 -s udp:localhost:7890 -F -d INFOLOG_LOCAL1

c)        修改/etc/opensips/opensips.cfg文件
修改如下:
在#loadmodule "presence_xml.so"下面添加
loadmodule "nathelper.so"

在” #modparam("presence", "server_address","sip:192.168.1.2:5060")”下面添加:
modparam("nathelper","rtpproxy_sock", "udp:127.0.0.1:7890")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 0)
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "sipping_from","sip:pinger@127.0.0.1")
modparam("registrar","received_avp","$avp(i:42)")
modparam("nathelper","received_avp","$avp(i:42)")

在# main request routing logic下面的代码中添加如下红色字:
# main request routing logic

route{

         if(!mf_process_maxfwd_header("10")) {

                   sl_send_reply("483","TooMany Hops");

                   exit;

         }

#---- NAT Detection ----#

force_rport();

if (nat_uac_test("18")) {

if (is_method("REGISTER")) {

fix_nated_register();

}

else {

fix_nated_contact();

}

setflag(5);

}

         if (has_totag()) {

                   # sequentialrequest withing a dialog should

                   # take thepath determined by record-routing

                   if(loose_route()) {

                            if(is_method("BYE")) {

                                     setflag(1);# do accounting ...

                                     setflag(3);# ... even if the transaction fails

                            }else if (is_method("INVITE")) {

                                     #even if in most of the cases is useless, do RR for

                                     #re-INVITEs alos, as some buggy clients do change route set

                                     #during the dialog.

                                     record_route();

                            }

                            #route it out to whatever destination was set by loose_route()

                            #in $du (destination URI).

                            route(1);

                   } else {

                            /*uncomment the following lines if you want to enable presence */

                            ##if(is_method("SUBSCRIBE") && $rd =="your.server.ip.address") {

                            ##     # in-dialog subscribe requests

                            ##     route(2);

                            ##     exit;

                            ##}

                            if( is_method("ACK") ) {

                                     if( t_check_trans() ) {

                                               #non loose-route, but stateful ACK; must be an ACK after

                                               #a 487 or e.g. 404 from upstream server

                                               t_relay();

                                               exit;

                                     }else {

                                               #ACK without matching transaction ->

                                               #ignore and discard

                                               exit;

                                     }

                            }

                            sl_send_reply("404","Nothere");

                   }

                   exit;

         }

         #initial requests

         # CANCEL processing

         if(is_method("CANCEL"))

         {

                   if(t_check_trans())

                            t_relay();

                   exit;

         }

         t_check_trans();

         # authenticate if fromlocal subscriber (uncomment to enable auth)

         # authenticate allinitial non-REGISTER request that pretend to be

         # generated by localsubscriber (domain from FROM URI is local)

         #if(!(method=="REGISTER") && from_uri==myself) /*no multidomainversion*/

         ##if(!(method=="REGISTER") && is_from_local())  /*multidomain version*/

         #{

         #       if (!proxy_authorize("","subscriber")) {

         #                proxy_challenge("","0");

         #                exit;

         #       }

         #       if (!db_check_from()) {

         #                sl_send_reply("403","Forbiddenauth ID");

         #                exit;

         #       }

         #

         #       consume_credentials();

         #       # caller authenticated

         #}

         # preloaded routechecking

         if (loose_route()) {

                   xlog("L_ERR",

                   "Attemptto route with preloaded Route's [$fu/$tu/$ru/$ci]");

                   if(!is_method("ACK"))

                            sl_send_reply("403","PreloadRoute denied");

                   exit;

         }

         # record routing

         if(!is_method("REGISTER|MESSAGE"))

                   record_route();

         # account only INVITEs

         if(is_method("INVITE")) {

                   setflag(1);# do accounting

         }

         if (!uri==myself)

         ## replace withfollowing line if multi-domain support is used

         ##if(!is_uri_host_local())

         {

                   append_hf("P-hint:outbound\r\n");

                   # if youhave some interdomain connections via TLS

                   ##if($rd=="tls_domain1.net"){

                   ##     t_relay("tls:domain1.net");

                   ##     exit;

                   ##} elseif($rd=="tls_domain2.net") {

                   ##     t_relay("tls:domain2.net");

                   ##     exit;

                   ##}

                   route(1);

         }

         # requests for mydomain

         ## uncomment this ifyou want to enable presence server

         ##   and comment the next 'if' block

         ##   NOTE: uncomment also the definition ofroute[2] from  below

         ##if( is_method("PUBLISH|SUBSCRIBE"))

         ##              route(2);

         if(is_method("PUBLISH"))

         {

                   sl_send_reply("503","Service Unavailable");

                   exit;

         }

        

         if(is_method("REGISTER"))

         {

                   #authenticate the REGISTER requests (uncomment to enable auth)

                   if(!www_authorize("", "subscriber"))

                   {

                            www_challenge("","0");

                            exit;

                   }

                  

                   if(!db_check_to())

                   {

                            sl_send_reply("403","Forbiddenauth ID");

                            exit;

                   }

 

#--Request is behind NAT(flag5) save with bflag 6 -#

#----Use bflag 7 to start SIP pinging (Options) ---#

if(isflagset(5)) {

setbflag(6);

setbflag(7);

};

 

                   if(!save("location"))

                            sl_reply_error();

                   exit;

         }

         if ($rU==NULL) {

                   # requestwith no Username in RURI

                   sl_send_reply("484","AddressIncomplete");

                   exit;

         }

         # apply DB basedaliases (uncomment to enable)

         ##alias_db_lookup("dbaliases");

         # do lookup withmethod filtering

         if(!lookup("location","m")) {

                   switch($retcode) {

                            case-1:

                            case-3:

                                     t_newtran();

                                     t_reply("404","Not Found");

                                     exit;

                            case -2:

                                     sl_send_reply("405","Method Not Allowed");

                                     exit;

                   }

         }

         # when routing viausrloc, log the missed calls also

         setflag(2);

         route(1);

}

route[1] {

         # for INVITEs enablesome additional helper routes

#---- Helper route, if nat=yes in the R-URI setflag 6 ----#

#---- This is used to Process REINVITES ----#

if (subst_uri('/(sip:.*);nat=yes/\1/')){

setbflag(6);

};

#-- If caller(flag 5) or callee(flag 6) are behindNAT --#

#-- Call the route(6) to force the use of the RTPProxy --#

if (isflagset(5)||isbflagset(6)) {

route(6);

};

if (isflagset(5)){

search_append('Contact:.*sip:[^>[:cntrl:]]*',';nat=yes');

}

         if(is_method("INVITE")) {

                   t_on_branch("2");

                   t_on_reply("2");

                   t_on_failure("1");

         }

         if (!t_relay()) {

                   sl_reply_error();

         };

         exit;

}

# Presence route

/* uncomment the whole following route for enabling presence

   NOTE: do not forget toenable the call of this route from the main

     route */

##route[2]

##{

##     if (!t_newtran())

##     {

##              sl_reply_error();

##              exit;

##     };

##

##     if(is_method("PUBLISH"))

##     {

##              handle_publish();

##              t_release();

##     }

##     else

##     if(is_method("SUBSCRIBE"))

##     {

##              handle_subscribe();

##              t_release();

##     }

##

##     exit;

##}

route[6] {

#---- RTP Proxy handling ---#

if (is_method("BYE|CANCEL")) {

unforce_rtp_proxy();

}

else if (is_method("INVITE")){

#---- Activates the RTP Proxy for the CALLEE ---#

force_rtp_proxy();

t_on_failure("1");

};

}

branch_route[2] {

         xlog("new branchat $ru\n");

}

onreply_route[2] {

         xlog("incomingreply\n");

#---- Handling of the SDP for the 200 or 183 reply----#

#---- If behind nat (flags 5 or 6) start RTP Proxy----#

#---- Activates the RTP Proxy for the CALLER ----#

if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])"){

force_rtp_proxy();

append_hf("P-hint:onreply_route|force_rtp_proxy \r\n");

}

#---- If the CALLEE is behind NAT, fix the CONTACTHF ----#

if (isbflagset(6)) {

#-- Insert nat=yes at the end of the Contactheader --#

#-- This helps with REINVITEs, --#

#- nat=yes will be included in the R-URI forseq.requests-#

search_append('Contact:.*sip:[^>[:cntrl:]]*',';nat=yes');

append_hf("P-hint: Onreply-route - fixcontact\r\n");

fix_nated_contact();

}

exit;

}

failure_route[1] {

#---- If a failure has ocurred, deactivate the RTpproxy ----#

if (isflagset(5) || isbflagset(6)){

unforce_rtp_proxy();

}

         if (t_was_cancelled()){

                   exit;

         }

         # uncomment thefollowing lines if you want to block client

         # redirect based on3xx replies.

         ##if(t_check_status("3[0-9][0-9]")) {

         ##t_reply("404","Notfound");

         ##     exit;

         ##}

         # uncomment thefollowing lines if you want to redirect the failed

         # calls to a differentnew destination

         ##if(t_check_status("486|408")) {

         ##     sethostport("192.168.2.100:5060");

         ##     # do not set the missed call flag again

         ##     t_relay();

         ##}

}

d)        重启opensips服务
/etc/init.d/opensips restart

相关文章:

Opensips安装配置(以下操作均已centOS 6.3系统为准)

1. 安装依赖软件: a) Yum update //更新系统到最新 b) 安装以下所需依赖软件 gcc bison flex make openssl libmysqlclient-dev mysql-server c) 安装radiusclient: 1. wget http://pkgs.repoforge.org/radiuscli…...

第03章 用户与权限管理

第03章 用户与权限管理 1. 用户管理 1.1 登录MySQL服务器 启动MySQL服务后,可以通过mysql命令来登录MySQL服务器,命令如下: mysql –h hostname|hostIP –P port –u username –p DatabaseName –e "SQL语句"-h参数后面接主机…...

赋能制造业高质量发展,释放采购数字化新活力——企企通亮相武汉2023国际智能制造创新论坛

摘要 “为应对成本上升、供应端不稳定、供应链上下游协同困难、决策无数据依据等问题,利用数字化手段降本增效、降低潜在风险十分关键。在AI等先进技术发展、供应链协同效应和降本诉求等机遇的驱动下,采购供应链数字化、协同化成为企业激烈竞争的优先选…...

洗地新天花板:CEYEE希亦顶配机皇T800 Pro洗地机多点发力上市开售

2023年11月1日,CEYEE希亦正式发布高端清洁产品无线洗地机希亦T800 PRO,创新性地实现了洗地场景深度清洁体验的新突破,彻底解决了清洁行业20多年来技术发展难题,颠覆式引领行业向水汽混动时代迈进,推动了整个市场向“智…...

如何创建一个react项目

文章目录 前言前言打开小黑窗口npm init vite后言 前言 hello world欢迎来到前端的新世界 😜当前文章系列专栏:react.js 🐱‍👓博主在前端领域还有很多知识和技术需要掌握,正在不断努力填补技术短板。(如果出现错误&am…...

面试算法49:从根节点到叶节点的路径数字之和

题目 在一棵二叉树中所有节点都在0~9的范围之内,从根节点到叶节点的路径表示一个数字。求二叉树中所有路径表示的数字之和。例如,图8.4的二叉树有3条从根节点到叶节点的路径,它们分别表示数字395、391和302,这3个数字…...

http1,https,http2,http3总结

1.HTTP 当我们浏览网页时,地址栏中使用最多的多是https://开头的url,它与我们所学的http协议有什么区别? http协议又叫超文本传输协议,它是应用层中使用最多的协议, http与我们常说的socket有什么区别吗? …...

stable-diffusion-webui环境部署

stable-diffusion-webui环境部署 1. 环境创建2. 安装依赖库3.下载底模4. 获取lora参数文件5.运行代码6. 报错信息报错1报错2 1. 环境创建 创建虚拟环境 conda create -n env_stable python3.10.0进入虚拟环境 conda activate env_stableclone源码 git clone https://github.com…...

使用Ansible中的playbook

目录 1.Playbook的功能 2.YAML 3.YAML列表 4.YAML的字典 5.playbook执行命令 6.playbook的核心组件 7.vim 设定技巧 示例 1.Playbook的功能 playbook 是由一个或多个play组成的列表 Playboot 文件使用YAML来写的 2.YAML #简介# 是一种表达资料序列的格式,类似XML #特…...

模型应用系实习生-模型训练笔记(更新至线性回归、Ridge回归、Lasso回归、Elastic Net回归、决策树回归、梯度提升树回归和随机森林回归)

sklearn机械学习模型步骤以及模型 一、训练准备(x_train, x_test, y_train, y_test)1.1 导包1.2 数据要求1.21 导入数据1.22 数据类型查看检测以及转换1.22 划分数据 二、回归2.1 线性回归2.2 随机森林回归2.3 GradientBoostingRegressor梯度提升树回归2…...

【Verilog】7.2.1 Verilog 并行 FIR 滤波器设计

FIR(Finite Impulse Response)滤波器是一种有限长单位冲激响应滤波器,又称为非递归型滤波器。 FIR 滤波器具有严格的线性相频特性,同时其单位响应是有限长的,因而是稳定的系统,在数字通信、图像处理等领域…...

【音视频 | wav】wav音频文件格式详解——包含RIFF规范、完整的各个块解析、PCM转wav代码

😁博客主页😁:🚀https://blog.csdn.net/wkd_007🚀 🤑博客内容🤑:🍭嵌入式开发、Linux、C语言、C、数据结构、音视频🍭 🤣本文内容🤣&a…...

人工智能基础_机器学习012_手写梯度下降代码演示_手动写代码完成梯度下降_并实现梯度下降可视化---人工智能工作笔记0052

可以看到上面我们那个公式,现在我们用梯度下降实现一下,比如我们有一堆数据,但是没有方程的情况下,我们来看一下如果计算,对应的w值也就是seta值对吧,没有方程我们可以使用梯度下降 这里首先我们可以设置一个0.0001.我们知道梯度下降的公式, 梯度下降刚开始的时候,下降会快,然…...

Docker安装部署[8.x]版本Elasticsearch+Kibana+IK分词器

文章目录 Docker安装部署elasticsearch拉取镜像创建数据卷创建网络elasticsearch容器,启动!踩坑:虚拟机磁盘扩容 Docker安装部署Kibana拉取镜像Kibana容器,启动! 安装IK分词器安装方式一:直接从github上下载…...

折纸达珠峰高度(forwhile循环)

对折0.1mm厚度的纸张多少次,高度可达珠峰高度8848180mm。 (本笔记适合熟悉循环和列表的 coder 翻阅) 【学习的细节是欢悦的历程】 Python 官网:https://www.python.org/ Free:大咖免费“圣经”教程《 python 完全自学教程》,不仅…...

探索网络攻防技术:自学之道

在当今数字化时代,网络攻防技术的重要性日益凸显。无论是个人用户还是企业组织,都需要具备一定的网络安全意识和基本技能来应对日益复杂的网络威胁。自学网络攻防技术成为许多人的选择,今天我们将探讨如何高效、有序地自学网络攻防技术。 如果…...

图像二值化阈值调整——cv2.threshold方法

二值化阈值调整:调整是指在进行图像二值化处理时,调整阈值的过程。阈值决定了将图像中的像素分为黑色和白色的界限,大于阈值的像素被设置为白色,小于等于阈值的像素被设置为黑色。 方法一: 取阈值为 127,…...

【C++代码】背包问题,完全背包,多重背包,打家劫舍,动态规划--代码随想录

爬楼梯(plus) 一步一个台阶,两个台阶,三个台阶,…,直到 m个台阶。问有多少种不同的方法可以爬到楼顶呢? 1阶,2阶,… m阶就是物品,楼顶就是背包。每一阶可以重复使用,例如…...

阿里云创始人王坚:云计算和GPT的关系,就是电和电机的关系

10月31日,在2023云栖大会,中国工程院院士、阿里云创始人王坚以《云计算的第三次浪潮》为主题发表演讲,他认为人工智能和云计算的结合,带来云计算的第三次浪潮,它不会在一年、两年完成,它可能会给我们十年、…...

python爬取豆瓣电影Top250数据

本次爬虫案例使用Python语言编写,使用了requests库进行网页请求,使用了BeautifulSoup库进行网页解析,使用了openpyxl库进行数据的保存。 案例中的爬虫目标是豆瓣电影Top250,通过循环访问不同页面进行数据的爬取。在每个页面上&am…...

8k长序列建模,蛋白质语言模型Prot42仅利用目标蛋白序列即可生成高亲和力结合剂

蛋白质结合剂(如抗体、抑制肽)在疾病诊断、成像分析及靶向药物递送等关键场景中发挥着不可替代的作用。传统上,高特异性蛋白质结合剂的开发高度依赖噬菌体展示、定向进化等实验技术,但这类方法普遍面临资源消耗巨大、研发周期冗长…...

条件运算符

C中的三目运算符(也称条件运算符,英文:ternary operator)是一种简洁的条件选择语句,语法如下: 条件表达式 ? 表达式1 : 表达式2• 如果“条件表达式”为true,则整个表达式的结果为“表达式1”…...

Neo4j 集群管理:原理、技术与最佳实践深度解析

Neo4j 的集群技术是其企业级高可用性、可扩展性和容错能力的核心。通过深入分析官方文档,本文将系统阐述其集群管理的核心原理、关键技术、实用技巧和行业最佳实践。 Neo4j 的 Causal Clustering 架构提供了一个强大而灵活的基石,用于构建高可用、可扩展且一致的图数据库服务…...

NLP学习路线图(二十三):长短期记忆网络(LSTM)

在自然语言处理(NLP)领域,我们时刻面临着处理序列数据的核心挑战。无论是理解句子的结构、分析文本的情感,还是实现语言的翻译,都需要模型能够捕捉词语之间依时序产生的复杂依赖关系。传统的神经网络结构在处理这种序列依赖时显得力不从心,而循环神经网络(RNN) 曾被视为…...

第 86 场周赛:矩阵中的幻方、钥匙和房间、将数组拆分成斐波那契序列、猜猜这个单词

Q1、[中等] 矩阵中的幻方 1、题目描述 3 x 3 的幻方是一个填充有 从 1 到 9 的不同数字的 3 x 3 矩阵,其中每行,每列以及两条对角线上的各数之和都相等。 给定一个由整数组成的row x col 的 grid,其中有多少个 3 3 的 “幻方” 子矩阵&am…...

【JavaWeb】Docker项目部署

引言 之前学习了Linux操作系统的常见命令,在Linux上安装软件,以及如何在Linux上部署一个单体项目,大多数同学都会有相同的感受,那就是麻烦。 核心体现在三点: 命令太多了,记不住 软件安装包名字复杂&…...

是否存在路径(FIFOBB算法)

题目描述 一个具有 n 个顶点e条边的无向图,该图顶点的编号依次为0到n-1且不存在顶点与自身相连的边。请使用FIFOBB算法编写程序,确定是否存在从顶点 source到顶点 destination的路径。 输入 第一行两个整数,分别表示n 和 e 的值(1…...

Unsafe Fileupload篇补充-木马的详细教程与木马分享(中国蚁剑方式)

在之前的皮卡丘靶场第九期Unsafe Fileupload篇中我们学习了木马的原理并且学了一个简单的木马文件 本期内容是为了更好的为大家解释木马(服务器方面的)的原理,连接,以及各种木马及连接工具的分享 文件木马:https://w…...

Linux C语言网络编程详细入门教程:如何一步步实现TCP服务端与客户端通信

文章目录 Linux C语言网络编程详细入门教程:如何一步步实现TCP服务端与客户端通信前言一、网络通信基础概念二、服务端与客户端的完整流程图解三、每一步的详细讲解和代码示例1. 创建Socket(服务端和客户端都要)2. 绑定本地地址和端口&#x…...

七、数据库的完整性

七、数据库的完整性 主要内容 7.1 数据库的完整性概述 7.2 实体完整性 7.3 参照完整性 7.4 用户定义的完整性 7.5 触发器 7.6 SQL Server中数据库完整性的实现 7.7 小结 7.1 数据库的完整性概述 数据库完整性的含义 正确性 指数据的合法性 有效性 指数据是否属于所定…...