JAVA实现麦克风说话同声传译

一、能力与场景说明

同声传译,又称同步口译或同声翻译,是一种专业的口译形式,指的是在讲话者发言时,口译员几乎同时将讲话内容翻译成目标语言。这种翻译方式通常用于国际会议、高级别政治或商业会谈、研讨会和其他需要即时多语言交流的场合。本文是用JAVA调用原生麦克风技术,实现产生音频的同时用麦克风实现边说边翻译成英文的技术。不限制录音时长。

二、同传主调用代码

package main.com.iflytek;import com.google.gson.Gson;
import com.google.gson.JsonObject;
import main.com.util.VideoPlayerService;
import okhttp3.*;
import main.com.util.AuthUtils;
import main.com.util.PcmToWav;import javax.sound.sampled.AudioInputStream;
import java.io.*;
import java.util.*;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;/*** 1、同声传译接口,可以将音频流实时翻译为不同语种的文本,并输对应的音频内容,广泛应用于国际论坛、智能会议、智慧教育、跨国交流等场景。*/
public class SimultaneousTranslationMain extends WebSocketListener {private static String requestUrl = "wss://ws-api.xf-yun.com/v1/private/simult_interpretation";//控制台获取以下信息private static String APPID = "";private static String apiSecret = "";private static String apiKey = "";private static final String domain = "ist_ed_open";private static final String language = "zh_cn";private static final String accent = "mandarin";// 翻译所需参数,从中文-英文private static final String from = "cn"; // 源文件的语言类型private static final String to = "en"; // 目标文件的语言类型// 发声发音人private static final String vcn = "x2_catherine";// 输出音频编码方式 PCMprivate static final String encoding = "raw";// 输入的源音频文件private static final String inputAudioPcm = "input/audio/original.pcm";// 输出的音频与文本文件private static final String outPutPcm = "output/audio/trans.pcm";private static final String outPutWav = "output/audio/trans.wav";private static final String asr_result = "output/text/asr.txt";private static final String trans_result = "output/text/trans.txt";public static final int StatusFirstFrame = 0;public static final int StatusContinueFrame = 1;public static final int StatusLastFrame = 2;public static final Gson gson = new Gson();private static BlockingQueue<String> queue = new LinkedBlockingQueue<>();private static boolean overFlag = false;public static byte[] audioDataByteArray;public static Long ivwStartTime;public static Long ivwEndTime;// 主函数入口public static void main(String[] args) {// 清空文件夹clearDir();Thread thread = new Thread(new videoPlayer());thread.start();// 构建鉴权urlString authUrl = AuthUtils.assembleRequestUrl(requestUrl, apiKey, apiSecret);// System.out.println(authUrl);OkHttpClient client = new OkHttpClient.Builder().build();Request request = new Request.Builder().url(authUrl).build();// System.out.println("url===>" + authUrl);WebSocket webSocket = client.newWebSocket(request, new SimultaneousTranslationMain());try {//打开音频文件int frameSize = 1280; // 每一帧音频的大小 1280/40msint interval = 40;int status = 0;  // 音频的状态int count = 0;Constants.IVW_ASR_TARGET_DATA_LINE.open(Constants.IVW_ASR_AUDIO_FORMAT);Constants.IVW_ASR_TARGET_DATA_LINE.start();ivwStartTime = System.currentTimeMillis(); // 更新开始时间// 发送音频end:while (true) {//int len = fs.read(buffer);audioDataByteArray = new byte[Constants.IVW_FRAME_SIZE];int len = new AudioInputStream(Constants.IVW_ASR_TARGET_DATA_LINE).read(audioDataByteArray);ivwEndTime = System.currentTimeMillis();// System.out.println(ivwEndTime - ivwStartTime);if (len < frameSize || (ivwEndTime - ivwStartTime) > 60000) { // 大于一分钟自动停止status = StatusLastFrame;  //文件读完,改变status 为 2}switch (status) {case StatusFirstFrame:   // 第一帧音频status = 0JsonObject frame = new JsonObject();JsonObject header = new JsonObject();  //第一帧必须发送JsonObject parameter = new JsonObject();JsonObject ist = new JsonObject();JsonObject streamtrans = new JsonObject();JsonObject tts = new JsonObject();JsonObject tts_results = new JsonObject();JsonObject payload = new JsonObject();JsonObject data = new JsonObject();// 填充headerheader.addProperty("app_id", APPID);//appid 必须带上,只需第一帧发送header.addProperty("status", 0);// 填充parameter// ist参数填充ist.addProperty("eos", 600000);ist.addProperty("vto", 15000);ist.addProperty("accent", accent);ist.addProperty("language", language);ist.addProperty("language_type", 1);ist.addProperty("domain", domain);// streamtrans参数填充streamtrans.addProperty("from", from);streamtrans.addProperty("to", to);// tts参数填充tts.addProperty("vcn", vcn);tts_results.addProperty("encoding", "raw");tts_results.addProperty("sample_rate", 16000);tts_results.addProperty("channels", 1);tts_results.addProperty("bit_depth", 16);tts.add("tts_results", tts_results);parameter.add("ist", ist);parameter.add("streamtrans", streamtrans);parameter.add("tts", tts);//填充payloaddata.addProperty("audio", Base64.getEncoder().encodeToString(Arrays.copyOf(audioDataByteArray, len)));data.addProperty("encoding", encoding);data.addProperty("sample_rate", 16000);data.addProperty("status", status);data.addProperty("seq", count);payload.add("data", data);//填充frameframe.add("header", header);frame.add("parameter", parameter);frame.add("payload", payload);webSocket.send(frame.toString());status = StatusContinueFrame;  // 发送完第一帧改变status 为 1System.out.println("send first 请开始说出中文:");break;case StatusContinueFrame:  //中间帧status = 1JsonObject contineuFrame = new JsonObject();JsonObject header1 = new JsonObject();JsonObject payload1 = new JsonObject();JsonObject data1 = new JsonObject();// 填充headheader1.addProperty("status", 1);header1.addProperty("app_id", APPID);//填充payloaddata1.addProperty("audio", Base64.getEncoder().encodeToString(Arrays.copyOf(audioDataByteArray, len)));data1.addProperty("encoding", encoding);data1.addProperty("sample_rate", 16000);data1.addProperty("status", status);data1.addProperty("seq", count);payload1.add("data", data1);contineuFrame.add("header", header1);contineuFrame.add("payload", payload1);webSocket.send(contineuFrame.toString());//  System.out.println("send continue");break;case StatusLastFrame:    // 最后一帧音频status = 2 ,标志音频发送结束String audio = "";if (len != 0) {audio = Base64.getEncoder().encodeToString(Arrays.copyOf(audioDataByteArray, len));}JsonObject lastFrame = new JsonObject();JsonObject header2 = new JsonObject();JsonObject payload2 = new JsonObject();JsonObject data2 = new JsonObject();// 填充headheader2.addProperty("status", 2);header2.addProperty("app_id", APPID);//填充payloaddata2.addProperty("audio", audio);data2.addProperty("encoding", encoding);data2.addProperty("sample_rate", 16000);data2.addProperty("status", status);data2.addProperty("seq", count);payload2.add("data", data2);lastFrame.add("header", header2);lastFrame.add("payload", payload2);webSocket.send(lastFrame.toString());System.out.println("send last 中文讲话结束!");break end;}count++;Thread.sleep(interval); //模拟音频采样延时}System.out.println("all data is send 所有音频数据发送完毕!");} catch (Exception e) {e.printStackTrace();}}@Overridepublic void onOpen(WebSocket webSocket, Response response) {super.onOpen(webSocket, response);// System.out.println("open connection");}// 客户端接收服务端的消息并处理@Overridepublic void onMessage(WebSocket webSocket, String text) {super.onMessage(webSocket, text);ResponseData resp = gson.fromJson(text, ResponseData.class);// System.err.println(text);if (resp != null) {if (resp.header.code != 0) {System.out.println("error=>" + resp.header.message + " sid=" + resp.header.sid + " 错误码=" + resp.header.code);return;}if (resp.header != null) {if (resp.header.code == 0) {// System.out.println(text);if (resp.payload != null) {// 接收到的识别结果写到文本if (resp.payload.recognition_results != null) {String s1 = resp.payload.recognition_results.text;byte[] trans1 = Base64.getDecoder().decode(s1);String res1 = new String(trans1);try {writeStringToFile(res1, asr_result);} catch (IOException e) {e.printStackTrace();}}// 接收到的翻译结果写到文本if (resp.payload.streamtrans_results != null) {String s2 = resp.payload.streamtrans_results.text;byte[] trans = Base64.getDecoder().decode(s2);String res = new String(trans);try {writeStringToFile(res, trans_result);} catch (IOException e) {e.printStackTrace();}}// 把接收到的音频流合成PCMif (resp.payload.tts_results != null) {String s = resp.payload.tts_results.audio;queue.add(s);// System.err.println("执行一次");try {writeBytesToFile(Base64.getDecoder().decode(s), outPutPcm);} catch (IOException e) {e.printStackTrace();}}}}if (resp.header.status == 2) {// todo  resp.data.status ==2 说明数据全部返回完毕,可以关闭连接,释放资源System.out.println("session end  同声传译返回完毕!");System.out.println("本次请求的sid==》 " + resp.header.sid);System.out.println("数据处理完毕,等待实时转译结束!");overFlag = true;try {// 流程完毕后,输出音频文件,把PCM转换为WAVPcmToWav.convertAudioFiles(outPutPcm, outPutWav);} catch (IOException e) {e.printStackTrace();}webSocket.close(1000, "");if (queue.size() == 0) {System.exit(0);}} else {// todo 根据返回的数据处理}}}}@Overridepublic void onFailure(WebSocket webSocket, Throwable t, Response response) {super.onFailure(webSocket, t, response);System.out.println(t.getMessage());try {System.out.println("错误信息:" + response);if (response == null) {return;}System.out.println("错误信息" + response.code());System.out.println(response.body().string());} catch (IOException e) {e.printStackTrace();}}// 实时播放音频流方法static class videoPlayer implements Runnable {@Overridepublic void run() {while (true) {if (overFlag && queue.size() == 0) {break;}if (queue.size() != 0) {String poll = queue.poll();VideoPlayerService.videoPlay(Base64.getDecoder().decode(poll));}}System.out.println("实时转译结束!!!");System.exit(1000);}}// 清空已存在文件public static void clearDir() {String path = "output";File file = new File(path);for (File f : file.listFiles()) {if (f.isDirectory()) {for (File subFile : f.listFiles()) {if (subFile != null) {subFile.delete();}}}}System.out.println("结果集初始化成功------");}// 写入文件public static void writeBytesToFile(byte[] bs, String path) throws IOException {OutputStream out = new FileOutputStream(path, true);InputStream is = new ByteArrayInputStream(bs);byte[] buff = new byte[1024];int len = 0;while ((len = is.read(buff)) != -1) {out.write(buff, 0, len);}is.close();out.close();}// 写入文件public static void writeStringToFile(String content, String path) throws IOException {OutputStream out = new FileOutputStream(path, true);out.write(content.getBytes());out.close();}// JSON解析public static class ResponseData {header header;payload payload;}public static class payload {streamtrans_results streamtrans_results;recognition_results recognition_results;tts_results tts_results;@Overridepublic String toString() {return "payload{" + "streamtrans_results=" + streamtrans_results + ", recognition_results=" + recognition_results + ", tts_results=" + tts_results + '}';}}public static class header {int code;String message;String sid;int status;}public static class recognition_results {String encoding;String format;String text;int status;@Overridepublic String toString() {return "recognition_results{" + "encoding='" + encoding + '\'' + ", format='" + format + '\'' + ", text='" + text + '\'' + ", status=" + status + '}';}}public static class streamtrans_results {String encoding;String format;String text;int status;@Overridepublic String toString() {return "streamtrans_results{" + "encoding='" + encoding + '\'' + ", format='" + format + '\'' + ", text='" + text + '\'' + ", status=" + status + '}';}}public static class tts_results {String encoding;String audio;int sample_rate;int channels;int bit_depth;int status;int seq;int frame_size;@Overridepublic String toString() {return "tts_results{" + "encoding='" + encoding + '\'' + ", audio='" + audio + '\'' + ", sample_rate=" + sample_rate + ", channels=" + channels + ", bit_depth=" + bit_depth + ", status=" + status + ", seq=" + seq + ", frame_size=" + frame_size + '}';}}
}

三、鉴权代码

package main.com.util;import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;/*** @Author:sjliu7* 鉴权使用* @Date:2019/7/31 15:23*/
public class AuthUtils {private static final String serviceId = "simult_interpretation";/*** 生成用于鉴权的URL,websocket 接口* @param requestUrl* @param apiKey* @param apiSecret* @return final requestUrl*/public static String assembleRequestUrl(String requestUrl, String apiKey, String apiSecret) {URL url = null;String  httpRequestUrl = requestUrl.replace("ws://", "http://").replace("wss://","https://" );try {url = new URL(httpRequestUrl);SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss z", Locale.US);// format.setTimeZone(TimeZone.getTimeZone("UTC"));format.setTimeZone(TimeZone.getTimeZone("GMT"));String date = format.format(new Date());// date = "Mon, 13 Dec 2021 03:05:05 GMT";String host = url.getHost();StringBuilder builder = new StringBuilder("host: ").append(host).append("\n").//append("date: ").append(date).append("\n").//append("GET ").append(url.getPath()).append(" HTTP/1.1");// System.out.println(builder);Charset charset = Charset.forName("UTF-8");Mac mac = Mac.getInstance("hmacsha256");// System.out.println(builder.toString());SecretKeySpec spec = new SecretKeySpec(apiSecret.getBytes(charset), "hmacsha256");mac.init(spec);byte[] hexDigits = mac.doFinal(builder.toString().getBytes(charset));String sha = Base64.getEncoder().encodeToString(hexDigits);// System.out.println(sha);String authorization = String.format("api_key=\"%s\", algorithm=\"%s\", headers=\"%s\", signature=\"%s\"", apiKey, "hmac-sha256", "host date request-line", sha);String authBase = Base64.getEncoder().encodeToString(authorization.getBytes(charset));// System.out.println(authBase);// System.out.println(String.format("%s?authorization=%s&host=%s&date=%s&serviceId=%s", requestUrl, URLEncoder.encode(authBase), URLEncoder.encode(host), URLEncoder.encode(date),serviceId));return String.format("%s?authorization=%s&host=%s&date=%s&serviceId=%s", requestUrl, URLEncoder.encode(authBase), URLEncoder.encode(host), URLEncoder.encode(date),serviceId);} catch (Exception e) {throw new RuntimeException("assemble requestUrl error:"+e.getMessage());}}
}

四、PCM转成WAV

package main.com.util;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
public class PcmToWav {/*** @param src    待转换文件路径* @param target 目标文件路径* @throws IOException 抛出异常*/public static void convertAudioFiles(String src, String target) throws IOException {FileInputStream fis = new FileInputStream(src);FileOutputStream fos = new FileOutputStream(target);//计算长度byte[] buf = new byte[1024 * 4];int size = fis.read(buf);int PCMSize = 0;while (size != -1) {PCMSize += size;size = fis.read(buf);}fis.close();//填入参数,比特率等等。这里用的是16位单声道 8000 hzWaveHeader header = new WaveHeader();//长度字段 = 内容的大小(PCMSize) + 头部字段的大小(不包括前面4字节的标识符RIFF以及fileLength本身的4字节)header.fileLength = PCMSize + (44 - 8);header.FmtHdrLeth = 16;header.BitsPerSample = 16;header.Channels = 2;header.FormatTag = 0x0001;header.SamplesPerSec = 8000;header.BlockAlign = (short) (header.Channels * header.BitsPerSample / 8);header.AvgBytesPerSec = header.BlockAlign * header.SamplesPerSec;header.DataHdrLeth = PCMSize;byte[] h = header.getHeader();assert h.length == 44; //WAV标准,头部应该是44字节fos.write(h, 0, h.length);fis = new FileInputStream(src);size = fis.read(buf);while (size != -1) {fos.write(buf, 0, size);size = fis.read(buf);}fis.close();fos.close();System.out.println("Convert OK!");}
}

五、音频播放

package main.com.util;
import javax.sound.sampled.*;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class VideoPlayerService {public static SourceDataLine auline = null;static {AudioFormat audioFormat=new AudioFormat(16000F, 16, 1,true,false);DataLine.Info info = new DataLine.Info(SourceDataLine.class, audioFormat);try {auline = (SourceDataLine) AudioSystem.getLine(info);auline.open(audioFormat);auline.start();} catch (LineUnavailableException e) {e.printStackTrace();} catch (Exception e) {e.printStackTrace();}}public static byte[] byteArray(String file) throws IOException {BufferedInputStream in = new BufferedInputStream(new FileInputStream(file));ByteArrayOutputStream out = new ByteArrayOutputStream(1024);System.out.println("Available bytes:" + in.available());byte[] temp = new byte[1024];int size = 0;while ((size = in.read(temp)) != -1) {out.write(temp, 0, size);}in.close();byte[] content = out.toByteArray();return content;}public static void videoPlay(byte[] video){auline.write(video,0,video.length);}
}

六、WAV头添加

package main.com.util;import java.io.ByteArrayOutputStream;
import java.io.IOException;public class WaveHeader {public final char fileID[] = {'R', 'I', 'F', 'F'};public int fileLength;public char wavTag[] = {'W', 'A', 'V', 'E'};public char FmtHdrID[] = {'f', 'm', 't', ' '};public int FmtHdrLeth;public short FormatTag;public short Channels;public int SamplesPerSec;public int AvgBytesPerSec;public short BlockAlign;public short BitsPerSample;public char DataHdrID[] = {'d', 'a', 't', 'a'};public int DataHdrLeth;public byte[] getHeader() throws IOException {ByteArrayOutputStream bos = new ByteArrayOutputStream();WriteChar(bos, fileID);WriteInt(bos, fileLength);WriteChar(bos, wavTag);WriteChar(bos, FmtHdrID);WriteInt(bos, FmtHdrLeth);WriteShort(bos, FormatTag);WriteShort(bos, Channels);WriteInt(bos, SamplesPerSec);WriteInt(bos, AvgBytesPerSec);WriteShort(bos, BlockAlign);WriteShort(bos, BitsPerSample);WriteChar(bos, DataHdrID);WriteInt(bos, DataHdrLeth);bos.flush();byte[] r = bos.toByteArray();bos.close();return r;}private void WriteShort(ByteArrayOutputStream bos, int s) throws IOException {byte[] mybyte = new byte[2];mybyte[1] = (byte) ((s << 16) >> 24);mybyte[0] = (byte) ((s << 24) >> 24);bos.write(mybyte);}private void WriteInt(ByteArrayOutputStream bos, int n) throws IOException {byte[] buf = new byte[4];buf[3] = (byte) (n >> 24);buf[2] = (byte) ((n << 8) >> 24);buf[1] = (byte) ((n << 16) >> 24);buf[0] = (byte) ((n << 24) >> 24);bos.write(buf);}private void WriteChar(ByteArrayOutputStream bos, char[] id) {for (char c : id) {bos.write(c);}}
}

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

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

相关文章

HarmonyOS Next 原生应用开发-从TS到ArkTS的适配规则(一)

一、强制使用静态类型 静态类型是ArkTS最重要的特性之一。如果程序采用静态类型&#xff0c;即所有类型在编译时都是已知的&#xff0c;那么开发者就能够容易理解代码中使用了哪些数据结构。同时&#xff0c;由于所有类型在程序实际运行前都是已知的&#xff0c;编译器可以提前…

【UE 网络】多人游戏开发时应该如何区分客户端逻辑和服务端逻辑 入门篇

目录 0 引言1 服务器和客户端逻辑1.1 服务器职责1.2 客户端职责 2 函数会在客户端执行还是服务端&#xff1f;2.1 只在客户端执行的函数RepNotifyClient RPCMulticast RPC 2.2 只在服务端执行的函数GameModeServer RPC 2.3 在两端都可以执行的函数GetNetMode() 和 HasAuthority…

LangGraph 和 AutoGen 的对比

LangGraph 和 AutoGen 都是用于构建大型语言模型 (LLM) 应用程序的框架。它们都旨在使开发人员更容易地控制 LLM 并使其适应特定任务。但是&#xff0c;这两种框架之间存在一些关键差异。 代理架构 LangGraph 和 AutoGen 之间最大的区别在于代理的构建方式。LangGraph 使用更…

用C#的MediaDevices程序集打开MTP设备(用usb线连接的手机)的文件夹

一、任务描述 1、可以访问MTP设备的桌面程序。 MTP设备&#xff1a;支持媒体传输协议(MTP)的设备&#xff0c;MTP简单来说就是一种PC与其他设备相连的一种协议&#xff0c;智能手机、平板电脑、数码相机等可以通过 USB 连接到电脑&#xff0c;并通过 MTP 协议传输媒体文件。点…

PLC_博图系列☞F_TRIG:检测信号下降沿

PLC_博图系列☞F_TRIG&#xff1a;检测信号下降沿 文章目录 PLC_博图系列☞F_TRIG&#xff1a;检测信号下降沿背景介绍F_TRIG&#xff1a; 检测信号下降沿说明参数示例 关键字&#xff1a; PLC、 西门子、 博图、 Siemens 、 F_TRIG 背景介绍 这是一篇关于PLC编程的文章&a…

httpx.HTTPStatusError: Client error ‘429 Too Many Requests‘ for url ‘

httpx.HTTPStatusError: Client error ‘429 Too Many Requests’ for url ‘https://open.bigmodel.cn/api/paas/v4/chat/completions’ For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429 错误解释&#xff1a; httpx.HTTPStatusE…

LeetCode:3115. 质数的最大距离(Java 筛质数)

目录 3115. 质数的最大距离 题目描述&#xff1a; 实现代码与解析&#xff1a; 筛质数 原理思路&#xff1a; 3115. 质数的最大距离 题目描述&#xff1a; 给你一个整数数组 nums。 返回两个&#xff08;不一定不同的&#xff09;质数在 nums 中 下标 的 最大距离。 示…

Swift中的二分查找:全面指南

Swift中的二分查找&#xff1a;全面指南 简介 二分查找是计算机科学中的经典算法&#xff0c;被广泛用于在已排序的数组中高效地搜索目标值。与线性查找逐个检查每个元素不同&#xff0c;二分查找不断将搜索区间减半&#xff0c;因此在处理大数据集时要快得多。 在这篇博客中…

从零到百万用户的扩展之路

写在前面: 此博客内容已经同步到我的博客网站,如需要获得更优的阅读体验请前往https://mainjaylai.github.io/Blog/blog/system/design-system 设计一个支持数百万用户的系统是极具挑战性的,它是一段需要持续优化和不断改进的旅程。在这篇博客中,我们将构建一个支持单个用…

NC13611 树(dfs序+区间dp)

链接 思路&#xff1a; 容易知道对于同一种颜色的子图一定是仅由该颜色的点连通的。设我们要划分的个数为x&#xff08;x<k&#xff09;&#xff0c;也就是说我们要选出x-1条边&#xff0c;这里有种情况。那么我们需要选出x种颜色&#xff0c;这里有种情况。然后我们需要将…

英国Assignment写作怎么积累经验?

最近很多留学生每天都要熬夜&#xff0c;吓死宝宝了。关键是最后还是会fall了啊&#xff01;其实英国Assignment写作是要靠日积月累的写作经验的&#xff0c;虽然阅读量和写作水平无法一日千里&#xff0c;但是写作技巧却是可以速成的&#xff0c;我们一起来看看吧。 选题定方…

单线服务器有什么作用?

什么是单线服务器&#xff1f;单线服务器是指只有一条物理线路可以接入的服务器&#xff0c;这表明所有的数据信息与用户的访问请求都只能通过这一条线路来进行传输&#xff0c;因此单线服务器在服务器的性能与可扩展性方面有着一定的限制。 单线服务器与双线服务器相比&#x…

双端队列广搜——AcWing 175. 电路维修

双端队列广搜 定义 双端队列广搜&#xff08;Breadth-First Search with a Deque&#xff09;是一种图或树的遍历算法变体&#xff0c;它利用了双端队列&#xff08;Deque&#xff0c;全称Double Ended Queue&#xff0c;允许在其两端进行插入和删除操作&#xff09;作为数据…

1996-2023年各省财政收支数据(无缺失)(地方财政一般预算收入、地方财政一般预算支出)

1996-2023年各省财政收支数据&#xff08;无缺失&#xff09;&#xff08;地方财政一般预算收入、地方财政一般预算支出&#xff09; 1、时间&#xff1a;1996-2023年 2、来源&#xff1a;国家统计局、统计年鉴、 3、指标&#xff1a;地方财政一般预算收入、地方财政一般预算…

跨境业务经验推荐:三大优秀的IP代理服务商

作为一名多年从事跨境业务的老手&#xff0c;今天我要给大家介绍几款绝对靠谱的IP代理服务商&#xff0c;保证让你的全球业务更加顺畅&#xff01; 1. 711Proxy 711Proxy以其优秀的性能和覆盖范围广而著称。对于跨境电商和国际业务来说&#xff0c;快速稳定的网络连接至关重要…

d3dx9_43.dll丢失怎么解决?d3dx9_43.dll怎么安装详细教程

在使用计算机中&#xff0c;如果遇到d3dx9_43.dll丢失或许找不到d3dx9_43.dll无法运行打开软件怎么办&#xff1f;这个是非常常见问题&#xff0c;下面我详细介绍一下d3dx9_43.dll是什么文件与d3dx9_43.dll的各种问题以及d3dx9_43.dll丢失的多个解决方法&#xff01; 一、d3dx9…

Zynq—按键控制LED灯闪烁

一、GPIO简介 ZYNQ 的 IO包括对外连接的 GPIO 和内部 PS 与 PL 通信的 AXIO。其中对外的 GPIO 又分为 两种&#xff1a; MIO 和 EMIO。 MIO 和 EMIO 只是 GPIO 信号的两种接口&#xff0c; MIO 直连到PS(数量有限)&#xff0c; EMIO 则是 PS 扩展到 PL&#xff0c;从 PL 接出的…

UTONMOS:探索未来区块链与元宇宙的游戏奇妙融合

在科技的飞速发展浪潮中&#xff0c;区块链技术正以前所未有的力量重塑着各个领域&#xff0c;而游戏行业也迎来了一场前所未有的变革——元宇宙游戏的崛起。 元宇宙&#xff0c;这个充满无限想象的虚拟世界&#xff0c;让玩家能够沉浸其中&#xff0c;体验超越现实的奇幻之旅。…

springboot评选投票系统-计算机毕业设计源码15837

摘 要 本文介绍的是基于Spring Boot开发的评选投票系统小程序。该系统旨在为用户提供一个便捷、高效的平台&#xff0c;以实现评选活动的投票功能。随着社交媒体和互联网的普及&#xff0c;评选活动已成为各行业中常见的形式&#xff0c;如最佳歌曲、最佳演员等。然而&#xf…

【SQL Server数据库】数据库完整性实验

目录 一、要求 1、认真学习三类完整性、CHECK短语、CONSTRAINT字句的使用&#xff0c;完成下列内容。 1.1 根据上表&#xff0c;在TEST数据库中建立数据表Table1。 1.2 在TEST数据库中创建Table2&#xff0c;只含各个基本列&#xff08;包括列名和数据类型&#xff0c;标识…