Data transmission method and device, electronic device, and storage medium
By reading and parsing pre-configured target parameter files, determining the data transmission method and provider or receiver, the problem of large code volume and inconvenient transformation of the existing FTP transmission method is solved, efficient and convenient data transmission is achieved, and the cost.
Patent Information
- Application Number
- CN202310082092.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-02-08
AI Technical Summary
The existing FTP data transmission methods have large code volume and are inconvenient to transform, and they are costly and inefficient when increasing or changing file transfer requirements.
By reading pre-configured target parameter files, analyzing configuration parameters, determining the data transmission method and provider or receiver, data acquisition or transmission is realized, and the need to compile code logic is avoided, and a configurable data transmission method is adopted.
It improves the convenience and efficiency of data transmission, reduces the amount of code, reduces the cost when increasing or changing requirements, and realizes a lighter data transmission process.
Smart Images

Figure CN116095147B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a data transmission method and device, an electronic device, and a storage medium. Background Art
[0002] File Transfer Protocol (FTP) is a set of standard protocols for transferring files on the Internet. With its unique advantages, it has always been one of the most important and widely used services on the Internet. Therefore, data transmission is currently mainly based on FTP.
[0003] The current FTP transmission method, that is, the method of transferring files based on FTP, mainly compiles corresponding code logic in advance according to different file transfer requirements. When data transmission is required, the data transmission can be realized by executing the corresponding code.
[0004] However, this method requires a large amount of code and is relatively complex to implement. In addition, when new file transfer requirements need to be added or when file transfer requirements change, new code logic needs to be compiled and the code logic needs to be modified. This is not only costly, but also relatively inefficient. Summary of the invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a data transmission method and device, an electronic device, and a storage medium to solve the problem that the existing method has a large amount of code and is not easy to modify.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a data transmission method, including:
[0008] Read pre-configured target parameter files;
[0009] Parsing the target parameter file to obtain current configuration parameters;
[0010] If it is determined that the current data transmission mode is data acquisition according to the current configuration parameters, then the current data provider and the current data to be acquired are determined based on the current configuration parameters;
[0011] Pull the current data to be obtained from the current data provider;
[0012] If it is determined according to the current configuration parameters that the current data transmission mode is data sending, then reading the current data to be sent based on the current configuration parameters;
[0013] The current data to be sent is sent to a current data receiver indicated by the current configuration parameters.
[0014] Optionally, in the data transmission method provided above, the reading the current data to be sent based on the current configuration parameters includes:
[0015] If it is determined that the current content to be transmitted is a file based on the information of the current content to be transmitted in the current configuration parameters, then based on the information of the current content to be transmitted in the current content to be transmitted, a corresponding file to be sent is read, and the file to be sent is used as the current data to be sent;
[0016] If it is determined that the current content to be transmitted is a directory based on the information of the current content to be transmitted in the current configuration parameters, then traversing and reading each file except the temporary status file in the directory corresponding to the current content to be transmitted;
[0017] The read files are combined into current sending parameters, and the current sending parameters are determined as the current data to be sent.
[0018] Optionally, in the data transmission method provided above, the reading of a pre-configured target parameter file includes:
[0019] From each pre-configured parameter file in the file queue, the parameter file currently at the front of the file queue is read out as the target parameter file.
[0020] Optionally, in the data transmission method provided above, parsing the target parameter file to obtain the current configuration parameters includes:
[0021] Among the configuration parameter data in the target parameter file, one configuration parameter data that has not yet undergone corresponding data transmission processing is parsed in the traversal order to obtain the configuration parameter corresponding to the configuration parameter data, and the configuration parameter corresponding to the configuration parameter data is determined as the current configuration parameter.
[0022] Optionally, in the data transmission method provided above, it also includes:
[0023] Record the transmission result of the current transmission data, and archive the current transmission data; wherein the current transmission data refers to the current data to be acquired or the current data to be sent.
[0024] A second aspect of the present application provides a data transmission device, including:
[0025] A configuration reading unit, used for reading a pre-configured target parameter file;
[0026] A parsing unit, used to parse the target parameter file to obtain current configuration parameters;
[0027] an information determination unit, configured to determine a current data provider and current data to be acquired based on the current configuration parameters when it is determined that the current data transmission mode is data acquisition according to the current configuration parameters;
[0028] A data acquisition unit, used to pull the current data to be acquired from the current data provider;
[0029] A data reading unit, configured to read the current data to be sent based on the current configuration parameters when it is determined that the current data transmission mode is data sending according to the current configuration parameters;
[0030] A sending unit is used to send the current data to be sent to a current data receiver indicated by the current configuration parameters.
[0031] Optionally, in the data transmission device provided above, the data reading unit includes:
[0032] A file reading unit, configured to, when it is determined that the current content to be transmitted is a file based on the information of the current content to be transmitted in the current configuration parameters, read a corresponding file to be sent based on the information of the current content to be transmitted in the current content to be transmitted, and use the file to be sent as the current data to be sent;
[0033] A directory traversal unit, configured to, when it is determined that the current content to be transmitted is a directory based on the information of the current content to be transmitted in the current configuration parameters, traverse and read each file except a temporary status file in the directory corresponding to the current content to be transmitted;
[0034] The data determination unit is used to combine the read files into current sending parameters, and determine the current sending parameters as the current data to be sent.
[0035] Optionally, in the data transmission device provided above, the configuration reading unit includes:
[0036] The configuration reading subunit is used to read the parameter file currently at the front of the file queue from each pre-configured parameter file in the file queue as the target parameter file.
[0037] Optionally, in the data transmission device provided above, the parsing unit includes:
[0038] The parsing subunit is used to parse, in traversal order, one of the configuration parameter data in the target parameter file that has not yet undergone corresponding data transmission processing, obtain the configuration parameter corresponding to the configuration parameter data, and determine the configuration parameter corresponding to the configuration parameter data as the current configuration parameter.
[0039] Optionally, in the data transmission device provided above, it also includes:
[0040] A recording unit, used to record the transmission result of the current transmission data; wherein the current transmission data refers to the current data to be acquired or the current data to be sent;
[0041] The archiving unit is used to archive the current transmission data.
[0042] A third aspect of the present application provides an electronic device, including:
[0043] Memory and processor;
[0044] Wherein, the memory is used to store programs;
[0045] The processor is used to execute the program, and when the program is executed, it is specifically used to implement any one of the data transmission methods described above.
[0046] A fourth aspect of the present application provides a computer storage medium for storing a computer program, wherein when the computer program is executed, it is used to implement any of the data transmission methods described above.
[0047] The present application provides a data transmission method. When performing data transmission, a pre-configured target parameter file is read, and then the target parameter file is parsed to obtain the current configuration parameters. If the current data transmission mode is determined to be data acquisition based on the current configuration parameters, the current data provider and the current data to be acquired are determined based on the current configuration parameters to pull the current data to be acquired from the current data provider. If the current data transmission mode is determined to be data sending based on the current configuration parameters, the current data to be sent is read based on the current configuration parameters. The current data to be sent is sent to the current data recipient indicated by the current configuration parameters. Thus, a configurable data transmission method is realized through the configuration parameter file. When adding new requirements or changing requirements, only the corresponding parameters need to be configured, which effectively improves convenience. In addition, there is no need to compile a large amount of code logic, thereby becoming more lightweight. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0049] Figure 1 A flowchart of a data transmission method provided in an embodiment of the present application;
[0050] Figure 2 A flowchart of a method for parsing a target parameter file provided in an embodiment of the present application;
[0051] Figure 3 A flowchart of another data transmission method provided in another embodiment of the present application;
[0052] Figure 4 A schematic diagram of the architecture of a data transmission device provided in another embodiment of the present application;
[0053] Figure 5 A schematic diagram of the architecture of an electronic device provided in accordance with another embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] In this application, relational terms such as first and second, etc. are used only 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 "comprise", "include" 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, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0056] The present application embodiment provides a data transmission method, such as Figure 1 As shown, the specific steps include:
[0057] S101, reading a pre-configured target parameter file.
[0058] It should be noted that in the embodiment of the present application, according to the transmission requirements and the agreement between the two parties to the data transmission, the relevant information of the transmission content, the transmission path, the transmission method and other related information are pre-configured in the parameter file, and then the SHELL call is used to find the parameter information specified in the parameter file, and then data is transmitted based on these parameter information, so that data can be transmitted as agreed.
[0059] Therefore, when data transmission is required, it is necessary to first read the pre-configured target parameter file so as to obtain the configured parameters from the target parameter file.
[0060] Optionally, there may be only one parameter file, and different data transmission requirements may be configured in the parameter file to form multiple configuration parameter data, and each configuration parameter data corresponds to one data transmission requirement.
[0061] There may be multiple parameter files, and corresponding parameter files may be configured for different data transmission requirements. When data transmission is required, the corresponding parameter file may be read according to the current data transmission requirements.
[0062] Optionally, in another embodiment of the present application, there are multiple parameter files. Accordingly, in the embodiment of the present application, a specific implementation of step S101 specifically includes:
[0063] From each pre-configured parameter file in the file queue, read the parameter file that is currently at the front of the file queue as the target parameter file.
[0064] In an embodiment of the present application, there are multiple parameter files, and in order to enable data transmission with different needs to be carried out in an orderly manner, in an embodiment of the present application, the parameter files corresponding to the requirements for data transmission are sorted in a file queue, and the parameter files in the file queue are traversed in turn, and they are used as target parameter files so that data transmission can be carried out according to the configuration parameters in the parameter file.
[0065] S102: Parse the target parameter file to obtain current configuration parameters.
[0066] Specifically, the target parameter file may be parsed according to the format of the parameter file to obtain the configuration parameters in the target parameter file. Since the currently parsed configuration parameters are needed for data transmission, these configuration parameters are determined as current configuration parameters.
[0067] Optionally, if the target parameter file includes only one piece of data, that is, one parameter file corresponds to one data transmission requirement, the target parameter file can be directly parsed. If the target parameter file includes multiple pieces of data, each piece of data needs to be parsed in turn, and data transmission is performed according to the configuration parameters parsed from each piece of data.
[0068] Optionally, in another embodiment of the present application, a specific implementation of step S102 is as follows: Figure 2 As shown, specifically including:
[0069] S201. Among the pieces of configuration parameter data in the target parameter file, one piece of configuration parameter data that has not been processed for corresponding data transmission is parsed in a traversal order to obtain configuration parameters corresponding to the configuration parameter data.
[0070] In the embodiment of the present application, the target parameter file includes multiple configuration parameter data, so a certain traversal order is required to facilitate the configuration parameter data therein and parse it. In addition, in the embodiment of the present application, after parsing one configuration parameter data, the subsequent related data sending process is performed, and after the sending is completed, the next configuration parameter data is parsed.
[0071] S202: Determine the configuration parameter corresponding to the configuration parameter data as the current configuration parameter.
[0072] S103: Determine whether the current data transmission mode is data sending according to the current configuration parameters.
[0073] It should be noted that in the embodiment of the present application, the data transmission mode is divided into active data acquisition and active data transmission. Since the data transmission modes of the two modes are different, they need to be processed separately, so it is necessary to determine whether the current data transmission mode is data acquisition or data transmission. The corresponding data transmission mode will be configured in the configuration parameters, so it can be determined whether the current data transmission mode is data transmission based on the current configuration parameters. Of course, it can also be determined whether the current data transmission mode is data acquisition based on the current configuration parameters.
[0074] If the current data transmission mode is determined not to be data transmission according to the current configuration parameters, that is, the current data transmission mode is determined to be data acquisition according to the current configuration parameters, step S104 is executed. If the current data transmission mode is determined to be data transmission according to the current configuration parameters, step S106 is executed.
[0075] S104: Determine the current data provider and the current data to be acquired based on the current configuration parameters.
[0076] Since the data transmission mode at this time is data acquisition, the data transmission direction configured in the corresponding current configuration parameters includes relevant information of the data provider, such as its address or name, etc. In addition, the information of the data to be acquired is also configured, so the current data provider and the current data to be acquired can be determined based on the current configuration parameters, so as to perform step S105.
[0077] S105: Pull the current data to be obtained from the current data provider.
[0078] S106. Read the current data to be sent based on the current configuration parameters.
[0079] Since data is being sent from the local to the recipient at this time, the current data to be sent needs to be obtained from the local first.
[0080] The specific information of the data to be sent is pre-configured in the configuration file, so the relevant information of the current data to be sent, such as the storage address and name, etc., can be obtained from the current configuration parameters, so that the data to be sent can be read based on the relevant information of the current data to be sent.
[0081] S107: Send the current data to be sent to the current data receiver indicated by the current configuration parameters.
[0082] Specifically, based on the sending mode specified in the current configuration parameters, the current data to be sent is sent to the current data receiver indicated by the mode direction information in the current configuration parameters.
[0083] Optionally, in order to facilitate subsequent tracing, in another embodiment of the present application, after executing step S105 or step S107, the following may be further performed:
[0084] Record the transmission results of the current transmission data and archive the current transmission data.
[0085] The currently transmitted data refers to the currently to-be-acquired data or the currently to-be-sent data.
[0086] The embodiment of the present application provides a data transmission method. When performing data transmission, a pre-configured target parameter file is read, and then the target parameter file is parsed to obtain the current configuration parameters. If it is determined that the current data transmission mode is data acquisition based on the current configuration parameters, the current data provider and the current data to be acquired are determined based on the current configuration parameters to pull the current data to be acquired from the current data provider. If it is determined that the current data transmission mode is data sending based on the current configuration parameters, the current data to be sent is read based on the current configuration parameters. The current data to be sent is sent to the current data recipient indicated by the current configuration parameters. Thus, a configurable data transmission method is realized through the configuration parameter file. When adding new requirements or changing requirements, only the corresponding parameters need to be configured, which effectively improves convenience. In addition, there is no need to compile a large amount of code logic, thereby becoming more lightweight.
[0087] Another embodiment of the present application provides another data transmission method, such as Figure 3 As shown, the following steps are included:
[0088] S301, reading a pre-configured target parameter file.
[0089] S302: Parse the target parameter file to obtain current configuration parameters.
[0090] S303: Determine whether the current data transmission mode is data sending according to the current configuration parameters.
[0091] If the current data transmission mode is determined not to be data transmission according to the current configuration parameters, that is, the current data transmission mode is determined to be data acquisition according to the current configuration parameters, step S304 is executed. If the current data transmission mode is determined to be data transmission according to the current configuration parameters, step S306 is executed.
[0092] S304: Determine the current data provider and the current data to be acquired based on the current configuration parameters.
[0093] S305: Pull the current data to be obtained from the current data provider.
[0094] It should be noted that the specific implementation of steps S301 to S305 in the embodiment of the present application can refer to the implementation process of steps S101 to S105 in the above method embodiment, and will not be repeated here.
[0095] S306: Determine whether the current content to be transmitted is a file based on the information of the current content to be transmitted in the current configuration parameters.
[0096] It should be noted that in the embodiment of the present application, during the data transmission process, the transmitted data content can be a single file or various files under a directory. There are usually more files under a directory. If all the information of each file is configured in the configuration file, it will be too cumbersome. Therefore, in the configuration file, if the transmission content is various files under the target, the relevant information of the directory is configured in the configuration file.
[0097] Since the processing methods for a single file and a directory as the transmission object are different, it is necessary to first determine whether the current content to be transmitted configured in the configuration file is a file or a directory based on the information of the current content to be transmitted in the current configuration parameters. Therefore, in the embodiment of the present application, it is necessary to first determine whether the current content to be transmitted is a file, that is, determine whether it is a single file, based on the information of the current content to be transmitted in the current configuration parameters. Of course, it is also possible to determine whether the current content to be transmitted is a directory based on the information of the current content to be transmitted in the current configuration parameters.
[0098] It should be noted that a configuration file may be configured with information of one transmission content or multiple transmission contents. If there are multiple transmission contents, step S306 may be performed for each transmission content, and subsequent steps may be performed accordingly.
[0099] If the current content to be transmitted is determined to be a file based on the information of the current content to be transmitted in the current configuration parameters, step S307 is executed. If the current content to be transmitted is determined not to be a file based on the information of the current content to be transmitted in the current configuration parameters, that is, the current content to be transmitted is determined to be a directory based on the information of the current content to be transmitted in the current configuration parameters, step S308 is executed.
[0100] S307: Based on the information of the current content to be transmitted in the current content to be transmitted, read the corresponding file to be sent, and use the file to be sent as the current data to be sent.
[0101] S308: traverse and read each file except the temporary status file in the directory corresponding to the current content to be transmitted.
[0102] Since temporary status files are only temporary files and do not need to be transferred, temporary status files need to be excluded when reading files based on directory traversal.
[0103] S309: The read files are combined into current sending parameters, and the current sending parameters are determined as the current data to be sent.
[0104] Since the files in the read directory need to be sent to the receiving mode together, the read files are first combined into the current sending parameters, and then the current sending parameters are determined as the current data to be sent.
[0105] S310: Send the current data to be sent to the current data receiver indicated by the current configuration parameters.
[0106] S311. Record the transmission result of the current transmission data and archive the current transmission data.
[0107] The currently transmitted data refers to the currently to-be-acquired data or the currently to-be-sent data.
[0108] It should be noted that although the above method embodiments depict various operations in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. In certain circumstances, multitasking and parallel processing may be advantageous.
[0109] Another embodiment of the present application provides a data transmission device, such as Figure 4 As shown, it includes the following units:
[0110] The configuration reading unit 401 is used to read a pre-configured target parameter file.
[0111] The parsing unit 402 is used to parse the target parameter file to obtain the current configuration parameters.
[0112] The information determination unit 403 is used to determine the current data provider and the current data to be acquired based on the current configuration parameters when it is determined that the current data transmission mode is data acquisition according to the current configuration parameters.
[0113] The data acquisition unit 404 is used to pull the current data to be acquired from the current data provider.
[0114] The data reading unit 405 is configured to read the current data to be sent based on the current configuration parameters when it is determined that the current data transmission mode is data sending according to the current configuration parameters.
[0115] The sending unit 406 is used to send the current data to be sent to the current data receiver indicated by the current configuration parameters.
[0116] Optionally, in a data transmission device provided in another embodiment of the present application, the data reading unit includes:
[0117] The file reading unit is used to read the corresponding file to be sent based on the information of the current content to be transmitted in the current configuration parameters when it is determined that the current content to be transmitted is a file, and use the file to be sent as the current data to be sent.
[0118] The directory traversal unit is used to traverse and read each file except the temporary status file in the directory corresponding to the current content to be transmitted when it is determined that the current content to be transmitted is a directory based on the information of the current content to be transmitted in the current configuration parameters.
[0119] The data determination unit is used to combine the read files into current sending parameters, and determine the current sending parameters as the current data to be sent.
[0120] Optionally, in a data transmission device provided in another embodiment of the present application, a reading unit is configured, including:
[0121] The configuration reading subunit is used to read the parameter file currently at the front of the file queue from each pre-configured parameter file in the file queue as the target parameter file.
[0122] Optionally, in a data transmission device provided in another embodiment of the present application, the parsing unit includes:
[0123] The parsing subunit is used to parse, in the traversal order, a piece of configuration parameter data in the target parameter file that has not yet undergone corresponding data transmission processing, obtain the configuration parameter corresponding to the configuration parameter data, and determine the configuration parameter corresponding to the configuration parameter data as the current configuration parameter.
[0124] Optionally, the data transmission device provided in another embodiment of the present application further includes:
[0125] The recording unit is used to record the transmission result of the current transmission data, wherein the current transmission data refers to the current data to be obtained or the current data to be sent.
[0126] The archive unit is used to archive the current transmission data.
[0127] It should be noted that the specific working process of each unit provided in the above embodiments of the present application can refer to the corresponding steps in the above method embodiments, which will not be repeated here.
[0128] Another embodiment of the present application provides an electronic device, such as Figure 5 As shown, including:
[0129] Memory 501 and processor 502 .
[0130] The memory 501 is used to store programs.
[0131] The processor 502 is used to execute the program stored in the memory 501. When the program is executed, it is specifically used to implement the data transmission method as described in any one of the above embodiments.
[0132] Another embodiment of the present application provides a computer storage medium for storing a computer program. When the computer program is executed, it is used to implement the data transmission method provided in any of the above embodiments.
[0133] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0134] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0135] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data transmission method, characterized in that: include: From each pre-configured parameter file in the file queue, read the parameter file currently at the front of the file queue as the target parameter file; The parameter file is configured with at least relevant information of the transmission content, the transmission path and the transmission method; Parsing, in the traversal order, one of the configuration parameter data in the target parameter file that has not yet been processed for corresponding data transmission, to obtain a configuration parameter corresponding to the configuration parameter data, and determining the configuration parameter corresponding to the configuration parameter data as the current configuration parameter; each of the configuration parameter data corresponds to a data transmission requirement; If it is determined that the current data transmission mode is data acquisition according to the current configuration parameters, then the current data provider and the current data to be acquired are determined based on the current configuration parameters; Pull the current data to be obtained from the current data provider; If it is determined according to the current configuration parameters that the current data transmission mode is data sending, then reading the current data to be sent based on the current configuration parameters; The current data to be sent is sent to a current data receiver indicated by the current configuration parameters.
2. The method according to claim 1, characterized in that The reading the current data to be sent based on the current configuration parameters includes: If it is determined that the current content to be transmitted is a file based on the information of the current content to be transmitted in the current configuration parameters, then based on the information of the current content to be transmitted in the current content to be transmitted, a corresponding file to be sent is read, and the file to be sent is used as the current data to be sent; If it is determined that the current content to be transmitted is a directory based on the information of the current content to be transmitted in the current configuration parameters, then traversing and reading each file except the temporary status file in the directory corresponding to the current content to be transmitted; The read files are combined into current sending parameters, and the current sending parameters are determined as the current data to be sent.
3. The method according to claim 1, characterized in that Also includes: The transmission result of the current transmission data is recorded, and the current transmission data is archived; wherein the current transmission data refers to the current data to be acquired or the current data to be sent.
4. A data transmission device, characterized in that: include: The configuration reading unit comprises: a configuration reading subunit; The configuration reading subunit is used to read the parameter file currently at the front of the file queue from each pre-configured parameter file in the file queue as the target parameter file; the parameter file is configured with at least relevant information of the transmission content, the transmission path and the transmission mode; A parsing unit, comprising: a parsing subunit; a parsing subunit, configured to parse, in a traversal order, one of the configuration parameter data in the target parameter file that has not yet been subjected to corresponding data transmission processing, obtain a configuration parameter corresponding to the configuration parameter data, and determine the configuration parameter corresponding to the configuration parameter data as the current configuration parameter; each of the configuration parameter data corresponds to a data transmission requirement; an information determination unit, configured to determine a current data provider and current data to be acquired based on the current configuration parameters when it is determined that the current data transmission mode is data acquisition according to the current configuration parameters; A data acquisition unit, used to pull the current data to be acquired from the current data provider; A data reading unit, configured to read the current data to be sent based on the current configuration parameters when it is determined that the current data transmission mode is data sending according to the current configuration parameters; A sending unit is used to send the current data to be sent to a current data receiver indicated by the current configuration parameters.
5. The device according to claim 4, characterized in that The data reading unit comprises: A file reading unit, configured to, when it is determined that the current content to be transmitted is a file based on the information of the current content to be transmitted in the current configuration parameters, read a corresponding file to be sent based on the information of the current content to be transmitted in the current content to be transmitted, and use the file to be sent as the current data to be sent; A directory traversal unit, configured to, when it is determined that the current content to be transmitted is a directory based on the information of the current content to be transmitted in the current configuration parameters, traverse and read each file except a temporary status file in the directory corresponding to the current content to be transmitted; The data determination unit is used to combine the read files into current sending parameters, and determine the current sending parameters as the current data to be sent.
6. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the data transmission method according to any one of claims 1 to 3.
7. A computer storage medium, characterized in that: Used to store a computer program, which, when executed, is used to implement the data transmission method according to any one of claims 1 to 3.
Citation Information
Patent Citations
File transmission method and device, computer equipment and storage medium
CN110266775A
Data file transmission method and device, storage medium and electronic equipment
CN111049913A
File transmission method, device and equipment and readable storage medium
CN112929407A
File transmission method, file transmission device, electronic equipment and storage medium
CN115033542A
File transmission method and device, equipment, medium and product
CN115208877A
