java结合Ai

news2024/9/20 23:28:46
Spring AI

Spring AI提供的API支持跨人工智能提供商的 聊天,文本到图像,和嵌入模型等,同时支持同步和流API选项;

介绍

Spring AI 是 AI 工程的应用框架。其目标是将Spring生态系统的设计原则(如可移植性和模块化设计)应用于AI领域,并促进使用POJO作为应用程序的构建块到AI领域。

特征

跨 AI 提供商的可移植 API 支持,适用于聊天、文本到图像和嵌入模型。支持同步 API 和流 API 选项。还支持下拉以访问特定于模型的功能。

聊天模型
  • 亚马逊基岩
    • 人类学
    • Cohere的命令
    • AI21 Labs的侏罗纪-2
    • Meta 的 LLama
    • 亚马逊的泰坦
  • 人类学克劳德
  • Azure 开放式 AI
  • 谷歌顶点 AI
    • 帕LM2
    • 双子座
  • 格罗克
  • HuggingFace - 访问数以千计的模型,包括来自 Meta 的模型,例如 Llama
  • 米斯特拉尔AI
  • 极大 极小
  • Moonshot AI
  • Ollama - 在本地计算机上运行 AI 模型
  • OpenAI的
  • 芊芊
  • 智普人工智能
  • Watsonx.AI
文本到图像模型
  • OpenAI 与 DALL-E
  • 稳定性AI
转录(音频到文本)模型
  • OpenAI的
嵌入模型
  • 蔚蓝 OpenAI
  • 亚马逊基岩
    • 凝聚力
    • 巨人
  • 蔚蓝 OpenAI
  • 米斯特拉尔 AI
  • 极大 极小
  • 奥拉玛
  • (ONNX)变形金刚
  • OpenAI的
  • PostgresML的
  • 芊芊
  • 顶点AI
    • 发短信
    • 模 态
    • 帕LM2
  • 智普人工智能

Vector Store API 提供跨不同提供商的可移植性,具有一种新颖的类似 SQL 的元数据过滤 API,可保持可移植性。

向量数据库
  • Azure AI 服务
  • Apache Cassandra
  • 色度
  • 弹性搜索
  • 宝石火
  • Milvus (小米)
  • MongoDB地图集
  • Neo4j的
  • Open搜索
  • 神谕
  • PG矢量
  • 松果
  • Qdrant的
  • 雷迪斯
  • SAP Hana(萨普哈纳)
  • 类型感知
  • 织造

Spring Boot 自动配置和 AI 模型和向量存储的启动器。

函数调用您可以向 OpenAI 模型声明实现,以便在其提示响应中使用。您可以直接将这些函数作为对象提供,或者在应用程序上下文中作为@Bean注册时引用其名称。此功能最大限度地减少了不必要的代码,并使 AI 模型能够请求更多信息以实现其响应。java.util.Function

支持的模型包括

  • OpenAI的
  • 蔚蓝 OpenAI
  • 顶点AI
  • 米斯特拉尔 AI
  • 人类学克劳德
  • 格罗克
用于数据工程的 ETL 框架
  • 我们的 ETL 框架的核心功能是促进使用 Vector Store 将文档传输到模型提供者。ETL 框架基于 Java 函数式编程概念,可帮助您将多个步骤链接在一起。
  • 我们支持阅读各种格式的文档,包括 PDF、JSON 等。
  • 该框架允许进行数据操作以满足您的需求。这通常涉及拆分文档以遵守上下文窗口限制,并使用关键字增强它们以提高文档检索效率。
  • 最后,处理过的文档存储在矢量数据库中,以便将来检索。

广泛的参考文档、示例应用程序和研讨会/课程材料。

未来的版本将在此基础上提供对其他 AI 模型的访问,例如,Google 刚刚发布的 Gemini 多模态模型、用于评估 AI 应用程序有效性的框架、更方便的 API 以及帮助解决“查询/汇总我的文档”用例的功能。请查看 GitHub,了解即将发布的版本的详细信息。

官网地址

https://spring.io/projects/spring-ai

使用

1、本机电脑要可以访问OpenAI网站 https://openai.com/(科学上网)

2、要有OpenAI的API Key;(注册账号或者购买)

怎么获取OpenAI的api-key

这种方法需要一个国外手机号,某些国家(如俄罗斯)的手机号可能无法使用。具体步骤如下:

1.访问控制台
https://platform.openai.com/docs/overview

 进入 OpenAI 网站:登录你的 OpenAI 账号。
进入 API 密钥页面:
点击右上角的个人头像,选择【Your profile】。
点击【User API keys】。
点击【Start verification】进行手机短信验证。

2.点击API keys

https://platform.openai.com/api-keys

依赖

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.cqh</groupId>
    <artifactId>spring-ai</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-ai</name>
    <description>spring-ai</description>

    <properties>
        <java.version>17</java.version>
        <spring-ai.version>1.0.0-M1</spring-ai.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-openai-spring-boot-starter</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.ai</groupId>
                <artifactId>spring-ai-bom</artifactId>
                <version>${spring-ai.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>

    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <excludes>
                        <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                    </excludes>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

</project>

 yml

spring:
  application:
    name: spring-ai
  ai:
    openai:
      api-key: ${OPENAI_API_KEY}
      api-key-file-location: ${OPENAI_API_KEY_FILE_LOCATION}
      api-key-file-type: ${OPENAI_API_KEY_FILE_TYPE}
      api-key-file-name: ${OPENAI_API_KEY_FILE_NAME}
      api-key-file-path: ${OPENAI_API_KEY_FILE_PATH}
      api-key-header: ${OPENAI_API_KEY_HEADER}
      api-key-property: ${OPENAI_API_KEY_PROPERTY}
      api-key-env: ${OPENAI_API_KEY_ENV}
      api-key-file: ${OPENAI_API_KEY_FILE}
      api-type: ${OPENAI_API_TYPE}
      api-host: ${OPENAI_API_HOST}
      api-base: ${OPENAI_API_BASE}
      api-version: ${OPENAI_API_VERSION}
      base-url: ${OPENAI_BASE_URL}

yml解释

  • api-key: API 密钥,用于认证和授权对 OpenAI API 的访问。它从环境变量 ${OPENAI_API_KEY} 中读取。

  • api-key-file-location: API 密钥文件的位置。如果 API 密钥存储在文件中,这个配置项指定文件的位置。

  • api-key-file-type: API 密钥文件的类型(例如 JSON、YAML 等)。

  • api-key-file-name: API 密钥文件的名称。

  • api-key-file-path: API 密钥文件的完整路径,包括文件名。

  • api-key-header: API 密钥在请求头中的名称。

  • api-key-property: API 密钥存储在配置文件中的属性名。

  • api-key-env: API 密钥存储在环境变量中的名称。

  • api-key-file: API 密钥存储在文件中的位置或路径。

  • api-type: API 类型,可能用于指定使用的 API 版本或类型。

  • api-host: OpenAI API 的主机名或域名。

  • api-base: OpenAI API 的基础 URL 或路径。

  • api-version: OpenAI API 的版本号。

  • base-url: OpenAI API 的基础 URL,通常用于构造请求的完整 URL。

 一般这两个就够了

spring:
  ai:
    openai:
      api-key: sk-3sfER03LDLG3SDFsdadadadJSdw023lkrmrHDND32fmREKFD (换成你的api-key)
      base-url: https://api.openai.com(或者中转站)

安装

https://docs.spring.io/spring-cli/reference/installation.html
https://github.com/spring-projects/spring-cli/releases/tag/early-access

jdk使用17及以上

springboot3.几以上 

如果是0.8.1使用这个仓库

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.3.2</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>spring-ai3</artifactId>
    <version>0.8.1</version>
    <name>spring-ai3</name>
    <description>spring-ai3</description>

    <properties>
        <java.version>17</java.version>
        <spring-ai.version>1.0.0-SNAPSHOT</spring-ai.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.ai</groupId>
            <artifactId>spring-ai-openai-spring-boot-starter</artifactId>
            <version>${spring-ai.version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.ai</groupId>
                <artifactId>spring-ai-bom</artifactId>
               <version>${spring-ai.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
               <configuration>
                   <excludes>
                    <exclude>
                            <groupId>org.projectlombok</groupId>
                            <artifactId>lombok</artifactId>
                        </exclude>
                   </excludes>
               </configuration>
            </plugin>
        </plugins>
    </build>
    <!--稳定仓库-->
      <repositories>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/milestone</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>


</project>

消息聊天使用
    @RequestMapping("/chat3/hello2")
    public String hello2(@RequestParam(value = "msg") String msg)
    {
        String call = openAiChatClient.call(msg);
        System.out.println(call);
        return call;
    }

同步api

    @RequestMapping("/chat3/hello3")
    public Object hello3(@RequestParam(value = "msg") String msg)
    {
        ChatResponse call = openAiChatClient.call(new Prompt(msg));

        System.out.println(call);
        // 获取内容
        System.out.println("call.getResult().getOutput().getContent() = " + call.getResult().getOutput().getContent());
        return call;
    }

流式api

    @RequestMapping("/chat3/hello4")
    public Object hello4(@RequestParam(value = "msg") String msg)
    {
        Flux<ChatResponse> stream = openAiChatClient.stream(new Prompt(msg, OpenAiChatOptions.builder()
                .withTemperature(0.4F)
                .build()));

        stream.toStream().forEach(chatResponse -> {
            System.out.println(chatResponse.getResult().getOutput().getContent());
        });

        return stream.collectList();
    }
绘图(文字转图片)
    @Autowired
    private OpenAiImageClient openAiImageClient;   

 // 绘图
    @RequestMapping("/chat3/image1")
    public Object hello5(@RequestParam(value = "msg") String msg)
    {
        ImageResponse call = openAiImageClient.call(new ImagePrompt(msg));

        return call.getResult().getOutput();
    }

 

 

    @RequestMapping("/chat3/image2")
    public Object hello6(@RequestParam(value = "msg") String msg)
    {
        ImageResponse hd = openAiImageClient.call(new ImagePrompt(msg, OpenAiImageOptions.builder()
                .withQuality("hd") // 高清
                .withN(2) // 数量
                .withHeight(512) // 高度
                .withWidth(512) // 宽度
                .build()
        ));



        return hd.getResult().getOutput();
    }

或者 

使用版本1.0.0-快照版 

 语音转文字
  @Test
    public void test2() {
        //FileSystemResource fileSystemResource = new FileSystemResource("D:\\myDesktop\\test1\\test.mp3");
          ClassPathResource classPathResource = new ClassPathResource("test.mp3");

        String call = openAiTranscriptionModel.call(classPathResource);
        System.out.println("call = " + call);
    }


    @Autowired
    private OpenAiAudioTranscriptionModel openAiTranscriptionModel;
    // 语音转文字
    @Test
    public void test() {
        OpenAiAudioApi.TranscriptResponseFormat responseFormat = OpenAiAudioApi.TranscriptResponseFormat.VTT;
        // FileSystemResource fileSystemResource = new FileSystemResource("D:\\myDesktop\\test1\\test.mp3");
          ClassPathResource classPathResource = new ClassPathResource("test.mp3");

        OpenAiAudioTranscriptionOptions transcriptionOptions = OpenAiAudioTranscriptionOptions.builder()
                .withLanguage("en")
                .withPrompt("Ask not this, but ask that")
                .withTemperature(0f)
                .withResponseFormat(responseFormat)
                .build();
        AudioTranscriptionPrompt transcriptionRequest = new AudioTranscriptionPrompt(classPathResource, transcriptionOptions);
        AudioTranscriptionResponse response = openAiTranscriptionModel.call(transcriptionRequest);
        String output = response.getResult().getOutput();
        System.out.println("output = " + output);
    }

 

文字转语音
  @Autowired
    private OpenAiAudioSpeechModel openAiAudioSpeechModel;

    @Test
    void contextLoads() {
        OpenAiAudioSpeechOptions speechOptions = OpenAiAudioSpeechOptions.builder()
                .withModel("tts-1")
                .withVoice(OpenAiAudioApi.SpeechRequest.Voice.ALLOY)
                .withResponseFormat(OpenAiAudioApi.SpeechRequest.AudioResponseFormat.MP3)
                .withSpeed(1.0f)
                .build();

        SpeechPrompt speechPrompt = new SpeechPrompt("Hello, this is a text-to-speech example.", speechOptions);
        SpeechResponse response = openAiAudioSpeechModel.call(speechPrompt);
        System.out.println("response = " + response);
        byte[] output = response.getResult().getOutput();
        boolean b = FileUtil2.save2File("D:\\myDesktop\\test1\\test.mp3", output);
        System.out.println("b = " + b);


    }
package com.cqh.springai5.utils;



import java.io.*;

public class FileUtil2 {
        /**
         * 方法功能:将字节数组写入到新建文件中。

         * @return boolean
         * */
        public static boolean save2File(String fname, byte[] msg){
            OutputStream fos = null;
            try{
                File file = new File(fname);
                File parent = file.getParentFile();
                boolean bool;
                if ((!parent.exists()) &&
                        (!parent.mkdirs())) {
                    return false;
                }
                fos = new FileOutputStream(file);
                fos.write(msg);
                fos.flush();
                return true;
            }catch (FileNotFoundException e){
                return false;
            }catch (IOException e){
                File parent;
                return false;
            }
            finally{
                if (fos != null) {
                    try{
                        fos.close();
                    }catch (IOException e) {}
                }
            }
        }
        public static void main(String[] args)  {
            String msgStr = "aaaaa中国加油!!!!战胜新冠状病毒!!!";
            String filename = "E:\\test\\system\\test.txt";//注意修改为自己的文件名
            byte[] bytes = msgStr.getBytes();
            FileUtil2 fileUtil = new FileUtil2();
            boolean flag = fileUtil.save2File(filename, bytes);
        }
    }
    // 文字转语音
    @Test
    void contextLoads2() {

        SpeechPrompt speechPrompt = new SpeechPrompt("你好我是中国人");
        SpeechResponse response = openAiAudioSpeechModel.call(speechPrompt);
        System.out.println("response = " + response);
        byte[] output = response.getResult().getOutput();
        boolean b = FileUtil2.save2File("D:\\myDesktop\\test1\\test2.mp3", output);
        System.out.println("b = " + b);


    }

多模态Api

多模态是指模型同时理解和处理来自各种来源的信息的能力,包括文本、图像、音频和其他数据格式
多模式大语言模型(LLM)特征使模型能够结合其他模态(如图像、音频或视频)来处理和生成文本
Spring Al 多模态API提供了所有必要的统一抽象和代码封装来支持多模式LLM;

    @Autowired

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

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

相关文章

大数据-100 Spark 集群 Spark Streaming DStream转换 黑名单过滤的三种实现方式

喜大普奔&#xff01;破百了&#xff01; 点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; 目前已经更新到了&#xff1a; Hadoop&#xff08;已更完&#xff09;HDFS&#xff08;已更完&a…

【精选】基于django柚子校园影院(咨询+解答+辅导)

博主介绍&#xff1a; ✌我是阿龙&#xff0c;一名专注于Java技术领域的程序员&#xff0c;全网拥有10W粉丝。作为CSDN特邀作者、博客专家、新星计划导师&#xff0c;我在计算机毕业设计开发方面积累了丰富的经验。同时&#xff0c;我也是掘金、华为云、阿里云、InfoQ等平台…

[240824] 微软更新导致部分 Linux 用户无法启动系统,谁之过?| Chrome 稳定版更新(128.0.6613.84)

目录 微软更新导致部分 Linux 用户无法启动系统&#xff0c;谁之过&#xff1f;Chrome 稳定版更新 (128.0.6613.84) 微软更新导致部分 Linux 用户无法启动系统&#xff0c;谁之过&#xff1f; 最近&#xff0c;微软推送的一项 Windows 更新导致部分 Linux 用户无法启动系统&am…

基于Springboot + vue + mysql 藏区特产销售平台 设计实现

目录 &#x1f4da; 前言 &#x1f4d1;摘要 1.1 研究背景 &#x1f4d1;操作流程 &#x1f4da; 系统架构设计 &#x1f4da; 数据库设计 &#x1f4ac; E-R表 系统功能模块 系统首页 特产信息 ​编辑 个人中心 购物车 用户注册 管理员功能模块 管理员登录 管…

Stable diffusion模型如何区分?通俗易懂,入门必看!

在Stable Diffusion的基础学习中&#xff0c;很多小伙伴们可能看到繁杂的大模型就蒙圈了&#xff0c;那么多的模型后缀&#xff0c;究竟代表什么呢&#xff1f;如何区分呢&#xff1f;今天就带大家来学习一下&#xff5e; 不同后缀模型介绍 在Stable diffusion中&#xff0c;…

【Tomact源码解析】——组件介绍

目录 一、简介 二、组件和体系架构简介 三、组件详情 Server Service Connector Engine ​编辑Host Context Wrapper 四、容器详情 生命周期机制 监听器机制 管道机制 五、补充内容 一、简介 Tomcat 服务器是一个免费的开放源代码的 Web 应用服务器,属于…

支持在线编辑的文件管理系统MxsDoc

DocSys是一个基于Web的文件管理系统&#xff08;全平台支持:Linux&#xff0c;Windows&#xff0c;Mac&#xff09;&#xff0c;它提供了丰富的功能和特性&#xff0c;以满足不同用户在不同场景下的需求。 开源地址&#xff1a;DocSys: MxsDoc是基于Web的文件管理系统&#xff…

校友林小程序的设计

管理员账户功能包括&#xff1a;系统首页&#xff0c;个人中心&#xff0c;用户管理&#xff0c;树木管理管理&#xff0c;所属科管理&#xff0c;树木领取管理&#xff0c;树跟踪状态管理&#xff0c;用户信息统计管理&#xff0c;树木捐款管理&#xff0c;留言板管理 微信端…

【芯片往事】陈大同-展讯和TD

前言&#xff1a;几年前&#xff08;2012&#xff09;&#xff0c;应邀为校友刊物《水木清华》写了一年创业专栏&#xff0c;其中有几期回忆了当年先后创办硅谷豪威科技&#xff08;OmniVision&#xff09;和上海展讯通信&#xff08;SpreadTrum&#xff09;的经历&#xff0c;…

ZMQ发布订阅模型

案例一 发布者Publisher(server) // server.cpp #include <zmq.hpp> #include <string> #include <iostream> #include <chrono> #include <thread> using namespace std; using namespace zmq; int main() {context_t context(1);socket_t so…

维纳滤波(Wiener Filtering)

维纳滤波&#xff08;Wiener Filtering&#xff09; 引言 维纳滤波&#xff08;Wiener Filtering&#xff09;是一种最优线性滤波方法&#xff0c;广泛应用于信号处理、图像处理和通信系统中。它旨在从含噪声的信号中恢复原始信号&#xff0c;最小化均方误差&#xff08;MSE&…

谷粒商城实战笔记-251-商城业务-消息队列-Exchange类型

文章目录 一&#xff0c;Exchange二&#xff0c;Exchange的四种类型1&#xff0c;direct2&#xff0c;fanout3&#xff0c;topic 三&#xff0c;实操1&#xff0c;创建一个exchange2&#xff0c;创建一个queue3&#xff0c;将queue绑定到exchange 一&#xff0c;Exchange AMQP …

二叉树的链式存储(代码实现)

二叉树的链式存储 用链表实现&#xff0c;基于完全二叉树规律来构建树&#xff0c;按照完全二叉树的编号方法&#xff0c;从上到下&#xff0c;从左到右。一共n个节点。 第i个节点&#xff1a; 左子节点编号&#xff1a;2*i &#xff08;2*i<n&#xff09; 右子节点编号&…

【C++题解】1146. 求S的值

欢迎关注本专栏《C从零基础到信奥赛入门级&#xff08;CSP-J&#xff09;》 问题&#xff1a;1146. 求S的值 类型&#xff1a;递归基础、函数 题目描述&#xff1a; 求 S12471116…的值刚好大于等于 5000 时 S 的值。 输入&#xff1a; 无。 输出&#xff1a; 一行&…

写作手三天速成攻略【数学建模国赛赛前必看内容】

第一天&#xff1a;准备论文模板&#xff0c;学习各类基础画图技巧 1、论文模板 对于写作手&#xff0c;除了内容的连贯性&#xff0c;排版是非常重要的&#xff0c;可以说有一个好的排版&#xff0c;只要论文是完整的&#xff0c;有结果的&#xff0c;基本上保底有省奖&#…

CSP-CCF 201412-2 Z字形扫描

目录 一、问题描述 二、解答 三、总结 一、问题描述 在图像编码的算法中&#xff0c;需要将一个给定的方形矩阵进行Z字形扫描(Zigzag Scan)。给定一个nn的矩阵&#xff0c;Z字形扫描的过程如下图所示&#xff1a; 对于下面的44的矩阵&#xff0c;   1 5 3 9   3 7 5 6  …

玩客云刷机armbian后docker启动不起来,提示bpf_prog_query(BPF_CGROUP_DEVICE) failed

/ ___| ( _ )/ |___ \ \___ \ / _ \| | __) |___) | (_) | |/ __/ |____/ \___/|_|_____|Welcome to Armbian 20.12 Bullseye with Linux 5.10.61-aml-s812Linux aml-s812 5.10.61-aml-s812 #20.12 SMP Thu Sep 2 20:11:09 CST 2021 armv7l GNU/Linux 玩客云刷机armbian后dock…

工业气膜仓储:高效、灵活的仓储解决方案—轻空间

在现代工业生产中&#xff0c;仓储设施的选择至关重要。作为一种新型的仓储解决方案&#xff0c;工业气膜仓储凭借其高效、灵活、经济的优势&#xff0c;正在逐渐取代传统建筑仓库&#xff0c;成为各类企业的理想选择。 一、快速搭建&#xff0c;满足多种需求 工业气膜仓储采用…

24年浙江事业单位考试报名流程保姆级教程

2024年浙江事业单位考试报名马上就要开始了&#xff0c;有想要参加考试报名的同学可以提前了解一下报名流程&#xff0c;以及报名照要求。 一、考试时间安排&#xff1a; 报名时间&#xff1a;8月27日9:00 9月2日16:00 资格审核时间&#xff1a;8月27日—9月3日 网上缴费时…

软件开发商业模式的思考:软件最大的竞争力就是低价格

很多程序员在工作的时候&#xff0c;都会有机会碰到做外包项目的机会&#xff0c;还有很多的专业网站&#xff0c;接项目&#xff0c;在这种外包开发中&#xff0c;经常会按照评估的开发时间和程序员的薪酬来定价。 前几年有朋友介绍过一个线下实体店经营者&#xff0c;想做一…