[go: up one dir, main page]

CN116866331A - File transmission method, device, computer equipment and storage medium - Google Patents

File transmission method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116866331A
CN116866331A CN202310626231.2A CN202310626231A CN116866331A CN 116866331 A CN116866331 A CN 116866331A CN 202310626231 A CN202310626231 A CN 202310626231A CN 116866331 A CN116866331 A CN 116866331A
Authority
CN
China
Prior art keywords
file
sub
keyboard
virtual computer
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310626231.2A
Other languages
Chinese (zh)
Inventor
黄星宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Original Assignee
Industrial Bank Co Ltd
CIB Fintech Services Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial Bank Co Ltd, CIB Fintech Services Shanghai Co Ltd filed Critical Industrial Bank Co Ltd
Priority to CN202310626231.2A priority Critical patent/CN116866331A/en
Publication of CN116866331A publication Critical patent/CN116866331A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • G06F9/452Remote windowing, e.g. X-Window System, desktop virtualisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请涉及文件传输方法、装置、计算机设备和存储介质。所述方法包括:响应于虚拟计算机中第一文件的下载操作,根据所述下载操作生成下载指令;扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件;响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件;发送所述键盘事件至所述虚拟计算机。本公开实施例,实现了文件在虚拟计算机和客户端之间双向传输。

This application relates to file transmission methods, devices, computer equipment and storage media. The method includes: responding to a download operation of the first file in the virtual computer, generating a download instruction according to the download operation; scanning the display page to obtain the first encoded file, and decoding the first encoded file to obtain the first file ; In response to the upload operation of the second file in the client, convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate a keyboard corresponding to the keyboard characters Event; send the keyboard event to the virtual computer. The embodiment of the present disclosure realizes bidirectional transmission of files between the virtual computer and the client.

Description

文件传输方法、装置、计算机设备和存储介质File transfer methods, devices, computer equipment and storage media

技术领域Technical field

本申请涉及计算机技术领域,特别是涉及一种文件传输方法、装置、计算机设备、存储介质和计算机程序产品。The present application relates to the field of computer technology, and in particular to a file transmission method, device, computer equipment, storage medium and computer program product.

背景技术Background technique

随着计算机技术的发展,可以在云桌面服务端通过资源虚拟化的方式,生成虚拟个人计算机(虚拟PC,Personal Computer),供用户使用。用户可以在云桌面终端通过客户端连接虚拟个人计算机,并利用云桌面终端的外设(如键盘、鼠标)操作这台虚拟个人计算机。相关技术中,很多云桌面系统不支持在云桌面终端和服务端虚拟个人计算机之间进行文件传输。With the development of computer technology, virtual personal computers (Virtual PCs, Personal Computers) can be generated on the cloud desktop server through resource virtualization for users to use. Users can connect to the virtual personal computer through the client in the cloud desktop terminal, and use the peripherals (such as keyboard and mouse) of the cloud desktop terminal to operate the virtual personal computer. In related technologies, many cloud desktop systems do not support file transfer between the cloud desktop terminal and the server virtual personal computer.

发明内容Contents of the invention

基于此,有必要针对上述技术问题,提供一种文件传输方法、装置、计算机设备、存储介质和计算机程序产品。Based on this, it is necessary to provide a file transmission method, device, computer equipment, storage medium and computer program product to address the above technical problems.

第一方面,本申请提供了一种文件传输方法。应用于客户端,所述方法包括:In the first aspect, this application provides a file transmission method. Applied to the client, the methods include:

响应于虚拟计算机中第一文件的下载操作,根据所述下载操作生成下载指令;其中,所述下载指令用于指示所述虚拟计算机根据预设的第一编码规则,将所述第一文件对应的字节流转换为第一编码文件,所述虚拟计算机用于展示所述第一编码文件,生成展示页面;In response to the download operation of the first file in the virtual computer, a download instruction is generated according to the download operation; wherein the download instruction is used to instruct the virtual computer to correspond to the first file according to a preset first encoding rule. The byte stream is converted into a first encoded file, and the virtual computer is used to display the first encoded file and generate a display page;

扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件;Scan the display page to obtain the first encoded file, decode the first encoded file to obtain the first file;

响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件;In response to the upload operation of the second file in the client, convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate a keyboard event corresponding to the keyboard characters ;

发送所述键盘事件至所述虚拟计算机;其中,所述键盘事件用于指示所述虚拟计算机解析所述键盘事件得到所述键盘字符,并将所述键盘字符解码为所述第二文件对应的字节流。Send the keyboard event to the virtual computer; wherein the keyboard event is used to instruct the virtual computer to parse the keyboard event to obtain the keyboard characters, and decode the keyboard characters into corresponding characters of the second file. byte stream.

在一种可能的实现方式中,所述虚拟计算机用于展示所述第一编码文件,生成展示页面,包括:In a possible implementation, the virtual computer is used to display the first encoded file and generate a display page, including:

所述虚拟计算机用于将所述第一文件分割为多个第一子文件,分界面展示每个所述第一子文件对应的第一子编码文件,生成多个展示页面;其中,所述展示页面与所述第一子编码文件一一对应。The virtual computer is used to divide the first file into multiple first sub-files, display the first sub-coded files corresponding to each of the first sub-files on an interface, and generate multiple display pages; wherein, the The display page corresponds one-to-one with the first sub-encoding file.

在一种可能的实现方式中,所述第一编码规则包括多个预设顺序的第一编码子规则,所述扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件,包括:In a possible implementation, the first encoding rule includes a plurality of first encoding sub-rules in a preset sequence, the scanning the display page to obtain the first encoding file, and decoding the first encoding file, Get the first file, including:

扫描所述展示页面,得到第一子编码文件;Scan the display page to obtain the first sub-encoding file;

根据第一编码子规则,解码所述第一子编码文件,得到第一解码子文件;Decode the first sub-encoded file according to the first encoding sub-rule to obtain the first decoded sub-file;

校验所述第一解码子文件,若校验不通过,则发送重传指令至所述虚拟计算机,以指示所述虚拟计算机切换编码规则为所述第一编码子规则的下一个第一编码子规则,并根据所述下一个第一编码子规则,将所述第一子文件转换为新的第一子编码文件,展示所述新的第一子编码文件,直至所有的第一解码子文件校验通过,得到第一文件。Verify the first decoding sub-file. If the verification fails, send a retransmission instruction to the virtual computer to instruct the virtual computer to switch the encoding rule to the next first encoding of the first encoding sub-rule. sub-rules, and convert the first sub-file into a new first sub-encoding file according to the next first encoding sub-rule, and display the new first sub-encoding file until all first decoding sub-files are The file verification passes and the first file is obtained.

在一种可能的实现方式中,响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件,包括:In a possible implementation, in response to the upload operation of the second file in the client, convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate Keyboard events corresponding to the keyboard characters include:

响应于所述客户端中第二文件的上传操作,将所述第二文件拆分为多个第二子文件;In response to the upload operation of the second file in the client, split the second file into a plurality of second sub-files;

根据预设的第二编码规则,将所述多个第二子文件中每个第二子文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件。According to the preset second encoding rule, the byte stream corresponding to each second sub-file in the plurality of second sub-files is converted into keyboard characters, and a keyboard event corresponding to the keyboard characters is generated.

在一种可能的实现方式中,所述发送所述键盘事件至所述虚拟计算机,包括:In a possible implementation, sending the keyboard event to the virtual computer includes:

在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之前,发送表示数据页开始的键盘事件;其中,所述数据页与所述第二子文件对应的键盘事件一一对应;Before sending the keyboard event corresponding to each of the second sub-files in the plurality of second sub-files, send a keyboard event indicating the start of the data page; wherein the data page corresponds to the keyboard event of the second sub-file. One-to-one correspondence of events;

在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之后,发送表示数据页结束的键盘事件。After sending the keyboard event corresponding to each of the second sub-files in the plurality of second sub-files, a keyboard event indicating the end of the data page is sent.

在一种可能的实现方式中,所述虚拟计算机还用于在接收并解码所述第二子文件对应的键盘事件之后,对得到所述第二子文件对应的键盘字符进行校验,显示校验结果对应的编码字符。In a possible implementation, the virtual computer is further configured to, after receiving and decoding the keyboard event corresponding to the second sub-file, verify the keyboard characters corresponding to the second sub-file and display the verification. The coded character corresponding to the verification result.

第二方面,本申请还提供了一种文件传输装置。所述装置包括:In a second aspect, this application also provides a file transmission device. The device includes:

生成模块,用于响应于虚拟计算机中第一文件的下载操作,根据所述下载操作生成下载指令;其中,所述下载指令用于指示所述虚拟计算机根据预设的第一编码规则,将所述第一文件对应的字节流转换为第一编码文件,所述虚拟计算机用于展示所述第一编码文件,生成展示页面;Generating module, configured to respond to a download operation of the first file in the virtual computer and generate a download instruction according to the download operation; wherein the download instruction is used to instruct the virtual computer to convert the downloaded file according to a preset first encoding rule. Convert the byte stream corresponding to the first file into a first encoded file, and the virtual computer is used to display the first encoded file and generate a display page;

扫描模块,用于扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件;A scanning module, used to scan the display page to obtain the first encoded file, and decode the first encoded file to obtain the first file;

编码模块,用于响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件;An encoding module, configured to respond to the upload operation of the second file in the client, convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate the keyboard characters corresponding to the second file. Keyboard events corresponding to characters;

发送模块,用于发送所述键盘事件至所述虚拟计算机;其中,所述键盘事件用于指示所述虚拟计算机解析所述键盘事件得到所述键盘字符,并将所述键盘字符解码为所述第二文件对应的字节流。A sending module, configured to send the keyboard event to the virtual computer; wherein the keyboard event is used to instruct the virtual computer to parse the keyboard event to obtain the keyboard character, and decode the keyboard character into the The byte stream corresponding to the second file.

在一种可能的实现方式中,所述虚拟计算机用于展示所述第一编码文件,生成展示页面,包括:In a possible implementation, the virtual computer is used to display the first encoded file and generate a display page, including:

所述虚拟计算机用于将所述第一文件分割为多个第一子文件,分界面展示每个所述第一子文件对应的第一子编码文件,生成多个展示页面;其中,所述展示页面与所述第一子编码文件一一对应。The virtual computer is used to divide the first file into multiple first sub-files, display the first sub-coded files corresponding to each of the first sub-files on an interface, and generate multiple display pages; wherein, the The display page corresponds one-to-one with the first sub-encoding file.

在一种可能的实现方式中,所述第一编码规则包括多个预设顺序的第一编码子规则,所述扫描模块包括:In a possible implementation, the first encoding rule includes a plurality of first encoding sub-rules in a preset sequence, and the scanning module includes:

扫描子模块,用于扫描所述展示页面,得到第一子编码文件;A scanning sub-module is used to scan the display page and obtain the first sub-encoded file;

解码子模块,用于根据第一编码子规则,解码所述第一子编码文件,得到第一解码子文件;A decoding sub-module, used to decode the first sub-encoded file according to the first encoding sub-rule to obtain the first decoded sub-file;

校验子模块,用于校验所述第一解码子文件,若校验不通过,则发送重传指令至所述虚拟计算机,以指示所述虚拟计算机切换编码规则为所述第一编码子规则的下一个第一编码子规则,并根据所述下一个第一编码子规则,将所述第一子文件转换为新的第一子编码文件,展示所述新的第一子编码文件,直至所有的第一解码子文件校验通过,得到第一文件A check sub-module is used to check the first decoding sub-file. If the check fails, send a retransmission instruction to the virtual computer to instruct the virtual computer to switch the encoding rule to the first encoding sub-file. The next first encoding sub-rule of the rule, and according to the next first encoding sub-rule, convert the first sub-file into a new first sub-encoding file, and display the new first sub-encoding file, Until all the first decoded sub-files pass the verification, the first file is obtained

在一种可能的实现方式中,所述编码模块,包括:In a possible implementation, the encoding module includes:

拆分子模块,用于响应于所述客户端中第二文件的上传操作,将所述第二文件拆分为多个第二子文件;A split sub-module, configured to split the second file into multiple second sub-files in response to the upload operation of the second file in the client;

转换子模块,用于根据预设的第二编码规则,将所述多个第二子文件中每个第二子文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件。A conversion sub-module, configured to convert the byte stream corresponding to each second sub-file in the plurality of second sub-files into keyboard characters according to the preset second encoding rule, and generate a byte stream corresponding to the keyboard characters. Keyboard events.

在一种可能的实现方式中,所述发送模块,包括:In a possible implementation, the sending module includes:

第一发送子模块,用于在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之前,发送表示数据页开始的键盘事件;其中,所述数据页与所述第二子文件对应的键盘事件一一对应;The first sending sub-module is configured to send a keyboard event indicating the start of a data page before sending a keyboard event corresponding to each second sub-file in the plurality of second sub-files; wherein the data page and the The keyboard events corresponding to the second sub-file are in one-to-one correspondence;

第二发送子模块,用于在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之后,发送表示数据页结束的键盘事件。The second sending sub-module is configured to send a keyboard event indicating the end of the data page after sending the keyboard event corresponding to each of the plurality of second sub-files.

在一种可能的实现方式中,所述虚拟计算机还用于在接收并解码所述第二子文件对应的键盘事件之后,对得到所述第二子文件对应的键盘字符进行校验,显示校验结果对应的编码字符。In a possible implementation, the virtual computer is further configured to, after receiving and decoding the keyboard event corresponding to the second sub-file, verify the keyboard characters corresponding to the second sub-file and display the verification. The coded character corresponding to the verification result.

第三方面,本申请还提供了一种计算机设备。所述计算机设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现如本公开实施例任一项所述的文件传输方法的步骤。In a third aspect, this application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the steps of the file transmission method according to any one of the embodiments of the present disclosure.

第四方面,本申请还提供了一种计算机可读存储介质。所述计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如本公开实施例任一项所述的文件传输方法的步骤。In a fourth aspect, this application also provides a computer-readable storage medium. The computer-readable storage medium has a computer program stored thereon, and when the computer program is executed by a processor, the steps of the file transmission method described in any one of the embodiments of the present disclosure are implemented.

第五方面,本申请还提供了一种计算机程序产品。所述计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如本公开实施例任一项所述的文件传输方法的步骤。In a fifth aspect, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the file transmission method described in any one of the embodiments of the present disclosure.

上述文件传输方法、装置、计算机设备、存储介质和计算机程序产品,当需要从虚拟计算机下载第一文件时,可以通过将第一文件编码为第一编码文件,并展示第一编码文件,使得客户端可以通过扫描并解码的方式获取到第一文件;当需要从客户端上传第二文件时,可以通过编码的方式,将第二文件编码为键盘字符,进而生成键盘事件。使得虚拟计算机通过监听键盘事件,获取第二文件。本公开实施例,实现了文件在虚拟计算机和客户端之间双向传输,并且在每一次传输前对文件进行编码处理,更有助于压缩数据量,提高传输效率。The above file transmission methods, devices, computer equipment, storage media and computer program products, when it is necessary to download the first file from the virtual computer, can encode the first file into a first encoded file and display the first encoded file so that the customer can The client can obtain the first file by scanning and decoding it; when the second file needs to be uploaded from the client, the second file can be encoded into keyboard characters through encoding, and then a keyboard event can be generated. The virtual computer is caused to obtain the second file by listening to keyboard events. The embodiments of the present disclosure realize bidirectional transmission of files between the virtual computer and the client, and encode the files before each transmission, which is more conducive to compressing the amount of data and improving transmission efficiency.

附图说明Description of the drawings

图1为一个实施例中文件传输方法的应用环境图;Figure 1 is an application environment diagram of the file transmission method in one embodiment;

图2为一个实施例中文件传输方法的第一流程示意图;Figure 2 is a first flow diagram of a file transmission method in an embodiment;

图3为一个另实施例中文件传输方法的第二流程示意图;Figure 3 is a second flow diagram of a file transmission method in another embodiment;

图4为一个实施例中文件传输装置的结构框图;Figure 4 is a structural block diagram of a file transmission device in one embodiment;

图5为一个实施例中计算机设备的内部结构图。Figure 5 is an internal structure diagram of a computer device in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.

本申请实施例提供的文件传输方法,可以应用于如图1所示的应用环境中。其中,云端服务器虚拟出虚拟计算机104,客户102通过网络与虚拟计算机104进行通信。其中,客户端102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑、物联网设备和便携式可穿戴设备,物联网设备可为智能音箱、智能电视、智能空调、智能车载设备等。便携式可穿戴设备可为智能手表、智能手环、头戴设备等。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。The file transmission method provided by the embodiment of the present application can be applied in the application environment as shown in Figure 1. Among them, the cloud server virtualizes the virtual computer 104, and the client 102 communicates with the virtual computer 104 through the network. Among them, the client 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablets, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, and smart vehicle-mounted devices. wait. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server can be implemented as an independent server or a server cluster composed of multiple servers.

在一个实施例中,如图2所示,提供了一种文件传输方法,以该方法应用于图1中的客户端为例进行说明,包括以下步骤:In one embodiment, as shown in Figure 2, a file transfer method is provided. This method is explained by taking the method applied to the client in Figure 1 as an example, and includes the following steps:

步骤S201,响应于虚拟计算机中第一文件的下载操作,根据所述下载操作生成下载指令;其中,所述下载指令用于指示所述虚拟计算机根据预设的第一编码规则,将所述第一文件对应的字节流转换为第一编码文件,所述虚拟计算机用于展示所述第一编码文件,生成展示页面。Step S201: In response to the download operation of the first file in the virtual computer, generate a download instruction according to the download operation; wherein the download instruction is used to instruct the virtual computer to convert the first file into the first file according to the preset first encoding rule. The byte stream corresponding to a file is converted into a first encoded file, and the virtual computer is used to display the first encoded file and generate a display page.

具体的,客户端访问虚拟计算机时,可以通过一些预设的操作表示对虚拟计算机中第一文件的下载需求。本公开实施例中,所述第一文件可以包括从虚拟计算机中下载的文件。所述第一文件的字节流表示文件的存储,例如一个字节由8位二进制位组成。所述第一编码规则可以包括现有的编码规则,也可以包括自定义的编码规则。在一示例性实施例中,所述自定义的编码规则可以包括:字节流与字符的对应关系编码。其中,在对字符进行选择时可以选择常见、易识别、字形差别大的字符或字符组合,例如阿拉伯数字“1”和小写字母“l”,字形很相似。则不建议同时使用,以避免后续扫描错误。在另一示例性实施例中,所述自定义的编码规则可以包括选用英文字母中A至Z中任意两个或两个以上的字母的联合组合与字节建立对应关系。由于字节的值的范围包括0至255,因此,所需要的字符或字符组合的个数可以包括256个。Specifically, when the client accesses the virtual computer, it can express the download requirement for the first file in the virtual computer through some preset operations. In this embodiment of the present disclosure, the first file may include a file downloaded from the virtual computer. The byte stream of the first file represents the storage of the file, for example, one byte is composed of 8 binary bits. The first encoding rule may include existing encoding rules or may include customized encoding rules. In an exemplary embodiment, the customized encoding rules may include: encoding of the correspondence between byte streams and characters. Among them, when selecting characters, you can choose characters or character combinations that are common, easy to recognize, and have widely different glyphs, such as the Arabic numeral "1" and the lowercase letter "l", which have very similar glyphs. It is not recommended to use them at the same time to avoid subsequent scanning errors. In another exemplary embodiment, the customized encoding rules may include selecting a joint combination of any two or more letters from A to Z in the English alphabet to establish a corresponding relationship with the bytes. Since the value of the byte ranges from 0 to 255, the number of required characters or character combinations may include 256.

本公开实施例中,字节流通过第一编码规则转换位第一编码文件。所述虚拟计算机可以展示所述第一编码文件,生成展示页面。In this embodiment of the present disclosure, the byte stream is converted into a first encoded file through a first encoding rule. The virtual computer can display the first encoded file and generate a display page.

步骤S203,扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件。Step S203: Scan the display page to obtain a first encoded file, and decode the first encoded file to obtain a first file.

具体的,客户端扫描所述展示页面,在一示例性实施例中,可以通过OCR扫描识别展示页面中的第一编码文件,即字节流对应的字符。在一示例性实施例中,可以采用与第一编码规则相一致的解码规则,将识别出的字符进行解码,即将字符还原为字节流,得到第一文件。Specifically, the client scans the display page. In an exemplary embodiment, the first encoded file in the display page, that is, the characters corresponding to the byte stream, can be identified through OCR scanning. In an exemplary embodiment, a decoding rule consistent with the first encoding rule may be used to decode the recognized characters, that is, to restore the characters into a byte stream to obtain the first file.

步骤S205,响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件。Step S205: In response to the upload operation of the second file in the client, convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate a byte stream corresponding to the keyboard characters. keyboard events.

具体的,所述第二编码规则可以包括字节值与字符的对应关系。所述键盘字符可以包括计算机输入设备键盘上呈现的字符,例如应为字符、数字和符号等。客户端可以根据第二编码规则,将第二文件对应的字节流转换为键盘字符。在一示例性实施例中,可以从英文字母“A”至“Z”中任意选择两个字母作为一个组合,对应一个字节值。本公开实施例中,当前很多编程语言都支持生成键盘按键事件,比如Java语言中可利用Robot类的keyPress、keyRelease方法生成键盘事件,因此,生成与所述键盘字符对应的键盘事件可以通过编程的方式实现,例如在Java编程语言中,传输字符“A”可以用以下代码实现:Robot robot=new Robot();robot.keyPress(65);以上数值“65”为字符“A”对应的ASCII码。Specifically, the second encoding rule may include a correspondence between byte values and characters. The keyboard characters may include characters presented on the keyboard of a computer input device, such as characters, numbers, symbols, etc. The client can convert the byte stream corresponding to the second file into keyboard characters according to the second encoding rule. In an exemplary embodiment, two letters from English letters "A" to "Z" can be selected as a combination to correspond to a byte value. In the embodiment of the present disclosure, many current programming languages support the generation of keyboard key events. For example, in the Java language, the keyPress and keyRelease methods of the Robot class can be used to generate keyboard events. Therefore, the keyboard events corresponding to the keyboard characters can be generated through programming. For example, in the Java programming language, the transmission of the character "A" can be implemented with the following code: Robot robot=new Robot(); robot.keyPress(65); the above value "65" is the ASCII code corresponding to the character "A" .

步骤S207,发送所述键盘事件至所述虚拟计算机;其中,所述键盘事件用于指示所述虚拟计算机解析所述键盘事件得到所述键盘字符,并将所述键盘字符解码为所述第二文件对应的字节流。Step S207: Send the keyboard event to the virtual computer; wherein the keyboard event is used to instruct the virtual computer to parse the keyboard event to obtain the keyboard character, and decode the keyboard character into the second The byte stream corresponding to the file.

具体的,将所述键盘事件发送至所述虚拟计算机,具体的例如:虚拟计算机接收到“Home”键按下事件,将第1个传输页显示在用户界面上;若接收到“PgUp”键按下事件,则将当前页换另一种编码方案编码生成新的传输页,显示在用户界面上;若接收到“PgDn”键按下事件,显示下一页传输页在用户界面上;若接收到“End”键按下事件,传输结束。虚拟计算机利用与第二编码规则相一致的解码规则,将键盘事件中的键盘字符转换为对应的字节值,多个字节值形成字节流。所有的键盘字符都解码完成后,得到第二文件。Specifically, the keyboard event is sent to the virtual computer. Specifically, for example: the virtual computer receives the "Home" key press event and displays the first transmission page on the user interface; if the virtual computer receives the "PgUp" key When the event is pressed, the current page will be encoded with another encoding scheme to generate a new transmission page, which will be displayed on the user interface; if the "PgDn" key press event is received, the next transmission page will be displayed on the user interface; if When the "End" key press event is received, the transmission ends. The virtual computer uses the decoding rule consistent with the second encoding rule to convert the keyboard characters in the keyboard event into corresponding byte values, and the multiple byte values form a byte stream. After all keyboard characters are decoded, the second file is obtained.

上述文件传输方法中,当需要从虚拟计算机下载第一文件时,可以通过将第一文件编码为第一编码文件,并展示第一编码文件,使得客户端可以通过扫描并解码的方式获取到第一文件;当需要从客户端上传第二文件时,可以通过编码的方式,将第二文件编码为键盘字符,进而生成键盘事件。使得虚拟计算机通过监听键盘事件,获取第二文件。本公开实施例,实现了文件在虚拟计算机和客户端之间双向传输,并且在每一次传输前对文件进行编码处理,更有助于压缩数据量,提高传输效率。In the above file transfer method, when the first file needs to be downloaded from the virtual computer, the first file can be encoded into a first encoded file and the first encoded file can be displayed, so that the client can obtain the first file by scanning and decoding. One file; when a second file needs to be uploaded from the client, the second file can be encoded into keyboard characters through encoding, and then a keyboard event can be generated. The virtual computer is caused to obtain the second file by listening to keyboard events. The embodiments of the present disclosure realize bidirectional transmission of files between the virtual computer and the client, and encode the files before each transmission, which is more conducive to compressing the amount of data and improving transmission efficiency.

在一种可能的实现方式中,所述虚拟计算机用于展示所述第一编码文件,生成展示页面,包括:In a possible implementation, the virtual computer is used to display the first encoded file and generate a display page, including:

所述虚拟计算机用于将所述第一文件分割为多个第一子文件,分界面展示每个所述第一子文件对应的第一子编码文件,生成多个展示页面;其中,所述展示页面与所述第一子编码文件一一对应。The virtual computer is used to divide the first file into multiple first sub-files, display the first sub-coded files corresponding to each of the first sub-files on an interface, and generate multiple display pages; wherein, the The display page corresponds one-to-one with the first sub-encoding file.

具体的,可以根据预设数据量,对第一文件进行分割,得到多个第一子文件。本公开实施例中,所述预设数据量可以参考显示屏的尺寸进行设置,设置原则可以包括,每个第一子文件可以包括尽量多的字节数以保证传输效率,又不能包含过多的字节数导致编码生成的字符串无法完全显示的用户界面上。在一示例性实施例中,对于每个第一子文件,可以按照预设的第一编码规则,将第一子文件中每个字节按照字节与字符的对应关系,映射为字符后,多个字符进行拼接生成字符串。例如:某一字节值为0,编码方案中对应字符组合为“AA”,则将该字节转换为字符组合“AA”。所述第一子编码文件包括上述字符串。Specifically, the first file can be divided according to the preset data amount to obtain multiple first sub-files. In the embodiment of the present disclosure, the preset data amount can be set with reference to the size of the display screen. The setting principles can include that each first sub-file can include as many bytes as possible to ensure transmission efficiency, but cannot contain too many bytes. The number of bytes causes the encoding to produce a string that cannot be fully displayed on the user interface. In an exemplary embodiment, for each first sub-file, each byte in the first sub-file can be mapped to a character according to the corresponding relationship between bytes and characters according to the preset first encoding rule. Multiple characters are concatenated to generate a string. For example: a certain byte value is 0 and the corresponding character combination in the encoding scheme is "AA", then the byte is converted into the character combination "AA". The first sub-encoded file includes the above-mentioned character string.

本公开实施例中,在对多个第一子文件进行传输时,还可以设置客户端得反馈机制。在一示例性实施例中,客户端生成虚设的键盘事件通知虚拟计算机传输下一个第一子文件,例如,云桌面终端生成“PgDn”键按下事件,通知服务端虚拟PC显示下一页传输页。In this disclosed embodiment, when transmitting multiple first sub-files, a feedback mechanism on the client side can also be set. In an exemplary embodiment, the client generates a dummy keyboard event to notify the virtual computer to transmit the next first sub-file. For example, the cloud desktop terminal generates a "PgDn" key press event to notify the server virtual PC to display the next page for transmission. Page.

本公开实施例,将第一文件分割为多个第一子文件,分界面展示各个第一子编码文件,一方面,有利于传输数据量较大的第一文件,另一方面,避免当第一文件传输错误时,传输整个第一文件,降低传输效率。In the embodiment of the present disclosure, the first file is divided into multiple first sub-files, and each first sub-encoded file is displayed on the interface. On the one hand, it is beneficial to transmit the first file with a large amount of data, and on the other hand, it avoids When a file transmission error occurs, the entire first file is transmitted, reducing transmission efficiency.

在一种可能的实现方式中,如图3所述,所述第一编码规则包括多个预设顺序的第一编码子规则,所述步骤S203,扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件,包括:In a possible implementation, as shown in Figure 3, the first encoding rule includes a plurality of first encoding sub-rules in a preset sequence. In step S203, scan the display page to obtain the first encoding file. , decode the first encoded file to obtain the first file, including:

步骤S301,扫描所述展示页面,得到第一子编码文件;Step S301: Scan the display page to obtain the first sub-encoded file;

步骤S303,根据第一编码子规则,解码所述第一子编码文件,得到第一解码子文件;Step S303: Decode the first sub-encoded file according to the first encoding sub-rule to obtain the first decoded sub-file;

步骤S305,校验所述第一解码子文件,若校验不通过,则发送重传指令至所述虚拟计算机,以指示所述虚拟计算机切换编码规则为所述第一编码子规则的下一个第一编码子规则,并根据所述下一个第一编码子规则,将所述第一子文件转换为新的第一子编码文件,展示所述新的第一子编码文件,直至所有的第一解码子文件校验通过,得到第一文件。Step S305: Verify the first decoding sub-file. If the verification fails, send a retransmission instruction to the virtual computer to instruct the virtual computer to switch the encoding rule to the next one of the first encoding sub-rule. first encoding sub-rule, and according to the next first encoding sub-rule, convert the first sub-file into a new first sub-encoding file, and display the new first sub-encoding file until all the first sub-encoding files are Once the decoded sub-file passes the verification, the first file is obtained.

具体的,本公开实施例可以设置多套编码方案,每个编码方案对应一种第一编码子规则。在一示例性实施例中,扫描第一子编码文件的展示页面,得到第一子编码文件。从多个预设顺序的第一编码子规则中确定一个第一编码子规则,解码所述第一子编码文件,得到第一解码子文件。对所述第一解码子文件进行校验,若校验不通过,则发送重传指令。所述重传指令用于指示所述虚拟计算机切换编码规则为第一编码子规则的下一个第一编码子规则。由于多个第一编码子规则的排列顺序是预先约定好的,因此,第一编码子规则的下一个第一编码子规则也是确定的。与之对应的,客户端在解码上述第一子编码文件时,也需要按照所述第一编码子规则的下一个第一编码子规则进行解码。需要说明的是,本公开实施例对校验的次数不做限制,若通过所述下一个第一编码子规则解码的第一解码子文件仍然不通过校验,则继续切换第一编码子规则。Specifically, embodiments of the present disclosure may set up multiple sets of encoding schemes, and each encoding scheme corresponds to a first encoding sub-rule. In an exemplary embodiment, the display page of the first sub-encoded file is scanned to obtain the first sub-encoded file. A first encoding sub-rule is determined from a plurality of first encoding sub-rules in a preset sequence, and the first sub-encoding file is decoded to obtain a first decoded sub-file. The first decoded sub-file is verified, and if the verification fails, a retransmission instruction is sent. The retransmission instruction is used to instruct the virtual computer to switch the encoding rule to the first encoding sub-rule next to the first encoding sub-rule. Since the arrangement order of the plurality of first encoding sub-rules is predetermined, the next first encoding sub-rule of the first encoding sub-rule is also determined. Correspondingly, when decoding the first sub-encoded file, the client also needs to decode according to the next first encoding sub-rule of the first encoding sub-rule. It should be noted that the embodiment of the present disclosure does not limit the number of verifications. If the first decoding sub-file decoded by the next first encoding sub-rule still fails the verification, continue to switch to the first encoding sub-rule. .

本公开实施例中,所述重传指令可以通过预设得键盘事件反馈至虚拟计算机,例如:云桌面终端生成“PgUp”键按下事件,通知服务端虚拟PC将当前数据页换另一种编码方案编码生成新的传输页字符串显示。In the embodiment of the present disclosure, the retransmission instruction can be fed back to the virtual computer through a preset keyboard event. For example, the cloud desktop terminal generates a "PgUp" key press event to notify the server virtual PC to change the current data page to another one. Encoding scheme encoding generates new transmission page string display.

本公开实施例中,在对第一子解码文件进行校验是可以采用MD5校验方式。在一示例性实施例中,可以将MD5的值拼接在第一编码子文件的字符串之后。在第一子解码文件中,从末尾向前截取预设个数的字符串作为MD5的值。将该MD5的值与计算第一子解码文件中解码出来的字符串的MD5的值进行比较,若相同,则表示传输过程中没有发生错误;若不相同,则表示传输过程中发生了错误。在一示例性实施例中,MD5值得编码字符串可以固定为32个字符,其中MD5值固定为16个字节,编码规则中将1个字节转换为2个字符。In the embodiment of the present disclosure, the MD5 verification method may be used to verify the first sub-decoded file. In an exemplary embodiment, the MD5 value may be spliced after the string of the first encoded sub-file. In the first sub-decoded file, a preset number of character strings are intercepted from the end forward as the MD5 value. Compare the MD5 value with the MD5 value of the string decoded in the first sub-decoded file. If they are the same, it means that no error occurred during the transmission process; if they are not the same, it means that an error occurred during the transmission process. In an exemplary embodiment, the MD5 value encoding string may be fixed to 32 characters, where the MD5 value is fixed to 16 bytes, and 1 byte is converted into 2 characters in the encoding rule.

上述实施例中,通过设置多个预设顺序得第一编码子规则,通过校验,当第一编码子文件传输出错时,更换下一编码子规则,有利于提高第一文件传输得整体准确率。In the above embodiment, by setting a plurality of first encoding sub-rules in a preset sequence, and through verification, when an error occurs in the transmission of the first encoding sub-file, the next encoding sub-rule is replaced, which is beneficial to improving the overall accuracy of the first file transmission. Rate.

在一种可能的实现方式中,响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件,包括:In a possible implementation, in response to the upload operation of the second file in the client, convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate Keyboard events corresponding to the keyboard characters include:

响应于所述客户端中第二文件的上传操作,将所述第二文件拆分为多个第二子文件;In response to the upload operation of the second file in the client, split the second file into a plurality of second sub-files;

根据预设的第二编码规则,将所述多个第二子文件中每个第二子文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件。According to the preset second encoding rule, the byte stream corresponding to each second sub-file in the plurality of second sub-files is converted into keyboard characters, and a keyboard event corresponding to the keyboard characters is generated.

具体的,将第二文件拆分为多个第二子文件,在一示例性实施例中,可以根据数据量拆分成固定大小的第二子文件,例如可以设置1000个字节作为一个第二子文件。根据预设的第二编码规则,将多个第二子文件中每个第二子文件对应的字节流转换为键盘字符。在一示例性实施例中,可以设置文件校验规则,例如计算出第二子文件的MD5值,将MD5的值拆成字节流,按照第二编码规则编码生成字符串,拼接至第二子文件的键盘字符的后面,见拼接后的字符串生成键盘事件进行传输。Specifically, the second file is split into multiple second sub-files. In an exemplary embodiment, the second file can be split into second sub-files of a fixed size according to the amount of data. For example, 1000 bytes can be set as a second sub-file. Two sub-files. Convert the byte stream corresponding to each second sub-file in the plurality of second sub-files into keyboard characters according to the preset second encoding rule. In an exemplary embodiment, file verification rules can be set, for example, calculating the MD5 value of the second sub-file, splitting the MD5 value into a byte stream, encoding and generating a string according to the second encoding rule, and splicing it into the second sub-file. After the keyboard characters of the sub-file, see the spliced string to generate keyboard events for transmission.

本公开实施例,通过将第二文件拆分为多个第二子文件,分别发送每个第二子文件,有利于避免当少数的键盘事件发生错误时,导致这个第二文件的重传,提高了第二文件的传输效率。In this disclosed embodiment, by splitting the second file into multiple second sub-files and sending each second sub-file separately, it is helpful to avoid the retransmission of the second file when errors occur in a small number of keyboard events. Improved the transfer efficiency of the second file.

在一种可能的实现方式中,所述发送所述键盘事件至所述虚拟计算机,包括:In a possible implementation, sending the keyboard event to the virtual computer includes:

在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之前,发送表示数据页开始的键盘事件;其中,所述数据页与所述第二子文件对应的键盘事件一一对应;Before sending the keyboard event corresponding to each of the second sub-files in the plurality of second sub-files, send a keyboard event indicating the start of the data page; wherein the data page corresponds to the keyboard event of the second sub-file. One-to-one correspondence of events;

在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之后,发送表示数据页结束的键盘事件。After sending the keyboard event corresponding to each of the second sub-files in the plurality of second sub-files, a keyboard event indicating the end of the data page is sent.

本公开实施例中,将第二文件拆分为多个第二子文件,分别发送每个第二子文件。在一示例性实施例中,可以设置通知机制。例如,键盘事件:“Home”键代表一个第二子文件对应的数据页传输开始,键盘事件:“End”键代表一个第二子文件对应的数据页传输结束。In the embodiment of the present disclosure, the second file is split into multiple second sub-files, and each second sub-file is sent separately. In an exemplary embodiment, a notification mechanism may be provided. For example, the keyboard event: "Home" key represents the start of the transmission of the data page corresponding to a second sub-file, and the keyboard event: "End" key represents the end of the transmission of the data page corresponding to the second sub-file.

上述实施例,通过设置预设的通知机制,例如数据页开始的键盘事件以及数据页结束的键盘事件,有利于虚拟计算机区分不同的第二子文件对应的键盘事件。并对第二子文件对应的键盘事件进行解析,得到键盘字符。In the above embodiment, by setting a preset notification mechanism, such as a keyboard event at the beginning of a data page and a keyboard event at the end of a data page, it is helpful for the virtual computer to distinguish keyboard events corresponding to different second sub-files. And analyze the keyboard event corresponding to the second sub-file to obtain the keyboard characters.

在一种可能的实现方式中,所述虚拟计算机还用于在接收并解码所述第二子文件对应的键盘事件之后,对得到所述第二子文件对应的键盘字符进行校验,显示校验结果对应的编码字符。In a possible implementation, the virtual computer is further configured to, after receiving and decoding the keyboard event corresponding to the second sub-file, verify the keyboard characters corresponding to the second sub-file and display the verification. The coded character corresponding to the verification result.

具体的可以采用多种字符校验规则对键盘字符进行校验,例如MD5校验规则。在一示例性实施例中,虚拟计算机对接收到的第二子文件对应的键盘事件进行解析,分离出第二子文件对应的键盘字符以及MD5的值。对第二子文件对应的键盘字符进行MD5运算,得到MD5的预算值,将该运算值与接收到的MD5的值进行比较,若相同,将校验通过;若不相同,则校验失败。在一示例性实施例中,可以将上述校验结果显示在界面中,以使客户端通过扫描获知第二子文件的传输情况。在一示例性实施例中,虚拟计算机显示预设字符,例如字符“A”,表示传输成功;字符“B”表示传输失败。所述校验结果可以包括传输成功或传输失败。Specifically, multiple character verification rules can be used to verify keyboard characters, such as MD5 verification rules. In an exemplary embodiment, the virtual computer parses the received keyboard event corresponding to the second sub-file, and separates the keyboard characters corresponding to the second sub-file and the MD5 value. Perform an MD5 operation on the keyboard characters corresponding to the second sub-file to obtain the MD5 budget value. Compare the operation value with the received MD5 value. If they are the same, the verification will pass; if they are not the same, the verification will fail. In an exemplary embodiment, the above verification result can be displayed in the interface, so that the client can learn the transmission status of the second sub-file through scanning. In an exemplary embodiment, the virtual computer displays preset characters, such as the character "A", indicating successful transmission; the character "B" indicating failed transmission. The verification result may include transmission success or transmission failure.

应该理解的是,虽然如上所述的各实施例所涉及的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,如上所述的各实施例所涉及的流程图中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts involved in the above-mentioned embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above embodiments may include multiple steps or stages. These steps or stages are not necessarily executed at the same time, but may be completed at different times. The execution order of these steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

基于同样的发明构思,本申请实施例还提供了一种用于实现上述所涉及的文件传输方法的文件传输装置。该装置所提供的解决问题的实现方案与上述方法中所记载的实现方案相似,故下面所提供的一个或多个文件传输装置实施例中的具体限定可以参见上文中对于文件传输方法的限定,在此不再赘述。Based on the same inventive concept, embodiments of the present application also provide a file transmission device for implementing the above-mentioned file transmission method. The solution to the problem provided by this device is similar to the solution recorded in the above method. Therefore, for the specific limitations in one or more file transfer device embodiments provided below, please refer to the above limitations on the file transfer method. I won’t go into details here.

在一个实施例中,如图4所示,提供了一种文件传输装置,包括:In one embodiment, as shown in Figure 4, a file transmission device is provided, including:

生成模块401,用于响应于虚拟计算机中第一文件的下载操作,根据所述下载操作生成下载指令;其中,所述下载指令用于指示所述虚拟计算机根据预设的第一编码规则,将所述第一文件对应的字节流转换为第一编码文件,所述虚拟计算机用于展示所述第一编码文件,生成展示页面;Generating module 401, configured to respond to the download operation of the first file in the virtual computer and generate a download instruction according to the download operation; wherein the download instruction is used to instruct the virtual computer to encode the first file according to the preset first encoding rule. The byte stream corresponding to the first file is converted into a first encoded file, and the virtual computer is used to display the first encoded file and generate a display page;

扫描模块403,用于扫描所述展示页面,得到第一编码文件,解码所述第一编码文件,得到第一文件;The scanning module 403 is used to scan the display page to obtain the first encoded file, and decode the first encoded file to obtain the first file;

编码模块405,用于响应于所述客户端中第二文件的上传操作,根据预设的第二编码规则,将所述第二文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件;Encoding module 405, configured to respond to the upload operation of the second file in the client and convert the byte stream corresponding to the second file into keyboard characters according to the preset second encoding rule, and generate the Keyboard events corresponding to keyboard characters;

发送模块407,用于发送所述键盘事件至所述虚拟计算机;其中,所述键盘事件用于指示所述虚拟计算机解析所述键盘事件得到所述键盘字符,并将所述键盘字符解码为所述第二文件对应的字节流。Sending module 407, configured to send the keyboard event to the virtual computer; wherein the keyboard event is used to instruct the virtual computer to parse the keyboard event to obtain the keyboard character, and decode the keyboard character into the The byte stream corresponding to the second file.

在一种可能的实现方式中,所述虚拟计算机用于展示所述第一编码文件,生成展示页面,包括:In a possible implementation, the virtual computer is used to display the first encoded file and generate a display page, including:

所述虚拟计算机用于将所述第一文件分割为多个第一子文件,分界面展示每个所述第一子文件对应的第一子编码文件,生成多个展示页面;其中,所述展示页面与所述第一子编码文件一一对应。The virtual computer is used to divide the first file into multiple first sub-files, display the first sub-coded files corresponding to each of the first sub-files on an interface, and generate multiple display pages; wherein, the The display page corresponds one-to-one with the first sub-encoding file.

在一种可能的实现方式中,所述第一编码规则包括多个预设顺序的第一编码子规则,所述扫描模块包括:In a possible implementation, the first encoding rule includes a plurality of first encoding sub-rules in a preset sequence, and the scanning module includes:

扫描子模块,用于扫描所述展示页面,得到第一子编码文件;A scanning sub-module is used to scan the display page and obtain the first sub-encoded file;

解码子模块,用于根据第一编码子规则,解码所述第一子编码文件,得到第一解码子文件;A decoding sub-module, used to decode the first sub-encoded file according to the first encoding sub-rule to obtain the first decoded sub-file;

校验子模块,用于校验所述第一解码子文件,若校验不通过,则发送重传指令至所述虚拟计算机,以指示所述虚拟计算机切换编码规则为所述第一编码子规则的下一个第一编码子规则,并根据所述下一个第一编码子规则,将所述第一子文件转换为新的第一子编码文件,展示所述新的第一子编码文件,直至所有的第一解码子文件校验通过,得到第一文件A check sub-module is used to check the first decoding sub-file. If the check fails, send a retransmission instruction to the virtual computer to instruct the virtual computer to switch the encoding rule to the first encoding sub-file. The next first encoding sub-rule of the rule, and according to the next first encoding sub-rule, convert the first sub-file into a new first sub-encoding file, and display the new first sub-encoding file, Until all the first decoded sub-files pass the verification, the first file is obtained

在一种可能的实现方式中,所述编码模块,包括:In a possible implementation, the encoding module includes:

拆分子模块,用于响应于所述客户端中第二文件的上传操作,将所述第二文件拆分为多个第二子文件;A split sub-module, configured to split the second file into multiple second sub-files in response to the upload operation of the second file in the client;

转换子模块,用于根据预设的第二编码规则,将所述多个第二子文件中每个第二子文件对应的字节流转换为键盘字符,并生成与所述键盘字符对应的键盘事件。A conversion sub-module, configured to convert the byte stream corresponding to each second sub-file in the plurality of second sub-files into keyboard characters according to the preset second encoding rule, and generate a byte stream corresponding to the keyboard characters. Keyboard events.

在一种可能的实现方式中,所述发送模块,包括:In a possible implementation, the sending module includes:

第一发送子模块,用于在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之前,发送表示数据页开始的键盘事件;其中,所述数据页与所述第二子文件对应的键盘事件一一对应;The first sending sub-module is configured to send a keyboard event indicating the start of a data page before sending a keyboard event corresponding to each second sub-file in the plurality of second sub-files; wherein the data page and the The keyboard events corresponding to the second sub-file are in one-to-one correspondence;

第二发送子模块,用于在发送所述多个第二子文件中每个所述第二子文件对应的键盘事件之后,发送表示数据页结束的键盘事件。The second sending sub-module is configured to send a keyboard event indicating the end of the data page after sending the keyboard event corresponding to each of the plurality of second sub-files.

在一种可能的实现方式中,所述虚拟计算机还用于在接收并解码所述第二子文件对应的键盘事件之后,对得到所述第二子文件对应的键盘字符进行校验,显示校验结果对应的编码字符。In a possible implementation, the virtual computer is further configured to, after receiving and decoding the keyboard event corresponding to the second sub-file, verify the keyboard characters corresponding to the second sub-file and display the verification. The coded character corresponding to the verification result.

上述文件传输装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。Each module in the above file transmission device can be implemented in whole or in part by software, hardware and combinations thereof. Each of the above modules may be embedded in or independent of the processor of the computer device in the form of hardware, or may be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图5所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、移动蜂窝网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种文件传输方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be shown in Figure 5 . The computer device includes a processor, memory, communication interface, display screen and input device connected through a system bus. Wherein, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes non-volatile storage media and internal memory. The non-volatile storage medium stores operating systems and computer programs. This internal memory provides an environment for the execution of operating systems and computer programs in non-volatile storage media. The communication interface of the computer device is used for wired or wireless communication with external terminals. The wireless mode can be implemented through WIFI, mobile cellular network, NFC (Near Field Communication) or other technologies. The computer program, when executed by the processor, implements a file transfer method. The display screen of the computer device may be a liquid crystal display or an electronic ink display. The input device of the computer device may be a touch layer covered on the display screen, or may be a button, trackball or touch pad provided on the computer device shell. , it can also be an external keyboard, trackpad or mouse, etc.

本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 5 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. The specific computer equipment can May include more or fewer parts than shown, or combine certain parts, or have a different arrangement of parts.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive Random Access Memory,MRAM)、铁电存储器(Ferroelectric Random Access Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic RandomAccess Memory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage. In the media, when executed, the computer program may include the processes of the above method embodiments. Any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetic variable memory (Magnetoresistive Random) Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene memory, etc. Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM). The databases involved in the various embodiments provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include blockchain-based distributed databases, etc., but are not limited thereto. The processors involved in the various embodiments provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to this.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined in any way. To simplify the description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, all possible combinations should be used. It is considered to be within the scope of this manual.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。The above-described embodiments only express several implementation modes of the present application, and their descriptions are relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that, for those of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all fall within the protection scope of the present application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims (10)

1. A method for file transfer, applied to a client, the method comprising:
responding to the downloading operation of a first file in a virtual computer, and generating a downloading instruction according to the downloading operation; the downloading instruction is used for indicating the virtual computer to convert the byte stream corresponding to the first file into the first encoded file according to a preset first encoding rule, and the virtual computer is used for displaying the first encoded file and generating a display page;
scanning the display page to obtain a first encoded file, and decoding the first encoded file to obtain a first file;
responding to the uploading operation of a second file in the client, converting a byte stream corresponding to the second file into keyboard characters according to a preset second coding rule, and generating a keyboard event corresponding to the keyboard characters;
transmitting the keyboard event to the virtual computer; the keyboard event is used for indicating the virtual computer to analyze the keyboard event to obtain the keyboard characters, and decoding the keyboard characters into byte streams corresponding to the second file.
2. The method of claim 1, wherein the virtual computer is configured to render the first encoded file, and wherein generating a rendering page comprises:
the virtual computer is used for dividing the first file into a plurality of first sub-files, displaying the first sub-coded file corresponding to each first sub-file at an interface, and generating a plurality of display pages; the display pages are in one-to-one correspondence with the first sub-coded files.
3. The method of claim 2, wherein the first encoding rule comprises a plurality of first encoding sub-rules in a preset order, the scanning the presentation page to obtain a first encoded file, and decoding the first encoded file to obtain a first file, comprising:
scanning the display page to obtain a first subcode file;
decoding the first sub-encoded file according to a first encoding sub-rule to obtain a first decoded sub-file;
and checking the first decoding subfile, if the check is not passed, sending a retransmission instruction to the virtual computer to instruct the virtual computer to switch the coding rule to the next first coding subfile of the first coding subfile, and converting the first subfile into a new first subfile according to the next first coding subfile, and displaying the new first subfile until all the first decoding subfiles pass the check to obtain the first file.
4. The method of claim 1, wherein in response to the uploading operation of the second file in the client, converting the byte stream corresponding to the second file into keyboard characters according to a preset second encoding rule, and generating a keyboard event corresponding to the keyboard characters, comprises:
responding to the uploading operation of a second file in the client, and splitting the second file into a plurality of second subfiles;
and converting the byte stream corresponding to each second sub-file in the plurality of second sub-files into keyboard characters according to a preset second coding rule, and generating a keyboard event corresponding to the keyboard characters.
5. The method of claim 4, wherein the sending the keyboard event to the virtual computer comprises:
before transmitting a keyboard event corresponding to each of the plurality of second subfiles, transmitting a keyboard event indicating the start of a data page; wherein, the data page corresponds to the keyboard event corresponding to the second sub-file one by one;
and after the keyboard event corresponding to each second sub-file in the plurality of second sub-files is sent, sending a keyboard event which indicates that the data page is ended.
6. The method of claim 5, wherein the virtual computer is further configured to verify the keyboard character corresponding to the second sub-file after receiving and decoding the keyboard event corresponding to the second sub-file, and display the encoded character corresponding to the verification result.
7. A file transfer device, the device being applied to a client, comprising:
the generation module is used for responding to the downloading operation of the first file in the virtual computer and generating a downloading instruction according to the downloading operation; the downloading instruction is used for indicating the virtual computer to convert the byte stream corresponding to the first file into the first encoded file according to a preset first encoding rule, and the virtual computer is used for displaying the first encoded file and generating a display page;
the scanning module is used for scanning the display page to obtain a first coded file, and decoding the first coded file to obtain a first file;
the encoding module is used for responding to the uploading operation of the second file in the client, converting the byte stream corresponding to the second file into keyboard characters according to a preset second encoding rule, and generating a keyboard event corresponding to the keyboard characters;
the sending module is used for sending the keyboard event to the virtual computer; the keyboard event is used for indicating the virtual computer to analyze the keyboard event to obtain the keyboard characters, and decoding the keyboard characters into byte streams corresponding to the second file.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the file transfer method of any of claims 1 to 6 when the computer program is executed.
9. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the file transfer method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the file transfer method of any of claims 1 to 6.
CN202310626231.2A 2023-05-30 2023-05-30 File transmission method, device, computer equipment and storage medium Pending CN116866331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310626231.2A CN116866331A (en) 2023-05-30 2023-05-30 File transmission method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310626231.2A CN116866331A (en) 2023-05-30 2023-05-30 File transmission method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116866331A true CN116866331A (en) 2023-10-10

Family

ID=88217937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310626231.2A Pending CN116866331A (en) 2023-05-30 2023-05-30 File transmission method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116866331A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119814853A (en) * 2025-03-13 2025-04-11 上海阅维科技股份有限公司 Method, system and intelligent terminal for restoring transmission session flow in IP network traffic

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119814853A (en) * 2025-03-13 2025-04-11 上海阅维科技股份有限公司 Method, system and intelligent terminal for restoring transmission session flow in IP network traffic

Similar Documents

Publication Publication Date Title
WO2020233033A1 (en) Information interaction method, device and storage medium
US20120030375A1 (en) Codepage-independent binary encoding method
CN109756568B (en) File processing method and device and computer readable storage medium
US10229003B2 (en) Method and system for iterative data recovery and error correction in a distributed system
US11249885B2 (en) Test case generator and user interface
CN111352912A (en) Compressed file processing method, device, storage medium, terminal and server
CN111629214A (en) Transcoding method, apparatus, device and medium for video file
CN108965430A (en) Image acquisition method, device, computer equipment and storage medium
CN110807111A (en) Three-dimensional graph processing method and device, storage medium and electronic equipment
CN108415894B (en) Report data initialization method and device, computer equipment and storage medium
US20230216524A1 (en) Detection circuit and detection method, electronic device, and computer-readable storage medium
CN116866331A (en) File transmission method, device, computer equipment and storage medium
CN111931205A (en) Method and device for encrypting shader file
CN115630618A (en) Intelligent scene editing method, system, equipment and medium for PDF document
US12086079B2 (en) Generating messages with priorities in a storage network
CN109413077B (en) JSON message data receiving and sending method and device and electronic equipment
US20190095405A1 (en) Text message displaying method and system, and text message providing system
CN111475234B (en) Character string transmission method and device, computer and readable storage medium
CN114615325A (en) Message push method, device, computer equipment and storage medium
US10318445B2 (en) Priority level adaptation in a dispersed storage network
CN113703998A (en) Image conversion method, image conversion device, electronic equipment and computer readable storage medium
CN116781323A (en) Data sending method, data receiving method and device, equipment and medium
CN112016059B (en) Method, apparatus, device and storage medium for processing data
CN110765097A (en) Data processing method and device, computer storage medium and electronic equipment
CN113157277A (en) Host file processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination