CN113938475B - Data transmission method - Google Patents
Data transmission method Download PDFInfo
- Publication number
- CN113938475B CN113938475B CN202111541705.0A CN202111541705A CN113938475B CN 113938475 B CN113938475 B CN 113938475B CN 202111541705 A CN202111541705 A CN 202111541705A CN 113938475 B CN113938475 B CN 113938475B
- Authority
- CN
- China
- Prior art keywords
- connection
- client terminal
- information
- http
- server
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a data transmission method, which comprises the steps of establishing a websocket connection with a preset client terminal based on a preset websocket server, and establishing an http connection with the client terminal based on a preset http server; event monitoring is carried out on a preset monitored object; when a target event corresponding to the monitored object is monitored, generating http information of an update file corresponding to the monitored object according to the target event; based on the websocket server, sending the http information to the client terminal; and when a downloading request sent by the client terminal according to the http information is detected, sending the update file to the client terminal based on the http server. The invention can actively feed back the latest file information to the client terminal and realize quick transmission, and has high efficiency and convenience in the scene of needing data transmission with the client terminal for many times.
Description
Technical Field
The invention relates to the technical field of data transmission, in particular to a data transmission method.
Background
As smart terminals become more widely used, users watch video programs for a longer time on client terminals, such as mobile phones and tablets. However, the client terminal is weaker in computing performance than the service terminal for achieving portability, and for example, a computer is stronger in processing capability than a mobile phone in terms of video processing. Therefore, in order to view the processed video at the mobile terminal, the video to be transmitted is stored locally and uploaded to the cloud server, and then the user operates the mobile terminal to pull the video from the cloud server. For example, in the field of video, Adobe After Effects (AE), which is graphics processing software introduced by Adobe, is often used in many television stations, animation companies, and the like. When AE is used at the back end to develop a beauty algorithm, the processed video is generally transmitted to the client terminal, and the beauty effect is evaluated by the display effect of a plurality of client terminals and the service terminal.
This method requires frequent requests to the cloud server, which puts a certain stress on the server. Especially, when a designer conducts operations such as algorithm debugging, the effect needs to be frequently observed on the mobile terminal. In addition, this method only sends the video from the service terminal to the client terminal, and after the video is received by the mobile terminal, the user is required to perform some tedious and repeated operations, such as frequently searching for files, because a large number of old versions exist in the process, which results in inefficiency.
SUMMERY OF THE UTILITY MODEL
The technical problem to be solved by the invention is that the files processed by the existing service terminal can not be quickly and conveniently transferred to the client terminal, and a data transmission method is provided aiming at the defects of the prior art.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a method of data transmission, the method comprising:
establishing a websocket connection with a preset client terminal based on a preset websocket server, and establishing an http connection with the client terminal based on a preset http server;
event monitoring is carried out on a preset monitored object;
when a target event corresponding to the monitored object is monitored, generating http information of an update file corresponding to the monitored object according to the target event;
based on the websocket server, sending the http information to the client terminal;
and when a downloading request sent by the client terminal according to the http information is detected, sending the update file to the client terminal based on the http server.
According to the data transmission method, the monitoring object comprises an application program, and a target event corresponding to the application program is a derived event; when a target event corresponding to the monitored object is monitored, generating http information of an update file corresponding to the monitored object according to the target event comprises the following steps:
when the export event is monitored, determining a file corresponding to the export event as an update file;
and generating http information corresponding to the export event according to the storage address corresponding to the export event and the update file.
The data transmission method, wherein the establishing of the websocket connection with the preset client terminal based on the preset websocket server includes:
when the websocket server is detected, generating connection information corresponding to the websocket server based on the connection parameters of the websocket server;
sending the connection information to the client terminal;
and when detecting a connection request sent by the client terminal based on the connection information, establishing connection with the client terminal based on the websocket server.
The data transmission method comprises the following steps that after the websocket connection is established with a preset client terminal based on a preset websocket server:
acquiring terminal information of the client terminal, and recording the terminal information in a preset mass sending list;
based on the websocket server, sending ping signaling to client terminals corresponding to the mass sending list;
for each client terminal, when a pong signaling sent by the client terminal according to the ping signaling is detected according to preset detection time, determining that the client terminal is available;
and deleting the terminal information corresponding to the client terminal in the mass sending list when the ping signaling is not detected according to the detection time.
A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement steps in a data transmission method as recited in any above.
A service terminal, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the data transmission method as described in any of the above.
A data transmission system comprises a plurality of client terminals and a service terminal, wherein the client terminals are in communication connection with the service terminal.
The client terminal includes:
the first connection module is used for establishing connection with the websocket server and the http server;
the processing module is used for extracting the http information when the http information is received, and obtaining and displaying file information;
and the request module is used for sending a downloading request to the service terminal according to the http address in the http information when a first confirmation instruction aiming at the file information is detected.
The service terminal includes:
the second connection module is used for establishing a websocket connection with a preset client terminal based on a preset websocket server and establishing an http connection with the client terminal based on a preset http server;
the monitoring module is used for monitoring events of a preset monitored object;
the generating module is used for generating http information of an update file corresponding to the monitored object according to a target event when the target event corresponding to the monitored object is monitored;
the first sending module is used for sending the http information to the client terminal based on the websocket server;
the second sending module is used for sending the update file to the client terminal based on the http server when a downloading request sent by the client terminal according to the http information is detected;
wherein the second connection module comprises:
the first generating unit is used for generating connection information corresponding to the websocket server based on the connection parameters of the websocket server when the websocket server is detected;
a sending unit, configured to send the connection information to the client terminal;
the connection unit is used for establishing connection with the client terminal based on the websocket server when detecting a connection request sent by the client terminal based on the connection information;
the connection information comprises a two-dimensional code image; the first connection module includes:
the photographing unit is used for photographing the two-dimensional code image based on a preset camera to obtain two-dimensional code information;
the analyzing unit is used for analyzing the two-dimension code information to obtain a connection parameter corresponding to the websocket server;
and the first connection unit is used for sending a connection request to the websocket server based on the connection parameters and storing the connection parameters as historical parameters.
The connection module further includes:
the display unit is used for displaying the historical parameters when a connection instruction is detected;
and the second connection unit is used for establishing connection with the websocket server based on the history parameters when a second confirmation instruction aiming at the history parameters is detected.
Has the advantages that: the scheme provides a data transmission method, and an http server and a websocket server are arranged at a service terminal. Presetting an object to be monitored, and carrying out event monitoring on the monitored object. And when target events are detected, such as file updating and file adding, generating http information. And then the http information is automatically sent to the client terminal through the websocket server, and after the client terminal obtains the http information, the user can obtain the latest file information in real time. And then sends a download request based on the http information. The websocket can actively send update messages to the client terminal, is equal in two-way, and by means of the function, the address of the updated file can be actively sent to the client terminal, and the client terminal can actively acquire the updated file based on the received address.
Drawings
Fig. 1 is a schematic view of an application scenario of the data transmission method provided by the present invention.
Fig. 2 is a general flowchart of a data transmission method provided in the present invention.
Fig. 3 is a schematic diagram illustrating connection establishment between a service terminal and a client terminal in the data transmission method provided by the present invention.
Fig. 4 is a schematic interface diagram of a service terminal in the data transmission method provided by the present invention.
Fig. 5 is a schematic interface diagram of a client terminal in the data transmission method provided by the present invention.
Fig. 6 is a schematic structural diagram of a terminal device provided in the present invention.
Fig. 7 is a schematic diagram of a data transmission system provided in the present invention.
Detailed Description
The present invention provides a data transmission method, and in order to make the objects, technical solutions, and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
For example, embodiments of the present invention may be applied to the scenario shown in FIG. 1. The scene is a data transmission system, and the data transmission system comprises a service terminal and a client terminal. The service terminal is a computer, the client terminal is a mobile phone, the service terminal is provided with a plurality of application programs, and the application programs are used for processing images, videos and characters to generate new files.
It can be understood that, in the above application scenario, the service terminal is not limited to a computer, but may also be a server or a mobile terminal such as a tablet, and similarly, the client terminal is not limited to a mobile phone.
It should be noted that the above application scenarios are only presented to facilitate understanding of the present invention, and the embodiments of the present invention are not limited in any way in this respect. Rather, embodiments of the present invention may be applied to any scenario where applicable.
The invention will be further explained by the description of the embodiments with reference to the drawings.
As shown in fig. 2, the present embodiment provides a data transmission method, where a main body executing the method in a data transmission system is a service terminal, and the data transmission method includes the following steps:
and S10, establishing connection with the client terminal based on the preset websocket server and the http server.
Specifically, a websocket server and an http server are installed in advance for the service terminal. Based on the websocket protocol, an unlimited bidirectional protocol is established between the service terminal and the client terminal to realize data transmission. Based on the http server, the service terminal and the client terminal are connected in a unidirectional data transmission manner. The http server can only respond when it needs to receive a request sent by the client terminal.
In a first implementation manner of this embodiment, the websocket server and the http server are packaged in separate application programs.
In a second implementation manner of this embodiment, as shown in fig. 3, the websocket server and the http server are stored in an installation package of an application program in the form of a plug-in file, such as AE. AE provides a number of open plug-in interfaces based on which plug-ins with some functionality can be designed. The http server and the websocket server are stored in the program file of the AE in the form of plug-in files. When the AE is started, the program file is scanned, and the http server and the websocket server are obtained and installed.
The client terminal comprises a first connection module, and after the websocket server and the http server are installed, the first connection module can be connected with the service terminal through a protocol, wherein the connection comprises websocket connection and http connection.
http connects as long as through three times handshake can realize, and to the websocket connection needs more detailed information, for the convenience client terminal and the quick convenient connection of establishing of service terminal to and the secret nature of connection, in this embodiment, the process of establishing the websocket connection includes:
a10, when the websocket server is detected, generating connection information corresponding to the websocket server based on preset basic information.
Specifically, when the websocket server is installed and the service terminal detects the websocket server, the corresponding connection information is automatically generated. The service terminal itself stores connection parameters related to the local server and the websocket server, such as IP address and port information. And converting the connection parameter information into connection information.
And A20, sending the connection information to the client terminal.
Specifically, the connection information is then transmitted to the client terminal. In the first transmission mode, the connection information may be transmitted to the client terminal based on a local area network, bluetooth, or the like. In a second transmission mode, the connection parameters are converted into a two-dimensional code image, and the two-dimensional code image is displayed as connection information.
A30, when detecting the connection request sent by the client terminal based on the connection information, establishing connection with the client terminal based on the websocket server.
Specifically, the first connection module of the client terminal includes a photographing unit, an analyzing unit, and a first connection unit. The client terminal is provided with a camera, and the photographing unit can control the camera to photograph the two-dimension code image to obtain the two-dimension code information. And then the analyzing unit analyzes the two-dimension code information to obtain a connection parameter for realizing the connection with the websocket server. And finally, based on the connection parameters, the first connection unit sends a connection request to the websocket server, and meanwhile, the connection parameters are stored locally as historical parameters.
And when detecting a connection request sent by the client terminal based on the connection information, the websocket server responds to the connection request to establish websocket connection between the service terminal and the client terminal.
Further, after the websocket connection is established, since the communication between the service terminal and the client terminal depends on the stability of the websocket connection, if data transmission is not needed for a while, the websocket service maintains the connection with the client terminal for a long time, which also results in resource waste. Therefore, in this embodiment, the websocket server also adopts a heartbeat mechanism to avoid waste of resources during the connection process to the client terminal. The process is as follows:
and B10, acquiring the terminal information of the client terminal, and recording the terminal information in a preset mass sending list.
Specifically, a mass texting list is set in advance, and terminal information of each client terminal connected to the websocket server is recorded in the mass texting list. Whenever the websocket server establishes a websocket connection with a client terminal, the websocket server requests terminal information of the client terminal from the newly connected client terminal. The terminal information is information having an identification function such as an IP address of the client terminal. And recording the terminal information in a mass sending list every time one terminal information is obtained.
B20, based on the websocket server, sending ping signaling to the client terminal corresponding to the mass sending list.
Specifically, an access interval is preset, and ping signaling is continuously sent to the client terminal through the websocket server.
And B30, for each client terminal, determining that the client terminal is available when the pong signaling sent by the client terminal according to the ping signaling is detected according to the preset detection time.
Specifically, the client terminal includes a heartbeat module, and taking a single client terminal as an example, after sending the ping signaling to the client terminal based on the group sending list, if the heartbeat module is running, the heartbeat module feeds back the pong signaling to the service terminal based on the ping signaling; and if the heartbeat module stops running, the heartbeat module cannot feed back the pong signaling.
A detection time is set for each client terminal in advance, and all the client terminals can adopt the same detection time or carry out different detection times according to the frequency used by the client terminals. And aiming at the latter, calculating the use frequency of each client terminal according to the terminal information and the use time, and determining the detection time corresponding to each client terminal according to the use frequency. The higher the frequency of use, the longer the detection time.
And after sending the ping signaling, the service terminal waits for the pong signaling fed back by the client terminal based on the detection time. When the pong signaling sent by the client terminal according to the ping signaling is detected according to the detection time, it indicates that the heartbeat module of the client terminal is still running and needs to continue to send data stably, thus determining that the client terminal is available.
B40, when the ping signaling is not detected according to the detection time, deleting the terminal information corresponding to the client terminal in the group sending list.
Specifically, when the ping signaling fed back by the client terminal is not detected according to the detection time, it indicates that the client terminal temporarily does not need to transmit data, so that the client terminal is determined to be unavailable, and the terminal information corresponding to the client terminal in the mass texting list can be deleted. The subsequent service terminal no longer needs to send ping signaling to the client terminal based on the websocket server.
And S20, performing event monitoring on the preset monitored object.
Specifically, the monitored object to be monitored by the service terminal is preset. And after the websocket server and the http server are installed, performing event monitoring on the monitored object. Event monitoring is mainly used for monitoring whether changes of files, such as file updating and file adding, occur.
The embodiment exemplifies a specific process with two types of listening objects. The first monitoring object is a memory, the memory comprises a disk, a hard disk and the like, and the http server provides two interfaces, one is an interface of a file list of the memory, and the file list is composed of information of all files in the memory; one is the interface of all files of the memory. For a memory as a snooping object, the event snooping can directly adopt file snooping, for example, based on a webpack open snoop mode. Based on two interfaces provided by the http server, webpack can poll to determine whether the last editing time of each file changes. For each file, if the last editing time of the file changes, marking the file, and judging whether the file changes in the waiting time based on the preset waiting time. If the file is changed, the changed file is used as an update file; and if the file is not changed, taking the unchanged file as an updated file. Wherein, the waiting time can be freely set, and is recommended to be set to be 200-300 ms. In addition, if a new file exists, that is, the last editing time of the file is after the last polling, the file is also an updated file. In addition, inotify can be adopted for file monitoring. The file can be prevented from being monitored and transmitted in the storage and modification processes, and the accuracy is prevented from being influenced.
Furthermore, as the intermediate cache file is generated in the processes of generating, modifying and the like of partial files, and the format of the intermediate cache file is different from that of the complete file, a screening rule can be preset, and the files in the memory are selectively monitored based on the screening rule. For example, only files in docx, which is the file format, are monitored, while files in other formats are not monitored, and changes in other files are not transmitted to the client terminal.
The second type of interception object is an application, and as in the second implementation, is installed in an application AE, and the interception object is the AE. For the listening application, the generation of the file needs to be realized by function keys such as "save", "save as" and "export", and in this embodiment, events caused by operating these function keys are collectively referred to as export events. These derived events are snooped in advance. As shown in fig. 4, the created clip template is saved locally by the "export" button. When the 'export' key is clicked and the file export exists, the target event can be determined to have occurred. And subsequently, taking the file corresponding to the export event as an update file.
And S30, when the target event corresponding to the monitored object is monitored, generating http information of the update file corresponding to the monitored object according to the target event.
Specifically, the target event that the service terminal desires to monitor, that is, the aforementioned event causing the file change, is set in advance. If the server terminal monitors that the file changes, the changed file needs to be transmitted to the client terminal. For example, a back-end engineer creates a file with different rendering effects by using AE, when the file is stored locally in the service terminal, the service terminal can monitor that an event of a newly added file occurs, and simultaneously, the monitored target event includes the position of the event besides the nature of the event, for example, the file of the newly added file is stored in a C disk. And the service terminal takes the changed file as an update file and generates http information corresponding to the target event according to the target event. Taking the newly added file stored in the C disk as an example, http information of the updated file is generated according to the storage address of the newly added file and the file information of the newly added file.
In the first generation mode, the storage address of the update file and the update file are directly integrated to generate an http address which can be used for data requests. The http address is directly used as http information.
In the second generation mode, in order to better determine the file which needs to be downloaded by the subsequent user in the client terminal, the file information includes information such as the file name, the generation time, and the file type of the newly added file. And packaging the http address and the file information to generate http information.
And S40, sending the http information to the client terminal based on the websocket server.
Specifically, after the http information is obtained, the http information needs to be sent to the client terminal. The websocket server has a bidirectional transmission function, http only can respond passively, and therefore the obtained http information is sent to the websocket server, and then the websocket server is connected with the client terminal through the websocket, and the http information is sent to the client terminal.
And S50, when a downloading request sent by the client terminal according to the http information is detected, sending the update file to the client terminal based on the http server.
Specifically, the client terminal further comprises a processing module and a request module, and when the http information is sent based on websocket connection, the http information is subjected to information extraction, and description of the updated file, namely file information such as a file name, generation time and a file type, is extracted. After the processing module extracts the obtained file information, the file information is displayed on the display screen, as shown in fig. 5, where the displayed file information includes a file name, update time, a file format, and the like.
After the file information is displayed, the user judges whether the file needs to be downloaded. If downloading is required, the user sends a first confirmation instruction to the client terminal through an input device, such as a key or a touch pad. And when a first confirmation instruction sent by the user aiming at the file information is detected, the request module sends a downloading request to the service terminal according to the http address in the http information. The http protocol is a request-response mode, when a download request sent by the client terminal according to http information is detected, the http server can initiate a response, and the http server has a function of requesting a disk to specify a file, so that based on the http address and the http server, the service terminal can send an update file corresponding to the download request to the client terminal.
In the whole process, the webococket server is used for sending short data and has a bidirectional transmission function, so that the information of file change of the service terminal can be quickly and effectively transmitted to the client terminal. If the client terminal needs downloading, the downloading is directly carried out through the http protocol, and the http protocol can support the transmission of large files, so that the files processed by the service terminal are stably and efficiently transmitted to the client terminal. In the process, the service terminal is in an active transmission status, the user does not need to manually select the uploaded object, and the user can obtain the change of the service terminal in real time at the client terminal and can pass through the change
Based on the above data transmission method, the present invention further provides a terminal device, as shown in fig. 6, which includes at least one processor (processor) 20; a display screen 21; and a memory (memory)22, and may further include a communication Interface (Communications Interface)23 and a bus 24. The processor 20, the display 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call logical commands in the memory 22 to perform the methods in the above embodiments.
In addition, the logic commands in the memory 22 can be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 22, which is a computer-readable storage medium, may be configured to store a software program, a computer-executable program, such as program commands or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by executing software programs, commands or modules stored in the memory 22, i.e. implements the method in the above-described embodiments.
The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, may also be used as the transient computer readable storage medium.
In addition, the specific processes loaded and executed by the computer readable storage medium and the plurality of command processors in the terminal device are described in detail in the method, and are not stated herein.
As shown in fig. 7, based on the data transmission method, the present embodiment provides a data transmission system, where the data transmission system includes a plurality of client terminals and a service terminal, where the client terminals are in communication connection with the service terminal, and the service terminal executes the data transmission method.
Wherein, the service terminal includes:
the second connection module is used for establishing a websocket connection with a preset client terminal based on a preset websocket server and establishing an http connection with the client terminal based on a preset http server;
the monitoring module is used for monitoring events of a preset monitored object;
the generating module is used for generating http information of an update file corresponding to the monitored object according to a target event when the target event corresponding to the monitored object is monitored;
the first sending module is used for sending the http information to the client terminal based on the websocket server;
and the second sending module is used for sending the update file to the client terminal based on the http server when detecting a downloading request sent by the client terminal according to the http information.
The monitoring object comprises an application program, and a target event corresponding to the application program is an export event; the monitoring module comprises:
the determining unit is used for determining a file corresponding to the export event as an update file when the export event is monitored;
and the second generating unit is used for generating http information corresponding to the export event according to the storage address corresponding to the export event and the update file.
Wherein the second connection module comprises:
the first generating unit is used for generating connection information corresponding to the websocket server based on the connection parameters of the websocket server when the websocket server is detected;
a sending unit, configured to send the connection information to the client terminal;
and the connection unit is used for establishing connection with the client terminal based on the websocket server when detecting a connection request sent by the client terminal based on the connection information.
Wherein, the service terminal further comprises a mass sending module, and the mass sending module is used for:
acquiring terminal information of the client terminal, and recording the terminal information in a preset mass sending list;
based on the websocket server, sending ping signaling to client terminals corresponding to the mass sending list;
for each client terminal, when a pong signaling sent by the client terminal according to the ping signaling is detected according to preset detection time, determining that the client terminal is available;
and deleting the terminal information corresponding to the client terminal in the mass sending list when the ping signaling is not detected according to the detection time.
Wherein the client terminal includes:
the first connection module is used for establishing connection with the websocket server and the http server;
the processing module is used for extracting the http information when the http information is received, and obtaining and displaying file information;
and the request module is used for sending a downloading request to the service terminal according to the http address in the http information when a first confirmation instruction aiming at the file information is detected.
Wherein the connection information comprises a two-dimensional code image; the first connection module includes:
the photographing unit is used for photographing the two-dimensional code image based on a preset camera to obtain two-dimensional code information;
the analyzing unit is used for analyzing the two-dimension code information to obtain the connection parameters of the websocket server;
and the first connection unit is used for sending a connection request to the websocket server based on the connection parameters and storing the connection parameters as historical parameters.
Wherein the first connection module further comprises:
the display unit is used for displaying the historical parameters when a connection instruction is detected;
and the second connection unit is used for establishing connection with the websocket server based on the history parameters when a second confirmation instruction aiming at the history parameters is detected.
Specifically, the first connection module in the client terminal further includes a presentation unit and a second connection unit. In order to avoid repeatedly and tediously letting the service terminal send connection information, in the embodiment, connection parameters are stored as historical parameters based on the client terminal, and a mode for quickly connecting a previously connected websocket server is provided.
The display unit is used for displaying the connection information, and when the fact that the user inputs a connection instruction to the client terminal is detected, the display unit temporarily stores the history parameters before. After the user views the historical parameters, the appropriate historical parameters are selected to send a second confirmation instruction. And when a second confirmation instruction sent aiming at the historical parameters is detected, establishing connection with the websocket server based on the historical parameters.
Further, when the history parameters are displayed, part of information in the history parameters, such as the name of the service terminal, can be selected for displaying, so that the user can quickly confirm the history parameters for the connection.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.
Claims (10)
1. A data transmission method is applied to a service terminal provided with a websocket server and an http server, and comprises the following steps:
establishing a websocket connection with a preset client terminal based on the websocket server, and establishing an http connection with the client terminal based on the http server;
event monitoring is carried out on a preset monitored object;
when a target event corresponding to the monitored object is monitored, generating http information of an update file corresponding to the monitored object according to the target event;
based on the websocket server, sending the http information to the client terminal;
and when a downloading request sent by the client terminal according to the http information is detected, sending the update file to the client terminal based on the http server.
2. The data transmission method according to claim 1, wherein the interception object includes an application program, and a target event corresponding to the application program is an export event; when a target event corresponding to the monitored object is monitored, generating http information of an update file corresponding to the monitored object according to the target event comprises the following steps:
when the export event is monitored, determining a file corresponding to the export event as an update file;
and generating http information corresponding to the export event according to the storage address corresponding to the export event and the update file.
3. The data transmission method according to claim 1, wherein the establishing of the websocket connection with the preset client terminal based on the preset websocket server includes:
when the websocket server is detected, generating connection information corresponding to the websocket server based on the connection parameters of the websocket server;
sending the connection information to the client terminal;
and when detecting a connection request sent by the client terminal based on the connection information, establishing connection with the client terminal based on the websocket server.
4. The data transmission method according to any one of claims 1 to 3, wherein the establishing of the websocket connection with the preset client terminal based on the preset websocket server includes:
acquiring terminal information of the client terminal, and recording the terminal information in a preset mass sending list;
based on the websocket server, sending ping signaling to client terminals corresponding to the mass sending list;
for each client terminal, when a pong signaling sent by the client terminal according to the ping signaling is detected according to preset detection time, determining that the client terminal is available;
and deleting the terminal information corresponding to the client terminal in the mass sending list when the ping signaling is not detected according to the detection time.
5. A computer-readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps in the data transmission method according to any one of claims 1 to 4.
6. A service terminal, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the data transmission method of any of claims 1-4.
7. A data transmission system, comprising: a plurality of client terminals and a service terminal as claimed in claim 6, wherein the client terminals are communicatively connected to the service terminal.
8. The data transmission system according to claim 7, wherein the client terminal comprises:
the first connection module is used for establishing connection with the websocket server and the http server;
the processing module is used for extracting the http information when the http information is received, and obtaining and displaying file information;
and the request module is used for sending a downloading request to the service terminal according to the http address in the http information when a first confirmation instruction aiming at the file information is detected.
9. The data transmission system according to claim 8, wherein the service terminal comprises:
the second connection module is used for establishing a websocket connection with a preset client terminal based on a preset websocket server and establishing an http connection with the client terminal based on a preset http server;
the monitoring module is used for monitoring events of a preset monitored object;
the generating module is used for generating http information of an update file corresponding to the monitored object according to a target event when the target event corresponding to the monitored object is monitored;
the first sending module is used for sending the http information to the client terminal based on the websocket server;
the second sending module is used for sending the update file to the client terminal based on the http server when a downloading request sent by the client terminal according to the http information is detected;
wherein the second connection module comprises:
the first generating unit is used for generating connection information corresponding to the websocket server based on the connection parameters of the websocket server when the websocket server is detected;
a sending unit, configured to send the connection information to the client terminal;
the connection unit is used for establishing connection with the client terminal based on the websocket server when detecting a connection request sent by the client terminal based on the connection information;
the connection information comprises a two-dimensional code image; the first connection module includes:
the photographing unit is used for photographing the two-dimensional code image based on a preset camera to obtain two-dimensional code information;
the analyzing unit is used for analyzing the two-dimension code information to obtain a connection parameter corresponding to the websocket server;
and the first connection unit is used for sending a connection request to the websocket server based on the connection parameters and storing the connection parameters as historical parameters.
10. The data transmission system of claim 9, wherein the connection module further comprises:
the display unit is used for displaying the historical parameters when a connection instruction is detected;
and the second connection unit is used for establishing connection with the websocket server based on the history parameters when a second confirmation instruction aiming at the history parameters is detected.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111541705.0A CN113938475B (en) | 2021-12-16 | 2021-12-16 | Data transmission method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111541705.0A CN113938475B (en) | 2021-12-16 | 2021-12-16 | Data transmission method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113938475A CN113938475A (en) | 2022-01-14 |
CN113938475B true CN113938475B (en) | 2022-03-29 |
Family
ID=79288982
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111541705.0A Active CN113938475B (en) | 2021-12-16 | 2021-12-16 | Data transmission method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113938475B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103079089A (en) * | 2012-12-27 | 2013-05-01 | 合一网络技术(北京)有限公司 | Device and method for dynamically generating ts file by utilizing video file |
CN104378425A (en) * | 2014-11-06 | 2015-02-25 | 北京安奇智联科技有限公司 | Method for interconnection and communication information synchronization between mobile terminal and web terminal |
KR20160135811A (en) * | 2014-03-20 | 2016-11-28 | 삼성전자주식회사 | Method and apparatus for dash streaming using http streaming |
JP2017216492A (en) * | 2016-05-30 | 2017-12-07 | ネオス株式会社 | Data transmission and reception method, data transmission method, and server device |
CN110290417A (en) * | 2019-07-30 | 2019-09-27 | 四川虹魔方网络科技有限公司 | TV network method for communication transmission based on WebSocket |
CN112702430A (en) * | 2020-12-24 | 2021-04-23 | 山东大学 | Data transmission system and method based on cloud edge mode and Web technology and application thereof |
KR20210078115A (en) * | 2019-12-18 | 2021-06-28 | 에릭슨엘지엔터프라이즈 주식회사 | Apparatus and method for forwarding message of private branch exchange system |
CN113507502A (en) * | 2021-06-10 | 2021-10-15 | 新华三信息安全技术有限公司 | File transmission method, device, equipment and machine-readable storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060265662A1 (en) * | 2005-05-19 | 2006-11-23 | Custom Credit Systems, L.P. | System and method for generating and updating user interfaces of web-based applications |
US20150271233A1 (en) * | 2014-03-20 | 2015-09-24 | Samsung Electronics Co., Ltd. | Method and apparatus for dash streaming using http streaming |
CN104038390B (en) * | 2014-06-24 | 2017-10-10 | 汪敏 | A kind of linux server clusters based on netlink unify peripheral hardware action listener method |
CN104753926B (en) * | 2015-03-11 | 2019-04-12 | 华中科技大学 | A kind of gateway admittance control method |
-
2021
- 2021-12-16 CN CN202111541705.0A patent/CN113938475B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103079089A (en) * | 2012-12-27 | 2013-05-01 | 合一网络技术(北京)有限公司 | Device and method for dynamically generating ts file by utilizing video file |
KR20160135811A (en) * | 2014-03-20 | 2016-11-28 | 삼성전자주식회사 | Method and apparatus for dash streaming using http streaming |
CN104378425A (en) * | 2014-11-06 | 2015-02-25 | 北京安奇智联科技有限公司 | Method for interconnection and communication information synchronization between mobile terminal and web terminal |
JP2017216492A (en) * | 2016-05-30 | 2017-12-07 | ネオス株式会社 | Data transmission and reception method, data transmission method, and server device |
CN110290417A (en) * | 2019-07-30 | 2019-09-27 | 四川虹魔方网络科技有限公司 | TV network method for communication transmission based on WebSocket |
KR20210078115A (en) * | 2019-12-18 | 2021-06-28 | 에릭슨엘지엔터프라이즈 주식회사 | Apparatus and method for forwarding message of private branch exchange system |
CN112702430A (en) * | 2020-12-24 | 2021-04-23 | 山东大学 | Data transmission system and method based on cloud edge mode and Web technology and application thereof |
CN113507502A (en) * | 2021-06-10 | 2021-10-15 | 新华三信息安全技术有限公司 | File transmission method, device, equipment and machine-readable storage medium |
Non-Patent Citations (2)
Title |
---|
使用Websocket和Servlet实现服务器定点推送;钱宇虹;《软件工程》;20161005;全文 * |
齐华 ; 李佳 ; 刘军.基于Websocket的消息实时推送设计与实现.《微处理机》.2016, * |
Also Published As
Publication number | Publication date |
---|---|
CN113938475A (en) | 2022-01-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108205442B (en) | Edge computing platform | |
US10313535B2 (en) | Remote support apparatus, electronic apparatus, remote support method, and storage medium | |
CN106572139B (en) | Multi-terminal control method, terminal, server and system | |
CN108052474B (en) | Data format conversion method, device, equipment and computer readable storage medium | |
US20150067146A1 (en) | Custom correlation of a distributed business transaction | |
CN113360807B (en) | Page display method and device of mixed-mode mobile application and related equipment | |
CN111381749A (en) | Image display and processing method, device, equipment and storage medium | |
CN113946614B (en) | IOS static library-based network data transmission method, device and system | |
CN113347269A (en) | Data updating method of industrial system, electronic equipment and storage medium | |
CN108900627B (en) | Network request method, terminal device and storage medium | |
CN107302720A (en) | User feedback method and device, problem feedback traffic architecture system | |
CN111625371A (en) | Text transmission method, device, PC (personal computer) terminal, mobile terminal and system | |
US10938773B2 (en) | Method and apparatus for synchronizing contact information and medium | |
CN109788251B (en) | Video processing method, device and storage medium | |
CN110865973B (en) | Data processing method and equipment and related device | |
CN113938475B (en) | Data transmission method | |
AU2019101539A4 (en) | Android-based image and text information feedback terminal system | |
WO2015000417A1 (en) | Method, apparatus, application interactive platform, terminal, and system for uploading an image | |
CN108289165B (en) | Method and device for realizing camera control based on mobile phone and terminal equipment | |
CN108924773B (en) | Message processing method and device | |
WO2023071749A1 (en) | Parameter adjustment method and apparatus, and storage medium and electronic apparatus | |
JP6347636B2 (en) | Image processing system, data management method, and program | |
CN116016487A (en) | File cross-terminal processing method and device, storage medium and electronic equipment | |
CN107679063B (en) | Picture display method, server and computer-readable storage medium | |
CN113596325A (en) | Picture capturing method and device, electronic equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: 518000 Building 1901, 1902, 1903, Qianhai Kexing Science Park, Labor Community, Xixiang Street, Bao'an District, Shenzhen, Guangdong Province Patentee after: Shenzhen Flash Scissor Intelligent Technology Co.,Ltd. Address before: 518000 Unit 9ABCDE, Building 2, Haihong Industrial Plant Phase II, Haihong Industrial Plant, West Side of Xixiang Avenue, Labor Community, Xixiang Street, Bao'an District, Shenzhen, Guangdong Patentee before: Shenzhen big brother Technology Co.,Ltd. |
|
CP03 | Change of name, title or address |