Data transmission method, device and storage medium

By using codec methods in the desktop system to encode data into QR code pictures, and using screenshot technology, the data transmission between processes in the process isolation scenario is realized, solving the problem of restricted inter-process communication and providing a A new cross-regional data transmission solution.

CN114826485BActive Publication Date: 2024-12-17CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210441754.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-25
Publication Date
2024-12-17
Estimated Expiration
2042-04-25

AI Technical Summary

Technical Problem

In process isolation scenarios, multiple processes in the same operating system cannot use existing inter-process communication methods such as TCP/IP, pipelines, shared files, shared memory, etc. for direct communication, resulting in restricted inter-process communication.

Method used

By setting a sending program in the desktop system to obtain the data to be sent, encode the data into a QR code picture based on the preset encoding and decoding method, and display it on the desktop, listen to the program screenshot and decode it to realize data transmission between processes, using QR code Encoding recognition and desktop screenshot technology realize cross-region data transmission.

Benefits of technology

It solves the problem of restricted inter-process communication, realizes data transmission between multiple processes in the same operating system, and provides a new cross-region data transmission solution that does not rely on conventional inter-process communication technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114826485B_ABST
    Figure CN114826485B_ABST
Patent Text Reader

Abstract

The present application provides a data transmission method, device and storage medium, which relates to the field of data processing technology. The method obtains the data to be sent of the first process through a sending program set in the desktop system, and then processes the data to be sent based on a preset encoding and decoding method to obtain a QR code image to be sent, and displays the QR code image to be sent on the desktop of the system. In this way, after the listening program deployed in the second process takes a screenshot of the desktop, it can scan and decode the desktop screenshot based on the above-mentioned preset encoding and decoding method to obtain the above-mentioned data to be sent, wherein the communication between the above-mentioned first process and the second process is limited, which solves the existing problem of limited inter-process communication and communication between multiple processes in the same operating system. Moreover, the embodiment of the present application does not rely on conventional inter-process communication technology to realize inter-process data transmission, and provides a new technical solution for desktop systems to perform cross-region data transmission in scenarios with limited communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data transmission method, device and storage medium. Background Art

[0002] With the continuous development of technology, various inter-application communication technologies such as named pipes, shared memory, Transmission Control Protocol (TCP) / Internet Protocol (IP) network access, etc. have become very mature. At the same time, a variety of inter-process communication monitoring methods and devices have also emerged, such as Sandbox, which is used for communication between multiple processes in the same operating system.

[0003] In the related art, in certain scenarios, multiple processes within the same operating system may not be able to communicate directly using existing inter-process communication methods, such as TCP / IP, pipes, shared files, shared memory, etc., due to factors such as process isolation.

[0004] Therefore, when inter-process communication is limited, such as in process isolation scenarios, how to implement inter-process communication becomes an urgent problem to be solved. Summary of the invention

[0005] The present application provides a data transmission method, device and storage medium to solve the existing problem of limited inter-process communication and communication between multiple processes in the same operating system.

[0006] In a first aspect, an embodiment of the present application provides a data transmission method, the method is applied to a sending program, the sending program is set in a desktop system, and the method includes:

[0007] Obtain the data to be sent by the first process;

[0008] Based on the first preset encoding and decoding method, the data to be sent is encoded to obtain a character string to be sent, and based on the second preset encoding and decoding method, the character string to be sent is encoded to obtain a message to be sent;

[0009] Based on a third preset encoding and decoding method, encoding the message to be sent into a QR code image to be sent;

[0010] The QR code image to be sent is displayed on the desktop of the desktop system, so that the listening program deployed in the second process takes a screenshot of the desktop, and based on the third preset encoding and decoding method, scans the desktop screenshot to obtain the message to be sent, based on the second preset encoding and decoding method, decodes the message to be sent to obtain the character string to be sent, and based on the first preset encoding and decoding method, decodes the character string to be sent to obtain the data to be sent, wherein the communication between the first process and the second process is restricted.

[0011] In a possible implementation manner, after obtaining the data to be sent of the first process, the method further includes:

[0012] Based on a preset data size, the data to be sent is divided into multiple data blocks;

[0013] The step of encoding the data to be sent based on the first preset encoding and decoding method to obtain a character string to be sent includes:

[0014] Based on the first preset encoding and decoding method, the multiple data blocks are encoded in sequence to obtain an ordered array of character strings to be sent.

[0015] In a possible implementation, encoding the character string to be sent based on the second preset encoding and decoding method to obtain the message to be sent includes:

[0016] Determine the header segment of the message to be sent according to the identity identifier of the data to be sent, and determine the content segment and the termination segment of the message to be sent according to the character string to be sent;

[0017] The message to be sent is obtained based on the second preset encoding and decoding method, the header segment of the message to be sent, and the content segment and the termination segment of the message to be sent.

[0018] In a possible implementation, displaying the to-be-sent QR code image on the desktop of the desktop system includes:

[0019] A preset graphical interface component is called to display the to-be-sent QR code image on the desktop of the desktop system at a first preset time interval.

[0020] In a second aspect, an embodiment of the present application provides another data transmission method, the method is applied to a listening program, the listening program is deployed in a second process of a desktop system, wherein the desktop of the desktop system displays a QR code image to be sent, the QR code image to be sent is a sending program that encodes the data to be sent of the first process based on a first preset encoding and decoding method to obtain a string to be sent, and encodes the string to be sent based on a second preset encoding and decoding method to obtain a message to be sent, and encodes the message to be sent based on a third preset encoding and decoding method, and the communication between the first process and the second process is restricted;

[0021] The method comprises:

[0022] Taking a screenshot of the desktop of the desktop system;

[0023] Based on the third preset encoding and decoding method, scanning the desktop screenshot to obtain the message to be sent;

[0024] Based on the second preset encoding and decoding method, decoding the message to be sent to obtain the character string to be sent;

[0025] Based on the first preset encoding and decoding method, the character string to be sent is decoded to obtain the data to be sent.

[0026] In a possible implementation, taking a screenshot of the desktop of the desktop system includes:

[0027] At a second preset time interval, a screenshot is taken of the desktop of the desktop system.

[0028] In a possible implementation, the decoding from the message to be sent to obtain the character string to be sent based on the second preset encoding and decoding method includes:

[0029] Verifying whether the format of the message to be sent is a preset format;

[0030] If the format of the message to be sent is the preset format, the character string to be sent is obtained by decoding the message to be sent based on the second preset encoding and decoding method.

[0031] In a third aspect, an embodiment of the present application provides a data transmission device, the device is applied to a sending program, the sending program is set in a desktop system, and the device includes:

[0032] A data acquisition module, used for acquiring the data to be sent by the first process;

[0033] A data encoding module, used to encode the data to be sent based on a first preset encoding and decoding method to obtain a character string to be sent, and to encode the character string to be sent based on a second preset encoding and decoding method to obtain a message to be sent;

[0034] A message encoding module, used for encoding the message to be sent into a QR code image to be sent based on a third preset encoding and decoding method;

[0035] The image display module is used to display the QR code image to be sent on the desktop of the desktop system, so that the listening program deployed in the second process can take a screenshot of the desktop, and scan the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent, decode the message to be sent based on the second preset encoding and decoding method to obtain the character string to be sent, and decode the character string to be sent based on the first preset encoding and decoding method to obtain the data to be sent, wherein the communication between the first process and the second process is limited.

[0036] In a possible implementation, the data encoding module is further used to:

[0037] Based on a preset data size, the data to be sent is divided into multiple data blocks;

[0038] Based on the first preset encoding and decoding method, the multiple data blocks are encoded in sequence to obtain an ordered array of character strings to be sent.

[0039] In a possible implementation, the data encoding module is specifically used to:

[0040] Determine the header segment of the message to be sent according to the identity identifier of the data to be sent, and determine the content segment and the termination segment of the message to be sent according to the character string to be sent;

[0041] The message to be sent is obtained based on the second preset encoding and decoding method, the header segment of the message to be sent, and the content segment and the termination segment of the message to be sent.

[0042] In a possible implementation, the picture display module is specifically used to:

[0043] A preset graphical interface component is called to display the to-be-sent QR code image on the desktop of the desktop system at a first preset time interval.

[0044] In a fourth aspect, an embodiment of the present application provides another data transmission device, the device is applied to a listening program, the listening program is set in a second process of a desktop system, wherein the desktop of the desktop system displays a QR code image to be sent, the QR code image to be sent is a sending program that encodes the data to be sent of the first process based on a first preset encoding and decoding method to obtain a string to be sent, and encodes the string to be sent based on a second preset encoding and decoding method to obtain a message to be sent, and encodes the message to be sent based on a third preset encoding and decoding method, and the communication between the first process and the second process is restricted;

[0045] The device comprises:

[0046] A desktop screenshot module, used to take a screenshot of the desktop of the desktop system;

[0047] A picture decoding module, used for scanning the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent;

[0048] A message decoding module, used for decoding the message to be sent to obtain the character string to be sent based on the second preset encoding and decoding method;

[0049] The character string decoding module is used to decode the character string to be sent based on the first preset encoding and decoding method to obtain the data to be sent.

[0050] In a possible implementation, the desktop screenshot module is specifically used to:

[0051] At a second preset time interval, a screenshot is taken of the desktop of the desktop system.

[0052] In a possible implementation, the message decoding module is specifically used to:

[0053] Verifying whether the format of the message to be sent is a preset format;

[0054] If the format of the message to be sent is the preset format, the character string to be sent is obtained by decoding the message to be sent based on the second preset encoding and decoding method.

[0055] In a fifth aspect, an embodiment of the present application provides a data transmission device, including:

[0056] processor;

[0057] Memory; and

[0058] Computer programs;

[0059] The computer program is stored in the memory and is configured to be executed by the processor, wherein the computer program includes instructions for executing the method as described in the first aspect.

[0060] In a sixth aspect, an embodiment of the present application provides another data transmission device, including:

[0061] processor;

[0062] Memory; and

[0063] Computer programs;

[0064] The computer program is stored in the memory and is configured to be executed by the processor, wherein the computer program includes instructions for executing the method as described in the second aspect.

[0065] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a server to execute the method described in the first aspect.

[0066] In an eighth aspect, an embodiment of the present application provides another computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program enables a server to execute the method described in the second aspect.

[0067] In a ninth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, wherein the computer instructions are executed by a processor to perform the method described in the first aspect.

[0068] In a tenth aspect, an embodiment of the present application provides another computer program product, including computer instructions, wherein the computer instructions are executed by a processor to perform the method described in the second aspect.

[0069] The data transmission method, device and storage medium provided in the embodiment of the present application, the method obtains the data to be sent of the first process through a sending program set in the desktop system, and then processes the data to be sent based on a preset encoding and decoding method to obtain a QR code image to be sent, and displays the QR code image to be sent on the desktop of the system, so that after the listening program deployed in the second process takes a screenshot of the desktop, it can scan and decode the desktop screenshot based on the above preset encoding and decoding method to obtain the above data to be sent, wherein the communication between the above first process and the second process is limited, solving the existing problem of limited inter-process communication and communication between multiple processes in the same operating system. Moreover, the embodiment of the present application does not rely on conventional inter-process communication technology to realize inter-process data transmission, and provides a new technical solution for desktop systems to perform cross-region data transmission in scenarios with limited communication. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0071] Figure 1 A schematic diagram of the data transmission system architecture provided in an embodiment of the present application;

[0072] Figure 2 A flowchart of a data transmission method provided in an embodiment of the present application;

[0073] Figure 3 A flowchart of another data transmission method provided in an embodiment of the present application;

[0074] Figure 4 A flowchart of another data transmission method provided in an embodiment of the present application;

[0075] Figure 5 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application;

[0076] Figure 6 A schematic diagram of the structure of another data transmission device provided in an embodiment of the present application;

[0077] Fig. 7A A schematic diagram of the basic hardware architecture of a data transmission device provided in an embodiment of the present application;

[0078] Figure 7B A schematic diagram of the basic hardware architecture of another data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0080] The terms "first", "second", "third", and "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0081] In addition, in the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved are in compliance with the relevant laws and regulations and do not violate public order and good morals.

[0082] In the related technologies, on existing operating systems, when inter-process communication is limited, such as in process isolation scenarios, technologies such as TCP / IP, pipes, shared files, and shared memory have been widely used for inter-process communication. However, in certain scenarios, multiple processes in the same operating system may not be able to communicate directly using existing inter-process communication methods due to factors such as process isolation. At this point, how to implement inter-process communication becomes an urgent problem to be solved.

[0083] In order to solve the above problems, an embodiment of the present application proposes a data transmission method, which uses QR code recognition and desktop screenshot technology to realize data transmission between processes in a scenario where there are multiple processes with limited communication in the same desktop system.

[0084] Optionally, a data transmission method provided in this application may be applicable to Figure 1 The data transmission system architecture diagram is shown in FIG. Figure 1 As shown, the system may include a sending program and a listening program. The sending program and the listening program are set in the same desktop system, such as CentOS / 7 (CentOS / 7 is a Linux desktop / server operating system), the sending program can be deployed in the first process, the listening program can be deployed in the second process, and the communication between the first process and the second process is limited. Here, the first process and the second process can be determined according to actual conditions, such as process A and process B, the communication between the two processes is limited, and it is impossible to use existing inter-process communication methods, such as TCP / IP, pipes, shared files, shared memory, etc., to communicate directly.

[0085] In the specific implementation process, the sending program obtains the data to be sent of the first process, and then processes the data to be sent based on the preset encoding and decoding method to obtain the QR code image to be sent, and displays the QR code image to be sent on the system desktop. After the listening program takes a screenshot of the desktop, it can scan and decode the desktop screenshot based on the above preset encoding and decoding method to obtain the above data to be sent, solving the existing problem of limited communication between processes and communication between multiple processes in the same operating system.

[0086] Here, the sending program can display the QR code image to be sent on the desktop at a first preset time interval, for example, display the QR code image to be sent on the desktop at a time interval T. The listening program can be started before the sending program. After starting, the system desktop can be screenshotted at a second preset time interval, for example, at a time interval of T / 2, and the desktop screenshot containing the QR code image to be sent can be obtained in time, so as to complete the communication between multiple processes as soon as possible.

[0087] It should be understood that the above system is only an exemplary system and can be configured according to application requirements during specific implementation.

[0088] It is understandable that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the data transmission system architecture. In other feasible implementations of the present application, the above architecture may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently, which can be determined according to the actual application scenario and is not limited here. Figure 1 The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0089] In addition, the system architecture described in the embodiments of the present application is intended to more clearly illustrate the technical solutions of the embodiments of the present application, and does not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0090] The technical solution of the present application is described below by taking several embodiments as examples, and the same or similar concepts or processes may not be repeated in some embodiments.

[0091] Figure 2 A flow chart of a data transmission method provided in an embodiment of the present application. The execution subject of this embodiment may be Figure 1 The specific execution subject can be determined according to the actual application scenario, and the present application embodiment does not impose any special restrictions on this. Figure 2 As shown, the data transmission method provided in the embodiment of the present application may include the following steps:

[0092] S201: Obtain the data to be sent by the first process.

[0093] Here, after the sending program is started, it obtains the data to be sent of the first process. Taking the data to be sent as a file as an example, after the sending program is started, it can read the file header and read the file content in the form of a byte stream, thereby obtaining the data to be sent of the first process.

[0094] In an embodiment of the present application, in order to reduce the performance requirements for the sending program, after obtaining the data to be sent of the first process, the sending program can divide the data to be sent based on a preset data size to obtain multiple data blocks. The preset data size can be determined according to actual conditions, for example, N bytes, and N can be 1200. The sending program divides the data to be sent into data blocks of N bytes in size. When the last data block is less than N bytes, the actual size shall prevail.

[0095] S202: Encode the data to be sent based on a first preset encoding and decoding method to obtain a character string to be sent, and encode the character string to be sent based on a second preset encoding and decoding method to obtain a message to be sent.

[0096] Among them, the above-mentioned first preset encoding and decoding method can be a string encoding method, such as a Base64 encoding method. The above-mentioned sending program encodes the above-mentioned data to be sent based on the Base64 encoding method to obtain the string to be sent, so as to subsequently realize inter-process communication based on the string to be sent. Here, the Base64 encoding method is an encoding technology that converts a binary byte code array into an array of 64 American Standard Code for Information Interchange (ASCII) visible characters. In the above-mentioned Base64 encoding method, the encoding can adopt the String java.util.Base64.getEncoder().encodeToString(byte[]src) method, and the decoding can adopt the byte[]java.util.Base64.getDecoder().decode(String src) method to meet various application needs.

[0097] In an embodiment of the present application, if the sending program segments the data to be sent, after segmentation, the segmented multiple data blocks can be encoded in sequence based on the first preset encoding and decoding method to obtain an ordered array of strings to be sent.

[0098] In addition, the above-mentioned second preset encoding and decoding method can be a transmission message encoding method, which can be based on 8-bit (Universal Character Set / Unicode Transformation Format, UTF-8) character encoding to encode the above-mentioned character string to be sent to obtain the message to be sent, so as to subsequently solve the problem of limited inter-process communication and communication between multiple processes in the same operating system based on the message to be sent.

[0099] The message body is composed of the following segment format: [Command][Sequence][:][Content(UTF-8)]

[0100] [Command][Sequence][:] is the message header and belongs to the transmission control segment, and [Content(UTF-8)] belongs to the body of the transmission message.

[0101] [Command]: 1-byte character: Encoding enumeration: "0", "1", "2"

[0102] "0": indicates the "header segment" at the beginning of the transmission, which only appears once during the transmission process.

[0103] "1": represents the "content segment" of the transferred file body content.

[0104] "2": Indicates the "termination segment" of the transferred file body, which only appears once during the transfer process.

[0105] [Sequence]: variable length array, the content is a string representation of a natural number starting from 0 and increasing by 1 in each segment

[0106] [:]: 1 byte, the separator between [Sequence][Content(base64)] and two information ends, a fixed character

[0107] [Content(UTF-8)]: The data stream to be sent is encoded by the first preset codec, such as a string encoded by Base64.

[0108] Exemplarily, the sending program can determine the title segment of the message to be sent based on the identity identifier of the data to be sent, determine the content segment and the termination segment of the message to be sent based on the character string to be sent, and then, based on the second preset encoding and decoding method, the title segment of the message to be sent, and the content segment and the termination segment of the message to be sent, obtain the message to be sent to ensure that subsequent processing proceeds normally.

[0109] For example, as shown in Table 1, the header segment, content segment and termination segment of a message to be sent.

[0110] Table 1

[0111] Title segment 00:Identity of the data to be sent.docx Content section 1 11:Ye+8juS6jOe7tOeggee8lueggS / op6PnoIHm Content section 2 12:5LqM57u056CB57yW56CBL+ino+eggeaK Content section 3 13:5oqA5pyv6YeH55So5LqGenhpbmfnmoQ= Termination segment 24:7yW56CBL+ino+eggeaKgA0KCQ=

[0112] Here, if the above-mentioned sending program divides the data to be sent, after the division, the multiple data blocks after the division can be encoded in sequence based on the above-mentioned first preset encoding and decoding method to obtain an ordered array of character strings to be sent, and then, according to the above-mentioned second preset encoding and decoding method, it can be encoded into an ordered list of message character strings to be sent.

[0113] S203: Based on the third preset encoding and decoding method, encode the message to be sent into a QR code image to be sent.

[0114] Among them, the above-mentioned third preset encoding and decoding method can be a two-dimensional code encoding / decoding technology, that is, a technology that converts text into a two-dimensional code graphic and converts it into text by recognizing the two-dimensional code in the image.

[0115] In the embodiment of the present application, the above two-dimensional code encoding / decoding technology can adopt the open source implementation of zxing. Among them, the encoding scheme can adopt: com.zxing.MultiFormatWriter.encode(String contents,BarcodeFormat format,int width,int height) method, where:

[0116] content: The message to be sent can be encoded as a string according to the transmission message encoding rules.

[0117] format: BarcodeFormat.QR_CODE

[0118] width: 600

[0119] Height: 600

[0120] Additional properties: EncodeHintType.CHARACTER_SET,: "UTF-8"

[0121] The decoding scheme uses:

[0122] com.zxing.multi.qrcode.QRCodeMultiReader.decodeMultiple(BinaryBitmapimage,Map<DecodeHintType,?> hints) method, where:

[0123] image: You can use the screenshot application program interface (Application Programming Interface, API) of JDK8 to capture the system screen

[0124] hints:[EncodeHintType.CHARACTER_SET,:"UTF-8"]

[0125] Here, after obtaining the message to be sent, if the sending program divides the data to be sent, after obtaining the ordered list of message strings to be sent, the sending program can use the third preset encoding and decoding method in sequence, such as the QR code generation technology to encode the message into a QR code image, such as generating a QR code image of 600*600 size, to facilitate the subsequent inter-process communication based on the QR code image.

[0126] Furthermore, the above-mentioned sending program can call a preset graphical interface component to display the above-mentioned QR code image on the desktop of the desktop system according to a first preset time interval, such as using Java Swing technology to present the image on the system desktop, and each image is displayed for a time T, for example T = 1 second, until all the messages to be sent are encoded and displayed.

[0127] S204: Displaying a QR code image to be sent on the desktop of the desktop system, so that the listening program deployed in the second process can take a screenshot of the desktop, and based on the third preset encoding and decoding method, scan the desktop screenshot to obtain the message to be sent, and based on the second preset encoding and decoding method, decode the message to be sent to obtain the character string to be sent, and based on the first preset encoding and decoding method, decode the character string to be sent to obtain the data to be sent, wherein the communication between the first process and the second process is restricted.

[0128] Here, the above-mentioned sending program obtains the QR code image to be sent, displays the QR code image to be sent on the system's desktop, and after the listening program deployed in the second process takes a screenshot of the desktop, the desktop screenshot can be scanned and decoded based on the above-mentioned preset encoding and decoding methods, such as the above-mentioned first preset encoding and decoding method, the second preset encoding and decoding method and the third preset encoding and decoding method, to obtain the above-mentioned data to be sent, thereby realizing inter-process data transmission without relying on conventional inter-process communication technology.

[0129] The embodiment of the present application obtains the data to be sent of the first process through a sending program set in the desktop system, and then processes the data to be sent based on a preset encoding and decoding method to obtain a QR code image to be sent, and displays the QR code image to be sent on the desktop of the system. In this way, after the listening program deployed in the second process takes a screenshot of the desktop, it can scan and decode the desktop screenshot based on the above preset encoding and decoding method to obtain the above data to be sent, wherein the communication between the above first process and the second process is limited, solving the existing problem of limited inter-process communication and communication between multiple processes in the same operating system. Moreover, the embodiment of the present application does not rely on conventional inter-process communication technology to realize inter-process data transmission, and provides a new technical solution for desktop systems to perform cross-region data transmission in scenarios with limited communication.

[0130] In addition, the above Figure 2 The flow of the data transmission method is described from the sending program end. Figure 3 A flow of a data transmission method corresponding to the other end, namely, the listening program, is given. The listening program is deployed in the second process of the desktop system, and the desktop of the desktop system displays the above-mentioned QR code image to be sent. Figure 3 A flowchart of another data transmission method is provided for the embodiment of the present application, wherein the relevant description is referred to in Figure 2 , I will not repeat it here, such as Figure 3 As shown, the method may include:

[0131] S301: Taking a screenshot of the desktop of the desktop system.

[0132] Here, the monitoring program may take a screenshot of the desktop of the desktop system at a second preset time interval.

[0133] The monitoring program is started before the sending program. After being started, the system desktop is captured at a second preset time interval, such as a time interval of T / 2.

[0134] In an embodiment of the present application, the above-mentioned listening program can use JDK8's java.awt.Robot#createScreenCapture to take a screenshot of the desktop of the above-mentioned desktop system, that is, to capture the desktop screen and save it in a picture format.

[0135] S302: Based on the third preset encoding and decoding method, the desktop screenshot is scanned to obtain a message to be sent.

[0136] Among them, the above-mentioned monitoring program scans the desktop screenshot based on the above-mentioned third preset encoding and decoding method. If no QR code is found, no operation is performed. Otherwise, the found QR code is decoded to obtain the message to be sent.

[0137] S303: Based on the second preset encoding and decoding method, decode the message to be sent to obtain a character string to be sent.

[0138] Exemplarily, after obtaining the message to be sent, the monitoring program may verify whether the format of the message to be sent is a preset format. If it is a preset format, the character string to be sent is decoded from the message to be sent based on the second preset encoding and decoding method.

[0139] Here, the above preset format can be determined according to actual conditions, for example, Figure 2 The above monitoring program is based on Figure 2 The transmission message encoding method verifies the message. If it conforms to the message format, the string to be sent is obtained. When the [Command] bit of the read message is "2", the transmission ends. Figure 2 The transmission message encoding method obtains the character string to be sent from the data identity identifier in record No. 0 of the message to be sent.

[0140] S304: Based on the first preset encoding and decoding method, the character string to be sent is decoded to obtain data to be sent.

[0141] Among them, after receiving and decoding all the message contents, the above-mentioned monitoring program can use the above-mentioned first preset encoding and decoding method, such as Base64 encoding, to decode the character string to be sent obtained after the above decoding into a byte array, that is, the above-mentioned data to be sent.

[0142] In the scenario where multiple processes in the same desktop system have limited communication, the embodiment of the present application uses QR code recognition and desktop screenshot technology to achieve inter-process data transmission. Among them, inter-process data transmission is achieved without relying on conventional inter-process communication technology, providing a new technical solution for cross-region data transmission in desktop systems with limited communication.

[0143] Here, if Figure 4 As shown, Figure 4 A flow chart of another data transmission method is given, which illustrates the process of data transmission between processes from the interaction between the sending program and the listening program. For related descriptions, see Figure 2 and Figure 3 , I will not go into details here.

[0144] Here, the sending program and the listening program are set in the same desktop system, the sending program is deployed in the first process, and the listening program is deployed in the second process. The communication between the first process and the second process is limited, such as Figure 4 As shown, the method may include:

[0145] S401: The sending program obtains the data to be sent by the first process.

[0146] S402: The sending program divides the data to be sent based on a preset data size to obtain multiple data blocks.

[0147] For each data block, steps S403 - S406 are executed in sequence.

[0148] S403: The sending program encodes the data block based on the first preset encoding and decoding method to obtain a corresponding character string.

[0149] S404: The sending program encodes the above character string based on the second preset encoding and decoding method to obtain a corresponding message.

[0150] S405: The sending program encodes the message into a QR code image based on the third preset encoding and decoding method.

[0151] S406: The sending program displays the QR code image on the desktop of the system.

[0152] S407: The monitoring program takes a screenshot of the desktop.

[0153] S408: The monitoring program scans the desktop screenshot based on the third preset encoding and decoding method to obtain a corresponding message.

[0154] S409: The monitoring program decodes the message based on the second preset encoding and decoding method to obtain a corresponding character string.

[0155] S410: The monitoring program decodes the above character string based on the above first preset encoding and decoding method to obtain corresponding data.

[0156] S411: The listening program merges the acquired data into a single byte stream in sequence.

[0157] S412: The monitoring program obtains the data to be sent based on the single byte stream merged above.

[0158] Here, the listening program can write the above single byte stream into a preset receiving file for subsequent viewing.

[0159] In summary, compared with the prior art, the embodiments of the present application solve the problem of communication between multiple processes in the same operating system when inter-process communication is limited. Moreover, the embodiments of the present application do not rely on conventional inter-process communication technology to achieve inter-process data transmission, providing a new technical solution for desktop systems to perform cross-region data transmission in scenarios with limited communication.

[0160] Corresponding to the data transmission method of the above embodiment, Figure 5 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application. For ease of description, only the parts related to the embodiment of the present application are shown. Figure 5 A schematic diagram of the structure of a data transmission device provided in an embodiment of the present application, the data transmission device 50 includes: a data acquisition module 501, a data encoding module 502, a message encoding module 503 and a picture display module 504. The data transmission device here can be the above-mentioned sending program itself, or a chip or integrated circuit that implements the function of the sending program. It should be noted here that the division of the data acquisition module, the data encoding module, the message encoding module and the picture display module is only a division of logical functions, and the two can be physically integrated or independent.

[0161] The data acquisition module 501 is used to acquire the data to be sent by the first process.

[0162] The data encoding module 502 is used to encode the data to be sent based on a first preset encoding and decoding method to obtain a character string to be sent, and to encode the character string to be sent based on a second preset encoding and decoding method to obtain a message to be sent.

[0163] The message encoding module 503 is used to encode the message to be sent into a QR code image to be sent based on a third preset encoding and decoding method.

[0164] The picture display module 504 is used to display the QR code picture to be sent on the desktop of the desktop system, so that the listening program deployed in the second process can take a screenshot of the desktop, and scan the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent, decode the message to be sent based on the second preset encoding and decoding method to obtain the character string to be sent, and decode the character string to be sent based on the first preset encoding and decoding method to obtain the data to be sent, wherein the communication between the first process and the second process is restricted.

[0165] In a possible implementation, the data encoding module 502 is further configured to:

[0166] Based on a preset data size, the data to be sent is divided into multiple data blocks;

[0167] Based on the first preset encoding and decoding method, the multiple data blocks are encoded in sequence to obtain an ordered array of character strings to be sent.

[0168] In a possible implementation, the data encoding module 502 is specifically configured to:

[0169] Determine the header segment of the message to be sent according to the identity identifier of the data to be sent, and determine the content segment and the termination segment of the message to be sent according to the character string to be sent;

[0170] The message to be sent is obtained based on the second preset encoding and decoding method, the header segment of the message to be sent, and the content segment and the termination segment of the message to be sent.

[0171] In a possible implementation, the picture display module 504 is specifically used to:

[0172] A preset graphical interface component is called to display the to-be-sent QR code image on the desktop of the desktop system at a first preset time interval.

[0173] The device provided in the embodiment of the present application can be used to perform the above Figure 2 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in the embodiments of the present application.

[0174] Figure 6 A schematic diagram of the structure of another data transmission device provided in an embodiment of the present application, the data transmission device 60 includes: a desktop screenshot module 601, a picture decoding module 602, a message decoding module 603 and a string decoding module 604. The data transmission device here can be the above-mentioned monitoring program itself, or a chip or integrated circuit that implements the function of the monitoring program. It should be noted here that the division of the desktop screenshot module, the picture decoding module, the message decoding module and the string decoding module is only a division of logical functions, and the two can be physically integrated or independent.

[0175] The desktop screenshot module 601 is used to take a screenshot of the desktop of the desktop system.

[0176] The picture decoding module 602 is used to scan the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent.

[0177] The message decoding module 603 is used to decode the message to be sent to obtain the character string to be sent based on the second preset encoding and decoding method.

[0178] The character string decoding module 604 is used to decode the character string to be sent based on the first preset encoding and decoding method to obtain the data to be sent.

[0179] In a possible implementation, the desktop screenshot module 601 is specifically used to:

[0180] At a second preset time interval, a screenshot is taken of the desktop of the desktop system.

[0181] In a possible implementation, the message decoding module 603 is specifically configured to:

[0182] Verifying whether the format of the message to be sent is a preset format;

[0183] If the format of the message to be sent is the preset format, the character string to be sent is obtained by decoding the message to be sent based on the second preset encoding and decoding method.

[0184] The device provided in the embodiment of the present application can be used to perform the above Figure 3 The technical solution of the method embodiment shown has similar implementation principles and technical effects, and will not be repeated here in the embodiments of the present application.

[0185] Optionally, Fig. 7A and 7B A schematic diagram of a possible basic hardware architecture of the data transmission device described in the present application is provided schematically.

[0186] See also Fig. 7A and 7B The data transmission device includes at least one processor 701 and a communication interface 703. Further optionally, it may also include a memory 702 and a bus 704.

[0187] In the data transmission device, the number of processors 701 may be one or more. Fig. 7A and 7B Only one of the processors 701 is illustrated. Optionally, the processor 701 may be a central processing unit (CPU), a graphics processing unit (GPU), or a digital signal processor (DSP). If the data transmission device has multiple processors 701, the types of the multiple processors 701 may be different or the same. Optionally, the multiple processors 701 of the data transmission device may also be integrated into a multi-core processor.

[0188] The memory 702 stores computer instructions and data; the memory 702 may store computer instructions and data required to implement the above-mentioned data transmission method provided in the present application, for example, the memory 702 stores instructions for implementing the steps of the above-mentioned data transmission method. The memory 702 may be any one or any combination of the following storage media: non-volatile memory (e.g., read-only memory (ROM), solid state disk (SSD), hard disk (HDD), optical disk), volatile memory.

[0189] The communication interface 703 can provide information input / output for the at least one processor, and can also include any one or any combination of the following devices: a network interface (eg, an Ethernet interface), a wireless network card, and other devices with network access functions.

[0190] Optionally, the communication interface 703 may also be used for data transmission between the data transmission device and other computing devices or terminals.

[0191] Further optional, Fig. 7A and 7B A thick line represents bus 704. Bus 704 can connect processor 701 with memory 702 and communication interface 703. Thus, through bus 704, processor 701 can access memory 702, and can also use communication interface 703 to exchange data with other computing devices or terminals.

[0192] In the present application, the data transmission device executes the computer instructions in the memory 702, so that the data transmission device implements the above-mentioned data transmission method provided in the present application, or enables the data transmission device to deploy the above-mentioned data transmission device.

[0193] From the perspective of logical function division, for example, Fig. 7A As shown, the memory 702 may include a data acquisition module 501, a data encoding module 502, a message encoding module 503, and a picture display module 504. The inclusion here only refers to the instructions stored in the memory being executed to respectively realize the functions of the data acquisition module, the data encoding module, the message encoding module, and the picture display module, without limiting the physical structure.

[0194] For example, Figure 7B As shown, the memory 702 may include a desktop screenshot module 601, a picture decoding module 602, a message decoding module 603, and a string decoding module 604. The inclusion here only refers to the fact that when the instructions stored in the memory are executed, the functions of the desktop screenshot module, the picture decoding module, the message decoding module, and the string decoding module can be realized respectively, without limiting the physical structure.

[0195] The present application provides a computer-readable storage medium, wherein the computer program product includes computer instructions, and the computer instructions instruct a computing device to execute the above-mentioned data transmission method provided by the present application.

[0196] The present application provides a computer program product, comprising computer instructions, wherein the computer instructions are executed by a processor to perform the above data transmission method.

[0197] The present application provides a chip, comprising at least one processor and a communication interface, wherein the communication interface provides information input and / or output for the at least one processor. Further, the chip may also include at least one memory, wherein the memory is used to store computer instructions. The at least one processor is used to call and run the computer instructions to execute the above-mentioned data transmission method provided by the present application.

[0198] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0199] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0200] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.

Claims

1. A data transmission method, characterized in that: The method is applied to a sending program, the sending program is set in a desktop system, and the method includes: Obtain the data to be sent by the first process; Based on the first preset encoding and decoding method, the data to be sent is encoded to obtain a character string to be sent, and based on the second preset encoding and decoding method, the character string to be sent is encoded to obtain a message to be sent; Based on a third preset encoding and decoding method, encoding the message to be sent into a QR code image to be sent; The QR code image to be sent is displayed on the desktop of the desktop system, so that the listening program deployed in the second process takes a screenshot of the desktop, and scans the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent, decodes the message to be sent based on the second preset encoding and decoding method to obtain the string to be sent, and decodes the string to be sent based on the first preset encoding and decoding method to obtain the data to be sent, wherein the communication between the first process and the second process is limited; The encoding of the character string to be sent based on the second preset encoding and decoding method to obtain the message to be sent includes: Determine the header segment of the message to be sent according to the identity identifier of the data to be sent, and determine the content segment and the termination segment of the message to be sent according to the character string to be sent; Based on the second preset encoding and decoding method, the header segment of the message to be sent, and the content segment and the termination segment of the message to be sent, the message to be sent is obtained.

2. The method according to claim 1, characterized in that: After obtaining the data to be sent of the first process, the method further includes: Based on a preset data size, the data to be sent is divided into multiple data blocks; The step of encoding the data to be sent based on the first preset encoding and decoding method to obtain a character string to be sent includes: Based on the first preset encoding and decoding method, the multiple data blocks are encoded in sequence to obtain an ordered array of character strings to be sent.

3. The method according to claim 1 or 2, characterized in that: The displaying of the to-be-sent QR code image on the desktop of the desktop system includes: A preset graphical interface component is called to display the QR code image to be sent on the desktop of the desktop system at a first preset time interval.

4. A data transmission method, characterized in that: The method is applied to a listening program, which is deployed in a second process of a desktop system, wherein the desktop of the desktop system displays a QR code image to be sent, and the QR code image to be sent is obtained by the sending program encoding the data to be sent of the first process based on a first preset encoding and decoding method to obtain a string to be sent, and encoding the string to be sent based on a second preset encoding and decoding method to obtain a message to be sent, and encoding the message to be sent based on a third preset encoding and decoding method, and the communication between the first process and the second process is restricted; The method comprises: Taking a screenshot of the desktop of the desktop system; Based on the third preset encoding and decoding method, scanning the desktop screenshot to obtain the message to be sent; Based on the second preset encoding and decoding method, decoding the message to be sent to obtain the character string to be sent; Based on the first preset encoding and decoding method, decoding the character string to be sent to obtain the data to be sent; The decoding, based on the second preset encoding and decoding method, from the message to be sent to obtain the character string to be sent includes: Verifying whether the format of the message to be sent is a preset format; If the format of the message to be sent is the preset format, the character string to be sent is obtained by decoding the message to be sent based on the second preset encoding and decoding method.

5. The method according to claim 4, characterized in that The taking a screenshot of the desktop of the desktop system comprises: At a second preset time interval, a screenshot is taken of the desktop of the desktop system.

6. A data transmission device, characterized in that: The device is applied to a sending program, and the sending program is set in a desktop system. The device includes: A data acquisition module, used for acquiring the data to be sent by the first process; A data encoding module, used to encode the data to be sent based on a first preset encoding and decoding method to obtain a character string to be sent, and to encode the character string to be sent based on a second preset encoding and decoding method to obtain a message to be sent; A message encoding module, used for encoding the message to be sent into a QR code image to be sent based on a third preset encoding and decoding method; The picture display module is used to display the QR code picture to be sent on the desktop of the desktop system, so that the listening program deployed in the second process takes a screenshot of the desktop, and scans the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent, decodes the message to be sent based on the second preset encoding and decoding method to obtain the string to be sent, and decodes the string to be sent based on the first preset encoding and decoding method to obtain the data to be sent, wherein the communication between the first process and the second process is limited; The data encoding module is specifically used for: Determine the header segment of the message to be sent according to the identity identifier of the data to be sent, and determine the content segment and the termination segment of the message to be sent according to the character string to be sent; The message to be sent is obtained based on the second preset encoding and decoding method, the header segment of the message to be sent, and the content segment and the termination segment of the message to be sent.

7. The device according to claim 6, characterized in that The data encoding module is further used for: Based on a preset data size, the data to be sent is divided into multiple data blocks; Based on the first preset encoding and decoding method, the multiple data blocks are encoded in sequence to obtain an ordered array of character strings to be sent.

8. A data transmission device, characterized in that: The device is applied to a listening program, and the listening program is deployed in a second process of a desktop system, wherein the desktop of the desktop system displays a QR code image to be sent, and the QR code image to be sent is obtained by the sending program encoding the data to be sent of the first process based on a first preset encoding and decoding method to obtain a string to be sent, and encoding the string to be sent based on a second preset encoding and decoding method to obtain a message to be sent, and encoding the message to be sent based on a third preset encoding and decoding method, and the communication between the first process and the second process is restricted; The device comprises: A desktop screenshot module, used to take a screenshot of the desktop of the desktop system; A picture decoding module, used for scanning the desktop screenshot based on the third preset encoding and decoding method to obtain the message to be sent; A message decoding module, used for decoding the message to be sent to obtain the character string to be sent based on the second preset encoding and decoding method; A character string decoding module, used for decoding the character string to be sent based on the first preset encoding and decoding method to obtain the data to be sent; The message decoding module is specifically used for: Verifying whether the format of the message to be sent is a preset format; If the format of the message to be sent is the preset format, the character string to be sent is obtained by decoding the message to be sent based on the second preset encoding and decoding method.

9. The device according to claim 8, characterized in that The desktop screenshot module is specifically used for: At a second preset time interval, a screenshot is taken of the desktop of the desktop system.

10. A data transmission device, characterized in that: include: processor; Memory; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor, wherein the computer program includes instructions for executing the method according to any one of claims 1 to 3 and / or includes instructions for executing the method according to any one of claims 4 to 5.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which enables a processor to execute the method according to any one of claims 1 to 3 and / or enables a processor to execute the method according to any one of claims 4 to 5.

12. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used by a processor to execute the method according to any one of claims 1 to 3 and / or to execute the method according to any one of claims 4 to 5.