基于TCP协议的Socket通信

news2024/9/22 3:49:40

上节中我们给大家接触了Socket的一些基本概念以及使用方法,相信大家对Socket已经有了初步的掌握。本节我们学习使用Socket来实现大文件的断点续传!在这里我们以他人的案例进行讲解,这是别人写好的一个Socket上传大文件的例子,不要求我们自己可以写出来,需要的时候会用就好!

1.运行效果图

1.先把我们编写好的Socket服务端运行起来

2.将一个音频文件放到SD卡根目录下

3.运行我们的客户端

4.上传成功后可以看到我们的服务端的项目下生成一个file的文件夹,我们可以在这里找到上传的文件:.log那个是我们的日志文件

2.实现流程图

3.代码示例:

先编写一个服务端和客户端都会用到的流解析类:

StreamTool.java

public class StreamTool {

    public static void save(File file, byte[] data) throws Exception {
        FileOutputStream outStream = new FileOutputStream(file);
        outStream.write(data);
        outStream.close();
    }

    public static String readLine(PushbackInputStream in) throws IOException {
        char buf[] = new char[128];
        int room = buf.length;
        int offset = 0;
        int c;
        loop:       while (true) {
            switch (c = in.read()) {
                case -1:
                case '\n':
                    break loop;
                case '\r':
                    int c2 = in.read();
                    if ((c2 != '\n') && (c2 != -1)) in.unread(c2);
                    break loop;
                default:
                    if (--room < 0) {
                        char[] lineBuffer = buf;
                        buf = new char[offset + 128];
                        room = buf.length - offset - 1;
                        System.arraycopy(lineBuffer, 0, buf, 0, offset);

                    }
                    buf[offset++] = (char) c;
                    break;
            }
        }
        if ((c == -1) && (offset == 0)) return null;
        return String.copyValueOf(buf, 0, offset);
    }

    /**
     * 读取流
     * @param inStream
     * @return 字节数组
     * @throws Exception
     */
    public static byte[] readStream(InputStream inStream) throws Exception{
        ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
        byte[] buffer = new byte[1024];
        int len = -1;
        while( (len=inStream.read(buffer)) != -1){
            outSteam.write(buffer, 0, len);
        }
        outSteam.close();
        inStream.close();
        return outSteam.toByteArray();
    }
} 

1)服务端的实现:

socket管理与多线程管理类:

FileServer.java

public class FileServer {  
    
    private ExecutorService executorService;//线程池  
    private int port;//监听端口  
    private boolean quit = false;//退出  
    private ServerSocket server;  
    private Map<Long, FileLog> datas = new HashMap<Long, FileLog>();//存放断点数据  
      
    public FileServer(int port){  
        this.port = port;  
        //创建线程池,池中具有(cpu个数*50)条线程  
        executorService = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors() * 50);  
    }  
    /** 
     * 退出 
     */  
    public void quit(){  
       this.quit = true;  
       try {  
           server.close();  
       } catch (IOException e) {  
       }  
    }  
    /** 
     * 启动服务 
     * @throws Exception 
     */  
    public void start() throws Exception{  
        server = new ServerSocket(port);  
        while(!quit){  
            try {  
              Socket socket = server.accept();  
              //为支持多用户并发访问,采用线程池管理每一个用户的连接请求  
              executorService.execute(new SocketTask(socket));  
            } catch (Exception e) {  
              //  e.printStackTrace();  
            }  
        }  
    }  
      
    private final class SocketTask implements Runnable{  
       private Socket socket = null;  
       public SocketTask(Socket socket) {  
           this.socket = socket;  
       }  
         
       public void run() {  
           try {  
               System.out.println("accepted connection "+ socket.getInetAddress()+ ":"+ socket.getPort());  
               PushbackInputStream inStream = new PushbackInputStream(socket.getInputStream());  
               //得到客户端发来的第一行协议数据:Content-Length=143253434;filename=xxx.3gp;sourceid=  
               //如果用户初次上传文件,sourceid的值为空。  
               String head = StreamTool.readLine(inStream);  
               System.out.println(head);  
               if(head!=null){  
                   //下面从协议数据中提取各项参数值  
                   String[] items = head.split(";");  
                   String filelength = items[0].substring(items[0].indexOf("=")+1);  
                   String filename = items[1].substring(items[1].indexOf("=")+1);  
                   String sourceid = items[2].substring(items[2].indexOf("=")+1);        
                   long id = System.currentTimeMillis();//生产资源id,如果需要唯一性,可以采用UUID  
                   FileLog log = null;  
                   if(sourceid!=null && !"".equals(sourceid)){  
                       id = Long.valueOf(sourceid);  
                       log = find(id);//查找上传的文件是否存在上传记录  
                   }  
                   File file = null;  
                   int position = 0;  
                   if(log==null){//如果不存在上传记录,为文件添加跟踪记录  
                       String path = new SimpleDateFormat("yyyy/MM/dd/HH/mm").format(new Date());  
                       File dir = new File("file/"+ path);  
                       if(!dir.exists()) dir.mkdirs();  
                       file = new File(dir, filename);  
                       if(file.exists()){//如果上传的文件发生重名,然后进行改名  
                           filename = filename.substring(0, filename.indexOf(".")-1)+ dir.listFiles().length+ filename.substring(filename.indexOf("."));  
                           file = new File(dir, filename);  
                       }  
                       save(id, file);  
                   }else{// 如果存在上传记录,读取已经上传的数据长度  
                       file = new File(log.getPath());//从上传记录中得到文件的路径  
                       if(file.exists()){  
                           File logFile = new File(file.getParentFile(), file.getName()+".log");  
                           if(logFile.exists()){  
                               Properties properties = new Properties();  
                               properties.load(new FileInputStream(logFile));  
                               position = Integer.valueOf(properties.getProperty("length"));//读取已经上传的数据长度  
                           }  
                       }  
                   }  
                     
                   OutputStream outStream = socket.getOutputStream();  
                   String response = "sourceid="+ id+ ";position="+ position+ "\r\n";  
                   //服务器收到客户端的请求信息后,给客户端返回响应信息:sourceid=1274773833264;position=0  
                   //sourceid由服务器端生成,唯一标识上传的文件,position指示客户端从文件的什么位置开始上传  
                   outStream.write(response.getBytes());  
                     
                   RandomAccessFile fileOutStream = new RandomAccessFile(file, "rwd");  
                   if(position==0) fileOutStream.setLength(Integer.valueOf(filelength));//设置文件长度  
                   fileOutStream.seek(position);//指定从文件的特定位置开始写入数据  
                   byte[] buffer = new byte[1024];  
                   int len = -1;  
                   int length = position;  
                   while( (len=inStream.read(buffer)) != -1){//从输入流中读取数据写入到文件中  
                       fileOutStream.write(buffer, 0, len);  
                       length += len;  
                       Properties properties = new Properties();  
                       properties.put("length", String.valueOf(length));  
                       FileOutputStream logFile = new FileOutputStream(new File(file.getParentFile(), file.getName()+".log"));  
                       properties.store(logFile, null);//实时记录已经接收的文件长度  
                       logFile.close();  
                   }  
                   if(length==fileOutStream.length()) delete(id);  
                   fileOutStream.close();                    
                   inStream.close();  
                   outStream.close();  
                   file = null;  
                     
               }  
           } catch (Exception e) {  
               e.printStackTrace();  
           }finally{  
               try {  
                   if(socket!=null && !socket.isClosed()) socket.close();  
               } catch (IOException e) {}  
           }  
       }  
    }  
      
    public FileLog find(Long sourceid){  
        return datas.get(sourceid);  
    }  
    //保存上传记录  
    public void save(Long id, File saveFile){  
        //日后可以改成通过数据库存放  
        datas.put(id, new FileLog(id, saveFile.getAbsolutePath()));  
    }  
    //当文件上传完毕,删除记录  
    public void delete(long sourceid){  
        if(datas.containsKey(sourceid)) datas.remove(sourceid);  
    }  
      
    private class FileLog{  
       private Long id;  
       private String path;  
       public Long getId() {  
           return id;  
       }  
       public void setId(Long id) {  
           this.id = id;  
       }  
       public String getPath() {  
           return path;  
       }  
       public void setPath(String path) {  
           this.path = path;  
       }  
       public FileLog(Long id, String path) {  
           this.id = id;  
           this.path = path;  
       }     
    }  
 
}  

服务端界面类:ServerWindow.java

public class ServerWindow extends Frame {
    private FileServer s = new FileServer(12345);
    private Label label;

    public ServerWindow(String title) {
        super(title);
        label = new Label();
        add(label, BorderLayout.PAGE_START);
        label.setText("服务器已经启动");
        this.addWindowListener(new WindowListener() {
            public void windowOpened(WindowEvent e) {
                new Thread(new Runnable() {
                    public void run() {
                        try {
                            s.start();
                        } catch (Exception e) {
                            // e.printStackTrace();
                        }
                    }
                }).start();
            }

            public void windowIconified(WindowEvent e) {
            }

            public void windowDeiconified(WindowEvent e) {
            }

            public void windowDeactivated(WindowEvent e) {
            }

            public void windowClosing(WindowEvent e) {
                s.quit();
                System.exit(0);
            }

            public void windowClosed(WindowEvent e) {
            }

            public void windowActivated(WindowEvent e) {
            }
        });
    }

    /**
     * @param args
     */
    public static void main(String[] args) throws IOException {
        InetAddress address = InetAddress.getLocalHost();
        ServerWindow window = new ServerWindow("文件上传服务端:" + address.getHostAddress());
        window.setSize(400, 300);
        window.setVisible(true);

    }

}

2)客户端(Android端)

首先是布局文件:activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    android:padding="5dp">

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="文件名"
        android:textSize="18sp" />

    <EditText
        android:id="@+id/edit_fname"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Nikki Jamal - Priceless.mp3" />

    <Button
        android:id="@+id/btn_upload"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="上传" />

    <Button
        android:id="@+id/btn_stop"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="停止" />

    <ProgressBar
        android:id="@+id/pgbar"
        style="@android:style/Widget.ProgressBar.Horizontal"
        android:layout_width="fill_parent"
        android:layout_height="40px" />

    <TextView
        android:id="@+id/txt_result"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center" />
</LinearLayout> 

因为断点续传,我们需要保存上传的进度,我们需要用到数据库,这里我们定义一个数据库管理类:DBOpenHelper.java:

/**
 * Created by Jay on 2015/9/17 0017.
 */
public class DBOpenHelper extends SQLiteOpenHelper {

    public DBOpenHelper(Context context) {
        super(context, "jay.db", null, 1);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("CREATE TABLE IF NOT EXISTS uploadlog (_id integer primary key autoincrement, path varchar(20), sourceid varchar(20))");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}

然后是数据库操作类:UploadHelper.java

/**
 * Created by Jay on 2015/9/17 0017.
 */
public class UploadHelper {
    private DBOpenHelper dbOpenHelper;

    public UploadHelper(Context context) {
        dbOpenHelper = new DBOpenHelper(context);
    }

    public String getBindId(File file) {
        SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
        Cursor cursor = db.rawQuery("select sourceid from uploadlog where path=?", new String[]{file.getAbsolutePath()});
        if (cursor.moveToFirst()) {
            return cursor.getString(0);
        }
        return null;
    }

    public void save(String sourceid, File file) {
        SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
        db.execSQL("insert into uploadlog(path,sourceid) values(?,?)",
                new Object[]{file.getAbsolutePath(), sourceid});
    }

    public void delete(File file) {
        SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
        db.execSQL("delete from uploadlog where path=?", new Object[]{file.getAbsolutePath()});
    }
}

对了,别忘了客户端也要贴上那个流解析类哦,最后就是我们的MainActivity.java了:

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private EditText edit_fname;
    private Button btn_upload;
    private Button btn_stop;
    private ProgressBar pgbar;
    private TextView txt_result;

    private UploadHelper upHelper;
    private boolean flag = true;


    private Handler handler = new Handler() {
        @Override
        public void handleMessage(Message msg) {
            pgbar.setProgress(msg.getData().getInt("length"));
            float num = (float) pgbar.getProgress() / (float) pgbar.getMax();
            int result = (int) (num * 100);
            txt_result.setText(result + "%");
            if (pgbar.getProgress() == pgbar.getMax()) {
                Toast.makeText(MainActivity.this, "上传成功", Toast.LENGTH_SHORT).show();
            }
        }
    };

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        bindViews();
        upHelper = new UploadHelper(this);
    }

    private void bindViews() {
        edit_fname = (EditText) findViewById(R.id.edit_fname);
        btn_upload = (Button) findViewById(R.id.btn_upload);
        btn_stop = (Button) findViewById(R.id.btn_stop);
        pgbar = (ProgressBar) findViewById(R.id.pgbar);
        txt_result = (TextView) findViewById(R.id.txt_result);

        btn_upload.setOnClickListener(this);
        btn_stop.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.btn_upload:
                String filename = edit_fname.getText().toString();
                flag = true;
                if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
                    File file = new File(Environment.getExternalStorageDirectory(), filename);
                    if (file.exists()) {
                        pgbar.setMax((int) file.length());
                        uploadFile(file);
                    } else {
                        Toast.makeText(MainActivity.this, "文件并不存在~", Toast.LENGTH_SHORT).show();
                    }
                } else {
                    Toast.makeText(MainActivity.this, "SD卡不存在或者不可用", Toast.LENGTH_SHORT).show();
                }
                break;
            case R.id.btn_stop:
                flag = false;
                break;
        }
    }

    private void uploadFile(final File file) {
        new Thread(new Runnable() {
            public void run() {
                try {
                    String sourceid = upHelper.getBindId(file);
                    Socket socket = new Socket("172.16.2.54", 12345);
                    OutputStream outStream = socket.getOutputStream();
                    String head = "Content-Length=" + file.length() + ";filename=" + file.getName()
                            + ";sourceid=" + (sourceid != null ? sourceid : "") + "\r\n";
                    outStream.write(head.getBytes());

                    PushbackInputStream inStream = new PushbackInputStream(socket.getInputStream());
                    String response = StreamTool.readLine(inStream);
                    String[] items = response.split(";");
                    String responseSourceid = items[0].substring(items[0].indexOf("=") + 1);
                    String position = items[1].substring(items[1].indexOf("=") + 1);
                    if (sourceid == null) {//如果是第一次上传文件,在数据库中不存在该文件所绑定的资源id
                        upHelper.save(responseSourceid, file);
                    }
                    RandomAccessFile fileOutStream = new RandomAccessFile(file, "r");
                    fileOutStream.seek(Integer.valueOf(position));
                    byte[] buffer = new byte[1024];
                    int len = -1;
                    int length = Integer.valueOf(position);
                    while (flag && (len = fileOutStream.read(buffer)) != -1) {
                        outStream.write(buffer, 0, len);
                        length += len;//累加已经上传的数据长度
                        Message msg = new Message();
                        msg.getData().putInt("length", length);
                        handler.sendMessage(msg);
                    }
                    if (length == file.length()) upHelper.delete(file);
                    fileOutStream.close();
                    outStream.close();
                    inStream.close();
                    socket.close();
                } catch (Exception e) {
                    Toast.makeText(MainActivity.this, "上传异常~", Toast.LENGTH_SHORT).show();
                }
            }
        }).start();
    }

}

最后,还有,记得往**AndroidManifest.xml**中写入这些权限哦!

<!-- 在SDCard中创建与删除文件权限 -->
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>
<!-- 往SDCard写入数据权限 -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- 访问internet权限 -->
<uses-permission android:name="android.permission.INTERNET"/>

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

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

相关文章

TensorFlow Lite,ML Kit 和 Flutter 移动深度学习:6~11

原文&#xff1a;Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter 协议&#xff1a;CC BY-NC-SA 4.0 译者&#xff1a;飞龙 本文来自【ApacheCN 深度学习 译文集】&#xff0c;采用译后编辑&#xff08;MTPE&#xff09;流程来尽可能提升效率。 不要担心自己的…

MySQL(表的增删改查)

文章目录 0. 前言1. Create1.1 单行数据 全列插入1.2 多行数据 指定列插入1.3 插入否则更新1.4 替换 2. Retrieve2.1 SELECT 列2.1.1 全列查询2.1.2 指定列查询2.1.3 查询字段为表达式2.1.4 为查询结果指定别名2.1.5 结果去重 2.2 WHERE 条件2.2.1 英语不及格的同学及英语成绩…

【消息队列】聊一下Kafka多线程消费实例

Kafka Java Consumer设计原理 目前市面上大多数计算机都采用多核CPU来提升系统的处理性能&#xff0c;但是如果在程序开发层面使用单线程的话&#xff0c;那么必定不能完全发挥出系统的真实性能&#xff0c;而kafka Consumer就是单线程的。而这个只是针对于消费消息这个层面来…

【AI热点技术】ChatGPT开源替代品——LLaMA系列之「羊驼家族」

ChatGPT开源替代品——LLaMA系列之「羊驼家族」 1. Alpaca2. Vicuna3. Koala4. ChatLLaMA5. FreedomGPT6. ColossalChat完整的 ChatGPT 克隆解决方案中英双语训练数据集完整的RLHF管线 相关链接 现在如果问什么最火&#xff0c;很多人第一反应肯定就是ChatGPT。的确&#xff0c…

Redis集群模式下使用config set 命令所有节点都会生效吗?

Redis集群模式下使用config set 命令所有节点都会生效吗? 问题: Redis集群模式下使用config set 命令所有节点都会生效吗? 实践检验真理: 前置准备 Redis版本:5.0.5版本 Redis集群模式:三主三从 操作步骤: 分别连接7001节点与7002节点,准备在7001节点使用”config get”…

交友项目【查询好友动态,查询推荐动态】实现

目录 1&#xff1a;圈子 1.1&#xff1a;查询好友动态 1.1.1&#xff1a;接口分析 1.1.2&#xff1a;流程分析 1.1.2&#xff1a;代码实现 1.2&#xff1a;查询推荐动态 1.2.1&#xff1a;接口分析 1.2.2&#xff1a;流程分析 1.2.3&#xff1a;代码实现 1&#xff1a…

Python教程:如何用PIL将图片转换为ASCII艺术

Python教程&#xff1a;如何用PIL将图片转换为ASCII艺术 ASCII 艺术是一种将图像转换为由字符组成的艺术形式。Python 是一种灵活而强大的编程语言&#xff0c;可以使用它来将图片转换为 ASCII 艺术。本文将介绍如何使用 Python 和 PIL 库来实现这一功能。 文末有完整代码 效…

数学建模第一天:数学建模先导课之MATLAB的入门

目录 一、MATLAB的简介 二、Matlab基础知识 1. 变量 ①命名规则 ②特殊变量名 2、数学符号与函数调用 ①符号 ②数学函数 ③自定义函数 三、数组与矩阵 1、数组 ①创建数组 ②访问数组元素 ③数组运算 2、矩阵 ①定义 ②特殊矩阵 ③矩阵运算 四、控制流 …

若依项目springcloud启动

若依项目springcloud启动 参考&#xff1a;http://doc.ruoyi.vip/ruoyi-cloud/document/hjbs.html 1、概述 1.1、学习前提 熟练使用springboot相关技术了解springcloud相关技术电脑配置可以支持 1.2、需要的配置 JDK > 1.8 (推荐1.8版本) Mysql > 5.7.0 (推荐5.7版…

若依数据隔离 ${params.dataScope} 替换 优化为sql 替换

若依数据隔离 ${params.dataScope} 替换 优化为sql 替换 安全问题:有风险的SQL查询&#xff1a;MyBatis解决 若依框架的数据隔离是通过 ${params.dataScope} 实现的 但是在代码安全扫描的时候$ 符会提示有风险的SQL查询&#xff1a;MyBatis 所以我们这里需要进行优化参考: M…

凌恩生物文献分享|IF31.316→一网打尽与婴儿疾病相关的病毒组研究

期刊&#xff1a;Cell Host & Microbe 影响因子&#xff1a;31.316 发表时间&#xff1a;2022年4月 研究团队&#xff1a;清华大学医学院梁冠翔课题组与宾夕法尼亚大学医学院Frederic Bushman课题组 一、研究背景 已知微生物为人类提供营养物质和代谢物&…

AD、PADS、Cadence各有什么优势?

读者中有很大一部分是电子工程师&#xff0c;先想问下大家&#xff1a;你们画PCB常用什么软件&#xff1f; **函第一的AD? 还是最贵Cadence&#xff08;Allegro&#xff09;&#xff1f; 看到有读者在问&#xff1a;AD、PADS、Cadence各有什么优势&#xff1f; 这里就简单分…

一文吃透Java线程池——实现机制篇

前言 本篇博客是《一文吃透Java线程池》系列博客的下半部分。 上半部分链接&#xff1a;一文吃透Java线程池——基础篇 实现机制&#xff08;源码解析&#xff09; 根据前面的学习&#xff0c;我们知道&#xff0c;线程池是如下的运作机制 解析&#xff1a; 一开始&#…

Flutter插件开发-(进阶篇)

一、概述 Flutter也有自己的Dart Packages仓库。插件的开发和复用能够提高开发效率&#xff0c;降低工程的耦合度&#xff0c;像网络请求(http)、用户授权(permission_handler)等客户端开发常用的功能模块&#xff0c;我们只需要引入对应插件就可以为项目快速集成相关能力&…

2023-04-15 学习记录--C/C++-mac vscode配置并运行C/C++

mac vscode配置并运行C/C 一、vscode安装 ⭐️ 去官网下载安装mac版的vscode。 二、vscode配置 ⭐️ &#xff08;一&#xff09;、安装C/C扩展插件及必装好用插件 1、点击左边的 图标(扩展: 商店)&#xff0c;如下图&#xff1a; 2、先安装 C/C、C/CExtension Pack插件&…

大话数据结构-C(2)

二&#xff1a;算法 解决特定问题求解步骤的描述&#xff0c;在计算机中表现为指令的有限序列&#xff0c;并且每条指令表示一个或多个操作。 2.1 算法的特性 算法具有五个基本特性&#xff1a;输入、输出、有穷性、确定性、可行性。 1&#xff09;输入输出&#xff1a; 算法具…

Python --- 文件操作

目录 前言 一、open()函数 1.只读模式 r 2.只写模式 w 3.追加模式 a 二、操作其他文件 1.Python 操作二进制 2.Python 操作 json 文件 三、关闭文件 四、上下文管理器 五、文件指针位置 前言 在实际操作中&#xff0c;通常需要将数据写入到本地文件或者从本地文件中…

南方猛将加盟西方手机完全是臆测,他不会希望落得兔死狗烹的结局

早前南方某科技企业因为命名的问题闹得沸沸扬扬&#xff0c;于是一些业界人士就猜测该猛将会加盟西方手机&#xff0c;对于这种猜测可以嗤之以鼻&#xff0c;从西方手机以往的作风就可以看出来它向来缺乏容纳猛将的气量。一、没有猛将的西方手机迅速沉沦曾几何时&#xff0c;西…

【项目】bxg基于SaaS的餐掌柜项目实战(2023)

基于SaaS的餐掌柜项目实战 餐掌柜是一款基于SaaS思想打造的餐饮系统&#xff0c;采用分布式系统架构进行多服务研发&#xff0c;共包含4个子系统&#xff0c;分别为平台运营端、管家端&#xff08;门店&#xff09;、收银端、小程序端&#xff0c;为餐饮商家打造一站式餐饮服务…

如何用ChatGPT翻译?ChatGPT提升翻译速度,亲测有效

作为翻译新手&#xff0c;你是否为翻译不准确不地道而烦恼&#xff1f; 随着ChatGPT的大火&#xff0c;很多聪明的翻译已经开始使用ChatGPT辅助自己提升翻译能力和速度了。 想用ChatGPT翻译&#xff0c;首先要知道在哪里可以使用ChatGPT&#xff01;在国内选择不用注册不用登录…