A data transmission method, storage medium and computer program product
By setting up a tagging mechanism and polling process among clients, the system identifies and synchronizes its own proactively generated changes, thus solving the problems of low data transmission efficiency and redundancy in different network environments and achieving efficient data synchronization and secure transmission.
Patent Information
- Application Number
- CN202410786777.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-18
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2044-06-18
AI Technical Summary
When synchronizing data between clients in different network environments, existing technologies result in low data transmission efficiency and data redundancy. This is especially true in data transmission between intranets and extranets, where non-locally generated change data received from the extranet cannot be synchronized back to the other side, and the data transmission speed is slow, leading to low data transmission efficiency and data redundancy issues.
By setting a tagging mechanism between clients, the system identifies and synchronizes its own proactively generated change data, instead of synchronizing data synchronized from the other side. It utilizes a cross-domain gateway to achieve data transmission, employs a polling process to monitor changes in the file list, and synchronizes when the file attributes indicate that it is untagged.
It improves the security and efficiency of client data transmission in different network environments, reduces the risk of data backhaul, and achieves efficient data synchronization.
Smart Images

Figure CN118677890B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data transmission, and particularly relates to a data transmission method, a storage medium and a computer program product. BACKGROUND
[0002] Currently, when data is transmitted between clients in different networks (for example, an intranet and an extranet), because the clients are respectively in different network environments, there is isolation between the intranet and the extranet, and therefore, when data is transmitted between the intranet and the extranet, in one scenario, change data generated by the intranet and the extranet needs to be safely synchronized to the opposite side. Change data caused by synchronization from the opposite side will not be synchronized again. For example, the intranet synchronously sends change data generated by the intranet to the extranet. After the extranet receives the data synchronized from the intranet, change data is generated by the extranet. However, the change data generated by the extranet is not generated by the extranet itself, but is synchronized from the intranet, and therefore, the change data will not need to be synchronized back to the intranet as change data of the extranet, otherwise, the pressure on the data transmission speed between the intranet and the extranet will be increased, leading to a decrease in the data transmission efficiency between the intranet and the extranet, and unnecessary data redundancy between the intranet and the extranet. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide a data transmission method, a storage medium and a computer program product, to solve the problem of how to efficiently implement data synchronization transmission of change data of clients in different network environments.
[0004] The embodiments of the present application adopt the following technical solutions: a data transmission method, applied to a first client, the first client being in a first network, and connected with a second client in a second network through a cross-domain gate passage, the network environment of the first network being different from that of the second network;
[0005] The method comprises:
[0006] acquiring a file list associated with the first client and the second client respectively, and based on a polling process, determining the attribute of a target file in a case where it is determined that the file list of the first client and / or the second client changes, wherein the target file represents a file in the file list that changes;
[0007] in a case where the attribute of the target file represents no label, synchronously sending the target file of the first client to the second client, and synchronously sending the target file of the second client to the first client;
[0008] creating a first file in the first client, creating a second file in the second client, and setting a first tag for the first file and the second file, wherein the first tag is used to indicate that a file data is being received;
[0009] receiving, by the first client, a target file from the second client, writing the target file into the first file with the first tag, receiving, by the second client, a target file from the first client, and writing the target file into the second file with the first tag;
[0010] in a case where the target file sending is completed, converting the first tag into a second tag, wherein the second tag is used to indicate that the target file sending is completed.
[0011] In some embodiments, based on a polling process, determining the target file in the first client and / or the second client comprises:
[0012] based on a first polling process, traversing a file list of the first client to obtain last modification time and new file information of all files in the file list of the first client;
[0013] based on a second polling process, traversing a file list of the second client to obtain last modification time and new file information of all files in the file list of the second client;
[0014] in a case where the file list of the first client and / or the second client has a file with changed last modification time and / or a new file, determining the file as the target file.
[0015] In some embodiments, the method further comprises:
[0016] when the attribute of the target file indicates that the first file and / or the second file has the second tag during the polling process of the file list of the first client and / or the second client, deleting the second tag in the first file and / or the second file;
[0017] continuing to determine whether the file list of the first client and the second client changes.
[0018] In some embodiments, after deleting the second tag in the first file and / or the second file, the method further comprises:
[0019] resetting the attribute of the first file and / or the second file, and ignoring a synchronization request of a current target file.
[0020] In some embodiments, the synchronously sending the target file of the first client to the second client comprises:
[0021] The first client sends a first request for synchronizing files to the second client;
[0022] The second client sends a first response signal in response to the first request;
[0023] Based on the first response signal, a data transmission channel between the first client and the second client is established;
[0024] Based on the data transmission channel and a preset transmission protocol, the target file of the first client is synchronously sent to the second client.
[0025] In some embodiments, the synchronously sending the target file of the second client to the first client comprises:
[0026] The second client sends a second request for synchronizing files to the first client;
[0027] The first client sends a second response signal in response to the second request;
[0028] Based on the second response signal, a data transmission channel between the first client and the second client is established;
[0029] Based on the data transmission channel and a preset transmission protocol, the target file of the second client is synchronously sent to the first client.
[0030] In some embodiments, the creating a first file in the first client and a second file in the second client and setting a first tag for the first file and the second file comprises:
[0031] The first file is created in the first client, the second file is created in the second client, and the attributes of the first file and the second file are atomically set as the first tag.
[0032] In some embodiments, the obtaining a file list associated with the first client and the second client respectively comprises:
[0033] A file list associated with the first user server is obtained, wherein the first user server is in the first network with the first client;
[0034] A file list associated with the second user server is obtained, wherein the second user server is in the second network with the second client.
[0035] The embodiment of the present application further provides a computer readable storage medium, which stores computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the steps of the method in any one of the above embodiments.
[0036] The embodiment of the present application further provides a computer program product, which comprises computer programs / instructions, and the computer programs / instructions are executed by a processor to implement the steps of the method in any one of the above embodiments.
[0037] The embodiment of the present application has the following beneficial effects:
[0038] By setting the label in the target file synchronization stage between the first client and the second client, the first client and the second client in different network environments can perceive the change source of the changed file in the file list associated with the self through the set label, and then actively synchronize the changed file to the opposite side, and the file synchronized from the opposite side is no longer synchronized back to the opposite side, thereby improving the security and transmission efficiency of the first client and the second client in different network environments during data transmission. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the embodiment or related art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0040] Figure 1 It is a flowchart of the data transmission method of the present application;
[0041] Figure 2 It is a structural schematic diagram of the first client and the second client of the present application;
[0042] Figure 3 It is another flowchart of the data transmission method of the present application;
[0043] Figure 4 It is a flowchart of the data transmission method of the present application when the dest client receives the target file;
[0044] Figure 5 It is a flowchart of one embodiment of step S01 in the present application; Figure 1
[0045] Figure 6 It is a flowchart of one embodiment of the data transmission method of the present application;
[0046] Figure 7 For this application Figure 1 A flowchart of an embodiment of step S02;
[0047] Figure 8 For this application Figure 1 A flowchart of another embodiment of step S02. Detailed Implementation
[0048] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0049] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0050] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0051] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0052] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.
[0053] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0054] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0055] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0056] To address the problems in the background art, this application provides a data transmission method. This method is applied to a first client located in a first network, which connects to a second client located in a second network via a cross-domain gateway. The network environments of the first and second networks are different. For example, the first network may be an intranet, and the second network may be an extranet, meaning the first client is in an intranet environment and the second client is in an extranet environment. Of course, it can also be understood that the first network could be an extranet, and the second network could be an intranet, with the first client in an extranet environment and the second client in an intranet environment. To clearly explain this application, it will be illustrated using the example of the first network being an intranet and the second network being an extranet. Because there is isolation between the intranet and the extranet, the security requirements for data transmission between them are relatively high.
[0057] like Figure 1 As shown, the data transmission method includes the following steps:
[0058] S01, obtain the file lists associated with the first client and the second client respectively, and based on the polling process, determine the attributes of the target file if it is determined that the file lists of the first client and / or the second client have changed, wherein the target file represents the file in the file list that has changed.
[0059] For example, a first client connects to a first user server, which is also located in a first network environment, i.e., an intranet environment. The first client can obtain a first file list associated with itself from the first user server. The first file list includes information such as the file name, file size, file type, and last modification time. The first file list can include one or more files, each containing corresponding data. For example, the first file list may contain a file named FOO.txt, which contains text data. Similarly, a second client connects to a second user server, which is also located in a second network environment, i.e., an extranet environment. The second client can obtain a second file list associated with itself from the second user server. The second file list includes information such as the file name, file size, file type, and last modification time. The second file list can include one or more files, each containing corresponding data. For example, the second file list may contain a file named FOO.txt, which contains text data.
[0060] On the first client, a first polling process continuously monitors the first file list. This process monitors the number of files and their information. For example, by monitoring the file information and comparing it with other files, the first polling process determines if the first file list has changed. If a file in the first file list has a changed last modification time, it indicates a change in the first file list. This change might indicate that the file contains new data or that existing data has been modified.
[0061] If it is determined that the file list of the first client has changed, the attributes of the target file are determined, where the target file represents the file in the file list that has changed. The attributes of the target file represent the current state of the target file. For example, if the target file is characterized as having no tag, then it is determined that the data change in the target file was initiated by the first client.
[0062] Similar to the first client, the second client can continuously monitor the second file list through a second polling process. This second polling process can monitor the number of files and file information in the second file list. A change in the last modification time of any file in the second file list indicates a change in the second file list itself.
[0063] If it is determined that the file list of the second client has changed, the attributes of the target file are determined. The attributes of the target file represent the current state of the target file. For example, if the target file is characterized as having no tag, it is considered that the data change in the target file was initiated by the second client.
[0064] S02, when the attribute representation of the target file is unlabeled, the target file of the first client is synchronously sent to the second client, and the target file of the second client is synchronously sent to the first client.
[0065] For example, in combination Figure 2 and Figure 3If the target file on the first client has no tags, then the target file needs to be sent from the first client to the second client. In this case, the first client acts as the client initiating the synchronization request (src client), and the second client acts as the client receiving the synchronization request (dest client). The target file can be synchronously sent to the second client through the synchronization module. Conversely, if the target file on the first client has tags, the target file may be existing on the first client while the second client is synchronizing it or after synchronization is complete. In this case, it is unnecessary to send the target file to the second client, avoiding the need to synchronize files from the second client back to the second client. This prevents data backhaul and reduces the data transmission risks and low data transmission efficiency caused by data backhaul. Of course, it is understandable that the src client and dest client refer only to a single synchronization process. When the second client needs to send the target file to the first client, the first client will act as the dest client, and the second client will act as the src client.
[0066] Similar to the synchronization method of the target file by the first client, if the target file on the second client is characterized as having no tag, then the target file on the second client needs to be sent to the first client. In this case, the second client acts as the client initiating the synchronization request, i.e., the src client, and the first client acts as the client receiving the synchronization request, i.e., the dest client. Conversely, if the target file may be existing on the second client while the first client is synchronizing it or after synchronization is complete, then it is not necessary to send the target file to the first client. This avoids the file being synchronized from the first client and then synchronized back to the first client, thus preventing data backhaul and reducing the data transmission risks and low data transmission efficiency caused by data backhaul.
[0067] S03, create a first file on the first client, create a second file on the second client, and set a first tag for the first file and the second file, wherein the first tag is used to indicate that file data is being received.
[0068] For example, a first file is created on the first client, and a second file is created on the second client. A target file is received from the second client through the first file, and a target file is received from the first client through the second file. A first tag is set for the first file and the second file, wherein the first tag is used to indicate that file data is being received.
[0069] For example, a first client sends its target file to a second client. The second client stores the received target file from the first client into a second file, and this second file has a first tag, which can be set to RECEIVING, indicating that the target file is being received. Similarly, when the second client sends its target file to the first client, the first client stores the received target file from the second client into a first file, and this first file also has a first tag, which can also be set to RECEIVING, indicating that the target file is being received.
[0070] Of course, it is understood that the first tag can also be set to other tag content; this is merely an example and does not constitute a limitation on the scope of protection of the claims. Although the first file and the second file with the first tag will be identified as changes in the file list during the polling process, because they have the first tag indicating that a target file is being received, they will not be transmitted back to the first client or the second client as target files, thus avoiding data backhaul.
[0071] S04, receive the target file from the second client through the first client, write the target file into a first file with the first tag, and receive the target file from the first client through the second client, write the target file into a second file with the first tag.
[0072] For example, after receiving a target file from the second client, the first client stores or writes the received target file to a first file. Similarly, after receiving a target file from the first client, the second client stores or writes the received target file to a second file. This enables synchronized file transmission between the first and second clients, allowing file synchronization between clients in different network environments.
[0073] S05, if the target file has been sent, the first tag is converted to a second tag, wherein the second tag is used to indicate that the target file has been sent.
[0074] For example, in combination Figure 4 After the first client synchronously sends its target file to the second client, the synchronization process ends. At this point, the first tag of the second file on the second client will no longer accurately represent the current attributes of the second file; that is, the second file no longer displays the attributes of the file being received (RECEIVING), but rather the attributes of the file that have been received. Therefore, the first tag (RECEIVING) of the second file can be changed or modified to the second tag, which can be RECEIVE_FINISH, indicating that the target file has been sent.
[0075] Similarly, when the second client synchronously sends its target file to the first client, after the synchronization process is complete, the first tag of the first file will also be converted or modified to the second tag.
[0076] Although the first and second files with the second tag will also change the file list of the first and second clients during the polling process, they will not be sent back to the first or second client as target files because the first and second files have the second tag indicating that the target file has been sent. This avoids data backhaul.
[0077] This application embodiment sets tags during the target file synchronization phase between the first client and the second client, enabling the first client and the second client in different network environments to perceive the source of changes to files in their associated file lists through the set tags. This allows them to securely send the changed files they actively generate to the other side across domains, while files synchronized from the other side are no longer synchronized back to the other side. This improves the security and efficiency of data transmission between the first client and the second client in different network environments.
[0078] In addition, the embodiments of this application are based on existing clients and corresponding operating systems. Compared with methods that require the introduction of third-party support such as caching for the client or corresponding system, the embodiments of this application can achieve bidirectional file synchronization and anti-backward transmission in a lightweight manner.
[0079] In some embodiments, combined with Figure 5 Based on the polling process, the target file in the first client and / or the second client is determined, including:
[0080] S011, based on the first polling process, traverse the file list of the first client to obtain the last modification time and newly added file information of all files in the file list of the first client.
[0081] For example, based on the first polling process, the file list of the first client is traversed and checked to obtain the last modification time and information on newly added files for all files in the first client's file list. As mentioned earlier, the file list includes information such as file name, file size, file type, and last modification time. For instance, if the first client's file list had 10 files in the previous polling process, and now has more than 10 files in the current polling process, it means that newly added files have appeared in the first client's file list, i.e., the first client's file list has changed.
[0082] S012, based on the second polling process, traverse the file list of the second client to obtain the last modification time and new file information of all files in the file list of the second client.
[0083] For example, based on the second polling process, the file list of the second client is traversed and checked to obtain the last modification time and information on newly added files for all files in the file list of the second client. For instance, in the previous polling process, the last modification time of one file in the file list of the second client was 20:00, while in the current polling process, the last modification time of that file in the file list of the second client has changed to 20:10, indicating that the last modification time of a file in the file list of the second client has changed, that is, the file list of the second client has changed.
[0084] S013, if the file list of the first client and / or the second client contains a file whose last modification time has changed and / or a newly added file, then that file is determined to be the target file.
[0085] For example, as described in steps S011 and S012, whether the last time of a file in the file list has changed or a new file has been added to the file list, it indicates that the file list of the corresponding client has changed. Therefore, the file that has changed or been added is identified as the target file. Determining the target file is a prerequisite for deciding whether to send the corresponding client's file to another client in another network environment.
[0086] In some embodiments, combined with Figure 6 The method further includes:
[0087] S06, when checking the file list of the first client and / or the second client based on the polling process, if the attribute of the target file indicates that the first file and / or the second file has the second tag, delete the second tag in the first file and / or the second file.
[0088] For example, when the tags of the first and second files are changed to the second tag, it indicates that the file synchronization process has been completed. For instance, once the file synchronization process is complete, the first file will be a normal file in the first client's file list, or the first file will no longer have the attribute characteristics associated with the second client. When polling the first client's file list, the second tag of the first file can be removed.
[0089] S07, continue to determine whether the file lists of the first client and the second client have changed.
[0090] For example, even after the second tag is deleted, the polling process continues to check the file lists of both the first and second clients. For instance, the first polling process continuously checks the file list of the first client, and the second polling process continuously checks the file list of the second client. When the modification time of the first file whose second tag was deleted changes during subsequent checks, because it no longer has the second tag, it can be synchronously sent to the second client as a target file. This avoids the situation where the first file still has the second tag and cannot be sent to the second client as a target file, thus ensuring the accuracy of file synchronization between the first and second clients.
[0091] Of course, it is understandable that when the polling process checks the file list of the first client and / or the second client, if the attribute of the target file indicates that the first file and / or the second file has the first tag, the file changes detected in this round of polling can be ignored and the polling process can continue.
[0092] In some embodiments, after deleting the second tag in the first file and / or the second file, the method further includes:
[0093] Reset the attributes of the first file and / or the second file, and ignore the synchronization request for the current target file.
[0094] For example, after deleting the second tag in the first file and / or the second file, the attributes of the first file and / or the second file can be reset. For instance, after deleting the second tag in the first file, the attributes of the first file are reset. When the second client sends a synchronization request at this time, the synchronization request from the second client to send its target file to the first client is ignored, ensuring that subsequent file changes on the first client can be recognized and sent.
[0095] In some embodiments, combined with Figure 7 The process of synchronously sending the target file from the first client to the second client includes:
[0096] S021, the first client sends a first request to the second client to synchronize files.
[0097] For example, after the first client determines that it wants to send the target file to the second client, it first sends a first request to the second client to indicate that the first client is ready to send the target file to the second client.
[0098] The first client can set up a listener to continuously poll and check for changes in the file list.
[0099] S022, in response to the first request, the second client sends a first response signal.
[0100] For example, after receiving a first request from the first client, the second client may respond to the first request by sending a first response signal to the first client, which indicates that the second client agrees to receive the first client's request for synchronous transmission of the target file.
[0101] The second client can be configured with a synchronizer, which is used to listen for the first file request.
[0102] S023, Based on the first response signal, establish a data transmission channel between the first client and the second client.
[0103] For example, after receiving the first response signal, the first client establishes a data transmission channel between the first client and the second client based on the first response signal. For example, the data transmission channel is a cross-domain gate passage channel between the first client and the second client.
[0104] S024, based on the data transmission channel and the preset transmission protocol, the target file of the first client is synchronously sent to the second client.
[0105] For example, based on the data transmission channel and the preset transmission protocol, the target file of the first client is synchronously sent to the second client. The preset transmission protocol can be a private transmission protocol between the first and second clients to complete the synchronous transmission of the target file, or it can be based on a conventional transmission protocol.
[0106] In some embodiments, combined with Figure 8 The process of synchronously sending the target file from the second client to the first client includes:
[0107] S025, the second client sends a second request to the first client to synchronize files.
[0108] S026, in response to the second request, the first client sends a second response signal.
[0109] S027, Based on the second response signal, establish a data transmission channel between the first client and the second client.
[0110] S028, based on the data transmission channel and the preset transmission protocol, the target file of the second client is synchronously sent to the first client.
[0111] That is, when the second client sends the target file to the first client, the first client and the second client can simply switch roles of sending and receiving in steps S021 to S024, which will not be elaborated here.
[0112] In some embodiments, a first file is created on the first client, a second file is created on the second client, and a first tag is set for the first file and the second file, including:
[0113] Create a first file on the first client and a second file on the second client, and atomically set the attribute of the first file and the second file to the first tag.
[0114] When setting the first tag of the first and second files, an atomic setting method is used. Atomicity means that the file creation and the setting of the first tag are inseparable; that is, the operation either executes completely (the file attribute is set to "RECEIVING") or it doesn't execute at all (the file attribute remains in its original state or is not set). For example, when the dest client receives a new synchronization request, it performs the following operations:
[0115] Create a file named FOO.txt (either the first file or the second file, if the file does not already exist).
[0116] Atomically set the attribute of the newly created FOO.txt file to "RECEIVING".
[0117] The "atomic setting" here ensures that the process of setting the file attribute to "RECEIVING" will not be interrupted or interfered with by other concurrent operations (such as another process trying to read or modify the file's attributes), thus ensuring data consistency and operational integrity.
[0118] In some embodiments, obtaining the file lists associated with the first client and the second client respectively includes:
[0119] The system retrieves a list of files associated with a first user server, wherein the first user server and the first client are located within the first network. The first user server is used to provide the first client, which is in the same network environment, with a list of files associated with it.
[0120] The system retrieves a list of files associated with a second user server, wherein the second user server and the second client are located in the second network. The second user server is used to provide the second client, which is in the same network environment, with a list of files associated with it.
[0121] Based on the same inventive concept, embodiments of this application also provide a computer-readable storage medium having a computer program / instructions stored thereon, which, when executed by a processor, implements the steps of any of the methods described in the above embodiments.
[0122] Based on the same inventive concept, embodiments of this application also provide a computer program product, including a computer program / instructions, which, when executed by a processor, implements the method described in any of the above embodiments.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, computer-readable storage media, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware. Furthermore, this application can take the form of a computer program product implemented on one or more computer-readable storage media containing computer-readable program code. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium.
[0124] The aforementioned processor can be a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0125] The aforementioned memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0126] The aforementioned readable storage medium may be a magnetic disk, optical disk, DVD, USB, read-only memory (ROM) or random access memory (RAM), etc. This application does not limit the specific form of storage medium.
[0127] The foregoing has described in detail several embodiments of this application, but this application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this application, and all such variations and modifications should fall within the scope of protection claimed in this application.
[0128] The foregoing has described in detail several embodiments of this application, but this application is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications based on the concept of this application, and all such variations and modifications should fall within the scope of protection claimed in this application.
Claims
1. A data transmission method, characterized in that, It is applied to a first client, which is located in a first network and is connected to a second client in a second network through a cross-domain gateway channel. The network environments of the first network and the second network are different. The method includes: Obtain the file lists associated with the first client and the second client respectively. Based on the polling process, if it is determined that the file lists of the first client and / or the second client have changed, determine the attributes of the target file, wherein the target file represents the file in the file list that has changed. When the attribute representation of the target file is unlabeled, the target file of the first client is synchronously sent to the second client, and the target file of the second client is synchronously sent to the first client. A first file is created on the first client, a second file is created on the second client, and a first tag is set for the first file and the second file, wherein the first tag is used to indicate that file data is being received; The first client receives a target file from the second client and writes the target file into a first file with the first tag; the second client receives a target file from the first client and writes the target file into a second file with the first tag. If the target file has been sent, the first tag is converted to a second tag, wherein the second tag is used to indicate that the target file has been sent.
2. The data transmission method according to claim 1, characterized in that, Based on the polling process, the target file in the first client and / or the second client is determined, including: Based on the first round of polling, the file list of the first client is traversed to obtain the last modification time and new file information of all files in the file list of the first client. Based on the second round of polling, the file list of the second client is traversed to obtain the last modification time and new file information of all files in the file list of the second client. If the file list of the first client and / or the second client contains a file whose last modification time has changed and / or a newly added file, then that file is identified as the target file.
3. The data transmission method according to claim 1, characterized in that, The method further includes: When checking the file lists of the first client and / or the second client based on the polling process, if the attribute of the target file indicates that the first file and / or the second file has the second tag, the second tag in the first file and / or the second file shall be deleted. Continue to determine whether the file lists of the first client and the second client have changed.
4. The data transmission method according to claim 3, characterized in that, After deleting the second tag from the first file and / or the second file, the method further includes: Reset the attributes of the first file and / or the second file, and ignore the synchronization request for the current target file.
5. The data transmission method according to claim 1, characterized in that, Synchronously sending the target file from the first client to the second client includes: The first client sends a first request to the second client to synchronize files; In response to the first request, the second client sends a first response signal; Based on the first response signal, a data transmission channel is established between the first client and the second client; Based on the data transmission channel and the preset transmission protocol, the target file of the first client is synchronously sent to the second client.
6. The data transmission method according to claim 1, characterized in that, The target file from the second client is synchronously sent to the first client, including: The second client sends a second request to the first client to synchronize files; In response to the second request, the first client sends a second response signal; Based on the second response signal, a data transmission channel is established between the first client and the second client; Based on the data transmission channel and the preset transmission protocol, the target file of the second client is synchronously sent to the first client.
7. The data transmission method according to claim 1, characterized in that, Create a first file on the first client, create a second file on the second client, and set a first tag for the first file and the second file, including: Create a first file on the first client and a second file on the second client, and atomically set the attribute of the first file and the second file to the first tag.
8. The data transmission method according to claim 1, characterized in that, Retrieve the file lists associated with the first client and the second client respectively, including: Obtain the list of files associated with the first user server, wherein the first user server and the first client are located in the first network; Obtain the list of files associated with the second user server, wherein the second user server and the second client are located in the second network.
9. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 8.
10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Cross-network data processing method and device
CN114124929A
File dynamic caching method and device, equipment and storage medium
CN116821072A