Data transmission methods, devices, electronic equipment and storage media
By storing data files uniformly on the relay platform and transmitting encrypted messages, the lack of unified standards in existing technologies is solved, enabling efficient and secure data collection and sharing, and improving development efficiency and resource utilization.
Patent Information
- Application Number
- CN202410098136.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-24
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-01-24
AI Technical Summary
Existing technologies lack unified standards for data collection, resulting in significant resource consumption, heavy workload, and low development efficiency.
By establishing a centralized relay platform, data files from each publisher are stored uniformly on a local server, and subscriber devices are notified to download them from a designated path via message. Encryption algorithms are used to ensure data transmission security, thereby achieving closed-loop and sharing of data files.
It saves resources, reduces the amount of customized development work for subscribers, improves development efficiency, and ensures the traceability of call records and the security of data transmission through unified API specifications and interface management.
Smart Images

Figure CN118827754B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data transmission technology, and in particular relates to a data transmission method, apparatus, electronic device and storage medium. Background Technology
[0002] In the existing R&D process, there will be a lot of data integration.
[0003] For example, when users need to collect data files from a publisher, customized collection tasks need to be developed. Therefore, if different users need to collect the same data files from the same publisher, different collection tasks need to be customized. There is no unified standard, and it is necessary to repeatedly establish network connections with the publisher, wasting resources, increasing workload, and resulting in low development efficiency.
[0004] Therefore, the problems with existing technologies are: there is no unified standard when collecting data, resulting in serious resource consumption, large workload, and low development efficiency. Summary of the Invention
[0005] This application provides a data transmission method, apparatus, electronic device, and storage medium, which solves the problems of lack of unified standards, high resource consumption, large workload, and low development efficiency in the prior art when collecting data.
[0006] In a first aspect, embodiments of this application provide a data transmission method applied to a relay platform, comprising:
[0007] Upon receiving a subscription target data file request from a subscriber, the target information is retrieved from the local database, including the first storage information of the target data file on the local server.
[0008] Based on the first stored information, generate the first message;
[0009] Send a first message to the subscriber so that the subscriber can download the target data file from the local server of the relay platform based on the first message.
[0010] In some possible implementations, the first stored information includes an account password for accessing the local server of the relay platform, which is valid for a preset time period for the subscriber to download the target data file from the local server of the relay platform within the preset time period.
[0011] In some possible implementations, the target information also includes a relay platform identifier and a target data file key; the first message includes a first message header and a first message body; based on the first stored information, the first message is generated, including:
[0012] Based on the preset encryption algorithm, the relay platform identifier, the target data file key, and the first timestamp of file distribution are encrypted to obtain the first encryption result;
[0013] Based on the first encryption result and the first timestamp, generate the first message header;
[0014] Based on the first stored information, a first message body is generated.
[0015] In some possible implementations, the method further includes the following before sending the first message to the subscriber:
[0016] The first message is added to the message queue, which contains the first messages corresponding to multiple subscribers in a sequential order.
[0017] Send the first message to the subscriber, including:
[0018] The corresponding first message is sent to the subscribers in the order of the first message in the message queue.
[0019] In some possible implementations, before retrieving the target information from the local database upon receiving a subscription target data file request from the subscriber, the method further includes:
[0020] Upon receiving the second message from the publisher, the publisher identifier and the target data file key are retrieved from the local database. The second message includes a second message header and a second message body. The second message header includes a second timestamp of file distribution and a second encryption result. The second encryption result is obtained by the publisher encrypting the publisher identifier, the target data file key, and the second timestamp based on a preset encryption algorithm. The second message body includes the second storage information of the target data file in the publisher's server.
[0021] According to the preset encryption algorithm, the publisher identifier, the target data file key, and the second timestamp in the second message header in the local database are encrypted to obtain the third encryption result;
[0022] If the third encryption result is the same as the second encryption result in the second message, the target data file is downloaded from the publisher's server according to the second storage information in the second message.
[0023] In some possible implementations, the second stored information includes an account password for accessing the publisher's server, which is valid for a preset time period for the relay platform to download the target data file from the publisher's server within that preset time period.
[0024] Secondly, embodiments of this application also provide a data transmission method, applied to a subscriber, including:
[0025] Upon receiving the first message from the relay platform, the system retrieves the relay platform identifier and the target data file key from the local database. The first message is the target information retrieved from the local database by the relay platform upon receiving a subscription request for the target data file from the subscriber. The target information includes the first storage information of the target data file in the local server. A message is generated based on the first storage information. The first message includes a first message header and a first message body. The first message header includes a first encryption result and a first timestamp.
[0026] According to the preset encryption algorithm, the relay platform identifier, the target data file key, and the first timestamp in the first message are encrypted to obtain the fourth encryption result;
[0027] If the fourth encryption result is the same as the first encryption result in the first message, the target data file is downloaded from the server of the relay platform according to the first storage information in the first message.
[0028] Thirdly, embodiments of this application also provide a data transmission device applied to a relay platform, comprising:
[0029] The acquisition module is used to acquire target information from the local database when a subscription target data file request is received from the subscriber. The target information includes the first storage information of the target data file in the local server.
[0030] The generation module is used to generate a first message based on the first stored information;
[0031] The sending module is used to send a first message to the subscriber, so that the subscriber can download the target data file from the local server of the relay platform based on the first message.
[0032] In some possible implementations, the first stored information includes an account password for accessing the local server of the relay platform, which is valid for a preset time period for the subscriber to download the target data file from the local server of the relay platform within the preset time period.
[0033] In some possible implementations, the target information also includes a relay platform identifier and a target data file key; the first message includes a first message header and a first message body; the generation module is used to generate the first message based on the first stored information, including:
[0034] The encryption unit is used to encrypt the relay platform identifier, the target data file key, and the first timestamp of file distribution according to a preset encryption algorithm to obtain the first encryption result;
[0035] The generation unit is used to generate a first message header based on the first encryption result and the first timestamp;
[0036] The generation unit is also used to generate a first message body based on the first stored information.
[0037] In some possible implementations, the device also includes an adding module before the sending module sends the first message to the subscriber:
[0038] The add module is used to add the first message to the message queue, which includes the first messages corresponding to multiple subscribers in a sequential order;
[0039] The sending module is used to send the first message to the subscriber, including:
[0040] The sending unit is used to send the corresponding first message to the subscriber in the order of the first messages in the message queue.
[0041] In some possible implementations, before the acquisition module retrieves the target information from the local database upon receiving a subscription target data file request from the subscriber, the device further includes:
[0042] The acquisition module is also used to acquire the publisher identifier and the target data file key from the local database when the second message from the publisher is received. The second message includes a second message header and a second message body. The second message header includes a second timestamp of file distribution and a second encryption result. The second encryption result is obtained by the publisher encrypting the publisher identifier, the target data file key and the second timestamp based on a preset encryption algorithm. The second message body includes the second storage information of the target data file in the publisher's server.
[0043] The encryption module is also used to encrypt the publisher identifier, the target data file key, and the second timestamp in the second message header in the local database according to a preset encryption algorithm, so as to obtain a third encryption result;
[0044] The download module is used to download the target data file from the publisher's server based on the second storage information in the second message, provided that the third encryption result is the same as the second encryption result in the second message.
[0045] In some possible implementations, the second stored information includes an account password for accessing the publisher's server, which is valid for a preset time period, for the relay platform to download the target data file from the publisher's server within that preset time period.
[0046] Fourthly, embodiments of this application also provide a data transmission apparatus, applied to a subscriber, including:
[0047] The acquisition module is used to acquire, upon receiving a first message from the relay platform, the relay platform identifier and the target data file key from the local database. The first message is the target information acquired by the relay platform from the local database upon receiving a subscription request for the target data file from the subscriber. The target information includes the first storage information of the target data file in the local server; a message generated based on the first storage information; the first message includes a first message header and a first message body, and the first message header includes a first encryption result and a first timestamp.
[0048] The encryption module is used to encrypt the relay platform identifier, the target data file key, and the first timestamp in the first message according to a preset encryption algorithm to obtain a fourth encryption result;
[0049] The download module is used to download the target data file from the server of the relay platform according to the first stored information in the first message, provided that the fourth encryption result is the same as the first encryption result in the first message.
[0050] Fifthly, embodiments of this application also provide an electronic device, which includes a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, it implements a data transmission method as in the first aspect or any possible implementation of the first aspect, or implements a data transmission method as in the second aspect or any possible implementation of the second aspect.
[0051] In a sixth aspect, embodiments of this application also provide a computer-readable storage medium storing computer program instructions. When executed by a processor, the computer program instructions implement the data transmission method in the first aspect or any possible implementation of the first aspect, or implement the data transmission method in the second aspect or any possible implementation of the second aspect.
[0052] In a seventh aspect, embodiments of this application also provide a computer program product, wherein instructions in the computer program product, when executed by a processor of an electronic device, enable the electronic device to perform a data transmission method as described in the first aspect or any possible implementation thereof; or to implement a data transmission method as described in the second aspect or any possible implementation thereof.
[0053] The data transmission method, apparatus, electronic device, and storage medium of this application embodiment are applied to a relay platform. When the relay platform device receives a subscription target data file request from a subscriber, it retrieves target information from the relay platform's local database, such as the first storage information of the target data file in the local server. Then, based on the first storage information, it generates a first message and sends it to the subscriber device, enabling the subscriber device to download the target data file from the relay platform's local server. By establishing a centralized relay platform, data files from various publishers can be uniformly stored in the relay platform's local server, and subscriber devices can be notified via message to download the data files from a specified path on the relay platform's server. Publishers only need to publish their data files once, eliminating the need to repeatedly establish network connections between publishers and subscribers, thus saving resources. Subscribers do not need to customize the development of different data collection tasks, resulting in less workload and higher development efficiency. Attached Figure Description
[0054] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0055] Figure 1 This is a schematic flowchart of a data transmission method provided in an embodiment of this application;
[0056] Figure 2 This is a schematic flowchart of another data transmission method provided in an embodiment of this application;
[0057] Figure 3 This is a schematic flowchart of another data transmission method provided in an embodiment of this application;
[0058] Figure 4 This is a schematic diagram of the process of publishing data files on a publishing direction relay platform provided in an embodiment of this application;
[0059] Figure 5 This is a schematic diagram of the subscription data file process of a subscription direction relay platform provided in an embodiment of this application;
[0060] Figure 6 This is a schematic diagram of a data transmission device provided in an embodiment of this application;
[0061] Figure 7 This is a schematic diagram of another data transmission device provided in an embodiment of this application;
[0062] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0063] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0064] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0065] As described in the background section, there is a lot of data integration involved in the existing R&D process.
[0066] For example, when users need to collect data files from a publisher, customized collection tasks need to be developed. Therefore, if different users need to collect the same data files from the same publisher, different collection tasks need to be customized. There is no unified standard, and it is necessary to repeatedly establish network connections with the publisher, wasting resources, increasing workload, and resulting in low development efficiency.
[0067] Existing methods for collecting business data via file acquisition involve a scheduled task that parses data files based on rules. If the publisher fails to upload all data files within the specified time, the collected data will be incomplete. Similarly, if the publisher fails to generate files within the specified time and re-uploads them, the scheduled task remains unaware of this. Even if the scheduled task successfully downloads the data files, the publisher is not informed. This prevents a closed-loop data acquisition process. Furthermore, existing methods lack data file sharing capabilities, leading to redundant development of common capabilities, wasted resources, and untraceable call records. Security relies solely on existing license lists, lacking a proper authentication mechanism. Therefore, current technologies for data acquisition suffer from a lack of standardized specifications, significant resource consumption, high workload, and low development efficiency.
[0068] Based on this, embodiments of this application provide a data transmission method, apparatus, device, and storage medium, which can solve the problems of the lack of unified standards, serious resource consumption, large workload, and low development efficiency in the prior art when collecting data.
[0069] The data transmission method provided in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0070] Figure 1 This is a schematic diagram of a data transmission method provided in an embodiment of this application, such as... Figure 1 As shown, the method may include steps S110 to S160.
[0071] S110, when the relay platform receives a subscription target data file request from the subscriber, it retrieves the target information from the local database, wherein the target information includes the first storage information of the target data file in the local server.
[0072] Target information may include the initial storage information of the target data file on the local server.
[0073] A request to subscribe to a target data file refers to a request from the subscriber to subscribe to a target data file.
[0074] The first storage information refers to the storage information of the target data file on the local server of the relay platform. This storage information can be called the first storage information. For example, the first storage information may include the storage path of the target data file on the local server of the relay platform, the identification information of the target data file, the login account name and password of the local server of the relay platform, etc.
[0075] It should be noted that in this embodiment of the application, the relay platform, the subscriber, and the publisher refer to the relay platform device, the subscriber device, and the publisher device, respectively, and are referred to as the relay platform, the subscriber, and the publisher in this embodiment of the application.
[0076] Specifically, step S110 can be understood as follows: when the relay platform receives a request from the subscriber to subscribe to the target data file, it can obtain the target information from the local database of the relay platform. The target information may include the first storage information of the target data file in the local server of the relay platform.
[0077] In some embodiments, the first stored information includes an account password for accessing the local server of the relay platform, which is valid for a preset time period for the subscriber to download the target data file from the local server of the relay platform within the preset time period.
[0078] Specifically, the first stored information may include the account password for the account accessing the local server of the relay platform. This account password is only valid within a preset time period and can be used by the subscriber to download target data files from the local server of the relay platform within that preset time period. Since the account password has an expiration date, downloading must be done within the validity period, which improves the security of data transmission, prevents random downloading of data files after password leakage, and protects the privacy of the data files.
[0079] S120, the relay platform generates the first message based on the first stored information.
[0080] Specifically, step S120 can be understood as the relay platform encapsulating the first storage information into a first message. The first message may include the storage path of the target data file on the local server of the relay platform, so as to notify the subscriber where the file is stored on the server of the relay platform, so that the subscriber can download the target data file from the server of the relay platform.
[0081] In some embodiments, the target information further includes a relay platform identifier and a target data file key; the first message includes a first message header and a first message body; generating the first message based on the first storage information includes:
[0082] Based on the preset encryption algorithm, the relay platform identifier, the target data file key, and the first timestamp of file distribution are encrypted to obtain the first encryption result;
[0083] Based on the first encryption result and the first timestamp, generate the first message header;
[0084] Based on the first stored information, a first message body is generated.
[0085] The target information may include the first storage information of the target data file on the local server, and may also include the relay platform identifier and the target data file key.
[0086] The first encryption result refers to the encryption result obtained by the relay platform encrypting the relay platform identifier, the target data file key, and the first timestamp of file distribution according to the preset encryption algorithm. This encryption result can be called the first encryption result.
[0087] The first message may include a message header and a message body. The message header may be referred to as the first message header and the message body may be referred to as the first message body.
[0088] The first message header may include the first encryption result and the first timestamp information.
[0089] The first message body may include first stored information.
[0090] Specifically, step S120, based on the first stored information, generates a first message, which may include: the relay platform encrypts the relay platform identifier, the target data file key, and the first timestamp of file distribution according to a preset encryption algorithm to obtain a first encryption result; then, the relay platform encapsulates the first encryption result and the first timestamp to generate a first message header, and encapsulates the first stored information to generate a first message body. The first message header can be used by the subscriber to generate the encryption result based on the first timestamp and to verify the first encryption result, thereby improving the security of data transmission.
[0091] S130, the relay platform sends the first message to the subscriber.
[0092] Specifically, step S130 can be understood as the relay platform sending a first message to the subscriber, which the subscriber can use to download the target data file from the relay platform's local server based on the first message. Steps S110 to S130 involve the relay platform device receiving a subscription request for the target data file from the subscriber, retrieving target information from the relay platform's local database, such as the first storage information of the target data file on the local server, generating a first message based on the first storage information, and then sending the first message to the subscriber device for downloading the target data file from the relay platform's local server. By establishing a centralized relay platform, data files from each publisher can be uniformly stored on the relay platform's local server, and subscriber devices can be notified via message messages to download the data files from a specified path on the relay platform's server. Publishers only need to publish their data files once, eliminating the need to repeatedly establish network connections between publishers and subscribers, thus saving resources. Subscribers do not need to customize different data collection tasks, resulting in less workload and higher development efficiency.
[0093] In some embodiments, such as Figure 2 As shown, before the relay platform sends the first message to the subscriber, the method further includes step S170:
[0094] S170, the relay platform adds the first message to the message queue, which includes the first messages corresponding to multiple subscribers in a sequential order;
[0095] In step S130, the relay platform sends the first message to the subscriber, including:
[0096] The corresponding first message is sent to the subscribers in the order of the first message in the message queue.
[0097] Specifically, the message distribution process can be as follows: After generating the first message, the relay platform can add the first message to a message queue. The message queue includes the first messages corresponding to multiple subscribers arranged in sequence. By first adding the messages to the message queue, the messages are then distributed to the corresponding subscribers in order. In this embodiment, the relay platform notifies the subscribers to download data files from a specified path on the relay platform's server via message. The publisher's data files only need to be published once, eliminating the need to repeatedly establish network connections between the publisher and subscribers, thus saving resources. Subscribers do not need to customize the development of different data collection tasks, resulting in less workload and higher development efficiency.
[0098] In some embodiments, such as Figure 3 As shown, upon receiving a subscription target data file request from the subscriber, before retrieving the target information from the local database, the method further includes steps S181 to S184:
[0099] S181, the publisher generates a second message, which includes a second message header and a second message body. The second message header includes a second timestamp of the file distribution and a second encryption result. The second encryption result is obtained by the publisher encrypting the publisher identifier, the target data file key and the second timestamp based on a preset encryption algorithm. The second message body includes the second storage information of the target data file in the publisher's server.
[0100] S182, the publisher sends a second message to the relay platform;
[0101] S183, Upon receiving the second message from the publisher, the relay platform retrieves the publisher identifier and the target data file key from its local database;
[0102] S184, The relay platform encrypts the publisher identifier, the target data file key, and the second timestamp in the second message header in the local database according to the preset encryption algorithm to obtain the third encryption result;
[0103] S185, if the third encryption result is the same as the second encryption result in the second message, the relay platform downloads the target data file from the publisher's server according to the second storage information in the second message.
[0104] Specifically, steps S181 and S182 describe the process of the publisher pushing a publishing message to the relay platform: Before publishing a file to the relay platform, the publisher can encrypt the publisher identifier, the target data file key, and the second timestamp based on a preset encryption algorithm to obtain a second encryption result. Then, the publisher can encapsulate the second timestamp and the second encryption result into a second header. The publisher can also encapsulate the second storage information of the target data file in the publisher's server into a second body. After obtaining the second message including the second header and the second body, the publisher sends it to the relay platform.
[0105] Specifically, steps S183 to S185 involve the relay platform receiving the second message, i.e., verifying it after receiving the published message: Upon receiving the second message from the publisher, the relay platform first verifies the message header. This involves retrieving the publisher identifier and target data file key from the local database, and then encrypting the publisher identifier, target data file key, and the second timestamp in the second message header using a preset encryption algorithm. This yields a third encryption result. If the third encryption result matches the second encryption result in the second message, the message header verification is successful. Then, the target data file can be downloaded from the publisher's server based on the second stored information in the second message. In this embodiment, the relay platform verifies the message header upon receiving the "second message," thus enhancing data transmission security.
[0106] In some embodiments, the second storage information may include an account password for accessing the publisher's server, which is valid for a preset time period, for use by the relay platform to download the target data file from the publisher's server within the preset time period.
[0107] Specifically, the second stored information may include the account password for accessing the publisher's server. The account password is only valid for a preset time period, such as only 30 minutes. It can be used by the relay platform to download the target data file from the publisher's server within the preset time period. In this embodiment of the application, the account password for accessing the publisher's server has an expiration date, which can improve the security of data transmission, prevent random download of data files after password leakage, and protect the privacy of data files.
[0108] The following describes steps S140 to S160, which are the specific processes by which the subscriber downloads the target data file from the relay platform's server after receiving the first message from the relay platform.
[0109] S140: Upon receiving the first message from the relay platform, the subscriber retrieves the relay platform identifier and the target data file key from its local database.
[0110] Specifically, step S140 can be understood as follows: when the subscriber receives the first message from the relay platform, it can obtain the relay platform identifier and the target data file key from the subscriber's local database to generate a fourth encryption result to verify the first encryption result.
[0111] S150, the subscriber encrypts the relay platform identifier, the target data file key, and the first timestamp in the first message according to the preset encryption algorithm to obtain the fourth encryption result.
[0112] Specifically, step S150 can be understood as the subscriber encrypting the relay platform identifier, the target data file key, and the first timestamp in the first message according to a preset encryption algorithm to obtain the fourth encryption result.
[0113] S160, if the fourth encryption result is the same as the first encryption result in the first message, the subscriber downloads the target data file from the server of the relay platform according to the first storage information in the first message.
[0114] Specifically, step S160 can be understood as follows: if the fourth encryption result is the same as the first encryption result in the first message, the verification is successful, and the subscriber can download the target data file from the relay platform's server based on the first stored information in the first message. After receiving the message, the subscriber will also verify the message header, improving the security of data transmission. The relay platform can achieve closed-loop data file collection and sharing. It can also notify the download of files in the form of messages through unified API specifications and interface management, ensuring that call records are traceable, the call process is traceable, and the call status is monitorable. At the same time, through the authentication and authorization of preset encryption algorithms, such as MD5HEX (APPID + timestamp + API key), and the temporary password of the server, the security of data transmission is greatly improved.
[0115] In one embodiment, the data transmission system may include a rules module, a data acquisition module, a big data module, a notification module, and a server module. The rules module is used to monitor rule changes and may include two types of rules: the first type is the rule type for the relay platform subscribing to the publisher's data file (which can be understood as the type of data file the publisher publishes to the relay platform), and the second type is the rule type for the subscriber subscribing to the relay platform's data file (which can be understood as the type of data file the subscriber subscribes to the relay platform).
[0116] like Figure 4 As shown, when the rule type is the first type, i.e., the publisher publishes data files to the relay platform, the process of how the publisher publishes data files to the relay platform is as follows:
[0117] 1) The rules module listens for rule changes, and the rule type is the first rule type;
[0118] 2) The relay platform downloads data files from the publisher.
[0119] The relay platform assigns the publisher's identifier (appId) and data file key (appSecret) to the publisher, and then offline synchronizes the publisher's identifier (appId), data file key (appSecret), the URL of the relay platform's notification interface for successful file upload, and the interface writing specifications to the publisher, thus completing the preparation work.
[0120] Meanwhile, the local database of the relay platform can store some important rule information, such as the publisher's SFTP server IP address, port, publisher identifier appId, data file key appSecret, and the path where the relay platform stores files.
[0121] 2.1) The publishing direction sends a second message to the relay platform. The second message includes a second message header and a second message body.
[0122] Specifically, the publisher generates a data file; the publisher uploads the data file to a specified path on its SFTP server; the publisher uses the publisher identifier appId, data file key appSecret, and file upload timestamp sent by the relay platform, concatenated with commas, to calculate the MD5 hash and convert it to hexadecimal uppercase to generate a second encrypted result, sign. The second message body contains the file's storage path on the publisher's server, data file identification information, the username used to log in to the publisher's server, and the login password (valid for 30 minutes). The second message header contains the appId, timestamp, and the second encrypted result, sign. The publisher sends the second message header and the second message body to the relay platform.
[0123] 2.2) The data acquisition module of the relay platform obtains the publisher identifier and data file key from the big data module.
[0124] 2.3) The relay platform verifies the second message header.
[0125] The relay platform generates a third encryption result based on the publisher identifier, data file key, and timestamp in the second message header obtained from the platform's big data module. It then verifies the second encryption result, sign, thus solving the problem that existing technologies can only rely on existing license lists for security and lack authentication mechanisms.
[0126] 2.4) If the second message header is verified, the data acquisition module of the relay platform downloads the data file from the publisher based on the second message body.
[0127] Specifically, once the second encryption result (sign) is verified, the data file is downloaded to the local relay platform based on the storage path of the data file on the publisher's server, the data file identifier, the publisher's SFTP server IP address, port, username and password (valid for 30 minutes) when logging into the publisher's server, and the data file storage path in the second message body. This further solves the problem that existing technologies can only rely on existing license lists and lack authentication mechanisms for security.
[0128] The transit platform uploads the downloaded data files to the big data module according to the specified path and rules; the big data module then cleans, analyzes, and statistically processes the data, and generates analytical data files.
[0129] 2.5) The data acquisition module of the relay platform pushes the downloaded data files to the server module.
[0130] 2.6) The server module stores the data file to the specified path.
[0131] 2.7) The publisher successfully uploaded the file through the notification module of the relay platform.
[0132] The publisher calls the relay platform's API URL to notify the relay platform of a successful file upload, thus solving the problem that the publisher cannot be notified when a data file is successfully downloaded via a scheduled task in existing technologies.
[0133] like Figure 5 As shown, when the rule type is the second type, i.e., the subscriber subscribes to the data file type of the relay platform, the process of how the subscriber subscribes to the data file from the relay platform is as follows:
[0134] 1) The rules module listens for rule changes, and the rule type is the second rule type.
[0135] 2) Subscribers download data files from the relay platform.
[0136] The relay platform's local database stores some important rule information, such as the interface address (Url2) for subscribers to receive successful file upload notifications, the file storage path, the relay platform identifier (appId2), the data file key (appSecret2), and file identification information.
[0137] Offline, synchronize the SFTP server's IP address, port, relay platform identifier appId2, data file key appSecret2, and relay platform call subscriber communication interface Url2 to the subscriber to complete the preparation work.
[0138] 2.1) The notification module of the relay platform obtains the relay platform identifier and data file key from the big data module.
[0139] 2.2) The notification module of the relay platform generates the first message and adds it to the message queue based on the relay platform identifier, data file key and timestamp.
[0140] The notification module generates the first encrypted result, sign, by combining the relay platform's unique identifier appId2, the data file key appSecret2, and the timestamp, concatenating them with commas, calculating their MD5 hash, and converting them to hexadecimal uppercase. The first message body contains the file's storage path on the relay platform server, data identification information, the username and password for logging into the relay platform server (valid for 30 minutes), and the timestamp. The first message header contains the subscriber's unique identifier appId, the timestamp, and the first encrypted result, sign. The first message is then sent to the message queue.
[0141] 2.3) The notification module of the relay platform pushes the first message to the subscriber.
[0142] 2.4) The subscriber verifies the first message header.
[0143] 2.5) If the first message is verified, the subscriber downloads the data file from the server module of the relay platform according to the body of the first message.
[0144] The subscriber downloads the data file from the relay platform's SFTP server based on the relay platform's SFTP server's IP address, port, and the file's storage path on the relay platform server, data file identification information, login username, and login password (valid for 30 minutes) in the first message body.
[0145] 2.6) The relay platform calls the subscriber's communication interface Url2 to notify the subscriber that the file upload was successful.
[0146] In this embodiment, by establishing a centralized relay platform, data files from each publisher can be uniformly stored on the local server of the relay platform. Subscriber devices are then notified via message to download the data files from a specified path on the relay platform's server. Publishers only need to publish their data files once, eliminating the need to repeatedly establish network connections between publishers and subscribers, thus saving resources. Subscribers do not need to customize different data collection tasks, resulting in less workload and higher development efficiency. Furthermore, the relay platform enables closed-loop data file collection and sharing. Through unified API specifications and interface management, download notifications via messages (i.e., packets) ensure traceable call records, verifiable call processes, and monitorable call status. Simultaneously, authentication and authorization using preset encryption algorithms and temporary server passwords significantly enhance data transmission security.
[0147] Figure 6 This application also provides a data transmission device for use in relay platforms, such as... Figure 6 As shown, the device 600 may include:
[0148] The acquisition module 610 is used to acquire target information from a local database when it receives a subscription target data file request from a subscriber. The target information includes the first storage information of the target data file in the local server.
[0149] The generation module 620 is used to generate a first message based on the first stored information;
[0150] The sending module 630 is used to send a first message to the subscriber, so that the subscriber can download the target data file from the local server of the relay platform based on the first message.
[0151] The data transmission device provided in this application embodiment is applied to a relay platform. When the relay platform device receives a subscription target data file request from a subscriber, it retrieves target information from the relay platform's local database, such as the first storage information of the target data file on the local server. Then, based on the first storage information, it generates a first message and sends it to the subscriber device, enabling the subscriber device to download the target data file from the relay platform's local server. By establishing a centralized relay platform, data files from various publishers can be uniformly stored on the relay platform's local server. Subscriber devices are notified via message messages to download the data files from a specified path on the relay platform's server. Publishers only need to publish their data files once, eliminating the need to repeatedly establish network connections between publishers and subscribers, thus saving resources. Subscribers do not need to customize different data collection tasks, resulting in less workload and higher development efficiency.
[0152] In some embodiments, the first stored information includes an account password for accessing the local server of the relay platform, which is valid for a preset time period for the subscriber to download the target data file from the local server of the relay platform within the preset time period.
[0153] In some embodiments, the target information further includes a relay platform identifier and a target data file key; the first message includes a first message header and a first message body; the generation module is used to generate the first message based on the first stored information, including:
[0154] The encryption unit is used to encrypt the relay platform identifier, the target data file key, and the first timestamp of file distribution according to a preset encryption algorithm to obtain the first encryption result;
[0155] The generation unit is used to generate a first message header based on the first encryption result and the first timestamp;
[0156] The generation unit is also used to generate a first message body based on the first stored information.
[0157] In some embodiments, the apparatus further includes an adding module before the sending module sends the first message to the subscriber:
[0158] The add module is used to add the first message to the message queue, which includes the first messages corresponding to multiple subscribers in a sequential order;
[0159] The sending module is used to send the first message to the subscriber, including:
[0160] The sending unit is used to send the corresponding first message to the subscriber in the order of the first messages in the message queue.
[0161] In some embodiments, before the acquisition module receives a subscription target data file request from the subscriber and acquires the target information from the local database, the apparatus further includes:
[0162] The acquisition module is also used to acquire the publisher identifier and the target data file key from the local database when the second message from the publisher is received. The second message includes a second message header and a second message body. The second message header includes a second timestamp of file distribution and a second encryption result. The second encryption result is obtained by the publisher encrypting the publisher identifier, the target data file key and the second timestamp based on a preset encryption algorithm. The second message body includes the second storage information of the target data file in the publisher's server.
[0163] The encryption module is also used to encrypt the publisher identifier, the target data file key, and the second timestamp in the second message header in the local database according to a preset encryption algorithm, so as to obtain a third encryption result;
[0164] The download module is used to download the target data file from the publisher's server based on the second storage information in the second message, provided that the third encryption result is the same as the second encryption result in the second message.
[0165] In some embodiments, the second stored information includes an account password for accessing the publisher's server, which is valid for a preset time period for use by the relay platform to download the target data file from the publisher's server within the preset time period.
[0166] Figure 7 This application also provides a data transmission device, which is applied to the subscriber, such as... Figure 7 As shown, the device 700 may include:
[0167] The acquisition module 710 is used to acquire, upon receiving a first message from the relay platform, the relay platform identifier and the target data file key from a local database. The first message is the target information acquired by the relay platform from the local database upon receiving a subscription request for the target data file from a subscriber. The target information includes the first storage information of the target data file in the local server; a message generated based on the first storage information; and the first message includes a first message header and a first message body. The first message header includes a first encryption result and a first timestamp.
[0168] The encryption module 720 is used to encrypt the relay platform identifier, the target data file key, and the first timestamp in the first message according to a preset encryption algorithm to obtain a fourth encryption result;
[0169] Download module 730 is used to download the target data file from the server of the relay platform according to the first stored information in the first message, provided that the fourth encryption result is the same as the first encryption result in the first message.
[0170] The various modules in the data transmission apparatus provided in this application embodiment can achieve... Figures 1 to 7 The functions of each step in the provided data transmission method, and the corresponding technical effects they achieve, will not be elaborated here for the sake of brevity.
[0171] Figure 8 A schematic diagram of the hardware structure of the data transmission device provided in an embodiment of this application is shown.
[0172] The data transmission device may include a processor 801 and a memory 802 storing computer program instructions.
[0173] Specifically, the processor 801 may include a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of this application.
[0174] Memory 802 may include mass storage for data or instructions. For example, and not limitingly, memory 802 may include a hard disk drive (HDD), floppy disk drive, flash memory, optical disk, magneto-optical disk, magnetic tape, or Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 802 may include removable or non-removable (or fixed) media. Where appropriate, memory 802 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, memory 802 is non-volatile solid-state memory.
[0175] Memory may include read-only memory (ROM), random access memory (RAM), disk storage media devices, optical storage media devices, flash memory devices, and electrical, optical, or other physical / tangible memory storage devices. Therefore, typically, memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to one aspect of this application.
[0176] The processor 801 reads and executes computer program instructions stored in the memory 802 to implement any of the data transmission methods in the above embodiments.
[0177] In one example, the data transmission device may further include a communication interface 803 and a bus 804. For example, Figure 8 As shown, the processor 801, memory 802, and communication interface 803 are connected through bus 804 and complete communication with each other.
[0178] The communication interface 803 is mainly used to realize communication between various modules, devices, units and / or equipment in the embodiments of this application.
[0179] Bus 804 includes hardware, software, or both, that couples components of a data transmission device together. For example, and not limitingly, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an Infinite Bandwidth Interconnect, a Linear Predictive Coding (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (Peripheral Component Interconnect-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VESA Local Bus, VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 804 may include one or more buses. Although specific buses are described and illustrated in the embodiments of this application, this application considers any suitable bus or interconnection.
[0180] This device can execute the data transmission method of the embodiments of this application based on each unit / component in the data transmission device, thereby achieving a combination Figures 1 to 5 The described data transmission method.
[0181] Furthermore, in conjunction with the data transmission methods in the above embodiments, this application embodiment can provide a computer storage medium for implementation. This computer storage medium stores computer program instructions; when these computer program instructions are executed by a processor, they implement any of the data transmission methods in the above embodiments.
[0182] This application also provides a computer program product, wherein the instructions in the computer program product, when executed by the processor of an electronic device, cause the electronic device to perform various processes implementing any of the above-described data transmission method embodiments.
[0183] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0184] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application-specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of this application are programs or code segments used to perform the required tasks. Programs or code segments can be stored on a machine-readable medium or transmitted over a transmission medium or communication link via data signals carried on a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, read-only memory (ROM), flash memory, erasable read-only memory (EROM), floppy disks, compact disc read-only memory (CD-ROM), optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0185] It should also be noted that the exemplary embodiments mentioned in this application describe methods or systems based on a series of steps or apparatus. However, this application is not limited to the order of the above steps; that is, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.
[0186] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0187] The above are merely specific embodiments of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A data transmission method, characterized in that, Applications in transit platforms include: Upon receiving a subscription target data file request from a subscriber, target information is retrieved from the local database, wherein the target information includes the first storage information of the target data file in the local server; Based on the first stored information, a first message is generated; The first message is sent to the subscriber so that the subscriber can download the target data file from the local server of the relay platform based on the first message; The target information also includes a relay platform identifier and a target data file key; the first message includes a first message header and a first message body; generating the first message based on the first stored information includes: According to the preset encryption algorithm, the relay platform identifier, the target data file key, and the first timestamp of file distribution are encrypted to obtain the first encryption result; The first message header is generated based on the first encryption result and the first timestamp; The first message body is generated based on the first stored information.
2. The method according to claim 1, characterized in that, The first storage information includes an account password for accessing the local server of the relay platform. The account password is valid for a preset time period for the subscriber to download the target data file from the local server of the relay platform within the preset time period.
3. The method according to claim 1, characterized in that, Before sending the first message to the subscriber, the method further includes: The first message is added to a message queue, which includes the first messages corresponding to multiple subscribers arranged in sequence. Sending the first message to the subscriber includes: The first messages are sent to the subscribers in the order of the first messages in the message queue.
4. The method according to any one of claims 1 to 3, characterized in that, Before retrieving the target information from the local database upon receiving a subscription target data file request from the subscriber, the method further includes: Upon receiving the second message from the publisher, the publisher identifier and the target data file key are retrieved from the local database. The second message includes a second message header and a second message body. The second message header includes a second timestamp of file distribution and a second encryption result. The second encryption result is obtained by the publisher encrypting the publisher identifier, the target data file key, and the second timestamp based on a preset encryption algorithm. The second message body includes the second storage information of the target data file in the publisher's server. According to a preset encryption algorithm, the publisher identifier, the target data file key, and the second timestamp in the second message header in the local database are encrypted to obtain a third encryption result; If the third encryption result is the same as the second encryption result in the second message, the target data file is downloaded from the publisher's server according to the second storage information in the second message.
5. The method according to claim 4, characterized in that, The second stored information includes an account password for accessing the publisher's server, which is valid for a preset time period for the relay platform to download the target data file from the publisher's server within that preset time period.
6. A data transmission method, characterized in that, Applied to subscribers, including: Upon receiving the first message from the relay platform, the system retrieves the relay platform identifier and the target data file key from the local database. The first message is generated when the relay platform receives a subscription request for the target data file from a subscriber, and retrieves target information from the local database, including the first storage information of the target data file on the local server. A message is then generated based on the first storage information. The first message includes a first header and a first body, with the first header including a first encryption result and a first timestamp. According to the preset encryption algorithm, the relay platform identifier, the target data file key, and the first timestamp in the first message are encrypted to obtain a fourth encryption result; If the fourth encryption result is the same as the first encryption result in the first message, the target data file is downloaded from the server of the relay platform according to the first storage information in the first message.
7. A data transmission device, characterized in that, Applications in transit platforms include: The acquisition module is used to acquire target information from a local database upon receiving a subscription target data file request from a subscriber, wherein the target information includes first storage information of the target data file in the local server; The generation module is used to generate a first message based on the first stored information; The sending module is configured to send the first message to the subscriber, so that the subscriber can download the target data file from the local server of the relay platform based on the first message; The target information also includes a relay platform identifier and a target data file key; the first message includes a first message header and a first message body; the generation module is used to generate the first message based on the first stored information, specifically for: According to the preset encryption algorithm, the relay platform identifier, the target data file key, and the first timestamp of file distribution are encrypted to obtain the first encryption result; The first message header is generated based on the first encryption result and the first timestamp; The first message body is generated based on the first stored information.
8. A data transmission device, characterized in that, Applied to subscribers, including: The acquisition module is configured to, upon receiving a first message from the relay platform, acquire the relay platform identifier and the target data file key from a local database. The first message is the target information acquired by the relay platform from its local database upon receiving a subscription request for the target data file from a subscriber. The target information includes first storage information of the target data file on a local server. A message is generated based on the first storage information. The first message includes a first header and a first body, the first header including a first encryption result and a first timestamp. The encryption module is used to encrypt the relay platform identifier, the target data file key, and the first timestamp in the first message according to a preset encryption algorithm to obtain a fourth encryption result; The download module is used to download the target data file from the server of the relay platform according to the first storage information in the first message, when the fourth encryption result is the same as the first encryption result in the first message.
9. An electronic device, characterized in that, The electronic device includes: a processor and a memory storing computer program instructions; the processor, when executing the computer program instructions, implements the data transmission method as described in any one of claims 1 to 5; or, implements the data transmission method as described in claim 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions that, when executed by a processor, implement the data transmission method as described in any one of claims 1 to 5; or, implement the data transmission method as described in claim 6.
11. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device is able to perform the data transmission method as described in any one of claims 1-5; or, perform the data transmission method as described in claim 6.
Citation Information
Patent Citations
Extranet access processing method and device
CN115694865A
Data query method and device, equipment and storage medium
CN116737774A