Spring整合drools

1 Spring简单整合Drools

在项目中使用Drools时往往会跟Spring整合来使用。具体整合步骤如下:

第一步:创建maven工程drools_spring并配置pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.itheima</groupId>
    <artifactId>drools_spring</artifactId>
    <version>1.0-SNAPSHOT</version>
    <properties>
        <drools.version>7.10.0.Final</drools.version>
        <spring.version>5.0.5.RELEASE</spring.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>${drools.version}</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>
        <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-spring</artifactId>
            <version>${drools.version}</version>
            <!--注意:此处必须排除传递过来的依赖,否则会跟我们自己导入的Spring jar包产生冲突-->
            <exclusions>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-tx</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-beans</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-core</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.springframework</groupId>
                    <artifactId>spring-context</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context-support</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
    </dependencies>
</project>

第二步:创建规则目录/resources/rules,中rules目录中创建规则文件helloworld.drl

package helloworldrule "rule_helloworld"wheneval(true)thenSystem.out.println("规则:rule_helloworld触发...");
end

第三步:创建Spring配置文件/resources/spring.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:kie="http://drools.org/schema/kie-spring"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://drools.org/schema/kie-springhttp://drools.org/schema/kie-spring.xsd"><kie:kmodule id="kmodule"><kie:kbase name="kbase" packages="rules"><kie:ksession name="ksession"></kie:ksession></kie:kbase></kie:kmodule><bean class="org.kie.spring.annotations.KModuleAnnotationPostProcessor"></bean>
</beans>

第四步:编写单元测试类

package com.itheima.test;import org.junit.Test;
import org.junit.runner.RunWith;
import org.kie.api.KieBase;
import org.kie.api.cdi.KBase;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:spring.xml")
public class DroolsSpringTest {
    @KBase("kbase")private KieBase kieBase;//注入KieBase对象
    @Testpublic void test1(){KieSession kieSession = kieBase.newKieSession();kieSession.fireAllRules();kieSession.dispose();}
}

2 Spring整合Drools+web

本小节我们来进行Drools和Spring Web的整合。具体操作步骤如下:

第一步:创建maven的war工程drools_springweb并在pom.xml文件中导入相关maven坐标

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.itheima</groupId><artifactId>drools_springweb</artifactId><version>1.0-SNAPSHOT</version><packaging>war</packaging><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><drools.version>7.10.0.Final</drools.version><spring.version>5.0.5.RELEASE</spring.version></properties><dependencies><dependency><groupId>org.drools</groupId><artifactId>drools-compiler</artifactId><version>${drools.version}</version></dependency><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency><dependency><groupId>org.kie</groupId><artifactId>kie-spring</artifactId><version>${drools.version}</version><!--注意:此处必须排除传递过来的依赖,否则会跟我们自己导入的Spring jar包产生冲突--><exclusions><exclusion><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId></exclusion><exclusion><groupId>org.springframework</groupId><artifactId>spring-beans</artifactId></exclusion><exclusion><groupId>org.springframework</groupId><artifactId>spring-core</artifactId></exclusion><exclusion><groupId>org.springframework</groupId><artifactId>spring-context</artifactId></exclusion></exclusions></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-context-support</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-test</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>${spring.version}</version></dependency><dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>${spring.version}</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.tomcat.maven</groupId><artifactId>tomcat7-maven-plugin</artifactId><configuration><!-- 指定端口 --><port>80</port><!-- 请求路径 --><path>/</path></configuration></plugin></plugins></build>
</project>

第二步:配置web.xml

<!DOCTYPE web-app PUBLIC"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN""http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app><display-name>Archetype Created Web Application</display-name><servlet><servlet-name>springmvc</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><!-- 指定加载的配置文件 ,通过参数contextConfigLocation加载 --><init-param><param-name>contextConfigLocation</param-name><param-value>classpath:springmvc.xml</param-value></init-param><load-on-startup>1</load-on-startup></servlet><servlet-mapping><servlet-name>springmvc</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping>
</web-app>

第三步:创建/resources/springmvc.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc"xmlns:kie="http://drools.org/schema/kie-spring"xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://drools.org/schema/kie-springhttp://drools.org/schema/kie-spring.xsdhttp://www.springframework.org/schema/mvchttp://www.springframework.org/schema/mvc/spring-mvc.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context.xsd"><kie:kmodule id="kmodule"><kie:kbase name="kbase" packages="rules"><kie:ksession name="ksession"></kie:ksession></kie:kbase></kie:kmodule><bean class="org.kie.spring.annotations.KModuleAnnotationPostProcessor"/><!--spring批量扫描--><context:component-scan base-package="com.itheima" /><context:annotation-config/><!--springMVC注解驱动--><mvc:annotation-driven/>
</beans>

第四步:创建规则文件/resources/rules/helloworld.drl

package helloworldrule "rule_helloworld"wheneval(true)thenSystem.out.println("规则:rule_helloworld触发...");
end

第五步:创建RuleService

package com.itheima.service;import org.kie.api.KieBase;
import org.kie.api.cdi.KBase;
import org.kie.api.runtime.KieSession;
import org.springframework.stereotype.Service;@Service
public class RuleService {
    @KBase("kbase")private KieBase kieBase;public void rule(){KieSession kieSession = kieBase.newKieSession();kieSession.fireAllRules();kieSession.dispose();}
}

第六步:创建HelloController

package com.itheima.controller;import com.itheima.service.RuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping("/hello")
public class HelloController {
    @Autowiredprivate RuleService ruleService;
    @RequestMapping("/rule")public String rule(){ruleService.rule();return "OK";}
}

3 Spring Boot整合Drools

目前在企业开发中Spring Boot已经成为主流,本小节我们来进行Spring Boot整合Drools。具体操作步骤:

第一步:创建maven工程drools_springboot并配置pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starters</artifactId><version>2.0.6.RELEASE</version></parent><modelVersion>4.0.0</modelVersion><groupId>com.itheima</groupId><artifactId>drools_springboot</artifactId><version>1.0-SNAPSHOT</version><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-aop</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId></dependency><dependency><groupId>commons-lang</groupId><artifactId>commons-lang</artifactId><version>2.6</version></dependency><!--drools规则引擎--><dependency><groupId>org.drools</groupId><artifactId>drools-core</artifactId><version>7.6.0.Final</version></dependency><dependency><groupId>org.drools</groupId><artifactId>drools-compiler</artifactId><version>7.6.0.Final</version></dependency><dependency><groupId>org.drools</groupId><artifactId>drools-templates</artifactId><version>7.6.0.Final</version></dependency><dependency><groupId>org.kie</groupId><artifactId>kie-api</artifactId><version>7.6.0.Final</version></dependency><dependency><groupId>org.kie</groupId><artifactId>kie-spring</artifactId><exclusions><exclusion><groupId>org.springframework</groupId><artifactId>spring-tx</artifactId></exclusion><exclusion><groupId>org.springframework</groupId><artifactId>spring-beans</artifactId></exclusion><exclusion><groupId>org.springframework</groupId><artifactId>spring-core</artifactId></exclusion><exclusion><groupId>org.springframework</groupId><artifactId>spring-context</artifactId></exclusion></exclusions><version>7.6.0.Final</version></dependency></dependencies><build><finalName>${project.artifactId}</finalName><resources><resource><directory>src/main/java</directory><includes><include>**/*.xml</include></includes><filtering>false</filtering></resource><resource><directory>src/main/resources</directory><includes><include>**/*.*</include></includes><filtering>false</filtering></resource></resources><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>2.3.2</version><configuration><source>1.8</source><target>1.8</target></configuration></plugin></plugins></build>
</project>

第二步:创建/resources/application.yml文件

server:port: 8080
spring:application:name: drools_springboot

第三步:创建规则文件/resources/rules/helloworld.drl

package helloworld
rule "rule_helloworld"wheneval(true)thenSystem.out.println("规则:rule_helloworld触发...");
end

第四步:编写配置类DroolsConfig

package com.itheima.drools.config;
import org.kie.api.KieBase;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
import org.kie.api.builder.KieRepository;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import org.kie.internal.io.ResourceFactory;
import org.kie.spring.KModuleBeanFactoryPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.ResourcePatternResolver;
import org.springframework.core.io.Resource;
import java.io.IOException;
/*** 规则引擎配置类*/
@Configuration
public class DroolsConfig {//指定规则文件存放的目录private static final String RULES_PATH = "rules/";private final KieServices kieServices = KieServices.Factory.get();
    @Bean
    @ConditionalOnMissingBeanpublic KieFileSystem kieFileSystem() throws IOException {KieFileSystem kieFileSystem = kieServices.newKieFileSystem();ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver();Resource[] files = resourcePatternResolver.getResources("classpath*:" + RULES_PATH + "*.*");String path = null;for (Resource file : files) {path = RULES_PATH + file.getFilename();kieFileSystem.write(ResourceFactory.newClassPathResource(path, "UTF-8"));}return kieFileSystem;}
    @Bean
    @ConditionalOnMissingBeanpublic KieContainer kieContainer() throws IOException {KieRepository kieRepository = kieServices.getRepository();kieRepository.addKieModule(kieRepository::getDefaultReleaseId);KieBuilder kieBuilder = kieServices.newKieBuilder(kieFileSystem());kieBuilder.buildAll();return kieServices.newKieContainer(kieRepository.getDefaultReleaseId());}
    @Bean
    @ConditionalOnMissingBeanpublic KieBase kieBase() throws IOException {return kieContainer().getKieBase();}
    @Bean
    @ConditionalOnMissingBeanpublic KModuleBeanFactoryPostProcessor kiePostProcessor() {return new KModuleBeanFactoryPostProcessor();}
}

第五步:创建RuleService类

package com.itheima.drools.service;import org.kie.api.KieBase;
import org.kie.api.runtime.KieSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;@Service
public class RuleService {
    @Autowiredprivate KieBase kieBase;public void rule(){KieSession kieSession = kieBase.newKieSession();kieSession.fireAllRules();kieSession.dispose();}
}

第六步:创建HelloController类

package com.itheima.drools.controller;import com.itheima.drools.service.RuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;@RestController
@RequestMapping("/hello")
public class HelloController {
    @Autowiredprivate RuleService ruleService;
    @RequestMapping("/rule")public String rule(){ruleService.rule();return "OK";}
}

第七步:创建启动类DroolsApplication

package com.itheima.drools;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class DroolsApplication {public static void main(String[] args) {SpringApplication.run(DroolsApplication.class,args);}
}

第八步:启动服务,访问http://localhost:8080/hello/rule

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

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

相关文章

Android 13 自动旋转屏幕 重启后关闭的问题

介绍 近期在Android 13 上发现当打开自动旋转屏幕后关机&#xff0c;重新启动后自动旋转屏幕关闭了 修改 路径&#xff1a;vendor/mediatek/proprietary/frameworks/base/settingsprovider/java/com/mediatek/provider/MtkSettingsExt.java public static final String ACCEL…

Windows10系统的音频不可用,使用疑难解答后提示【 一个或多个音频服务未运行】

一、问题描述 打开电脑&#xff0c;发现电脑右下角的音频图标显示为X&#xff08;即不可用&#xff0c;无法播放声音&#xff09;&#xff0c;使用音频自带的【声音问题疑难解答】&#xff08;选中音频图标&#xff0c;点击鼠标右键&#xff0c;然后选择“声音问题疑难解答(T)”…

英飞凌TC3xx之一起认识GTM系列(五)如何实现GTM与DSADC关联的配置

英飞凌TC3xx之一起认识GTM系列(五)如何实现GTM与DSADC关联的配置 1 GTM与DSADC的连接1.1 EDSADC 到 GTM 的连接1.1.1 工作原理说明1.1.2 应用举例1.2 GTM 到 EDSADC 的连接1.2.1 工作原理说明1.2.2 应用举例2 总结编者按:笔者在从事这部分开发工作的时候,看着手册上的各种通…

17-网络安全框架及模型-信息流模型(FM)

目录 信息流模型&#xff08;FM&#xff09; 1 背景概述 2 基本概念 3 基本原理 4 应用领域 5 信息流分析方法 6 优势和局限性 7 应用场景 8 挑战和机遇 信息流模型&#xff08;FM&#xff09; 1 背景概述 在当今数字化时代&#xff0c;信息的传输和交换变得越来越重…

Git 常用命令知识笔记

Git 仓库数据结构 Git 仓库由一个个的 commit 组成某些 commit 上会有一些 branch 指向它们&#xff0c;这些 branch 的本质是引用有一个特殊的引用叫做 HEAD&#xff0c;它始终指向当前的位置&#xff0c;这个位置可以是 commit&#xff0c;也可以是 branch staging area 暂存…

学习记录——BiSeNet V2

BiSeNet V2: Bilateral Network with Guided Aggregation for Real-time Semantic Segmentation BiSeNet V2:基于引导聚合的双边网络实时语义分割 摘要在语义分割中,低级细节和高级语义都是必不可少的。然而,为了加快模型推理的速度,目前的方法几乎总是牺牲底层的细节,这导…

基于时空的Ramsar湿地自动淹没映射利用Google Earth Engine

题目:Spatiotemporal‑based automated inundation mapping of Ramsar wetlands using Google Earth Engine 期刊:Scientific Reports 第一作者:Manish KumarGoyal 发表单位:University of Nebraska 发表日期:2023年 1. 摘要 研究背景:湿地是生态系统中最关键的组成…

ctfshow 新手必刷菜狗杯 谜之栅栏题解记录

知识点&#xff1a;图片比较 拿到之后&#xff0c;有两个图片&#xff0c;直观看不出什么&#xff0c;尝试用工具比较。 用010editor打开其中一个&#xff0c;010editor的工具里面就有比较文件选项&#xff0c;比较两个文件&#xff0c;发现有一处不同。题目说栅栏&#xff0c…

八股文打卡day16——计算机网络(16)

面试题&#xff1a;TCP连接是如何确保可靠性的&#xff1f; 我的回答&#xff1a; 1.数据分块控制。应用数据被分成被认为最适合传输的数据块大小&#xff0c;再发送到传输层&#xff0c;数据块被称为数据报文段或数据段。 2.序列号和确认应答。TCP为每一个数据包分配了一个序…

【Vulnhub 靶场】【Looz: 1】【简单】【20210802】

1、环境介绍 靶场介绍&#xff1a;https://www.vulnhub.com/entry/looz-1,732/ 靶场下载&#xff1a;https://download.vulnhub.com/looz/Looz.zip 靶场难度&#xff1a;简单 发布日期&#xff1a;2021年08月02日 文件大小&#xff1a;2.1 GB 靶场作者&#xff1a;mhz_cyber &…

商标和专利是不是一回事儿?那它们究竟有什么区别呀?

商标和专利都是属于知识产权的一种&#xff0c;但它们的含义是不同的。 1.商标&#xff1a; 商标是指商品的生产者或经营者在其商品或服务上使用的标志&#xff0c;用于标识商品或服务的来源、品质、特点等。商标可以是文字、图形、字母、数字、颜色、声音等&#xff0c;也可…

八个理由:从java8升级到Java17

目录 前言 1. 局部变量类型推断 2.switch表达式 3.文本块 4.Records 5.模式匹配instanceof 6. 密封类 7. HttpClient 8.性能和内存管理能力提高 前言 从Java 8 到 Java 20&#xff0c;Java 已经走过了漫长的道路&#xff0c;自 Java 8 以来&#xff0c;Java 生态系统…

kivy开发一个登陆界面

Kivy Kivy是一个用于开发跨平台移动应用&#xff08;如Android和iOS&#xff09;以及桌面应用&#xff08;如Windows、Linux和macOS&#xff09;的Python框架。它采用开源许可证&#xff08;MIT许可证&#xff09;&#xff0c;提供了丰富的图形界面组件和工具&#xff0c;以便…

链表:约瑟夫环

#include<iostream> using namespace std; struct Circle //创建结构体Circle {int index; //编号Circle* next; //指针变量next指向一个节点 }; Circle* CreateList(int n) //创建链表 {Circle* head, * p; //head为头指针&#xff0c;p为当前指针head p new Circle;…

C#,入门教程(04)——Visual Studio 2022 数据编程实例:随机数与组合

上一篇&#xff1a; C#&#xff0c;入门教程(03)——Visual Studio 2022编写彩色Hello World与动画效果https://blog.csdn.net/beijinghorn/article/details/123478581 C#&#xff0c;入门教程(01)—— Visual Studio 2022 免费安装的详细图文与动画教程https://blog.csdn.net…

【CSS】布局方式梳理和总结

1. 前言 网页布局是CSS的重点功能&#xff0c;布局的传统方案是基于盒子模型&#xff0c;依靠display属性、position属性和float属性&#xff0c;它对一些特殊布局很麻烦。 CSS3推出的Flex布局和网格布局&#xff0c;让开发者更容易定制自己想要的布局。本篇梳理和总结一些布局…

java常见面试题:请解释一下Java中的常用ORM框架,如Hibernate、MyBatis等。

ORM&#xff08;Object-Relational Mapping&#xff09;框架在Java中主要用于将关系型数据库中的数据映射到Java对象&#xff0c;从而使得开发者可以更加方便地操作数据库&#xff0c;而不需要编写大量的SQL代码。以下是两个常用的ORM框架&#xff1a;Hibernate和MyBatis。 Hi…

【Delphi 基础知识 8】常用的运算符

目录 算术运算符关系运算符逻辑运算符位运算符 Delphi是一种基于Object Pascal语言的集成开发环境&#xff08;IDE&#xff09;&#xff0c;它支持多种运算符用于执行各种操作。以下是一些常见的Delphi运算符&#xff0c;以及简单的代码示例&#xff1a; 算术运算符 &#xff…

安装Hadoop:Hadoop的单机模式、伪分布式模式——备赛笔记——2024全国职业院校技能大赛“大数据应用开发”赛项

前言 Hadoop包括三种安装模式&#xff1a; 单机模式&#xff1a;只在一台机器上运行&#xff0c;存储是采用本地文件系统&#xff0c;没有采用分布式文件系统HDFS&#xff1b;伪分布式模式&#xff1a;存储采用分布式文件系统HDFS&#xff0c;但是&#xff0c;HDFS的名称节点…

门控循环单元(GRU)-多输入时序预测

目录 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 亮点与优势&#xff1a; 二、实际运行效果&#xff1a; 三、部分代码&#xff1a; 四、完整代码数据下载&#xff1a; 一、程序及算法内容介绍&#xff1a; 基本内容&#xff1a; 本代码基于Matlab平台编译…