File transmission method, device, electronic device and storage medium

Through file event generation and water level control mode, combined with light gate transmission and message queue encoding and sending, the problem of long delay in traditional file transmission is solved and efficient file transmission is achieved, especially through virtual disk processing for fast landing and hard disk processing for slow tasks. , reducing latency.

CN113783939BActive Publication Date: 2024-09-03QI AN XIN TECHNOLOGY GROUP INC +1
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202110961592.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-20
Publication Date
2024-09-03
Estimated Expiration
2041-08-20

AI Technical Summary

Technical Problem

In traditional file transfer methods, file transfer delays are large, especially when transferring document files, which usually requires a delay of 1 to 10 seconds, affecting efficiency.

Method used

Using the file event generation and water level control mode, file events are sent from the front-end platform to the back-end platform through the light gate to achieve file landing. It combines file priority and message queue mode for encoding and sending, reducing disk read and write overhead, and using virtual disks. Handles fast landing and slow hard drive tasks.

Benefits of technology

It effectively reduces data transmission delay and improves file transmission efficiency, especially for tasks with small processing scale and fast throughput, achieving rapid implementation and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113783939B
    Figure CN113783939B
Patent Text Reader

Abstract

The embodiments of the present invention provide a file transmission method, device, electronic device and storage medium. The file transmission method includes: when a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode; when it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the rear platform through the optical gate, so that the rear platform can implement the file landing based on the file event in the receiving buffer area. The embodiments of the present invention can effectively reduce the data transmission delay.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information technology, and in particular to a file transmission method, device, electronic equipment and storage medium. Background Art

[0002] The file import function of the single-guide platform is designed to provide the function of importing file data from the front-end direction to the back-end direction. In the traditional solution, when transmitting document files (<1MB), after the front-end server and the front-end machine file land, the software senses the transmission, and the back-end server starts to receive the file. The delay is usually around 1 to 10 seconds, and the transmission delay is large. Summary of the invention

[0003] In view of the problems in the prior art, embodiments of the present invention provide a file transmission method, device, electronic device and storage medium.

[0004] Specifically, the embodiment of the present invention provides the following technical solutions:

[0005] In a first aspect, an embodiment of the present invention provides a file transmission method, including:

[0006] When a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode;

[0007] When it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through the optical gate, so that the back-end platform implements the file landing based on the file event in the receiving buffer area.

[0008] Further, when a new file arrives in the current platform, a file event is generated, and before the file event is loaded into the sending buffer area based on a preset water level control mode, it also includes:

[0009] Monitor the file changes in the front-end platform to determine whether new files have arrived in the front-end platform.

[0010] Further, when a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode, including:

[0011] When the water level control mode is at a low water level, the front-end server of the front-end platform reads file events from a preset event queue, encapsulates the file header information and file content into a private protocol, and then loads the encapsulated file events into the sending buffer area; when the water level control mode is at a high water level, the reading of file events is suspended, and after refreshing the status of the file events, a confirmation message fed back by the rear-end platform is received.

[0012] Furthermore, when it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through the optical gate, so that the back-end platform implements the file landing based on the file event in the receiving buffer area, including:

[0013] Based on the file event, the file is sent to the receiving buffer area of ​​the back-end platform through the optical gate in the form of a message, so that the back-end platform can restore the file based on the file event in the receiving buffer area and implement the file landing.

[0014] Furthermore, the file events in the event queue include priorities, and the reading of the file events from the preset event queue includes: based on the priorities of the file events, preferentially reading the file events with high priorities from the event queue.

[0015] Furthermore, the method of sending the file event to the receiving buffer area of ​​the back-end platform through the optical gate includes a coding sending method in a single message queue mode and a coding sending method in a dual message queue mode.

[0016] In a second aspect, an embodiment of the present invention further provides a file transmission device, including:

[0017] A generating module, used for generating a file event when a new file arrives in the front platform, and loading the file event into a sending buffer area based on a preset water level control mode;

[0018] The sending module is used to send the file event to the receiving buffer area of ​​the back-end platform through the optical gate when it is determined that the file can be sent, so that the back-end platform can implement the file landing based on the file event in the receiving buffer area.

[0019] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the file transfer method described in the first aspect are implemented.

[0020] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the file transfer method as described in the first aspect.

[0021] In a fifth aspect, an embodiment of the present invention further provides a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the file transfer method described in the first aspect are implemented.

[0022] It can be seen from the above technical solutions that the file transmission method, device, electronic device and storage medium provided by the embodiments of the present invention require the file to be stored on the ground during the file receiving process, and the traditional disk reading and writing occupies most of the I / O processing. The embodiments of the present invention reduce the disk reading and writing overhead by landing the file blocks on the memory virtual disk. For tasks with small processing scale and fast throughput, the files are quickly landed on the virtual disk for processing and sending, that is, "fast path" processing; for tasks with slow processing and low throughput, they are exchanged to the hard disk for "slow path" processing. This can effectively reduce data transmission delays. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0024] Figure 1 A flowchart of a file transmission method provided by an embodiment of the present invention;

[0025] Figure 2 An architectural diagram of a front-end platform and a back-end platform in a file transmission method provided in an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of a file interaction process of a file transmission method provided by an embodiment of the present invention;

[0027] Figure 4 A schematic diagram of water level control of a file transmission method provided by an embodiment of the present invention;

[0028] Figure 5 A schematic diagram of event sorting of a file transmission method provided by an embodiment of the present invention;

[0029] Figure 6 A schematic diagram of encoding and sending a single message queue of a file transmission method provided by an embodiment of the present invention;

[0030] Figure 7 A schematic diagram of encoding and sending of dual message queues of a file transmission method provided by an embodiment of the present invention;

[0031] Figure 8 A schematic diagram of task sorting of a file transmission method provided in one embodiment of the present invention;

[0032] Fig. 9 A structural block diagram of a file transmission device provided by an embodiment of the present invention;

[0033] Fig.10A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0035] Figure 1 FIG. 1 is a flowchart of a file transmission method provided by an embodiment of the present invention. Figure 1 As shown, the file transmission method provided by the embodiment of the present invention includes the following steps:

[0036] Step 101: When a new file arrives in the front platform, a file event is generated, and the file event is loaded into a sending buffer area based on a preset water level control mode.

[0037] In a specific example, when a new file arrives in the front platform, a file event is generated, and before the file event is loaded into the sending buffer area based on a preset water level control mode, it also includes: monitoring file changes in the front platform to determine whether there are new files arriving in the front platform.

[0038] When a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on the preset water level control mode, including: when the water level control mode is low water level, the front server of the front platform reads the file event from the preset event queue, and encapsulates the file header information and file content into a private protocol and loads it into the sending buffer area; when the water level control mode is high water level, the reading of the file event is suspended, and the status of the file event is refreshed before receiving the confirmation message fed back by the rear platform.

[0039] Step 102: When it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through the optical gate, so that the back-end platform implements the file landing based on the file event in the receiving buffer area.

[0040] In a specific example, when it is determined that a file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through an optical gate, so that the back-end platform implements file landing based on the file event in the receiving buffer area, including: based on the file event, the file is sent to the receiving buffer area of ​​the back-end platform in the form of a message through an optical gate, so that the back-end platform restores the file based on the file event in the receiving buffer area and implements file landing.

[0041] Furthermore, the file events in the event queue include priorities, and the reading of the file events from the preset event queue includes: based on the priorities of the file events, preferentially reading the file events with high priorities from the event queue.

[0042] In the above description, the manner of sending the file event to the receiving buffer area of ​​the back-end platform through the optical gate includes the encoding sending manner in the single message queue mode and the encoding sending manner in the dual message queue mode.

[0043] Among them, Figure 2 As shown, the front-end platform includes a front-end server and a single-channel front-end machine, and the back-end platform includes a single-channel back-end machine and a back-end server. The front-end platform and the back-end platform communicate through an optical gate.

[0044] Specifically, file client software is installed in the front-end server and the back-end server.

[0045] Among them, the file client software uses a private file transfer protocol and cooperates with the single-guide platform to perform file transfer. The transmission direction can be configured as sending, receiving, and bidirectional. The docking application party (service call HTTP, email access, file business) will land the file in the specified working directory, and the software will perform the file import operation. Later, the business will be uniformly expressed as file import. The front-end server is configured with a Linux or Windows system and is the source of file data. It is used to deploy file sending software applications. The back-end server is configured with a Linux or Windows system and is the destination of file data. It is used to deploy file receiving software applications. The front-end machine of the single-guide platform (i.e., the single-guide front-end machine) is deployed on the user's front-end network side. The transmitted file data will be centrally cached on this machine, and a unified data check will be performed before the next step of optical gate data transmission. The optical gate is used for one-way data import services. The back-end machine of the single-guide platform (i.e., the single-guide back-end machine) is deployed on the user's back-end network side. The transmitted file data will be cached on this machine and then distributed to each back-end server by the distribution program.

[0046] The data interaction process between the front-end platform and the back-end platform is as follows: Figure 3 As shown:

[0047] File monitoring stage: monitor the working directory on the front-end server to see if there are any new files arriving;

[0048] File pre-import stage: When a new file arrives, it is streamed through the file private protocol and sent to the single-lead pre-import platform;

[0049] Cross-domain file transmission stage: The single-guide front-end platform splits the file data into data packets and sends the data to the single-guide back-end platform through the optical gate. The back-end platform assembles the data packets.

[0050] Post-file import phase: file restoration and verification. If successful, the file is distributed to the corresponding post-file server in the form of a file protocol stream through the file private protocol.

[0051] In terms of data interaction, this method includes a one-way message queue mode and a two-way message queue mode. Among them, a business-driven model based on a state machine is adopted. That is: high and low water level control: common to Window and Linux platforms, the "water level control" mode is used to complete the separation of network and business and realize efficient asynchronous transmission. Low water level trigger: read the event queue, encapsulate the file header information and file content into a private protocol, load it into the sending buffer, and send the content of the sending buffer if the network can send it; high water level trigger: suspend file reading, refresh the event status, and try to receive the confirmation message from the other end. In the present invention, the water level state in the water level control mode is used as the state in the "finite state machine", and the received file is used as a trigger event, thereby realizing a business-driven model based on a state machine. As Figure 4 As shown, further, the "file business driven" model is realized by combining the "finite state machine" with the evolution of the "event driven" model, and the ultimate goal is to realize the "request-confirmation" mechanism of the file. Since the content field is a data field of indefinite length, the request protocol is divided into sending the file header and sending the file content; the confirmation protocol is divided into receiving the confirmation header and receiving the extension field content. Through the "state machine" idea, the final result is adaptive protocol processing: for large files, it is a one-to-one "request-confirmation" process, while small files are adaptively processed as batch "request-confirmation".

[0052] Among them, in the present invention, the file segmentation technology is adopted in both the file pre-import stage and the file post-import stage: Figure 5As shown in the figure, when receiving client files, the file header information is received and the file content is written to the disk. When receiving small files, after the entire file is completed, the file header information is integrated into an event message and sent to the message queue with a priority mark according to the task priority; when receiving large files, they are cut according to a fixed size (such as 100MB), and each slice is sent to the message queue as a separate event message. This will reduce the startup time for large files, and there is no need to wait for the entire file to be landed before transmission.

[0053] Priority sorting: The priorities are divided into high, medium and low. The sorter reads the event messages of the high priority queue first according to the level, and then obtains the event messages of the medium and low priority queues when the high priority queue is empty. The message queue is implemented based on the linked list structure of Redis, and the blocking consumption interface is used to achieve the effect of sending and processing time messages. After sorting is completed, the file content is read for encoding and sending.

[0054] like Figure 6 As shown, coded transmission (single message queue): a single message queue deploys a one-way optical switch between the front-end and the back-end, and the data sent by the front-end will not be fed back. Therefore, in this working mode, the data packets need to be redundantly encoded during coded transmission, and the flow control restrictions are performed on the export to maximize the prevention of packet loss. In the ultra-low latency solution of the present invention, streaming data is transmitted between multiple processes through sockets, and the file content is input and encoded into data packets for simplex transmission. Figure 7 As shown, coded transmission (dual message queues): The dual message queue deploys two one-way optical gates between the front and rear. The data sent by the front-end is sent through one optical gate, and the confirmation data is fed back through the other optical gate. In this working mode, the file content needs to be split into data packets, and the message sequence number, timestamp and other information are entered to achieve the effect of reliable transmission through the "request-confirmation" mechanism. In the single-guide module of the front and rear, through the dual message queue: in the case of large files, the request queue sends the file slice content (sliced ​​by 100MB), and the confirmation queue sends the completion of the file slice (the next retransmission is performed after failure); in the case of small files, the request queue splices a batch of small file requests in the concentration together (with an upper limit of 10MB), and replies a batch of confirmation information after processing. If a timeout failure occurs, it will be retransmitted. The overall processing flow is designed based on the cross-domain file transmission characteristics. Different from the transport layer protocol based on data packets, this application protocol is based on the application layer to transmit meta-file information as a unit (file information of 10MB-100MB size). The overall processing flow is equivalent to converting into reliable data duplex transceiver processing.

[0055] like Figure 8As shown, receiving and decoding (dual message queues): corresponding to the above-mentioned dual message mode encoding and sending, the data is first received into the buffer, and after the sequence number is checked, the data encoding header is separated, the confirmation packet is fed back, and then the upper layer is notified to process the data content. It is implemented in a three-thread manner, one thread for original data packet reception, one thread for reply confirmation, and one thread for file landing. The memory elastic queue is used for notification, burst traffic is smoothed, and the CPU is used to the maximum extent to achieve an overall low latency effect. Finally, the processing thread saves the file to disk and hands it over to the next level sorting process for processing.

[0056] Receiving and decoding (single message queue): Corresponding to the above-mentioned single message mode encoding and sending, the single message queue uses a dual-thread buffering mode. The receiving thread first receives the data, performs decoding processing, and restores the data content. In order to ensure timeliness, the multi-thread semaphore mechanism is used to notify the processing thread of the completed action and write the file to the disk.

[0057] Task sorting: After receiving and decoding, the task number to which the file belongs needs to be determined based on the file header information, and each task is divided into an event message queue to notify the event to the file process. The implementation method is implemented by the Redis queue structure, and the blocking interface call method is used to achieve the effect of processing the file immediately when the event message arrives.

[0058] According to the file transmission method of the embodiment of the present invention, the file receiving process needs to save the file on the disk, and the traditional disk reading and writing occupies most of the I / O processing. The embodiment of the present invention reduces the disk reading and writing overhead by landing the file block on the memory virtual disk. For tasks with small processing scale and fast throughput, the file is quickly landed on the virtual disk for processing and sending, that is, "fast path" processing; for tasks with slow processing and low throughput, it is exchanged to the hard disk for "slow path" processing. This can effectively reduce data transmission delay.

[0059] Fig. 9 FIG. 1 is a schematic diagram showing the structure of a file transmission device provided by an embodiment of the present invention. Fig. 9 As shown, the file transmission device provided in this embodiment includes: a generating module 910 and a sending module 920, wherein:

[0060] A generating module 910 is used to generate a file event when a new file arrives in the front platform, and load the file event into a sending buffer area based on a preset water level control mode;

[0061] The sending module 920 is used to send the file event to the receiving buffer area of ​​the back-end platform through the optical gate when it is determined that the file can be sent, so that the back-end platform can implement the file landing based on the file event in the receiving buffer area.

[0062] Based on the contents of the above embodiments, in this embodiment, when a new file arrives in the current platform, a file event is generated, and before the file event is loaded into the sending buffer area based on a preset water level control mode, it also includes:

[0063] Monitor the file changes in the front-end platform to determine whether new files have arrived in the front-end platform.

[0064] Based on the contents of the above embodiments, in this embodiment, when a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode, including:

[0065] When the water level control mode is at a low water level, the front-end server of the front-end platform reads file events from a preset event queue, encapsulates the file header information and file content into a private protocol, and then loads the encapsulated file events into the sending buffer area; when the water level control mode is at a high water level, the reading of file events is suspended, and after refreshing the status of the file events, a confirmation message fed back by the rear-end platform is received.

[0066] Based on the contents of the above embodiments, in this embodiment, when it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through the optical gate, so that the back-end platform implements the file landing based on the file event in the receiving buffer area, including:

[0067] Based on the file event, the file is sent to the receiving buffer area of ​​the back-end platform through the optical gate in the form of a message, so that the back-end platform can restore the file based on the file event in the receiving buffer area and implement the file landing.

[0068] Based on the contents of the above embodiments, in this embodiment, the file events in the event queue include priorities, and reading file events from a preset event queue includes: based on the priorities of the file events, preferentially reading file events with high priorities from the event queue.

[0069] Based on the contents of the above embodiments, in this embodiment, the method of sending the file event to the receiving buffer area of ​​the back-end platform through the optical gate includes the encoding sending method in the single message queue mode and the encoding sending method in the dual message queue mode.

[0070] According to the file transmission device of the embodiment of the present invention, the process of receiving files needs to save the files on the disk, and the traditional disk reading and writing occupies most of the I / O processing. The embodiment of the present invention reduces the disk reading and writing overhead by landing the file blocks on the memory virtual disk. For tasks with small processing scale and fast throughput, the files are quickly landed on the virtual disk for processing and sending, that is, "fast path" processing; for tasks with slow processing and low throughput, they are exchanged to the hard disk for "slow path" processing. This can effectively reduce data transmission delay.

[0071] Since the file transmission device provided in the embodiment of the present invention can be used to execute the file transmission method described in the above embodiment, its working principle and beneficial effects are similar, so they are not described in detail here. For specific contents, please refer to the introduction of the above embodiment.

[0072] In this embodiment, it should be noted that the various modules in the device of the embodiment of the present invention can be integrated into one or deployed separately. The above modules can be combined into one module or further divided into multiple sub-modules.

[0073] Based on the same inventive concept, another embodiment of the present invention provides an electronic device, see Fig.10 , the electronic device specifically includes the following contents: a processor 301, a memory 302, a communication interface 303 and a communication bus 304;

[0074] The processor 301, memory 302, and communication interface 303 communicate with each other via the communication bus 304;

[0075] The processor 301 is used to call the computer program in the memory 302. When the processor executes the computer program, all the steps of the above-mentioned file transfer method are implemented. For example, when the processor executes the computer program, the following process is implemented: when a new file arrives on the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode; when it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the rear platform through the optical gate, so that the rear platform can implement the file landing based on the file event in the receiving buffer area.

[0076] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.

[0077] Based on the same inventive concept, another embodiment of the present invention provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, all the steps of the above-mentioned file transfer method are implemented. For example, when the processor executes the computer program, the following process is implemented: when a new file arrives on the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode; when it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the rear platform through the optical gate, so that the rear platform can implement the file landing based on the file event in the receiving buffer area.

[0078] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.

[0079] Based on the same inventive concept, another embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, all the steps of the above-mentioned file transfer method are implemented. For example, when the processor executes the computer program, the following process is implemented: when a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode; when it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the rear platform through the optical gate, so that the rear platform can implement the file landing based on the file event in the receiving buffer area.

[0080] It can be understood that the detailed functions and extended functions that can be executed by the computer program can refer to the description of the above embodiments.

[0081] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0082] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present invention. Those of ordinary skill in the art may understand and implement them without creative effort.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the traffic audit method described in each embodiment or some parts of the embodiment.

[0084] In addition, in the present invention, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0085] In addition, in the present invention, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A file transmission method, characterized in that: include: When a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode; When it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through the optical gate, so that the back-end platform implements the file landing based on the file event in the receiving buffer area; When a new file arrives in the front platform, a file event is generated, and the file event is loaded into the sending buffer area based on a preset water level control mode, including: When the water level control mode is at a low water level, the front-end server of the front-end platform reads file events from a preset event queue, encapsulates the file header information and file content into a private protocol, and then loads the encapsulated file events into the sending buffer area; when the water level control mode is at a high water level, the reading of file events is suspended, and after refreshing the status of the file events, a confirmation message fed back by the rear-end platform is received.

2. The file transmission method according to claim 1, characterized in that: When a new file arrives in the current platform, a file event is generated, and before the file event is loaded into the sending buffer area based on a preset water level control mode, the method further includes: Monitor the file changes in the front-end platform to determine whether new files have arrived in the front-end platform.

3. The file transmission method according to claim 1, characterized in that: When it is determined that the file can be sent, the file event is sent to the receiving buffer area of ​​the back-end platform through the optical gate, so that the back-end platform implements the file landing based on the file event in the receiving buffer area, including: Based on the file event, the file is sent to the receiving buffer area of ​​the back-end platform through the optical gate in the form of a message, so that the back-end platform can restore the file based on the file event in the receiving buffer area and implement the file landing.

4. The file transmission method according to claim 1, characterized in that: The file events in the event queue include priorities, and the reading of file events from the preset event queue includes: based on the priorities of the file events, preferentially reading file events with high priorities from the event queue.

5. The file transmission method according to any one of claims 1 to 4, characterized in that: The method of sending the file event to the receiving buffer area of ​​the back-end platform through the optical shutter includes a coding sending method in a single message queue mode and a coding sending method in a dual message queue mode.

6. A file transmission device, characterized in that: include: A generating module, used for generating a file event when a new file arrives in the front platform, and loading the file event into a sending buffer area based on a preset water level control mode; A sending module, for sending the file event to a receiving buffer area of ​​a back-end platform through an optical gate when it is determined that the file can be sent, so that the back-end platform implements the file landing based on the file event in the receiving buffer area; The generation module is specifically used for: When the water level control mode is at a low water level, the front-end server of the front-end platform reads file events from a preset event queue, encapsulates the file header information and file content into a private protocol, and then loads the encapsulated file events into the sending buffer area; when the water level control mode is at a high water level, the reading of file events is suspended, and after refreshing the status of the file events, a confirmation message fed back by the rear-end platform is received.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the file transmission method according to any one of claims 1 to 5 are implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the file transmission method according to any one of claims 1 to 5 are implemented.

9. A computer program product, the computer program product comprising a computer program, characterized in that: When the computer program is executed by a processor, the steps of the file transmission method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • One-way reliable transmission and control system based on light transmission

    CN105656902A

  • File reading method and device

    CN107870928A

  • Data transmission method and device

    CN110233851A

  • Data acquisition method and device, computer equipment and computer readable storage medium

    CN111104233A

  • Load self-adaptive cross-platform file transfer protocol and distributed service implementation method thereof

    CN111314480A