Cross-network file exchange method, device and storage medium
The cache mechanism deduplicates the checked and sent file information, solving the problem of repeated checking and transmission in cross-network file exchange and improving exchange efficiency and security.
Patent Information
- Application Number
- CN202410811781.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-06-21
AI Technical Summary
In the prior art, cross-network file exchange is inefficient because each time a file is sent out, repeated security checks and file transfers are required, resulting in unnecessary repetitive data transmission processes.
Adopt one or more levels of cache mechanism, cache the security results of checked files and information of sent files, perform deduplication processing, construct data packets and transmit them across the network, and reduce repeated file transmission.
It improves the efficiency of cross-network file exchange, reduces repeated security checks and file transfers, and enhances the flexibility and security of data exchange.
Smart Images

Figure CN119011565B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of cross-network data management, and in particular to a cross-network file exchange method, device, and storage medium. Background Art
[0002] To prevent data security issues like internal data leaks, companies often isolate their internal networks from external ones, sometimes even further dividing them into R&D, office, and production networks. While network isolation improves data security, it also creates significant inconvenience for data exchange between different network systems.
[0003] The cross-network file security exchange system can establish a secure, compliant, efficient, convenient and controllable data flow channel between different security domains (different network systems), realize the safe and reliable flow of files, and effectively prevent the leakage of sensitive data. The cross-network file security exchange system is generally divided into an intranet system and an extranet system, and is generally used with security isolation equipment (two-way network gates, one-way optical gates). Intranet users upload files first, or they can choose existing personal or team shared files to initiate cross-network file transmission applications. After the outbound files pass the security check and are approved, the relevant user and file data are encapsulated using a private protocol, and then transmitted across the network through the network gate to the data receiving module of the extranet system. After the data receiving module parses the data, it will be stored in the inbox of the target extranet user after a data consistency check, realizing the secure cross-network exchange of files.
[0004] However, since the file content is transmitted each time a file is sent out, some unnecessary and repetitive file data transmission processes will occur, resulting in low efficiency in cross-network file exchange. Summary of the Invention
[0005] The purpose of the embodiments of the present application is to provide a cross-network file exchange method, device and storage medium to improve the efficiency of cross-network file exchange.
[0006] In a first aspect, an embodiment of the present application provides a cross-network file exchange method, comprising:
[0007] Responding to a user's request for sending a file to a target file and obtaining a security check result of the target file;
[0008] Determining that a security check result of the target file meets a preset outbound condition, adding a file unique identifier corresponding to the target file to a list of files to be outbound, and obtaining file outbound information based on the file outbound request and adding the information to the outbound information list;
[0009] Deduplicating the unique identifiers of the files in the to-be-sent file list based on a preset third buffer area, obtaining the file contents based on the deduplicated to-be-sent file list, constructing a data packet based on the file contents and the to-be-sent information list, and transmitting the data packet across the network to the second network system;
[0010] Among them, the file outgoing information includes the sharing validity period; the third cache area stores file cache information that has been sent to the second network system and is within the sharing validity period, and the file cache information includes a file unique identifier and a corresponding sharing validity period.
[0011] In an embodiment of the present application, by caching the information of sent files within the sharing validity period, it is possible to deduplicate the file content that needs to be sent out later, thereby streamlining the amount of data sent out, and effectively improving the efficiency of cross-network file exchange.
[0012] In some possible embodiments, responding to a user's request to send a file for a target file and obtaining a security check result of the target file includes:
[0013] In response to a user's request for sending a file for a target file, querying whether a security check result corresponding to the target file is stored in a preset first buffer area;
[0014] If so, obtaining the security check result of the target file from the first cache area;
[0015] If not, a security check is performed on the target file based on a preset security check policy to obtain a security check result of the target file, and the security check result of the target file is added and stored in the first cache area.
[0016] In an embodiment of the present application, by caching the security check results of files that have undergone security checks, when these files need to be shared externally in the future, the security check results of these files can be obtained directly from the cache area without repeating the security check process, thereby further improving the efficiency of cross-network file exchange.
[0017] In some possible embodiments, the security check strategy includes at least two types; and the cross-network file exchange method further includes:
[0018] When a modification or deletion event for a target security check policy is monitored, the security check result corresponding to the target security check policy stored in the first cache area is cleared.
[0019] In an embodiment of the present application, by monitoring modification or deletion events of security check policies and promptly clearing corresponding security check results in the cache, the erroneous use of invalid security check results is avoided, thereby ensuring the security of cross-network file exchange.
[0020] In some possible embodiments, determining that a security check result of the target file meets a preset outbound condition, adding a unique file identifier corresponding to the target file to a list of files to be outbound, and obtaining file outbound information based on the file outbound request and adding the information to the outbound information list include:
[0021] Determine whether the security check result of the target file meets the preset outbound conditions, add the file unique identifier corresponding to the target file to the list of files to be outbound stored in the second cache area, obtain file outbound information based on the file outbound request and add it to the outbound information list stored in the second cache area.
[0022] In an embodiment of the present application, by utilizing the second cache area to store the list of files to be sent out and the list of outbound information, an information buffer is provided before the outbound file data is sent out, which further improves the flexibility of managing outbound data and helps to further improve the efficiency of cross-network file exchange.
[0023] In some possible embodiments, adding the unique file identifier corresponding to the target file to the list of files to be sent out stored in the second buffer area includes:
[0024] Adding the file unique identifier corresponding to the target file to a list of files to be sent out stored in the second buffer area, and performing deduplication processing on the file unique identifiers in the list of files to be sent out;
[0025] Alternatively, it is determined that there is no identifier consistent with the file unique identifier of the target file in the list of files to be sent stored in the second buffer area, and the file unique identifier corresponding to the target file is added to the list of files to be sent.
[0026] In an embodiment of the present application, by deduplicating the list of files to be sent out in the second cache area, duplicate files that need to be shared in the short term can be quickly filtered, thereby further improving the efficiency of cross-network file exchange.
[0027] In some possible embodiments, the method of performing deduplication processing on the unique identifiers of files in the to-be-sent file list based on a preset third buffer area, obtaining file content based on the deduplication processed to-be-sent file list, and constructing a data packet based on the file content and the to-be-sent information list and transmitting the data packet across the network to the second network system includes:
[0028] Obtaining the to-be-sent file list and the to-be-sent information list from the second buffer area based on a preset period, and clearing the second buffer area;
[0029] Based on the preset third cache area, the unique file identifiers in the list of files to be sent are deduplicated, the file content is obtained based on the deduplicated list of files to be sent, and a data packet is constructed based on the file content and the outgoing information list and transmitted across the network to the second network system.
[0030] In an embodiment of the present application, the information list stored in the second cache area is obtained according to a preset period, which is used as information to initiate data packaging and transmission to the external network, and the file cache information stored in the third cache area is used to deduplicate the outgoing files, thereby avoiding unnecessary file content transmission and improving the efficiency of cross-network file exchange.
[0031] In some possible embodiments, the deduplication processing of the unique file identifiers in the list of files to be sent out based on the preset third buffer area includes:
[0032] Querying whether a preset third cache area stores file cache information that matches the list of files to be sent out;
[0033] If so, the target file unique identifier that matches the file cache information in the list of files to be sent out is deleted, and at the same time, the file unique identifier of the file cache information is updated based on the list of files to be sent out, and the shared validity period of the file cache information is updated based on the file outgoing information in the outgoing information list;
[0034] If not, the file unique identifier of the file cache information is updated based on the to-be-sent file list, and the shared validity period of the file cache information is updated based on the file outbound information in the outbound information list.
[0035] In an embodiment of the present application, by utilizing the file cache information of the third cache area to deduplicate files to be sent out, and at the same time updating the file cache information of the third cache area based on the currently sent out information, the deduplication effect of the third cache area on duplicate file content can be improved, thereby further improving the efficiency of cross-network file exchange.
[0036] In a second aspect, an embodiment of the present application provides a cross-network file exchange device, including:
[0037] A security check module, configured to respond to a user's request for sending a file to a target file and obtain a security check result of the target file;
[0038] An outbound information acquisition module, configured to determine if the security check result of the target file meets a preset outbound condition, add the file unique identifier corresponding to the target file to a list of files to be outbound, and acquire file outbound information based on the file outbound request and add the information to the outbound information list;
[0039] A file outbound module, configured to perform deduplication processing on the unique identifiers of files in the list of files to be outbound based on a preset third buffer area, obtain file contents based on the deduplication-processed list of files to be outbound, construct a data packet based on the file contents and the outbound information list, and transmit the data packet across the network to the second network system;
[0040] Among them, the file outgoing information includes the sharing validity period; the third cache area stores file cache information that has been sent to the second network system and is within the sharing validity period, and the file cache information includes a file unique identifier and a corresponding sharing validity period.
[0041] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor can implement the method described in any embodiment of the first aspect when executing the program.
[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the first aspect can be implemented.
[0043] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a computer program, wherein when the computer program is executed by a processor, it can implement the method described in any embodiment of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flowchart of a cross-network file exchange method provided in an embodiment of the present application;
[0046] Figure 2 This is a flowchart of the overall process of the cross-network file exchange method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of a storage example of the second cache area provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of another storage example of the second cache area provided in an embodiment of the present application;
[0049] Figure 5 A schematic diagram of the structure of a cross-network file exchange device provided in an embodiment of the present application;
[0050] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0052] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and should not be understood as indicating or implying relative importance.
[0053] It should be noted that the existing technology has the following defects in the process of cross-network file exchange: 1. During the file security check stage, each time the same user or different users initiates a cross-network file outbound application for the same file, a repeated file security check process is required, resulting in low overall file outbound efficiency; 2. During the file sending stage, regardless of whether the external network system still has access rights to a certain file, after the same user or different users initiate a cross-network file outbound application for this file within a certain period of time, the content data of the file will still be transmitted across the network, resulting in low cross-network file exchange efficiency.
[0054] In response to at least one problem existing in the above-mentioned prior art, an embodiment of the present application provides a cross-network file exchange method, which simplifies cross-network file transmission through one or more levels of cache, thereby improving the efficiency of cross-network file exchange.
[0055] like Figure 1 As shown, an embodiment of the present application provides a cross-network file exchange method, which can be performed by a first network system. The method may include the following steps:
[0056] S1. Respond to a user's request for sending a target file and obtain a security check result of the target file.
[0057] It should be noted that the first network system, the second network system, etc. are only used to distinguish the description and should not be understood as having an order or indicating a degree of importance. For example, the first network system can be an intranet system, and correspondingly, the second network system can be an extranet system. In addition, the first network system and the second network system can also be two sub-network systems in the intranet system, such as a research and development network, an office network, a production network, etc., but the embodiments of the present application are not limited to this. Among them, the first network system and the second network system usually implement a network isolation function.
[0058] For example, authorized or registered users can upload files to the first network system at any time. After uploading the files to the first network system, corresponding storage information will be generated for each file (i.e., a file feature model will be established), including unique index, file summary, storage path, file size and other information.
[0059] For example, when a file is uploaded or shared, a user-file mapping relationship can be established to limit which users have the permission to share the file. After the file is uploaded, a file feature model can be established based on the file attributes in the following table:
[0060]
[0061]
[0062] When a user needs to exchange and share a target file (which can be one or more target files) across networks, they can initiate a file outbound request for the target file. It is understood that the initiated file outbound request may include the file's unique identifier (which can be a unique index fileId or a file digest file_md5 obtained based on the MD5 algorithm, etc.), the initiator of the exchange file (i.e., the user who initiates the file outbound request), the exchange target user (the user with access rights to the exchanged file), the file validity period (i.e., the sharing validity period), etc. Part or all of this information can be entered by the user initiating the request or automatically generated by the system based on preset rules.
[0063] It should be noted that point_count is used to indicate the number of times a file has been referenced, which can illustratively represent the number of access permissions a user has. It is understood that when the point_count corresponding to a file in the file feature model is detected to be zero, all caches in the first cache area whose keys match the file_md5 of the file are cleared.
[0064] Step S1 first responds to the file outbound request initiated by the user and obtains the security check result of the target file. For example, the security check process can be executed on the target file according to the preset security check policy to obtain the corresponding security check result. It is understandable that the security check policy can include one or more items, which can be set according to the needs. When performing a security check on the target file, the user can enter the check items to be performed when initiating the file outbound request, and use this as the basis for selecting the security check policy; in addition, the corresponding security check policy can be automatically matched according to the set rules based on the file type of the target file.
[0065] It should be noted that in the embodiment of the present application, "cross-network file exchange" means that files of the current network system can be shared to another network system, and it is not limited to receiving "exchange files" fed back by the network system as exchange after sending shared files to another network system.
[0066] S2. Determine that the security check result of the target file meets the preset outbound conditions, add the file unique identifier corresponding to the target file to the list of files to be outbound, obtain file outbound information based on the file outbound request, and add it to the outbound information list. The file outbound information includes a sharing validity period.
[0067] Specifically, after obtaining the security check result of the target file, it is determined whether the security check result meets the requirements according to the preset outbound conditions. If the outbound requirements are not met, the process is terminated and a reminder message of file sharing failure can be fed back.
[0068] When a file meets the outbound conditions, two lists are used to collect relevant information of the file to be outbound, including a list of files to be outbound and an outbound information list. The list of files to be outbound is used to record the unique file identifiers of the files that need to be outbound this time; the outbound information list is used to record the file outbound information of the files that need to be outbound this time. The file outbound information may include information such as the sharing validity period and the exchange target user. The sharing validity period is used to limit the validity period during which the outbound file can be accessed; the exchange target user information is used to limit the range of users with access rights. If the exchange target user information does not exist, it can be assumed that all users of the second network system (extranet system) have access rights.
[0069] S3. Deduplicating the unique identifiers of the files in the to-be-sent file list based on a preset third buffer, obtaining the file contents based on the deduplicated to-be-sent file list, constructing a data packet based on the file contents and the to-be-sent information list, and transmitting the data packet across the network to the second network system;
[0070] The third cache area stores file cache information that has been sent to the second network system and is within the sharing validity period. The file cache information includes a file unique identifier and a corresponding sharing validity period.
[0071] Specifically, the third cache area is used to store file cache information that has been sent to the second network system and is within the sharing validity period. It can be understood that since the file cache information includes the sharing validity period of the corresponding file, as the sharing validity period expires, the third cache area will immediately delete the file cache information of the corresponding file.
[0072] It should be noted that the file cache information in the third cache area can be stored in a file unique identifier-shared validity period structure. During deduplication processing, by matching the file unique identifier of the list of files to be sent out with the file cache information, it can be determined which files are to be sent out that need to be streamlined.
[0073] For example, if the file cache information in the third cache area contains the file unique identifier of file A, it means that file A already exists in the external network system. If the list of files to be sent out this time also contains the file unique identifier of file A, the file unique identifier corresponding to file A in the list of files to be sent out is deleted (deduplicated), and then, the file content is obtained only based on the list of files to be sent out after deduplication as one of the data for constructing the data packet, that is, there is no need to send out the file content of file A this time.
[0074] It should be noted that although the file content of file A does not need to be transferred to the second network system this time, the access rights of file A in the second network system need to be updated. Therefore, in addition to the deduplicated file content, the data packet sent to the second network system this time also needs to be constructed according to the file outbound information in the outbound information list, so that the second network system can update and rewrite the access rights, sharing validity period, etc. of the corresponding file A according to the file outbound information.
[0075] It should be noted that the first cache area, second cache area, and third cache area in the embodiments of this application are used only for descriptive purposes and do not indicate a precedence order or importance. Furthermore, one or more of the first cache area, second cache area, and third cache area may implement data storage based on different storage slices of the same storage medium, or may utilize different storage media.
[0076] Based on this, by caching the information of sent files within the sharing validity period, the content of files that need to be sent out later can be deduplicated, which reduces the amount of data sent out and effectively improves the efficiency of cross-network file exchange.
[0077] In some possible embodiments, step S1, responding to a user's request to send a file for a target file and obtaining a security check result for the target file, may include:
[0078] S101: In response to a user's request to send a file for a target file, query whether a security check result corresponding to the target file is stored in a preset first buffer area;
[0079] S102: If yes, obtain the security check result of the target file from the first buffer area;
[0080] S103: If not, perform a security check on the target file based on a preset security check policy to obtain a security check result of the target file, and add the security check result of the target file to the first cache area for storage.
[0081] It should be noted that in addition to performing a security check process every time a file is sent out, the security check results of files that have undergone security checks can also be stored in the first cache area. Therefore, when these files want to be sent out later, the security check results of these files can be obtained directly from the first cache area, eliminating the process of performing a security check on them and further improving the efficiency of cross-network file exchange.
[0082] Specifically, the security check results can be stored in the form of "file unique identifier + security check result". When a file outbound request for the target file is received from the current user, the first cache area can be queried for data based on the file unique identifier of the target file. If a match is found, the corresponding security check result in the first cache area is directly read as the security check result of this time; if a match is not found, a security check process needs to be performed on the target file to be outbound this time to obtain the corresponding security check result, and the security check result is stored in the first cache area according to the set format.
[0083] It should be noted that in addition to executing the security check process in response to a request to send a target file, security checks can also be performed asynchronously on individual files stored in the first network system at a set periodicity, thereby further improving the efficiency of cross-network file exchange. Specifically, the first cache can be queried at a set periodicity for files for which security check results are not yet available. Then, when the system is idle, security checks can be automatically performed on these files and the corresponding security check results can be cached. Based on this, when these files are subsequently sent for sharing, the cached security check results can be directly referenced without waiting for the security check process.
[0084] In some possible embodiments, the security check strategy includes at least two types; and the cross-network file exchange method further includes:
[0085] When a modification or deletion event for the target security check policy is monitored, the security check result corresponding to the target security check policy stored in the first buffer area is cleared.
[0086] It should be noted that when performing a security check on a file, the target file can be checked based on one or more security check policies, such as a file name check policy, a file size check policy, a file type check policy, and a file content check policy. Each security check policy can be configured with a corresponding policy unique identifier. Accordingly, in the first cache, the security check result can be stored in the form of "policy unique identifier + file unique identifier + security check result."
[0087] For example, the pre-built security check policy set can be configured according to the following format:
[0088] Policy attributes Data Type Remark policyId Int This field is unique file_name_check String Filename checking strategy file_size_check String File size checking policy file_type_check String File type checking policy file_content_check String File content inspection policy
[0089] It is understandable that the security check on the target file can be performed based on one or more security check policies selected by the user, or can be performed by matching one or more corresponding security check policies according to preset rules based on the file type of the target file.
[0090] It should be noted that since there may be multiple security check results corresponding to different security check policies for the same file, when querying whether the security check result corresponding to the target file is stored in the first cache area, it is necessary to use the "policy unique identifier + file unique identifier" field for query matching.
[0091] It should be noted that the security check policy in the system can be configured, updated, or deleted by the administrator (or automatically executed periodically), and the corresponding security check results will be invalid. Therefore, when a modification or deletion event for the target security check policy is detected, the security check results corresponding to the target security check policy stored in the first cache area can be matched based on the "policy unique identifier" query and cleared. When sending files out subsequently, it is necessary to re-execute the security check process at least once based on the updated security check policy and store the corresponding security check results.
[0092] For example, the file security check results can be cached based on the file's file_md5 and the currently selected security check policy policyId. The cache key is: policyId+"_"+file_md5; where "_" represents the terminator of policyId. For example, when querying an object with a policyId of "1", all objects with a policyId starting with 1 (such as "10", "133", etc.) will not be mistakenly queried.
[0093] When it is detected that the security check policy corresponding to policyId is modified or deleted, all cache objects in the first cache area whose keys start with policyId+"_" are cleared.
[0094] It should be noted that in addition to deleting the corresponding security check results by monitoring modification or deletion events, the security check results of the first cache area can also be automatically cleared according to the set period; for example, a retention period can also be set for each cached security check result, and the corresponding security check results will be automatically cleared when the retention period expires, thereby further improving the security of cross-network file exchange.
[0095] In some possible embodiments, step S2, determining that the security check result of the target file meets the preset outbound conditions, adding the file unique identifier corresponding to the target file to the list of files to be outbound, obtaining file outbound information based on the file outbound request and adding it to the outbound information list, may include:
[0096] S201. Determine that the security check result of the target file meets the preset outbound conditions, add the file unique identifier corresponding to the target file to the list of files to be outbound stored in the second cache area, obtain file outbound information based on the file outbound request and add it to the outbound information list stored in the second cache area.
[0097] It should be noted that the list of files to be sent out and the list of information to be sent out can be stored in the second buffer area. Based on this, the file sending process can be executed in batches or cycles based on the information stored in the second buffer area. This provides an information management platform before the outgoing file data is transmitted, further improving the flexibility of managing outgoing data and helping to further improve the efficiency of cross-network file exchange.
[0098] In some possible embodiments, in step S201, adding the file unique identifier corresponding to the target file to the list of files to be sent out stored in the second buffer area may include:
[0099] Adding the file unique identifier corresponding to the target file to the list of files to be sent out stored in the second buffer area, and performing deduplication processing on the file unique identifiers in the list of files to be sent out;
[0100] Alternatively, it is determined that there is no identifier consistent with the file unique identifier of the target file in the list of files to be sent stored in the second buffer area, and the file unique identifier corresponding to the target file is added to the list of files to be sent.
[0101] It should be noted that, when the file unique identifier of the target file is added to the list of files to be sent out based on the file sending request, the file unique identifiers in the list of files to be sent out may be initially deduplicated.
[0102] Specifically, the initial deduplication process may include at least the following two methods: 1. First, the file unique identifier of the target file to be sent out this time is directly added to the list of files to be sent out, and then the file unique identifiers in the list of files to be sent out are deduplicated, that is, multiple identical file unique identifiers in the list of files to be sent out are merged into one. 2. Based on the file unique identifier of the target file to be sent out this time, it is checked whether the list of files to be sent out already has the same file unique identifier. If so, it does not need to be added. If not, the file unique identifier of the target file is added to the list of files to be sent out.
[0103] Based on this, there will never be two or more identical file unique identifiers in the list of files to be sent out, thereby reducing the number of matches when performing the second file deduplication, further improving the efficiency of cross-network file exchange.
[0104] Exemplarily, the second cache area can be considered a file outbound cache pool, which is used to cache the relevant information of files to be sent out across the network. The cache pool contains two cache queues: FileList (list of files to be sent out) and OutInfoList (list of outbound information). Among them, the elements in FileList are file_md5 (file unique identifier). Exemplarily, the structure of this list can adopt HashSet. The data set stored by this structure is a set that does not allow duplicate elements (used for automatic deduplication of file_md5); the elements in OutInfoList are file outbound information outInfo. Exemplarily, the structure of this list is defined as follows:
[0105]
[0106]
[0107] It can be understood that after the file is approved according to the security check results, the file_md5 of the file to be sent out is first added to the FileList to complete the first file deduplication, and then the basic information of this file outbound (based on the file outbound request) is packaged into outInfo (file outbound information) according to the above structure and added to the OutInfoList.
[0108] In some possible embodiments, step S3, performing deduplication processing on the unique identifiers of the files in the to-be-sent file list based on a preset third buffer, obtaining the file content based on the deduplication processed to-be-sent file list, constructing a data packet based on the file content and the to-be-sent information list, and transmitting the data packet across the network to the second network system, may include:
[0109] S301, obtaining a list of files to be sent out and a list of messages to be sent out from a second buffer area based on a preset period, and clearing the second buffer area;
[0110] S302: Deduplication is performed on the unique identifiers of the files in the list of files to be sent out based on a preset third buffer area, file contents are obtained based on the deduplication-processed list of files to be sent out, and a data packet is constructed based on the file contents and the list of outgoing information and transmitted across the network to the second network system.
[0111] Specifically, the list of files to be sent out and the list of information to be sent out temporarily stored in the second buffer area can be periodically obtained to perform subsequent file content deduplication processing and outbound flow.
[0112] It is understandable that after responding to the user's file outbound request and generating the list of files to be outbound and the list of outbound information, the process first waits through the second buffer area until these lists are obtained according to a preset period and the second buffer area is cleared, and the subsequent file content deduplication processing and outbound process are randomly started. During the current waiting period, if file outbound requests are received successively from the same user or different users, the file unique identifier and file outbound information obtained during the period can be added to the list of files to be outbound and the list of outbound information respectively. At this time, the file unique identifier in the list of files to be outbound can be deduplicated for the first time to reduce the number of matches in the subsequent file content deduplication process.
[0113] It is understandable that for the preset period, if the set period is too long, the time that the file waits for outbound transmission will be too long, causing a certain degree of delay in the exchange of files; if the set period is too short, since the probability of the same file to be sent out in a short period of time is low, that is, the probability of deduplication of the same file unique identifier through the list of files to be sent out in the same period is low, the advantage of the first file deduplication cannot be brought into play, and it is easy to cause the data sending process of the previous and next periods to overlap, resulting in a small probability of the third-level cache failure (the deduplication function of the third cache area fails). Therefore, for the preset period, a time of appropriate size can be set according to the business characteristics of the specific cross-network file exchange, so as to balance the performance of file exchange efficiency and file deduplication efficiency.
[0114] In some possible embodiments, in step S302, deduplication processing of the unique file identifiers in the to-be-sent file list based on the preset third buffer area may include:
[0115] S3021: Check whether the preset third cache area stores file cache information that matches the list of files to be sent out;
[0116] S3022: If yes, then delete the target file unique identifier that matches the file cache information in the list of files to be sent out, and at the same time, update the file unique identifier of the file cache information based on the list of files to be sent out, and update the shared validity period of the file cache information based on the file outgoing information in the outgoing information list;
[0117] S3023: If not, the file unique identifier of the file cache information is updated based on the list of files to be sent out, and the shared validity period of the file cache information is updated based on the file sending information in the sending information list.
[0118] Specifically, in the process of performing deduplication processing on the file unique identifiers in the to-be-sent file list based on the preset third cache area, the first step is to query the file cache information stored in the third cache area to see whether there is a file unique identifier that is consistent with the to-be-sent file list: 1. If so, the target file unique identifier (the file unique identifier that is consistent with the file cache information) in the to-be-sent file list needs to be deleted. Since the file cache information in the third cache area represents the information of valid files that are currently in the external network system (the second network system) and are within the shared validity period, it means that the destination end (the second network system) already has the file content of the corresponding file (with the same file unique identifier) and does not need to send the file content again. Therefore, by performing deduplication processing on the to-be-sent file list, the data transmission of the file content of these valid files can be omitted when the file data is sent out this time. 2. If not, the file unique identifier of the file cache information is updated according to the to-be-sent file list. The significance of this process is to cache the file unique identifiers of the files to be sent out to the second network system, thereby performing deduplication processing on the case where the same file unique identifier exists in the to-be-sent file list in the next cycle.
[0119] It should be noted that, regardless of whether the file cache information stored in the third cache area contains a file unique identifier that is consistent with the file list to be sent out, that is, regardless of whether the deduplication process for the outgoing file list is implemented, the shared validity period of the file cache information needs to be updated according to the file outgoing information in the outgoing information list. This is because, regardless of whether the deduplication process for the outgoing file list is implemented, the file outgoing information of the file to be sent out this time (at least including the shared validity period, etc.) is usually different from the file cache information stored in the third cache area. Therefore, it is necessary to update the shared validity period of the file cache information at least according to the file outgoing information in the outgoing information list this time (when the file outgoing information only includes the shared validity period). It can be understood that if the file outgoing information also includes information such as the target shared user, the corresponding information of the file cache information also needs to be updated together.
[0120] Exemplarily, when updating the file cache information stored in the third cache area, it can be implemented according to the following rules: 1. In the same sending package (data packet sent out in the same cycle), if there are multiple outInfo containing the same file, the shared validity period of the file cache information is cached and updated according to the longest shared validity period of the file; 2. If the cache does not contain the file unique identifier of the corresponding file, the file unique identifier of the file is added and the shared validity period corresponding to the identifier is set to the shared validity period corresponding to the file in the current file sending information; 3. If the cache already has the file unique identifier of the corresponding file, the new and old shared validity periods are compared. If the new shared validity period (the shared validity period of the corresponding file in the current file sending information) is longer, the shared validity period of the corresponding file in the file cache information is updated.
[0121] Please refer to Figures 2 to 4 The following describes the cross-network file exchange provided by the embodiment of the present application in combination with a specific scenario. This example uses the intranet system and the extranet system as the interaction scenario, and the implementation process is as follows:
[0122] 1) In the intranet system, there are users A and B. Files File1 (MD5 value file1_md5) and File2 (MD5 value file2_md5) are stored. User A has the send permission (i.e., sharing permission) for both File1 and File2, while User B only has the send permission for File1. User A initiates a file send request to send File1 and File2 across the network to user C on the extranet. The packaged file send information is called outInfo1 (one send request corresponds to one file send information).
[0123] 2) The currently selected security check policy for the file is policy1. At this time, the first cache area is not hit according to the query of {file1_md5, policy1} and {file2_md5, policy1}. File security checks are performed on File1 and File2 respectively based on policy1. The security check results are security_check_result1 and security_check_result2 respectively. The corresponding approval process is triggered according to the security check results, and the security check results are cached at the same time: key1 is {file1_md5, policy1}, value1 is security_check_result1, key2 is {file2_md5, policy1}, and value2 is security_check_result2.
[0124] 3) After the file outbound request is approved, the corresponding file identifier and file outbound information enter the cache pool Pool (second cache area). At this time, the data in the Pool is as follows: Figure 3 shown.
[0125] 4) Assuming that user B initiates an application to send file File1 across the network to user D within the same cache cycle, the file outbound information is packaged as outInfo2. At this time, the security check policy has not changed. The first cache area is queried based on {file1_md5, policy1}, and the corresponding security check result is hit, avoiding repeated checks. The approval policy for this outbound application is determined directly based on the security check result stored in the first cache area. Assuming that it is approved within the cache cycle, continue to cache data in the Pool: first add file1_md5 to FileList. Since the previous file outbound application of user A in the same cache cycle already includes File1, that is, file1_md5 already exists in FileList, there is no need to add it repeatedly, and then add outInfo2 to OutInfoList. The merged Pool data is as follows Figure 4 shown.
[0126] 5) After the cache cycle ends, prepare to send data. First, traverse FileList to obtain all md5 (file unique identifiers), search for the md5 in the third cache area, and if neither file1_md5 nor file2_md5 is matched, match the corresponding file1_url and file2_url (file storage path) from the file feature model based on file1_md5 and file2_md5. Then, read the corresponding file content based on file1_url and file2_url to construct the sending packet (data packet); at the same time, traverse OutInfoList to obtain outInfo1 and outInfo2 to construct the sending packet; then send the data packet across the network and clear the cache pool.
[0127] 6) Store (or update) the information about the sent valid file in the third cache. Assuming that the outgoing file validity period (shared validity period) of outInfo1 is authorized to be 7 days, and the outgoing file validity period of outInfo2 is authorized to be 5 days, then add file1_md5 and file2_md5 to the third cache, and configure the shared validity period to be 7 days for both (because the shared validity period of outInfo1 corresponding to File1 is 7 days, and the shared validity period of outInfo2 corresponding to File1 is 5 days, the shared validity period of the same file is cached with the longest validity period).
[0128] 7) The external network system first parses the file content in the data packet through the data receiving module, and after processing such as verifying the file integrity, stores the corresponding files File1 and File2, and builds a file feature model of the external network system (the format can be the same as that of the internal network system); then parses OutInfo (outInfo1 and outInfo2), associates the external network user file mapping relationship and authorization relationship, and the user of the external network system can match file_url (based on the storage path of the external network system) from the external network file feature model according to the md5 of each file and access the file.
[0129] 8) Within the 7 days of authorized sharing, assuming that user B initiates another application to send file File1 to user E across the network, and is approved, the file sending information is packaged as outInfo3 (the sharing validity period is authorized to be 10 days). At this time, the file1_md5 stored in the third cache area can be hit. Therefore, there is no need to read the file content of File1 to construct a data packet. Only outInfo3 needs to be transmitted across the network. The external network system associates File1 with the external network user file mapping relationship and authorization relationship by parsing outInfo3, so that user E can access File1 within the sharing validity period (10 days). In addition, since the sharing validity period of File1 authorized this time is 10 days, which is longer than the original validity period (any validity period less than 7 days), the sharing validity period corresponding to file1_md5 stored in the third cache area needs to be updated to 10 days.
[0130] 9) After 7 days, due to the expiration of the sharing validity period of File1 previously initiated by user A and user B, user C and user D in the external network system have successively lost access to File1. At this time, the point_count (the number of times it has been referenced, which can be understood as the number of users with access rights to the file) corresponding to file1_md5 in the external network file feature model is reduced by one. Until 10 days later, the system detects that the point_count attribute corresponding to file1_md5 in the external network file feature model is zero (the access rights of all users in the external network system to file File1 are invalid), which triggers the deletion of file File1 in the external network system; in addition, the third cache area in the internal network system will also delete the file cache information corresponding to file1_md5 according to the expiration of the stored sharing validity period.
[0131] Please refer to Figure 5 , Figure 5 The following is a block diagram showing the composition of the cross-network file exchange device provided by some embodiments of the present application. Figure 1Corresponding to the method embodiment, it is capable of executing each step involved in the above method embodiment. The specific functions of the cross-network file exchange device can be found in the description above. To avoid repetition, detailed description is appropriately omitted here.
[0132] Figure 5 The cross-network file exchange device includes at least one software function module that can be stored in a memory in the form of software or firmware or fixed in the cross-network file exchange device, and the cross-network file exchange device includes:
[0133] The security check module 510 is used to respond to a user's request for sending a target file and obtain a security check result of the target file;
[0134] An outbound information acquisition module 520 is configured to determine whether a security check result of a target file satisfies a preset outbound condition, add a unique file identifier corresponding to the target file to a list of files to be outbound, and acquire file outbound information based on the file outbound request and add the information to the outbound information list;
[0135] The file outbound transmission module 530 is configured to perform deduplication processing on the unique identifiers of files in the outbound file list based on a preset third buffer, obtain file contents based on the deduplication-processed outbound file list, construct a data packet based on the file contents and the outbound information list, and transmit the data packet across the network to the second network system;
[0136] Among them, the file outgoing information includes the sharing validity period; the third cache area stores the file cache information that has been sent to the second network system and is within the sharing validity period, and the file cache information includes the file unique identifier and the corresponding sharing validity period.
[0137] It can be understood that the above-mentioned device embodiment corresponds to the method embodiment of the present invention. The cross-network file exchange device provided by the embodiment of the present invention can implement the cross-network file exchange method provided by any method embodiment of the present invention.
[0138] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method, and will not be described in detail here.
[0139] like Figure 6 As shown, some embodiments of the present application provide an electronic device 600, which includes: a memory 610, a processor 620, and a computer program stored in the memory 610 and executable on the processor 620, wherein the processor 620 reads the program from the memory 610 through the bus 630 and executes the program to implement a method of any embodiment included in the above-mentioned cross-network file exchange method.
[0140] Processor 620 can process digital signals and can include various computing architectures, such as a complex instruction set computer architecture, a reduced instruction set computer architecture, or an architecture that implements a combination of multiple instruction sets. In some examples, processor 620 can be a microprocessor.
[0141] The memory 610 can be used to store instructions executed by the processor 620 or data related to the execution of instructions. These instructions and / or data may include code for implementing some or all functions of one or more modules described in the embodiments of this application. The processor 620 of the embodiment of the present disclosure can be used to execute the instructions in the memory 610 to implement the method shown above. The memory 610 includes dynamic random access memory, static random access memory, flash memory, optical storage, or other memory known to those skilled in the art.
[0142] Some embodiments of the present application further provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method described in the method embodiment is executed.
[0143] Some embodiments of the present application further provide a computer program product, which, when running on a computer, enables the computer to execute the method described in the method embodiment.
[0144] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similarities between the various embodiments can be referred to in conjunction with each other. For device embodiments, since they are generally similar to method embodiments, their description is relatively simple, and for relevant details, reference can be made to the description of the method embodiments.
[0145] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a portion of code, and the module, program segment, or a portion of code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0146] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0147] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0148] The foregoing is merely an embodiment of the present application and is not intended to limit the scope of protection of the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined or explained in subsequent figures.
[0149] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0150] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
Claims
1. A cross-network file exchange method, characterized in that: include: Responding to a user's request for sending a file to a target file and obtaining a security check result of the target file; Determining that a security check result of the target file meets a preset outbound condition, adding a file unique identifier corresponding to the target file to a list of files to be outbound, and obtaining file outbound information based on the file outbound request and adding the information to the outbound information list; Deduplicating the unique identifiers of the files in the to-be-sent file list based on a preset third buffer area, obtaining the file contents based on the deduplicated to-be-sent file list, constructing a data packet based on the file contents and the to-be-sent information list, and transmitting the data packet across the network to the second network system; Among them, the file outgoing information includes the sharing validity period; the third cache area stores file cache information that has been sent to the second network system and is within the sharing validity period, and the file cache information includes a file unique identifier and a corresponding sharing validity period.
2. The cross-network file exchange method according to claim 1, characterized in that: The step of responding to a user's request for sending a file to a target file and obtaining a security check result of the target file includes: In response to a user's request for sending a file for a target file, querying whether a security check result corresponding to the target file is stored in a preset first buffer area; If so, obtaining the security check result of the target file from the first cache area; If not, a security check is performed on the target file based on a preset security check policy to obtain a security check result of the target file, and the security check result of the target file is added and stored in the first cache area.
3. The cross-network file exchange method according to claim 2, characterized in that: The security check strategy includes at least two types; the cross-network file exchange method also includes: When a modification or deletion event for a target security check policy is monitored, the security check result corresponding to the target security check policy stored in the first cache area is cleared.
4. The cross-network file exchange method according to claim 1, characterized in that: The step of determining that a security check result of the target file meets a preset outbound condition, adding a file unique identifier corresponding to the target file to a list of files to be outbound, and obtaining file outbound information based on the file outbound request and adding the information to the outbound information list includes: Determine whether the security check result of the target file meets the preset outbound conditions, add the file unique identifier corresponding to the target file to the list of files to be outbound stored in the second cache area, obtain file outbound information based on the file outbound request and add it to the outbound information list stored in the second cache area.
5. The cross-network file exchange method according to claim 4, characterized in that: The adding the file unique identifier corresponding to the target file to the list of files to be sent out stored in the second buffer area includes: Adding the file unique identifier corresponding to the target file to a list of files to be sent out stored in the second buffer area, and performing deduplication processing on the file unique identifiers in the list of files to be sent out; Alternatively, it is determined that there is no identifier consistent with the file unique identifier of the target file in the list of files to be sent stored in the second buffer area, and the file unique identifier corresponding to the target file is added to the list of files to be sent.
6. The cross-network file exchange method according to claim 5, characterized in that: The method comprises: performing deduplication processing on the unique identifiers of files in the to-be-sent file list based on a preset third buffer area, obtaining file content based on the to-be-sent file list after deduplication processing, constructing a data packet based on the file content and the to-be-sent information list, and transmitting the data packet across the network to the second network system, including: Obtaining the to-be-sent file list and the to-be-sent information list from the second buffer area based on a preset period, and clearing the second buffer area; Based on the preset third cache area, the unique file identifiers in the list of files to be sent are deduplicated, the file content is obtained based on the deduplicated list of files to be sent, and a data packet is constructed based on the file content and the outgoing information list and transmitted across the network to the second network system.
7. The cross-network file exchange method according to any one of claims 1 to 6, characterized in that: The deduplication processing of the unique file identifiers in the list of files to be sent out based on the preset third buffer area includes: Checking whether a preset third cache area stores file cache information that matches the list of files to be sent out; If so, the target file unique identifier that matches the file cache information in the list of files to be sent out is deleted, and at the same time, the file unique identifier of the file cache information is updated based on the list of files to be sent out, and the shared validity period of the file cache information is updated based on the file outgoing information in the outgoing information list; If not, the file unique identifier of the file cache information is updated based on the to-be-sent file list, and the shared validity period of the file cache information is updated based on the file outbound information in the outbound information list.
8. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor can implement the cross-network file exchange method according to any one of claims 1 to 7 when executing the program.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the cross-network file exchange method according to any one of claims 1 to 7 is executed.
10. A computer program product, characterized in that The computer program product includes a computer program, and when the computer program is executed by a processor, the cross-network file exchange method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cross-network data transmission method, device, equipment and medium
CN115834584A
Cross-network data exchange method, device and system, server and storage medium
CN116647598A