CN117176741A - Method and device for detecting synchronization of data exchange files and electronic equipment - Google Patents

Method and device for detecting synchronization of data exchange files and electronic equipment Download PDF

Info

Publication number
CN117176741A
CN117176741A CN202311229945.6A CN202311229945A CN117176741A CN 117176741 A CN117176741 A CN 117176741A CN 202311229945 A CN202311229945 A CN 202311229945A CN 117176741 A CN117176741 A CN 117176741A
Authority
CN
China
Prior art keywords
file
tested
storage server
file storage
folder
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311229945.6A
Other languages
Chinese (zh)
Inventor
柯志成
杨勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Hubei Topsec Network Security Technology Co Ltd
Original Assignee
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Hubei Topsec Network Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd, Hubei Topsec Network Security Technology Co Ltd filed Critical Beijing Topsec Technology Co Ltd
Priority to CN202311229945.6A priority Critical patent/CN117176741A/en
Publication of CN117176741A publication Critical patent/CN117176741A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment discloses a method and a device for detecting synchronization of data exchange files and electronic equipment. Wherein the method comprises the following steps: in a first file storage server, executing at least one concurrency operation aiming at a plurality of files to be tested and folders to be tested in different levels; after each concurrent operation is finished, the first file storage server sends a synchronous verification request to a second file storage server; receiving a response message returned by the second file storage server according to the synchronous verification request; and acquiring a verification result of whether the concurrent operation is successfully synchronized in the second file storage server according to the response message. The method can generate the files to be tested and the folders to be tested under different directory levels, improves the testing efficiency and accuracy of the data exchange files in a concurrent synchronous mode, and reduces the cost of manual testing and the resource cost.

Description

Method and device for detecting synchronization of data exchange files and electronic equipment
Technical Field
The disclosure relates to the technical field of computers, and in particular relates to a method and a device for detecting synchronization of data exchange files and electronic equipment.
Background
The data safety life cycle is divided into a plurality of stages of acquisition, transmission, storage, processing, exchange and destruction, wherein the data exchange stage involves data transfer, and the information safety risk is very high, so the data safety exchange is extremely important. The cross-network data safety exchange system is a platform for realizing data synchronization between two different network service area servers by comprehensively utilizing safety measures such as equipment authentication, format check and the like based on the technology of a network gate and a unidirectional optical gate. The cross-network data security exchange system comprises a plurality of data type synchronizing modules such as file synchronization, database synchronization and the like, wherein the file synchronization function can backup files in a file server to another server, and the function of safely exchanging files under various directory levels between different network areas is realized.
In the related art, a method for testing single file synchronous detection correctness or single file read-write correctness is provided, the content of the file used for testing is single and the file synchronous detection cannot be carried out, and the labor cost and the resource cost are high due to huge directory levels, file quantity and file size under the file server.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide a method, an apparatus, and an electronic device for detecting synchronization of data exchange files, which can cover a large amount of test task amounts from the start of file generation by a first file storage server to the end of synchronization by a second file storage server, so as to generate files to be tested and folders to be tested under different directory levels, and improve efficiency and accuracy of data exchange file synchronization detection in a concurrent synchronization manner, and reduce cost of manual testing and resource cost.
In a first aspect, an embodiment of the present disclosure provides a method for detecting synchronization of data exchange files, which adopts the following technical scheme:
in a first file storage server, executing at least one concurrency operation aiming at a plurality of files to be tested and folders to be tested in different levels;
after each concurrent operation is finished, the first file storage server sends a synchronous verification request to a second file storage server;
receiving a response message returned by the second file storage server according to the synchronous verification request;
and acquiring a verification result of whether the concurrent operation is successfully synchronized in the second file storage server according to the response message.
In some embodiments, in the first file storage server, at least one concurrent operation is performed for a plurality of files under test and folders under test of different levels, including:
calculating the hierarchical structure of the folder to be tested based on the acquired directory information and file information; the directory information at least comprises preset directory depth, and the file information at least comprises preset total number of files, preset total number of folders and preset total size of files;
randomly generating a file structure in each level of the hierarchical structure according to the total number of the preset files;
and according to the file structure, the file to be tested and the folder to be tested are newly built in the first file storage server in a concurrent mode based on the test connection pool of the central control platform.
In some embodiments, according to the file structure, the method for newly building the file to be tested and the folder to be tested in the first file storage server based on the test connection pool of the central control platform in a concurrent manner includes:
randomly selecting a random directory depth which is more than 1 and less than the preset directory depth;
performing a corresponding number of loop operations based on the random directory depth;
Reading a folder list under the current path in each cycle operation process;
when the number of the folders obtained at random is not zero, directly entering the corresponding folders to be tested; when the number of the folders acquired randomly is zero, newly building a folder to be tested under the current path and entering the newly built folder to be tested;
when the generated new directory number or the generated directory depth of the random access is the same as the random directory depth, continuously judging whether the total number of the randomly acquired folders reaches the total number of the preset folders or not;
and when the generated directory number or the generated directory depth of the random access is different from the random directory depth, executing the process of reading the folder list under the current path in each circulation operation.
In some embodiments, the method further comprises:
returning to the root directory when the total number of the folders obtained at random does not reach the total number of the preset folders, and executing the random selection of a random directory depth which is larger than 1 and smaller than the preset directory depth;
when the total number of the folders obtained randomly reaches the total number of the preset folders, randomly selecting a path from a path list;
Newly creating a file to be tested in a randomly selected path until the total number of the newly created file to be tested reaches the total number of the preset files; the content of the file to be tested is randomly set, and the size of the file is randomly valued between a ratio of more than 1 and less than the total size of the preset file to the total number of the preset file.
In some embodiments, when each of the concurrent operations is completed, the first file storage server sends a synchronous verification request to a second file storage server through a central control platform, including:
each time a folder to be tested or a file to be tested is newly built, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform;
the second file storage server is enabled to synchronously establish a correct path according to the fact that the folder to be tested or the file to be tested is detected in a preset time, and a response message of successful synchronization establishment is returned to the first file storage server through the central control platform; or,
and the second file storage server synchronously builds a correct path according to the fact that the folder to be detected or the file to be detected is not detected within a preset time, and returns a response message of failure in synchronous building to the first file storage server through the central control platform.
In some embodiments, the concurrent operations further include operations of modifying a file name, modifying a file content, and deleting a file, and when each of the concurrent operations is completed, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform, including:
taking out connections from the test connection pool, wherein each connection randomly enters one folder to be tested from a root directory until only the file to be tested exists in the current path;
executing concurrent operations of modifying file names, modifying file contents and deleting files in sequence for each file to be tested;
after the concurrent operation is finished each time, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform, and the verification request is finished when the file to be tested does not exist in the current path and the current path is the root directory.
In some embodiments, the method further comprises:
if the file to be detected does not exist in the current path and the current path is not the root directory, returning to the path of the previous stage of the current path;
continuing to modify the name of the folder and delete the folder of the folder to be tested of the previous path;
After the operation of modifying the folder name and deleting the folder is finished each time, a synchronous verification request is sent to a second file storage server through a central control platform;
returning to the root directory when the folder to be tested exists in the previous path, and executing the step of randomly entering one folder to be tested;
and when the previous path does not have the folder to be tested, executing the concurrent operation of modifying the file name, modifying the file content and deleting the file for each file to be tested in sequence.
In some embodiments, the method further comprises:
when each operation thread corresponding to the concurrent operation randomly enters one folder to be tested from the root directory, locking the root directory;
when the operation of the operation thread on the root directory is completed and all folders to be tested under the root directory are deleted, releasing the root directory and switching the operation thread to an idle state;
and the operation thread in the idle state continuously enters an unlocked root directory to execute concurrent operation until paths under the root directory are locked, and the operation thread is released.
In a second aspect, an embodiment of the present disclosure further provides a test apparatus for synchronizing data exchange files, which adopts the following technical scheme:
the execution unit is configured to execute at least one concurrent operation aiming at a plurality of files to be tested and folders to be tested in different levels in the first file storage server;
a transmitting unit configured to transmit a synchronous verification request to a second file storage server through a central control platform when each of the concurrent operations is completed;
the receiving unit is configured to receive a response message returned by the second file storage server according to the synchronous verification request;
and the synchronous verification unit is configured to acquire a verification result of whether the concurrent operation is successfully synchronized at the second file storage server according to the response message.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, which adopts the following technical scheme:
the electronic device includes:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any one of the above data exchange file synchronization test methods.
According to the method for detecting the synchronization of the data exchange files, provided by the embodiment of the disclosure, files and folders to be detected in different levels are generated in the first file storage server, concurrent operation is carried out on the files and folders to be detected in different levels, and a synchronization verification request is sent to the second file storage server to acquire file information for comparison so as to detect the accuracy of file synchronization; the method can cover a large number of test task amounts from the start of file generation of the first file storage server to the synchronous end of the second file storage server so as to generate files to be tested and folders to be tested under different directory levels, improves the test efficiency and accuracy of the data exchange files in a concurrent synchronous mode, and reduces the cost of manual testing and the resource cost.
The foregoing description is only an overview of the disclosed technology, and may be implemented in accordance with the disclosure of the present disclosure, so that the above-mentioned and other objects, features and advantages of the present disclosure can be more clearly understood, and the following detailed description of the preferred embodiments is given with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to a person of ordinary skill in the art.
Fig. 1 is an application scenario schematic diagram of a method for detecting synchronization of data exchange files according to an embodiment of the present disclosure;
fig. 2 is a flow chart of a method for detecting synchronization of data exchange files according to an embodiment of the disclosure;
fig. 3 is a flowchart illustrating another method for detecting synchronization of data exchange files according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating another method for detecting synchronization of data exchange files according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of another detection apparatus for synchronization of data exchange files according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
It should be appreciated that the following specific embodiments of the disclosure are described in order to provide a better understanding of the present disclosure, and that other advantages and effects will be apparent to those skilled in the art from the present disclosure. It will be apparent that the described embodiments are merely some, but not all embodiments of the present disclosure. The disclosure may be embodied or practiced in other different specific embodiments, and details within the subject specification may be modified or changed from various points of view and applications without departing from the spirit of the disclosure. It should be noted that the following embodiments and features in the embodiments may be combined with each other without conflict. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the following claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the present disclosure, one skilled in the art will appreciate that one aspect described herein may be implemented independently of any other aspect, and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. In addition, such apparatus may be implemented and/or such methods practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should also be noted that the illustrations provided in the following embodiments merely illustrate the basic concepts of the disclosure by way of illustration, and only the components related to the disclosure are shown in the drawings and are not drawn according to the number, shape and size of the components in actual implementation, and the form, number and proportion of the components in actual implementation may be arbitrarily changed, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided in order to provide a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
Fig. 1 is a schematic application scenario of a method for detecting synchronization of data exchange files according to an embodiment of the present disclosure, where a first file storage server 10 and a second file storage server 30 are file storage servers in two different network areas, the first file storage server 10 and the second file storage server 30 perform file synchronization through an intermediate connected data exchange system 20, a central control platform 40 is a test platform for summarizing operations and results, which is set up for testing accuracy of file synchronization, and for the first file storage server 10 and the second file storage server 30, the connection between the central control platform 40 and the first file storage server 10 and the second file storage server 30 is a client connection.
Fig. 2 is a flow chart of a method for detecting synchronization of data exchange files according to an embodiment of the present disclosure, where the method for detecting synchronization of data exchange files according to an embodiment of the present disclosure includes the following steps:
s101, in a first file storage server, at least one concurrency operation is executed for a plurality of files to be tested and folders to be tested in different levels.
Optionally, the at least one concurrent operation includes operations of creating a file to be tested, creating a folder to be tested, modifying a file name, modifying file content, deleting a file, modifying a folder name, deleting a folder, and the like.
And S102, after each concurrent operation is finished, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform.
Optionally, a test connection pool is generated on a central control platform (i.e. a test platform), a folder to be tested and a file to be tested are quickly created in a first file storage server through concurrent operation threads, and a new synchronization result is judged in a second file storage server through the corresponding test connection pool, namely whether the newly-built folder to be tested and the file to be tested are successfully synchronized in the second file storage server is judged. After the new synchronization is successful, parallel operations such as file name modification, file content modification, file deletion and the like can be continuously executed in the first file storage server, and synchronization result detection can be continuously executed in the second file storage server.
S103, the first file storage server receives a response message returned by the second file storage server according to the synchronous verification request.
S104, the first file storage server acquires a verification result of whether the concurrent operation is successfully synchronized with the second file storage server according to the response message.
According to the method and the device for testing the files, the files can be generated from the first file storage server until the second file storage server synchronously ends, a large number of testing task amounts can be covered, files to be tested and folders to be tested under different directory levels are generated, testing efficiency and accuracy of data exchange files are improved in a concurrent synchronous mode, and cost of manual testing and resource cost are reduced.
In some embodiments, in the first file storage server, at least one concurrent operation is performed for a number of files under test and folders under test of different levels, including:
calculating the hierarchical structure of the folder to be tested based on the acquired directory information and file information; the directory information at least comprises preset directory depth, and the file information at least comprises preset total number of files, preset total number of folders and preset total size of files;
randomly generating a file structure in each level of the hierarchical structure according to the total number of preset files;
and newly establishing a file to be tested and a folder to be tested in the first file storage server in a concurrent mode based on the test connection pool of the central control platform according to the file structure.
Alternatively, the preset directory depth may be the maximum value of the directory depth, and the hierarchical structure of the folders to be tested is calculated according to the maximum value of the directory depth and the total number of preset folders, and then the file structure is randomly added in each level of the hierarchical structure according to the total number of preset files.
Optionally, the file to be tested and the folder to be tested are generated and operated through a random algorithm, and the operation result is judged and counted through a central control platform, so that the aim of synchronizing the automatic test files is fulfilled.
In some embodiments, according to the file structure, a test connection pool based on a central control platform newly builds a file to be tested and a folder to be tested in a first file storage server in a concurrent manner, including:
randomly selecting a random directory depth which is more than 1 and less than a preset directory depth;
performing a corresponding number of loop operations based on the random directory depth;
reading a folder list under the current path in each cycle operation process;
when the number of the folders obtained at random is not zero, directly entering the corresponding folders to be tested; when the number of the folders acquired randomly is zero, newly building a folder to be tested under the current path and entering the newly built folder to be tested;
When the generated new directory number or the generated directory depth of the random access is the same as the random directory depth, continuously judging whether the total number of the folders acquired randomly reaches the preset total number of the folders;
when the generated directory number or the generated directory depth of the random access is different from the random directory depth, the method is executed to read the folder list under the current path in each circulation operation process.
In some embodiments, the method further comprises:
when the total number of the folders which are randomly acquired does not reach the total number of the preset folders, returning to the root directory, and executing random selection of a random directory depth which is more than 1 and less than the preset directory depth;
when the total number of the folders obtained randomly reaches the total number of the preset folders, randomly selecting a path from the path list;
newly creating a file to be tested in a randomly selected path until the total number of the newly created file to be tested reaches the total number of the preset files; the content of the files to be tested is randomly set, and the sizes of the files to be tested are randomly valued between the ratio of the total size of the preset files to the total number of the preset files, wherein the ratio is larger than 1 and smaller than the total size of the preset files.
Fig. 3 is a flow chart of another method for detecting synchronization of data exchange files according to an embodiment of the present disclosure, where the method for detecting synchronization of data exchange files according to the embodiment of the present disclosure includes the following steps:
S1, setting the depth of a preset directory as A, the total number of preset folders as B, the total number of preset files as C and the total size of the preset files as D.
S2, continuously randomly selecting a random directory depth a from the range between 1 and the preset directory depth A, and cycling for a times.
Wherein, in the process of cycling a times, the generated catalogue is randomly entered each time, or a new catalogue is generated, until the sum of all the selected catalogues is equal to the total number B of the preset folders. And the new catalogue generated each time is recorded and stored, so that the path can be conveniently acquired when the file to be tested is generated.
S3, in each cycle operation process, reading a folder list under the current path, and randomly selecting a value M from 0 to the folder number M.
S4, judging whether the value of m is zero, and if the value of m is not zero, executing the step S5; if the value of m is zero, step S6 is executed.
S5, directly entering a folder to be tested corresponding to the m value, and turning to the step S7.
S6, newly creating a folder to be tested under the current path, and entering the newly created folder to be tested, and turning to the step S7 and the step S13.
S7, judging whether the current directory depth is the same as the random directory depth a, and if so, executing the step S8; if the current directory depth is not a, step S3 is executed.
S8, judging whether the total number of folders reaches the preset total number of folders B, and if so, executing a step S9; if the preset total number of folders B is not reached, step S10 is performed.
S9, randomly selecting a path from the path list.
S10, returning to the root directory, and turning to the step S2.
S11, creating a file to be tested under a randomly selected path, wherein the size of the file to be tested is larger than 1 and smaller than the ratio of the total size of the preset files to the total number of the preset files.
S12, judging whether the total number of the files reaches the preset total number of the files C, and if the total number of the files reaches the preset total number of the files C, ending the new construction process; if the total number of the preset files C is not reached, step S9 is executed.
S13, storing the paths of the newly-built folders into a path list.
S14, obtaining path lists of all newly-built folders.
Wherein the path in step S9 is obtained from the path list of step S14.
In some embodiments, when each concurrent operation is completed, the first file storage server sends a synchronization verification request to the second file storage server through the central control platform, including:
every time a folder to be tested or a file to be tested is newly built, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform;
The second file storage server synchronously builds a correct path according to the detected folder to be detected or the file to be detected in the preset time, and returns a response message of successful synchronous building to the first file storage server through the central control platform; or,
and the second file storage server synchronously builds a correct path according to the fact that the folder to be detected is not detected or the file to be detected is synchronously built in the preset time, and returns a response message of failure in synchronous building to the first file storage server through the central control platform.
Optionally, the preset time may be set to 3 times of the synchronization interval time, that is, the sum of the last synchronization operation time, the synchronization interval time, and the current synchronization operation time, where the value of each operation time selects the synchronization interval time as the theoretical longest time.
In some embodiments, the concurrent operations further include operations of modifying a file name, modifying a file content, and deleting a file, and when each concurrent operation is completed, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform, including:
taking out connections from the test connection pool, wherein each connection randomly enters a folder to be tested from the root directory until only files to be tested exist in the current path;
The concurrent operations of modifying the file name, modifying the file content and deleting the file are sequentially executed for each file to be tested;
after each concurrent operation is finished, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform, and the verification request is finished to be sent when the file to be tested does not exist in the current path and the current path is the root directory.
In some embodiments, the method further comprises:
if the file to be detected does not exist in the current path and the current path is not the root directory, returning to the previous path of the current path;
continuing to modify the name of the folder and delete the folder of the folder to be tested of the previous path;
after the operation of modifying the folder name and deleting the folder is finished each time, a synchronous verification request is sent to a second file storage server through a central control platform;
returning to the root directory when the folder to be tested exists in the previous path, and executing the step of randomly entering one folder to be tested;
and when the file folder to be detected does not exist in the previous path, executing the concurrent operation of modifying the file name, modifying the file content and deleting the file for each file to be detected.
Optionally, after generating the folder to be tested and the file to be tested each time, the central control platform respectively builds the test connection pools with the same number on the first file storage server and the second file storage server, and when the connection in the test connection pool of the first file storage server performs corresponding operation in the same time, the synchronous result detection and judgment are performed through the corresponding connection of the test connection pool of the second file storage server, so as to ensure the accuracy of the test file synchronization between the first file storage server and the second file storage server. Meanwhile, in order to avoid the mutual influence of concurrent operations, the corresponding connection of different test connection pools needs to enter step by step from different folders of the root directory.
Fig. 4 is a flowchart of another method for detecting synchronization of data exchange files according to an embodiment of the present disclosure, where the method for detecting synchronization of data exchange files according to the embodiment of the present disclosure includes the following steps:
a1, the first file storage server takes out the connection in the test connection pool, and each connection enters the folder to be tested from the root directory.
A2, randomly entering a folder to be tested.
A3, judging whether other folders to be tested exist in the current path, and if so, executing the step A2; if no other folder to be tested exists, step A4 is performed.
Optionally, each connection of the test connection pool starts from the root directory and enters into a layer directory to judge whether the layer has the folder to be tested, if the layer has the folder to be tested, the test connection pool continues to randomly enter into a folder to be tested until only the file to be tested is left in the entering path, and then the operation is performed on all the files to be tested in the path.
According to the embodiment of the disclosure, the files to be tested and the folders to be tested in different levels are generated through a generation algorithm; the method comprises the steps that a to-be-detected file and a to-be-detected folder of a first file storage server are operated on a central control platform, and file information is requested to be acquired at a second file storage server for comparison so as to detect the accuracy of synchronization; and using the test connection pool to synchronously detect concurrency so as to improve detection efficiency.
A4, carrying out concurrent operations of modifying file names, modifying file contents and deleting files in sequence for each file to be tested, and turning to the step A5 and the step A10.
A5, judging whether a file to be tested exists in the current path, and if so, executing the step A4; and if the file to be tested does not exist in the current path, executing the step A6.
A6, judging whether the current path is a root directory, and if the current path is the root directory, ending the synchronous detection of the second file storage server; if the current path is not the root directory, step A7 is performed.
A7, returning to the path of the previous stage of the current path.
I.e. the current path is not the root directory, returning to the previous stage of the current directory.
A8, continuing to modify the folder names and delete the folders of the folders to be tested in the previous path, and turning to the step A10.
And simultaneously, after the operations of modifying the folder name and deleting the folder are finished each time, synchronous detection and judgment are carried out on each operation in the second file storage server.
A9, judging whether a folder to be tested exists in the current path, and if the folder to be tested exists in the current path, executing the step A2; if the folder to be tested does not exist under the current path, the step A5 is executed.
According to the embodiment of the disclosure, the synchronous test is finished until all folders to be tested at the first file storage server end are deleted successfully and all detections at the second file storage server end are synchronously finished.
A10, synchronous detection and judgment are carried out on concurrent operation of the first file storage server at the corresponding position of the second file storage server, and a synchronous detection judgment result is obtained.
Optionally, when the first file storage server performs an operation on each file to be tested, the second file storage server also performs synchronous detection and judgment at the corresponding position until all the files to be tested in the path are deleted. Aiming at the file name modifying operation, the second file storage server can directly compare the character strings to judge whether the file name modifying operation is successful in synchronization or not; for the modification operation of the file content, the second file storage server can compare the file sizes and the MD5 values at two ends of the second file storage server and the first file storage server, and if the file sizes at two ends are completely consistent with the MD5 values, the synchronization of the modification operation of the file content is judged to be successful.
In some embodiments, the method further comprises:
when an operation thread corresponding to each concurrent operation randomly enters a folder to be tested from the root directory, locking the root directory;
when the operation of the operation thread on the root directory is completed and all folders to be tested under the root directory are deleted, releasing the root directory and switching the operation thread to an idle state;
and the operation thread in the idle state continuously enters the unlocked root directory to execute concurrent operation until the paths under the root directory are locked, and the operation thread is released.
Optionally, when each operation thread enters from the root directory, the root directory is locked to ensure that other operation threads do not collide with the operation of the thread. And when the operation of the operation thread on the root directory is completed and the folder to be tested under the root directory is also deleted successfully, releasing the operation thread. The operation thread becomes an idle operation thread after the operation thread operates to finally delete the folder to be detected under the root directory, the idle operation thread can continue to enter the unlocked directory to operate, and if paths under the root directory are locked, the operation thread can be released.
According to the embodiment of the disclosure, the files to be tested and the folders to be tested under different levels can be automatically generated and corresponding synchronous detection is carried out, so that the investment of manual testing is reduced, and the cost of manual testing and the cost of resources are reduced; the files to be tested are uniformly covered under each level, so that whether the functions of the tested equipment are stable and efficient during file synchronization can be checked; and by using the test connection pool, a plurality of connections are operated to perform operation verification simultaneously, so that the automatic test efficiency is improved.
For example, for the random names and contents of the files to be tested, it is difficult for the tester to manually add, and moreover, the names of the files to be tested need to be randomly valued in tens of thousands of characters, and the contents of the random files to be tested need to be generated by means of tools. In the synchronous detection process, after the tester needs the source terminal operation (i.e. after the first file storage server terminal operation), the result is checked at the destination terminal (i.e. the second file storage server section), and then the operation at the source terminal is continued, and the operation is repeated until all the operations are completed.
The depth of the manual test directory of the related art can only reach a few layers, and the deeper the directory path is, the more files are stored in the directory path, the more time is consumed by a tester for adding, modifying and deleting. In summary, the automated test of data exchange file synchronization in the embodiment of the disclosure can greatly reduce the manual test time of a tester, and the depth of the test is deeper, and the randomness is increased, so that the test accuracy and efficiency are improved.
Fig. 5 is a schematic structural diagram of another device for detecting synchronization of data exchange files according to an embodiment of the present disclosure, where the embodiment of the present disclosure further provides a device for detecting synchronization of data exchange files, including:
An execution unit 51 configured to execute, in the first file storage server, at least one concurrent operation with respect to a plurality of files to be tested and folders to be tested of different levels;
a transmitting unit 52 configured to transmit a synchronization verification request to the second file storage server through the central control platform when each concurrent operation is completed;
a receiving unit 53 configured to receive a response message returned by the second file storage server according to the synchronization verification request;
and a synchronization verification unit 54 configured to obtain a verification result of whether the concurrent operation is successfully synchronized at the second file storage server according to the response message.
An electronic device according to an embodiment of the present disclosure includes a memory and a processor. The memory is for storing non-transitory computer readable instructions. In particular, the memory may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM) and/or cache memory (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like.
The processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities, and may control other components in the electronic device to perform the desired functions. In one embodiment of the present disclosure, the processor is configured to execute the computer readable instructions stored in the memory, so that the electronic device performs all or part of the steps of the foregoing method for testing data exchange file synchronization of embodiments of the present disclosure.
It should be understood by those skilled in the art that, in order to solve the technical problem of how to obtain a good user experience effect, the present embodiment may also include well-known structures such as a communication bus, an interface, and the like, and these well-known structures are also included in the protection scope of the present disclosure.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. A schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The electronic device shown in fig. 6 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 6, the electronic device may include a processor (e.g., a central processing unit, a graphic processor, etc.) that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) or a program loaded from a storage device into a Random Access Memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processor, ROM and RAM are connected to each other by a bus. An input/output (I/O) interface is also connected to the bus.
In general, the following devices may be connected to the I/O interface: input means including, for example, sensors or visual information gathering devices; output devices including, for example, display screens and the like; storage devices including, for example, magnetic tape, hard disk, etc.; a communication device. The communication means may allow the electronic device to communicate wirelessly or by wire with other devices, such as edge computing devices, to exchange data. While fig. 6 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device, or installed from a storage device, or installed from ROM. All or part of the steps of the test method for data exchange file synchronization of the embodiments of the present disclosure are performed when the computer program is executed by a processor.
The detailed description of the present embodiment may refer to the corresponding description in the foregoing embodiments, and will not be repeated herein.
A computer-readable storage medium according to an embodiment of the present disclosure has stored thereon non-transitory computer-readable instructions. When executed by a processor, perform all or part of the steps of the method of testing data exchange file synchronization of the various embodiments of the disclosure described above.
The computer-readable storage medium described above includes, but is not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or removable hard disk), media with built-in rewritable non-volatile memory (e.g., memory card), and media with built-in ROM (e.g., ROM cartridge).
The detailed description of the present embodiment may refer to the corresponding description in the foregoing embodiments, and will not be repeated herein.
The basic principles of the present disclosure have been described above in connection with specific embodiments, however, it should be noted that the advantages, benefits, effects, etc. mentioned in the present disclosure are merely examples and not limiting, and these advantages, benefits, effects, etc. are not to be considered as necessarily possessed by the various embodiments of the present disclosure. Furthermore, the specific details disclosed herein are for purposes of illustration and understanding only, and are not intended to be limiting, since the disclosure is not necessarily limited to practice with the specific details described.
In this disclosure, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions, and the block diagrams of devices, apparatuses, devices, systems involved in this disclosure are merely illustrative examples and are not intended to require or implicate that connections, arrangements, configurations must be made in the manner shown in the block diagrams. As will be appreciated by one of skill in the art, the devices, apparatuses, devices, systems may be connected, arranged, configured in any manner. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
In addition, as used herein, the use of "or" in the recitation of items beginning with "at least one" indicates a separate recitation, such that recitation of "at least one of A, B or C" for example means a or B or C, or AB or AC or BC, or ABC (i.e., a and B and C). Furthermore, the term "exemplary" does not mean that the described example is preferred or better than other examples.
It is also noted that in the systems and methods of the present disclosure, components or steps may be disassembled and/or assembled. Such decomposition and/or recombination should be considered equivalent to the present disclosure.
Various changes, substitutions, and alterations are possible to the techniques described herein without departing from the teachings of the techniques defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the particular aspects of the process, machine, manufacture, composition of matter, means, methods and acts described above. The processes, machines, manufacture, compositions of matter, means, methods, or acts, presently existing or later to be developed that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein may be utilized. Accordingly, the appended claims are intended to include within their scope such processes, machines, manufacture, compositions of matter, means, methods, or acts.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the disclosure to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (10)

1. A method for detecting synchronization of data exchange files, the method comprising:
in a first file storage server, executing at least one concurrency operation aiming at a plurality of files to be tested and folders to be tested in different levels;
after each concurrent operation is finished, the first file storage server sends a synchronous verification request to a second file storage server;
receiving a response message returned by the second file storage server according to the synchronous verification request;
and acquiring a verification result of whether the concurrent operation is successfully synchronized in the second file storage server according to the response message.
2. The method for detecting synchronization of data exchange files according to claim 1, wherein in the first file storage server, at least one concurrent operation is performed for a plurality of files to be tested and folders to be tested of different levels, including:
Calculating the hierarchical structure of the folder to be tested based on the acquired directory information and file information; the directory information at least comprises preset directory depth, and the file information at least comprises preset total number of files, preset total number of folders and preset total size of files;
randomly generating a file structure in each level of the hierarchical structure according to the total number of the preset files;
and according to the file structure, the file to be tested and the folder to be tested are newly built in the first file storage server in a concurrent mode based on the test connection pool of the central control platform.
3. The method for detecting synchronization of data exchange files according to claim 2, wherein the method for newly building the files to be detected and the folders to be detected in the first file storage server based on the test connection pool of the central control platform in a concurrent manner according to the file structure comprises the following steps:
randomly selecting a random directory depth which is more than 1 and less than the preset directory depth;
performing a corresponding number of loop operations based on the random directory depth;
reading a folder list under the current path in each cycle operation process;
When the number of the folders obtained at random is not zero, directly entering the corresponding folders to be tested; when the number of the folders acquired randomly is zero, newly building a folder to be tested under the current path and entering the newly built folder to be tested;
when the generated new directory number or the generated directory depth of the random access is the same as the random directory depth, continuously judging whether the total number of the randomly acquired folders reaches the total number of the preset folders or not;
and when the generated directory number or the generated directory depth of the random access is different from the random directory depth, executing the process of reading the folder list under the current path in each circulation operation.
4. A method of detecting synchronization of data exchange files according to claim 3, wherein the method further comprises:
returning to the root directory when the total number of the folders obtained at random does not reach the total number of the preset folders, and executing the random selection of a random directory depth which is larger than 1 and smaller than the preset directory depth;
when the total number of the folders obtained randomly reaches the total number of the preset folders, randomly selecting a path from a path list;
newly creating a file to be tested in a randomly selected path until the total number of the newly created file to be tested reaches the total number of the preset files; the content of the file to be tested is randomly set, and the size of the file is randomly valued between a ratio of more than 1 and less than the total size of the preset file to the total number of the preset file.
5. The method for detecting synchronization of data exchange files according to claim 3 or 4, wherein the first file storage server transmits a synchronization verification request to the second file storage server after each of the concurrent operations is completed, comprising:
each time a folder to be tested or a file to be tested is newly built, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform;
the second file storage server is enabled to synchronously establish a correct path according to the fact that the folder to be tested or the file to be tested is detected in a preset time, and a response message of successful synchronization establishment is returned to the first file storage server through the central control platform; or,
and the second file storage server synchronously builds a correct path according to the fact that the folder to be detected or the file to be detected is not detected within a preset time, and returns a response message of failure in synchronous building to the first file storage server through the central control platform.
6. The method according to claim 2, wherein the concurrent operation further includes operations of modifying a file name, modifying a file content, and deleting a file, and when each of the concurrent operations is completed, the first file storage server sends a synchronization verification request to the second file storage server, including:
Taking out connections from the test connection pool, wherein each connection randomly enters one folder to be tested from a root directory until only the file to be tested exists in the current path;
executing concurrent operations of modifying file names, modifying file contents and deleting files in sequence for each file to be tested;
after the concurrent operation is finished each time, the first file storage server sends a synchronous verification request to the second file storage server through the central control platform, and the verification request is finished when the file to be tested does not exist in the current path and the current path is the root directory.
7. The method for detecting synchronization of data exchange files according to claim 6, further comprising:
if the file to be detected does not exist in the current path and the current path is not the root directory, returning to the path of the previous stage of the current path;
continuing to modify the name of the folder and delete the folder of the folder to be tested of the previous path;
after the operation of modifying the folder name and deleting the folder is finished each time, a synchronous verification request is sent to a second file storage server through a central control platform;
Returning to the root directory when the folder to be tested exists in the previous path, and executing the step of randomly entering one folder to be tested;
and when the previous path does not have the folder to be tested, executing the concurrent operation of modifying the file name, modifying the file content and deleting the file for each file to be tested in sequence.
8. The method for detecting synchronization of data exchange files according to claim 6, further comprising:
when each operation thread corresponding to the concurrent operation randomly enters one folder to be tested from the root directory, locking the root directory;
when the operation of the operation thread on the root directory is completed and all folders to be tested under the root directory are deleted, releasing the root directory and switching the operation thread to an idle state;
and the operation thread in the idle state continuously enters an unlocked root directory to execute concurrent operation until paths under the root directory are locked, and the operation thread is released.
9. A device for detecting synchronization of data exchange files, comprising:
the execution unit is configured to execute at least one concurrent operation aiming at a plurality of files to be tested and folders to be tested of different levels in the first file storage server;
A transmitting unit configured to transmit a synchronization verification request to a second file storage server by the first file storage server when each of the concurrent operations is ended;
the receiving unit is configured to receive a response message returned by the second file storage server according to the synchronous verification request;
and the synchronous verification unit is configured to acquire a verification result of whether the concurrent operation is successfully synchronized at the second file storage server according to the response message.
10. An electronic device, the electronic device comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of detecting data exchange file synchronization of any one of claims 1 to 8.
CN202311229945.6A 2023-09-21 2023-09-21 Method and device for detecting synchronization of data exchange files and electronic equipment Pending CN117176741A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311229945.6A CN117176741A (en) 2023-09-21 2023-09-21 Method and device for detecting synchronization of data exchange files and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311229945.6A CN117176741A (en) 2023-09-21 2023-09-21 Method and device for detecting synchronization of data exchange files and electronic equipment

Publications (1)

Publication Number Publication Date
CN117176741A true CN117176741A (en) 2023-12-05

Family

ID=88942932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311229945.6A Pending CN117176741A (en) 2023-09-21 2023-09-21 Method and device for detecting synchronization of data exchange files and electronic equipment

Country Status (1)

Country Link
CN (1) CN117176741A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117422281A (en) * 2023-12-18 2024-01-19 深圳赛桥生物创新技术有限公司 Process file testing method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117422281A (en) * 2023-12-18 2024-01-19 深圳赛桥生物创新技术有限公司 Process file testing method and device, computer equipment and storage medium
CN117422281B (en) * 2023-12-18 2024-03-22 深圳赛桥生物创新技术有限公司 Process file testing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN117176741A (en) Method and device for detecting synchronization of data exchange files and electronic equipment
CN104461693B (en) Virtual machine update method and system under a kind of desktop cloud computing environment
CN110362633B (en) Block data storage method, device, computer equipment and storage medium
TW201232294A (en) Formatting data by example
CN107277016B (en) Authority verification method and device
CN112383610A (en) Synchronous processing method and system for block chain state data
CN114648302B (en) Data processing method and device for collaborative scenario editing
CN109324958A (en) A kind of REST unifies method of calibration, device, equipment and readable storage medium storing program for executing
CN113515303B (en) Project transformation method, device and equipment
CN113190448A (en) Test code updating method and device, electronic equipment and storage medium
CN112527904A (en) Automatic synchronization method and device for associated scripts, computer equipment and storage medium
CN112597023A (en) Case management method and device based on guide picture, computer equipment and storage medium
CN111737349A (en) Data consistency checking method and device
CN115129704A (en) Migration data verification method and system, electronic device and storage medium
CN116561003A (en) Test data generation method, device, computer equipment and storage medium
CN107632864B (en) Method for establishing UEFI Boot Order of specific ordering
CN110896359A (en) Method and system for sequencing multiple network cards
CN109359093A (en) A kind of rule file update method and system
CN115269548A (en) Method and system for generating data warehouse development model and related equipment
CN110928860B (en) Data migration method and device
CN113792026A (en) Deployment method and device of database script and computer readable storage medium
CN113704123A (en) Interface test method, device, equipment and storage medium
CN113342647A (en) Test data generation method and device
CN112965745A (en) System access method, device, equipment and computer readable medium
CN106354830A (en) Device and method for data synchronization of database cluster nodes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination