File transmission method, device, electronic device and readable storage medium
The file transfer control center manages service node configuration information to realize automatic addressing and file transfer, solves the problem of low file transfer efficiency in distributed file systems, and improves transmission efficiency and reliability.
Patent Information
- Application Number
- CN202111590475.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-12-23
AI Technical Summary
The existing distributed file system has a two-stage transmission problem during the file transfer process, resulting in low efficiency and difficulty in meeting actual application needs.
The file transfer control center manages the service node configuration information of each application to realize automatic addressing and file transfer. It adopts cluster mode to manage service nodes, supports breakpoint resume and timeout retry mechanisms, and improves file transfer efficiency and reliability.
It improves the efficiency and reliability of file transmission and avoids single point risks. As the number of service nodes increases, the transmission efficiency is further improved.
Smart Images

Figure CN114338650B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file transmission method, device, electronic device and readable storage medium. Background Art
[0002] With the development of computer technology, the data that people can obtain has increased exponentially. The method of simply expanding the storage capacity of the computer file system by increasing the number of hard disks has far from satisfactory performance in terms of capacity size, capacity growth rate, data backup, and data security.
[0003] Distributed file systems came into being, which can effectively solve the problem of data storage and management: a file system fixed in a certain location is expanded to any number of locations / multiple file systems, and a large number of nodes form a file system network. Each node can be distributed in different locations, and communication and data transmission between nodes are carried out through the network.
[0004] At present, when a distributed file system is performing file transfer, the file producer first needs to upload the file to be transferred to the storage system, and then the file consumer needs to download the file from the storage system to the local computer for processing. This is a two-stage transfer, which makes the file transfer inefficient and difficult to meet actual application needs. Summary of the invention
[0005] The purpose of the embodiments of the present application is to solve the problem that it is difficult to improve the file transmission efficiency in the two-stage transmission solution.
[0006] In a first aspect, a file transmission method is provided, the method comprising:
[0007] Receiving a file transfer request from a client of a first application to a second application, wherein the file transfer request includes a second application identifier of the second application and a file to be transferred;
[0008] In response to the file transfer request, sending a configuration information acquisition request to the file transfer control center, wherein the configuration information acquisition request includes a second application identifier;
[0009] receiving target configuration information returned by the file transfer control center, where the target configuration information is configuration information corresponding to at least one service node of the second application determined by the file transfer control center according to the second application identifier; wherein the file transfer control center stores configuration information of application identifiers of multiple applications and their corresponding service nodes, the multiple applications include the first application and the second application, and the application identifiers include the second application identifier;
[0010] Based on the target configuration information, the file to be transmitted is sent to at least one service node of the second application.
[0011] In an optional embodiment of the first aspect, the configuration information acquisition request also includes a first application identifier and a task identifier of the first application, and the task identifier is used to indicate that a file is transmitted from the first application to the second application.
[0012] In an optional embodiment of the first aspect, the file transfer control center further stores permission information corresponding to application identifiers of multiple applications, and for any application identifier, the permission information includes the file transfer permission corresponding to the application identifier;
[0013] The target configuration information is determined by the file transfer control center in the following way:
[0014] Obtain a first application identifier of a first application;
[0015] Determine the permission information corresponding to the first application identifier, and verify the permission information;
[0016] When the authority information verification passes, target configuration information corresponding to at least one service node of the second application is determined based on the second application identifier.
[0017] In an optional embodiment of the first aspect, the method further comprises:
[0018] In response to the start-up operation of at least one service node of the first application, relevant information of the first application is sent to the file transfer control center; the relevant information includes the first application identifier and configuration information corresponding to at least one service node of the first application.
[0019] In an optional embodiment of the first aspect, the target configuration information further includes load information corresponding to each service node of the second application;
[0020] Sending the file to be transmitted to at least one service node of the second application based on the target configuration information includes:
[0021] Determine a target service node from at least one service node of the second application based on load information of each service node of the second application;
[0022] The file to be transmitted is sent to the target service node of the second application.
[0023] In an optional embodiment of the first aspect, after sending the file to be transmitted to the target service node of the second application, the method further includes:
[0024] Within the preset time after the file to be transmitted is sent, if no sending status information is received from the target service node, a new target service node is re-determined from at least one service node of the second application based on the load information of each service node of the second application, and the file to be transmitted is sent to the new target service node.
[0025] In a second aspect, a file transmission method is provided, the method comprising:
[0026] Receiving a configuration information acquisition request sent by a service node of the first application, where the configuration information acquisition request includes a second application identifier of the second application;
[0027] Determine target configuration information corresponding to at least one service node of the second application according to the second application identifier, and send the target configuration information to the service node of the first application, so that the service node of the first application sends the file to be transmitted to at least one service node of the second application according to the target configuration information.
[0028] In a third aspect, a file transmission device is provided, the device comprising:
[0029] A first receiving module, configured to receive a file transfer request from a client of a first application to a second application, wherein the file transfer request includes a second application identifier of the second application and a file to be transferred;
[0030] A first sending module, configured to send a configuration information acquisition request to a file transfer control center in response to a file transfer request, wherein the configuration information acquisition request includes a second application identifier;
[0031] a second receiving module, configured to receive target configuration information returned by the control center, the target configuration information being configuration information corresponding to at least one service node of the second application determined by the file transfer control center according to the second application identifier; wherein the file transfer control center stores configuration information of application identifiers of multiple applications and their corresponding service nodes, the multiple applications including the first application and the second application, and the application identifiers including the second application identifier;
[0032] The second sending module is used to send the file to be transmitted to at least one service node of the second application based on the target configuration information.
[0033] In an optional embodiment of the third aspect, the configuration information acquisition request also includes a first application identifier and a task identifier of the first application, and the task identifier is used to indicate the transmission of a file from the first application to the second application.
[0034] In an optional embodiment of the third aspect, the file transfer control center further stores permission information corresponding to application identifiers of multiple applications, and for any application identifier, the permission information includes the file transfer permission corresponding to the application identifier;
[0035] The file transmission device also includes a target configuration information acquisition module, which is specifically used to:
[0036] Obtain a first application identifier of a first application;
[0037] Determine the permission information corresponding to the first application identifier, and verify the permission information;
[0038] When the authority information verification passes, target configuration information corresponding to at least one service node of the second application is determined based on the second application identifier.
[0039] In an optional embodiment of the third aspect, a registration module is further included, specifically configured to:
[0040] In response to the start-up operation of at least one service node of the first application, relevant information of the first application is sent to the file transfer control center; the relevant information includes the first application identifier and configuration information corresponding to at least one service node of the first application.
[0041] In an optional embodiment of the third aspect, the target configuration information further includes load information corresponding to each service node of the second application; and the second sending module, when sending the file to be transmitted to at least one service node of the second application based on the target configuration information, is specifically used to:
[0042] Determine a target service node from at least one service node of the second application based on load information of each service node of the second application;
[0043] The file to be transmitted is sent to the target service node of the second application.
[0044] In an optional embodiment of the third aspect, a resending module is further included, specifically configured to:
[0045] Within the preset time after the file to be transmitted is sent, if no sending status information is received from the target service node, a new target service node is re-determined from at least one service node of the second application based on the load information of each service node of the second application, and the file to be transmitted is sent to the new target service node.
[0046] In a fourth aspect, a file transmission device is provided, the device comprising:
[0047] A request receiving module, configured to receive a configuration information acquisition request sent by a service node of a first application, wherein the configuration information acquisition request includes a second application identifier of a second application;
[0048] A configuration information sending module is used to determine the target configuration information corresponding to at least one service node of the second application according to the second application identifier, and send the target configuration information to the service node of the first application, so that the service node of the first application sends the file to be transmitted to at least one service node of the second application according to the target configuration information.
[0049] In a fifth aspect, an electronic device is provided, the electronic device comprising:
[0050] 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 file transmission method of any of the above embodiments is implemented.
[0051] In a sixth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the file transfer method of any of the above embodiments is implemented.
[0052] In a seventh aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes the computer instructions, the method provided in the embodiment of the first aspect is implemented.
[0053] The above-mentioned file transfer method receives a file transfer request from a client of a first application for a second application, wherein the file transfer request includes a second application identifier of the second application and a file to be transferred; in response to the file transfer request, sends a configuration information acquisition request to a file transfer control center, wherein the configuration information acquisition request may include the second application identifier of the second application; receives target configuration information corresponding to at least one service node of the second application returned by the file transfer control center, and sends the file to be transferred to at least one service node of the second application based on the target configuration information. The configuration information of the service nodes of each application is managed by the file transfer control center, so that the first application can automatically complete addressing and file transfer through the file transfer control center according to the application identifier of the second application, thereby improving the efficiency of file transfer. At the same time, the service nodes of each application are managed in a cluster mode, so that the reliability of file transfer is relatively high. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in describing the embodiments of the present application are briefly introduced below.
[0055] Figure 1 A flowchart of a text transmission method provided in an embodiment of the present application;
[0056] Figure 2 A schematic diagram of a file transmission control center in a text transmission method provided in an embodiment of the present application;
[0057] Figure 3 A schematic diagram of a text transmission method provided in an embodiment of the present application when applied to a specific application scenario;
[0058] Figure 4 A flowchart of a text transmission method provided in an embodiment of the present application;
[0059] Figure 5 A flowchart of a text transmission method provided in an embodiment of the present application;
[0060] Figure 6a A schematic diagram of an independent service mode in a text transmission method provided in an embodiment of the present application;
[0061] Figure 6b A schematic diagram of a sidecar service mode in a text transmission method provided in an embodiment of the present application;
[0062] Figure 7 A structural schematic diagram of a text transmission device provided in an embodiment of the present application;
[0063] Figure 8 A structural schematic diagram of a text transmission device provided in an embodiment of the present application;
[0064] Fig. 9 A schematic diagram of the structure of a text transmission electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] The embodiments of the present application are described below in conjunction with the drawings in the present application. It should be understood that the implementation methods described below in conjunction with the drawings are exemplary descriptions for explaining the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions of the embodiments of the present application.
[0066] It will be understood by those skilled in the art that, unless specifically stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the terms "including" and "comprising" used in the embodiments of the present application refer to that the corresponding features can be implemented as the presented features, information, data, steps, operations, elements and / or components, but do not exclude the implementation as other features, information, data, steps, operations, elements, components and / or combinations thereof supported by the technical field. It should be understood that when we say that an element is "connected" or "coupled" to another element, the one element may be directly connected or coupled to the other element, or it may refer to that the one element and the other element establish a connection relationship through an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein indicates at least one of the items defined by the term, for example, "A and / or B" may be implemented as "A", or as "B", or as "A and B".
[0067] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0068] First, traditional file transfer methods mostly use online messages to carry file streams, or system component services such as File Transfer Protocol (FTP) and Secret File Transfer Protocol (SFTP) to transfer files.
[0069] Among them, if the file is directly transferred by using online messages to carry file streams, the large number of file data packets in the communication will cause the entire network utilization rate to increase significantly, thereby increasing the cost of improving network performance.
[0070] If a distributed file storage system is used for file transfer based on FTP / SFTP, the problem of two-stage transmission will inevitably arise, which will also affect the file transfer efficiency.
[0071] In addition, the above-mentioned file transfer implementation method requires the construction of different software services on different platforms, has weak portability, and is generally single-point operation with insufficient reliability.
[0072] The file transmission method, device, electronic device and readable storage medium provided in this application are intended to solve the above technical problems in the prior art.
[0073] The terminal interface display method provided in the embodiment of the present application can be applied to a service node corresponding to any application or system, and the service node can be a terminal server (erminal Servers).
[0074] The following describes several exemplary embodiments to illustrate the technical solutions of the embodiments of the present application and the technical effects produced by the technical solutions of the present application. It should be noted that the following embodiments can refer to, draw on or combine with each other, and the same terms, similar features and similar implementation steps in different embodiments will not be described repeatedly.
[0075] The present application provides a method for transferring files. Figure 1 As shown, the method includes:
[0076] Step S101: receiving a file transfer request from a client of a first application for a second application, wherein the file transfer request includes a second application identifier of the second application and a file to be transferred.
[0077] The application identifier may be a unique identifier for each application. Each application has a corresponding application identifier, and its expression includes but is not limited to an application name and an application ID (Identity document).
[0078] The files to be transferred can be text, video, audio, program, etc.
[0079] In an embodiment of the present application, the user of the first application can send a file transfer request through the client of the first application to upload the file to be transferred to the service node of the first application. The service node can be a server serving the first application, specifically a terminal server of the first application.
[0080] Among them, the terminal server is used to connect many terminals to the host system or small computer system on the local area network (LAN), and there are two working modes: client mode and server mode. Specifically, in the client working mode, the terminal server acts as a Transmission Control Protocol (TCP) client, and the converter actively requests a connection from the platform program when it is powered on. This mode is more suitable for multiple converters to establish a connection to a platform program at the same time; in the server working mode, the terminal server acts as a TCP server, and the converter listens for the connection request of the platform program on the specified TCP port, which can be suitable for one converter to establish a connection with multiple platform programs.
[0081] In the embodiments of the present application, the service nodes of each application can be deployed in a cluster mode to implement a breakpoint resume mechanism and a timeout retry mechanism, thereby avoiding the risk of single-point operation and improving the reliability of file transmission.
[0082] In the embodiment of the present application, each service node in the service node cluster of each application is equal, and the original deployment data can be copied to deploy new service nodes to increase the number of service nodes and achieve horizontal expansion. When the amount of node data of the service increases, the network bandwidth of different servers is used, and the transmission efficiency can be further improved as the number of nodes increases.
[0083] Step S102: In response to the file transfer request, a configuration information acquisition request may be sent to the file transfer control center, where the configuration information acquisition request may include a second application identifier;
[0084] The file transfer control center may be arranged in the server, and may be used to determine the relevant configuration information of the second application according to the configuration information acquisition request, and send the relevant configuration information to the node of the first application.
[0085] In a specific application scenario, the file transfer control center can be implemented as a file transfer system, and its structure can be as follows: Figure 2 As shown, it may include a registration center, a management and control center, and a database.
[0086] Among them, the registration center can have the following functions:
[0087] (1) Service registry: The service registry is the core of the registration center. It is used to record the information of each microservice (which can be the service node of each application in this application), such as the name, IP, port, etc. of the microservice. The service registry provides a query interface and a management interface. The query interface is used to query available microservice instances, and the management interface is used to register and deregister services.
[0088] (2) Service registration and discovery: Service registration refers to the process of registering the microservice information with the registration center when it is started. Service discovery refers to the mechanism of querying the list of available microservices and network addresses.
[0089] (3) Service check: The registration center uses a certain mechanism to periodically check registered services. If it finds that an instance is inaccessible for a long time, it will remove the instance from the service registry.
[0090] The control center can be used to verify the authorization relationship between the service nodes of each application and record the file transfer process between the service nodes. In addition, the control center can also provide a visual control interface for interaction with users, so that users can visually configure the service nodes of each application.
[0091] The database can be used to store various tables and data in the registration center and the management and control center.
[0092] Step S103, receiving the target configuration information returned by the file transfer control center, where the target configuration information may be configuration information corresponding to at least one service node of the second application determined by the file transfer control center based on the second application identifier; wherein the file transfer control center stores configuration information of application identifiers of multiple applications and their corresponding service nodes, the multiple applications include a first application and a second application, and the application identifiers include a second application identifier.
[0093] Specifically, in the file transfer control center, there is an association between the application identifier of each application and the configuration information of the service node. The configuration information corresponding to at least one service node of the second application can be determined according to the application identifier of the second application, and the determined configuration information can be used as the target configuration information.
[0094] For any service node, its configuration information may include but is not limited to the Internet protocol address, port information, virtual machine instance information and server status information corresponding to the service node, which is not limited in this application. Among them, the server status information can be used to indicate whether the service node is online and connectable and whether it is idle.
[0095] In an embodiment of the present application, the file transfer control center may store application descriptions of multiple applications and configuration information of the service nodes corresponding thereto. Taking the first application as an example, the configuration information of the first application in the file transfer control center may be obtained in the following manner:
[0096] In response to the start-up operation of at least one service node of the first application, relevant information of the first application is sent to the file transfer control center; the relevant information may include but is not limited to the first application identifier and configuration information corresponding to at least one service node of the first application.
[0097] In an actual application scenario, the relevant information may be configuration parameters related to the file transfer function in each application and information about a Java virtual machine instance.
[0098] Step S104: sending the file to be transmitted to at least one service node of the second application based on the target configuration information.
[0099] Specifically, the target configuration information may include configuration information such as the IP (Internet Protocol) and port corresponding to at least one service node of the second application. Based on the target configuration information, any service node of the first application can send the file to be transferred to at least one service node of the second application.
[0100] In one example, if Figure 3 As shown, the file transfer method provided by the present application can be used for cross-application or cross-system file transfer. As shown in the figure, application A is the file transfer sender, and application B is the file transfer receiver, and both can run in cluster mode. The server cluster of application A includes terminal server A, terminal server C, and terminal server D, and the server cluster of application B includes terminal server 1, terminal server 2, and terminal server 3. The file transfer control center may include a registration center, a management and control center, and a database. When application A wants to transfer a file to application B, it can obtain the configuration information of at least one terminal server of application B from the file transfer control center, and transfer the file to application B based on the obtained configuration information.
[0101] The above-mentioned file transfer method receives a file transfer request from a client of a first application for a second application, wherein the file transfer request includes a second application identifier of the second application and a file to be transferred; in response to the file transfer request, sends a configuration information acquisition request to a file transfer control center, wherein the configuration information acquisition request may include the second application identifier of the second application; receives target configuration information corresponding to at least one service node of the second application returned by the file transfer control center, and sends the file to be transferred to at least one service node of the second application based on the target configuration information. The configuration information of the service nodes of each application is managed by the file transfer control center, so that the first application can automatically complete addressing and file transfer through the file transfer control center according to the application identifier of the second application, thereby improving the efficiency of file transfer. At the same time, the service nodes of each application are managed in a cluster mode, so that the reliability of file transfer is relatively high.
[0102] In an embodiment of the present application, a file transfer request from a client of a first application to a second application is received, and the file transfer request may include an application identifier of the second application, a file to be transferred, and a client identifier of a target client of the second application. In response to the file transfer request, a configuration information acquisition request is sent to a file transfer control center, and target configuration information returned by the file transfer center is received.
[0103] According to the target configuration information, the file to be transferred and the client identifier of the target client are sent to at least one service node of the second application, and at least one service node of the second application sends the file to be transferred to the designated client of the second application corresponding to the client identifier according to the client identifier.
[0104] In an embodiment of the present application, the above-mentioned file transfer method can be implemented as a file transfer system written in Java language, which can be run based on a Java virtual machine environment to achieve seamless porting on multiple platforms.
[0105] In an embodiment of the present application, the target configuration information may also include load information corresponding to each service node of the second application; wherein the load information may be used to characterize the busyness of the service node, and the form of expression is not limited in this application.
[0106] Since load information is time-sensitive, the load information can be obtained by the file transfer control center from the service nodes of each application at preset time intervals, or by each service node of each application pushing the load information to the file transfer control center at preset time intervals and updating the load information in the configuration information of the file transfer control center.
[0107] Based on the target configuration information, sending the file to be transmitted to at least one service node of the second application may include the following steps: based on the load information of each service node of the second application, determining the target service node from at least one service node of the second application; sending the file to be transmitted to the target service node of the second application.
[0108] In some embodiments, the load information may specifically be response time or concurrency number, and the acquisition method and expression meaning are as follows:
[0109] (1) Response time: The time required for the service node to respond to each request can be recorded, and the average response time of the service node to the request can be calculated. The average response time is used as the response time of the service node.
[0110] (2) Concurrency: The number of transactions being processed by each service node at the current moment is recorded as the concurrency of the service node.
[0111] For the above two types of load information, the minimum response time method and the minimum concurrency method can be used to determine the target service node from at least one service node of the second application, and the file to be transmitted is sent to the target service node of the second application.
[0112] Specifically, the minimum response time method: determine the minimum response time from the response time of each service node, and use the service node corresponding to the minimum response time as the target service node. This method can better reflect the status of each service node;
[0113] Minimum concurrency method: Determine the minimum concurrency from the concurrency of each service node. The concurrency represents the number of transactions being processed by each service node. Then, the service node corresponding to the minimum concurrency is used as the target service node. This method can quickly reflect the current status of the server and distribute the responsibilities more evenly. It is suitable for scenarios that are more sensitive to the current system load.
[0114] In addition, the target service node may be determined from at least one service node of the second application based on other soft load balancing strategies, including but not limited to the following strategies:
[0115] (1) Round Robin: Each request to be dispatched (for example, a request to send a file to be transferred for the second application) is marked with a serial number, and then the request is dispatched to each service node in turn. This strategy is suitable for scenarios where each node in the cluster provides equal service capabilities and is stateless. Weighted Round Robin is an improved strategy of Round Robin. Each node has a weight attribute, and requests are dispatched based on the weight attribute.
[0116] (2) Random: Similar to polling, a service node is randomly selected to dispatch the request each time without numbering.
[0117] The above-mentioned file transfer method realizes a soft load balancing mechanism between service nodes. When obtaining remote link information, it can automatically select idle nodes for file transfer according to various soft load balancing strategies based on the load information of each service node in the service node cluster corresponding to the application, thereby reducing waiting time and improving file transfer efficiency.
[0118] A possible implementation method is provided in an embodiment of the present application, where the file transfer request also includes receiving end indication information, and the receiving end indication information can be used to further determine to which client of the second application the file to be transferred is sent.
[0119] Specifically, based on the target configuration information, the file to be transmitted and the receiving end indication information can be sent to at least one service node of the second application, so that the service node that receives the file to be transmitted and the receiving end indication information sends the file to be transmitted to the designated client in the second application according to the receiving end indication information.
[0120] An embodiment of the present application provides a possible implementation manner. After sending the file to be transmitted to the target service node of the second application, the file transmission method provided by the present application further includes:
[0121] Within the preset time after the file to be transmitted is sent, if no sending status information is received from the target service node, a new target service node is re-determined from at least one service node of the second application based on the load information of each service node of the second application, and the file to be transmitted is sent to the new target service node.
[0122] The sending status information can be used to indicate that the target service node has successfully received the file to be transmitted. If the sending status information returned by the target service node is not received within the preset time, it means that the current target service node is busy, down, or abnormal. Based on the load information of each service node of the second application, a new target service node can be re-determined from at least one service node of the second application, and the file to be transmitted can be sent to the new target service node.
[0123] In an embodiment of the present application, if the file to be transferred is successfully sent to the target service node, the file transfer result can be reported to the file transfer control center. Specifically, the file transfer result may include which service node of the first application successfully transferred the file to be transferred to which service node of the second application, and record the corresponding file transfer time.
[0124] A possible implementation method is provided in an embodiment of the present application. The file transfer control center further stores permission information corresponding to application identifiers of multiple applications. For any application identifier, the permission information includes the file transfer permission corresponding to the application identifier.
[0125] In the embodiment of the present application, the target configuration information can be determined by the file transfer control center in the following manner:
[0126] (1) obtaining a first application identifier of the first application; specifically, when receiving a configuration information obtaining request sent by a service node of the first application, since the first application needs to let the file transfer control center know that the request is sent by the first application, the configuration information obtaining request carries the first application identifier of the first application;
[0127] (2) determining the permission information corresponding to the first application identifier and verifying the permission information; specifically, the control center of the file transfer control center stores the permission information corresponding to each application, and the permission information may be the file transfer permission between applications, or may be more detailed, such as the file transfer permission between service nodes of different applications. As an optional method, the permission information corresponding to the first application may be determined according to the first application identifier, and it may be verified whether the permission information of the first application includes the file transfer from the first application to the second application. If so, the permission information verification is passed; otherwise, the permission information verification is failed.
[0128] (3) When the authority information verification is passed, the configuration information corresponding to the at least one service node of the second application determined based on the second application identifier is used as the target configuration information.
[0129] In the embodiment of the present application, the method of determining the transmission authority between the first application and the second application is not limited in the present application. For example, the file transfer control center can also first determine whether there is authorization authority between the first application and the second application based on the first application identifier of the first application and the second application identifier of the second application. If so, further determine whether the authorization authority includes the authority to transfer files from the first application to the second application. If so, the configuration information corresponding to at least one service node of the second application determined based on the second application identifier is used as the target configuration information, and then based on the target configuration information, the file to be transferred is sent to at least one service node of the second application.
[0130] A possible implementation method is provided in an embodiment of the present application. The configuration information acquisition request may also include a first application identifier and a task identifier of the first application. The task identifier is used to indicate the transmission of a file from the first application to the second application.
[0131] The file transfer control center can directly determine the first application identifier and the second application identifier through the configuration information acquisition request, and can determine whether the file is transferred from the first application to the second application based on the task identifier. Based on the first application identifier and the second application identifier, it can be first determined whether there is an authorization relationship between the first application and the second application in the permission information corresponding to each application identifier stored in the file transfer control center, wherein the authorization relationship may include file transfer permission and file reading permission, etc., and the authorization relationship may be a two-way authorization or a one-way authorization. If there is an authorization relationship between the first application and the second application in the file transfer control center, it is further determined whether the authorization relationship between the first application and the second application includes the permission to transfer files from the first application to the second application. If it does, the file transfer control center can send the target configuration information corresponding to at least one service node of the second application to the service node of the first application, so that the service node of the first application can send the file to be transferred to at least one service node of the second application based on the target configuration information.
[0132] The above-mentioned file transfer method realizes verification of the authorization relationship between various applications during file transfer. File transfer can be performed only when the verification is passed, thereby improving the reliability and security of file transfer.
[0133] A possible implementation method is provided in the embodiment of the present application, such as Figure 4 As shown, the method provided by the present application can be applied to a server, and a file transfer center can be configured on the server. Then the file transfer method provided by the present application can include the following steps:
[0134] Step S401: receiving a configuration information acquisition request sent by a service node of a first application, where the configuration information acquisition request includes a second application identifier of a second application;
[0135] Step S402, determining target configuration information corresponding to at least one service node of the second application according to the second application identifier, and sending the target configuration information to the service node of the first application, so that the service node of the first application sends the file to be transferred to at least one service node of the second application according to the target configuration information.
[0136] The above-mentioned file transfer method receives a configuration information acquisition request sent by a service node of a first application, and the configuration information acquisition request may include a second application identifier of a second application; determines target configuration information corresponding to at least one service node of the second application according to the second application identifier, and sends the target configuration information to the service node of the first application, so that the service node of the first application sends the file to be transferred to at least one service node of the second application according to the target configuration information. The configuration information of the service nodes of each application is managed by a file transfer control center, so that the first application can automatically complete addressing and file transfer through the file transfer control center according to the application identifier of the second application, thereby improving the efficiency of file transfer. At the same time, the service nodes of each application are managed in a cluster mode, so that the reliability of file transfer is relatively high.
[0137] In order to more clearly explain the file transmission method of the present application, the file transmission method will be further described below in conjunction with specific optional embodiments.
[0138] This optional embodiment provides a file transmission method, such as Figure 5 As shown, the following steps may be included:
[0139] Step S501: The service node of the first application receives a file transfer request from a client of the first application for a second application, and in response to the file transfer request, sends a configuration information acquisition request to a file transfer control center; the file transfer request includes a second application identifier of the second application and a file to be transferred; the configuration information acquisition request includes a first application identifier, a second application identifier, and a task identifier; the task identifier is used to indicate that a file is transferred from the first application to the second application;
[0140] Step S502, the file transfer control center determines the permission information corresponding to the first application identifier based on the first application identifier of the first application, and verifies the permission information; wherein, if the permission information includes the permission to transfer files from the first application to the second application, the permission information verification passes; otherwise, the permission information verification fails;
[0141] Step S503: Check whether the authority information is verified. If so, proceed to step S505; otherwise, proceed to step S504;
[0142] Step S504: the file transfer control center sends a prompt message indicating that the permission information verification has failed to the service node of the first application, and ends the process;
[0143] Step S505: The file transfer control center determines target configuration information corresponding to at least one service node of the second application based on the second application identifier, and sends the target configuration information to the service node of the first application;
[0144] Step S506, the target configuration information also includes load information corresponding to each service node of the second application. The service node of the first application determines a target service node from at least one service node of the second application based on the load information of each service node of the second application, and sends the file to be transferred to the target service node of the second application.
[0145] Step S507, within a preset time after the file to be transmitted is sent, whether the service node of the first application receives the sending status information returned by the target service node, if the sending status information is received, proceed to step S509, otherwise, proceed to step S508;
[0146] Step S508, based on the load information of each service node of the second application, re-determine a new target service node from at least one service node of the second application, send the file to be transmitted to the new target service node, and enter step S507;
[0147] Step S509: The service node of the first application reports the relevant information of the current file transfer process to the file transfer control center, and the process ends.
[0148] In one example, the file transfer method provided in the present application can be applied to financial scenarios. Since many files in financial transactions are time-sensitive, there is no need to store too many of them in shared storage. This method can realize file transfer between the file production end and the file receiving end directly based on the configuration information obtained from the file transfer center, saving a section of the file transfer process and improving file transfer efficiency.
[0149] In one example, if Figure 6a As shown, the deployment mode of the independent service mode can be realized based on the file transfer method provided in this application.
[0150] First, the Client SDK (Software Development Kit) in the figure can be understood as the client corresponding to system A, and the Sever SDK can be understood as the server corresponding to system B. In this application, for a system, two working modes can be included: client and server. File storage facilities include but are not limited to various hard disks or storage devices.
[0151] The independent service mode is an optimized traditional file transfer mode. The file transfer client (i.e., Client SDK in the figure) can be integrated into the file generator's system A, and the file transfer server can be integrated into the file consumer's system B. It is started together with the application project. When the application system (system A and system B) is started, the file transfer service can be used. The application system can call the file transfer system in the form of local methods.
[0152] The operation steps of the independent service mode can be roughly divided into three steps: the first step is that after system A and system B are started, they are registered in the registration center of the file transfer system respectively, that is, they automatically report their own configuration information to the registration center; the second step is that system A obtains the configuration information of system B on the subscriber side from the file transfer system. In this step, the control center verifies whether system A has the authority to transfer files to system B, and if the verification is successful, system A obtains the configuration information of system B from the registration center; the third step is that system A pushes files to system B according to the obtained configuration information of system B, and reports the relevant information of this file transfer process to the control center.
[0153] In one example, if Figure 6b As shown, the deployment mode of the sidecar service mode can be implemented based on the file transfer method provided in this application.
[0154] In actual application scenarios, the distributed file transfer platform can be completely developed in Java and has good platform portability. However, there may be many heterogeneous systems, such as systems developed based on C, C++, Python, Go and other languages. These systems are difficult to call Java methods directly, so they need to call interfaces to implement them. In this case, the sidecar mode deployment method is more suitable. Even for systems developed in Java, the sidecar mode can be used for deployment when iterations are very frequent.
[0155] like Figure 6b As shown, there is system A as a file producer and system B and system C as file consumers. The Client SDK, Sever SDK and corresponding startup container corresponding to system A, system B and system C can be separated and set on a terminal device, so that users can visually control the interaction process between system A, system B, system C and the file transfer system through the user interface of Client SDK or Sever SDK. In this mode, management and business logic are separated, business code is less invasive, and can serve cross-language systems.
[0156] Compared with the independent service mode, the difference of the sidecar service mode is that the original systems and corresponding file storage facilities are called through the independent Client SDK or Sever SDK. The rest of the steps are similar to the independent service mode and will not be described in detail here.
[0157] The present application embodiment provides a file transmission device, such as Figure 7 As shown, the file transmission device 70 may include: a first receiving module 701, a first sending module 702, a second receiving module 703 and a second sending module 704, wherein:
[0158] The first receiving module 701 is used to receive a file transfer request from a client of a first application to a second application, where the file transfer request includes a second application identifier of the second application and a file to be transferred;
[0159] A first sending module 702 is used to send a configuration information acquisition request to the file transfer control center in response to the file transfer request, wherein the configuration information acquisition request includes a second application identifier;
[0160] The second receiving module 703 is used to receive the target configuration information returned by the control center, where the target configuration information is the configuration information corresponding to at least one service node of the second application determined by the file transfer control center according to the second application identifier; wherein the file transfer control center stores the configuration information of the application identifiers of multiple applications and the corresponding service nodes, the multiple applications include the first application and the second application, and the application identifiers include the second application identifier;
[0161] The second sending module 704 is configured to send the file to be transmitted to at least one service node of the second application based on the target configuration information.
[0162] The above-mentioned file transfer device receives a file transfer request from a client of a first application for a second application, wherein the file transfer request includes a second application identifier of the second application and a file to be transferred; in response to the file transfer request, sends a configuration information acquisition request to a file transfer control center, wherein the configuration information acquisition request may include the second application identifier of the second application; receives target configuration information corresponding to at least one service node of the second application returned by the file transfer control center, and sends the file to be transferred to at least one service node of the second application based on the target configuration information. By managing the configuration information of the service nodes of each application through the file transfer control center, the first application can automatically complete addressing and file transfer through the file transfer control center according to the application identifier of the second application, thereby improving the efficiency of file transfer. At the same time, the service nodes of each application are managed in a cluster mode, thereby making the reliability of file transfer higher.
[0163] In an embodiment of the present application, the configuration information acquisition request also includes a first application identifier and a task identifier of the first application, and the task identifier is used to indicate the transmission of a file from the first application to the second application.
[0164] In the embodiment of the present application, the file transfer control center also stores permission information corresponding to application identifiers of multiple applications. For any application identifier, the permission information includes the file transfer permission corresponding to the application identifier;
[0165] The file transmission device also includes a target configuration information acquisition module, which is specifically used to:
[0166] Obtain a first application identifier of a first application;
[0167] Determine the permission information corresponding to the first application identifier, and verify the permission information;
[0168] When the authority information verification passes, target configuration information corresponding to at least one service node of the second application is determined based on the second application identifier.
[0169] In the embodiment of the present application, a registration module is also included, which is specifically used to:
[0170] In response to the start-up operation of at least one service node of the first application, relevant information of the first application is sent to the file transfer control center; the relevant information includes the first application identifier and configuration information corresponding to at least one service node of the first application.
[0171] In an embodiment of the present application, the target configuration information also includes load information corresponding to each service node of the second application; the second sending module, when sending the file to be transmitted to at least one service node of the second application based on the target configuration information, is specifically used to:
[0172] Determine a target service node from at least one service node of the second application based on load information of each service node of the second application;
[0173] The file to be transmitted is sent to the target service node of the second application.
[0174] In the embodiment of the present application, a resending module is also included, which is specifically used to:
[0175] Within the preset time after the file to be transmitted is sent, if no sending status information is received from the target service node, a new target service node is re-determined from at least one service node of the second application based on the load information of each service node of the second application, and the file to be transmitted is sent to the new target service node.
[0176] The present application also provides a file transmission device, such as Figure 8 As shown, the file transmission device 80 may include: a request receiving module 801 and a configuration information sending module 802, wherein:
[0177] The request receiving module 801 is used to receive a configuration information acquisition request sent by a service node of a first application, where the configuration information acquisition request includes a second application identifier of a second application;
[0178] The configuration information sending module 802 is used to determine the target configuration information corresponding to at least one service node of the second application according to the second application identifier, and send the target configuration information to the service node of the first application, so that the service node of the first application sends the file to be transmitted to at least one service node of the second application according to the target configuration information.
[0179] The device of the embodiments of the present application can execute the method provided by the embodiments of the present application, and the implementation principles are similar. The actions performed by each module in the device of each embodiment of the present application correspond to the steps in the method of each embodiment of the present application. For the detailed functional description of each module of the device, please refer to the description in the corresponding method shown in the previous text, which will not be repeated here.
[0180] An electronic device (computer device / equipment / system) is provided in an embodiment of the present application, including a memory, a processor and a computer program stored in the memory, and the processor executes the above-mentioned computer program to implement the steps of the file transfer method. Compared with the related technology, it can achieve: improving the efficiency and reliability of file transfer.
[0181] In an alternative embodiment, an electronic device is provided, such as Fig. 9 As shown, Fig. 9 The electronic device 4000 shown includes: a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, such as through a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present application.
[0182] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0183] The bus 4002 may include a path to transmit information between the above components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 4002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0184] The memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium that can be used to carry or store computer programs and can be read by a computer, without limitation herein.
[0185] The memory 4003 is used to store the computer program for executing the embodiment of the present application, and the execution is controlled by the processor 4001. The processor 4001 is used to execute the computer program stored in the memory 4003 to implement the steps shown in the above method embodiment.
[0186] The electronic devices include but are not limited to mobile terminals such as mobile phones, notebook computers, PADs, etc. and fixed terminals such as digital TVs, desktop computers, etc.
[0187] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps and corresponding contents of the aforementioned method embodiment can be implemented.
[0188] The embodiment of the present application also provides a computer program product, including a computer program, which can implement the steps and corresponding contents of the aforementioned method embodiment when executed by a processor.
[0189] The terms "first", "second", "third", "fourth", "1", "2", etc. (if any) in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than that shown or described in the drawings.
[0190] It should be understood that, although each operation step is indicated by arrows in the flowchart of the embodiment of the present application, the implementation order of these steps is not limited to the order indicated by the arrows. Unless clearly stated herein, in some implementation scenarios of the embodiment of the present application, the implementation steps in each flowchart can be performed in other orders according to demand. In addition, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on actual implementation scenarios. Some or all of these sub-steps or stages may be executed at the same time, and each sub-step or stage in these sub-steps or stages may also be executed at different times respectively. In different scenarios of execution time, the execution order of these sub-steps or stages may be flexibly configured according to demand, and the embodiment of the present application does not limit this.
[0191] The above is only an optional implementation method for some implementation scenarios of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the technical concept of the solution of the present application, other similar implementation methods based on the technical ideas of the present application are also within the protection scope of the embodiments of the present application.
Claims
1. A file transmission method, characterized in that: include: Receiving a file transfer request from a client of a first application for a second application, and uploading the file to be transferred to a service node of the first application, wherein the file transfer request includes a second application identifier of the second application and the file to be transferred; In response to the file transfer request, a configuration information acquisition request is sent to a file transfer control center, wherein the configuration information acquisition request includes the second application identifier; the configuration information acquisition request also includes a first application identifier and a task identifier of the first application, wherein the task identifier is used to indicate that a file is transferred from the first application to the second application; the file transfer control center also stores permission information corresponding to the application identifiers of the multiple applications, wherein for any application identifier, the permission information includes a file transfer permission and a file read permission corresponding to the application identifier; Determining, by the file transfer control center, whether there is an authorization relationship between the first application and the second application in the permission information corresponding to the application identifiers of the multiple applications based on the first application identifier and the second application identifier; If the authorization relationship exists in the permission information corresponding to the application identifiers of the multiple applications, further determining whether the authorization relationship includes permission for the first application to transfer files to the second application; if it does, sending target configuration information to the service node of the first application through the file transfer control center; receiving target configuration information returned by the file transfer control center, the target configuration information being configuration information corresponding to at least one service node of the second application determined by the file transfer control center according to the second application identifier; wherein the file transfer control center stores configuration information of application identifiers of multiple applications and their corresponding service nodes, the multiple applications including the first application and the second application, and the application identifiers including the second application identifier; Based on the target configuration information, the file to be transmitted is sent to at least one service node of the second application through the service node of the first application.
2. The method according to claim 1, characterized in that The target configuration information is determined by the file transfer control center in the following manner: Obtaining a first application identifier of the first application; Determining permission information corresponding to the first application identifier, and verifying the permission information; When the authority information is verified, target configuration information corresponding to at least one service node of the second application is determined based on the second application identifier.
3. The file transmission method according to claim 1, characterized in that: The method further comprises: In response to the start-up operation of at least one service node of the first application, relevant information of the first application is sent to the file transfer control center; the relevant information includes the first application identifier and configuration information corresponding to at least one service node of the first application.
4. The file transmission method according to claim 1, characterized in that: The target configuration information also includes load information corresponding to each service node of the second application; The sending the file to be transmitted to at least one service node of the second application based on the target configuration information includes: Determining a target service node from at least one service node of the second application based on load information of each service node of the second application; Send the file to be transmitted to the target service node of the second application.
5. The file transmission method according to claim 4, characterized in that: After sending the file to be transmitted to the target service node of the second application, the method further includes: If no sending status information is received from the target service node within a preset time after the file to be transmitted is sent, a new target service node is re-determined from at least one service node of the second application based on the load information of each service node of the second application, and the file to be transmitted is sent to the new target service node.
6. A file transmission method, characterized in that: include: Receiving a configuration information acquisition request sent by a service node of the first application, wherein the configuration information acquisition request includes a second application identifier of the second application; The configuration information acquisition request also includes a first application identifier and a task identifier of the first application, where the task identifier is used to indicate the transmission of a file from the first application to the second application; The file transfer control center also stores permission information corresponding to the application identifiers of the multiple applications. For any application identifier, the permission information includes the file transfer permission and file reading permission corresponding to the application identifier. Determine target configuration information corresponding to at least one service node of the second application according to the second application identifier, and determine, by the file transfer control center, based on the first application identifier and the second application identifier, whether there is an authorization relationship between the first application and the second application in the permission information corresponding to the application identifiers of the multiple applications; If the authorization relationship exists in the permission information corresponding to the application identifiers of the multiple applications, it is further determined whether the authorization relationship includes the permission to transfer files from the first application to the second application; if it is included, the target configuration information is sent to the service node of the first application through the file transfer control center, so that the service node of the first application sends the file to be transferred to at least one service node of the second application according to the target configuration information.
7. A file transmission device, characterized in that: include: A first receiving module, configured to receive a file transfer request from a client of a first application for a second application, and upload the file to be transferred to a service node of the first application, wherein the file transfer request includes a second application identifier of the second application and the file to be transferred; a first sending module, configured to send a configuration information acquisition request to a file transfer control center in response to the file transfer request, wherein the configuration information acquisition request includes the second application identifier; the configuration information acquisition request also includes a first application identifier and a task identifier of the first application, wherein the task identifier is used to indicate that a file is transferred from the first application to the second application; the file transfer control center also stores permission information corresponding to the application identifiers of the multiple applications, wherein for any application identifier, the permission information includes a file transfer permission and a file read permission corresponding to the application identifier; Determining, by the file transfer control center, whether there is an authorization relationship between the first application and the second application in the permission information corresponding to the application identifiers of the multiple applications based on the first application identifier and the second application identifier; If the authorization relationship exists in the permission information corresponding to the application identifiers of the multiple applications, further determining whether the authorization relationship includes permission for the first application to transfer files to the second application; if it does, sending target configuration information to the service node of the first application through the file transfer control center; a second receiving module, configured to receive target configuration information returned by the file transfer control center, wherein the target configuration information is configuration information corresponding to at least one service node of the second application determined by the file transfer control center according to the second application identifier; wherein the file transfer control center stores configuration information of application identifiers of multiple applications and their corresponding service nodes, the multiple applications include the first application and the second application, and the application identifiers include the second application identifier; The second sending module is used to send the file to be transmitted to at least one service node of the second application through the service node of the first application based on the target configuration information.
8. A file transmission device, characterized in that: include: A request receiving module, configured to receive a configuration information acquisition request sent by a service node of a first application, wherein the configuration information acquisition request includes a second application identifier of a second application; The configuration information acquisition request also includes a first application identifier and a task identifier of the first application, where the task identifier is used to indicate the transmission of a file from the first application to the second application; The file transfer control center also stores permission information corresponding to the application identifiers of the multiple applications. For any application identifier, the permission information includes the file transfer permission and file reading permission corresponding to the application identifier. a configuration information sending module, configured to determine target configuration information corresponding to at least one service node of the second application according to the second application identifier, and determine, through the file transfer control center, based on the first application identifier and the second application identifier, whether there is an authorization relationship between the first application and the second application in the permission information corresponding to the application identifiers of the multiple applications; If the authorization relationship exists in the permission information corresponding to the application identifiers of the multiple applications, it is further determined whether the authorization relationship includes the permission to transfer files from the first application to the second application; if it is included, the target configuration information is sent to the service node of the first application through the file transfer control center, so that the service node of the first application sends the file to be transferred to at least one service node of the second application according to the target configuration information.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
10. A 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 6 are implemented.
Citation Information
Patent Citations
File transmission method and device, electronic equipment and readable storage medium
CN111368173A
File transmission method, device and system and electronic equipment
CN111600957A
Data transmission method and device, computer equipment and storage medium
CN113067883A
File transmission method and device and server
CN113364852A
Data processing method, device and equipment
CN113783914A
