Synchronous verification method and device, computer storage medium and electronic device
By automatically generating file operation use cases and simulated file operations based on sample data in the shared space, the problem of time-consuming and low efficiency of synchronization verification in the existing technology is solved, and more efficient and reliable synchronization verification is achieved.
Patent Information
- Application Number
- CN202010710510.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-22
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2040-07-22
AI Technical Summary
In the prior art, synchronous verification takes a long time and is less efficient. It relies on manual testing, which makes it easy to miss operations or operation errors, and the test coverage is insufficient.
Based on the sample data in the shared space between the first device and the second device, the file operation use case is automatically generated, the file operation is simulated, the operation message is generated, and the second synchronization disk is triggered to perform synchronization verification to receive the verification result.
It realizes automation of synchronous verification, improves operational efficiency, saves manpower, ensures wider testing coverage and more reliable results.
Smart Images

Figure CN111935249B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a synchronization verification method and device, a computer storage medium, and an electronic device. Background Art
[0002] With the rapid development of computer and network technology, the management of files in computers is also constantly improving. Users have a need for synchronous processing of computer files. They need to synchronize local files to the server so that multiple users can upload, download, and edit files together on the synchronization application to work together. The file collaboration synchronization network disk (hereinafter referred to as the synchronization disk) can realize file synchronization operations, and can also set permissions for users to enable users to download, upload, and collaboratively edit files in the specified directory. In order to verify the accuracy of file synchronization on the synchronization disk, it is necessary to test the synchronization function of the synchronization disk.
[0003] In the related art, a manual testing method is usually adopted, that is, a real person manually performs file operations and manually checks whether the file synchronization results after the operation are accurate. Since the manual testing method relies on manual operation and inspection, the operation is cumbersome and requires a lot of manpower, which is time-consuming and inefficient. At the same time, since it is necessary to manually record what specific file operations have been performed and the expected synchronization results, it is necessary to cover multiple file operations, as well as various file and folder types. Manual operations are prone to omissions or operational errors. In addition, since manual testing is time-consuming and manpower-intensive, it may result in low test coverage.
[0004] Therefore, a new synchronization verification method and device, computer storage medium and electronic device are needed.
[0005] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure. Summary of the invention
[0006] The embodiments of the present disclosure provide a synchronization verification method and device, a computer storage medium and an electronic device, which can solve the technical problems of long synchronization verification time consumption and low efficiency existing in the related art.
[0007] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0008] An embodiment of the present disclosure provides a synchronous verification method, which includes: automatically generating a file operation use case for a first target file in the sample data based on sample data in a shared space between a first synchronous disk of a first device and a second synchronous disk of a second device; automatically simulating the operation on the first target file based on the file operation use case of the first target file to generate a first target file operation message; sending the first target file operation message to the second device to trigger the second synchronous disk to perform synchronous verification of the first target file and generate a verification result; and receiving the verification result sent by the second device.
[0009] An embodiment of the present disclosure provides a synchronization verification method, which includes: receiving a first target file operation message, where the first target file operation message is generated based on an operation on the first target file, a first synchronization disk of a first device and a second synchronization disk of a second device have a shared space, and sample data is contained in the shared space, and the sample data includes the first target file; according to the first target file operation message, triggering a synchronization verification of the first target file in the second synchronization disk to generate a verification result; and sending the verification result.
[0010] An embodiment of the present disclosure provides a synchronous verification device, which includes: a file operation case automatic generation unit, which is used to automatically generate a file operation case for a first target file in the sample data based on sample data in a shared space between a first synchronous disk of a first device and a second synchronous disk of a second device; a file operation message generation unit, which is used to automatically simulate the operation on the first target file based on the file operation case of the first target file, and generate a first target file operation message; a file operation message sending unit, which is used to send the first target file operation message to the second device, so as to trigger the second synchronous disk to perform synchronous verification of the first target file and generate a verification result; and a verification result receiving unit, which is used to receive the verification result sent by the second device.
[0011] An embodiment of the present disclosure provides a synchronization verification device, which includes: a file operation message receiving unit, used to receive a first target file operation message, the first target file operation message is generated according to an operation on the first target file, a first synchronization disk of the first device and a second synchronization disk of the second device have a shared space, and there is sample data in the shared space, and the sample data includes the first target file; a synchronization verification unit, used to trigger the execution of a synchronization verification of the first target file in the second synchronization disk according to the first target file operation message, and generate a verification result; a verification result sending unit, used to send the verification result.
[0012] An embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the synchronization verification method described in the above embodiment is implemented.
[0013] An embodiment of the present disclosure provides an electronic device, comprising: at least one processor; and a storage device configured to store at least one program, so that when the at least one program is executed by the at least one processor, the at least one processor implements the synchronization verification method described in the above embodiment.
[0014] In the technical solutions provided in some embodiments of the present disclosure, on the one hand, based on the sample data in the shared space of the first synchronization disk of the first device and the second synchronization disk of the second device, a file operation use case for the first target file in the sample data can be automatically generated. Through the automated file operation use case, the file operations and file types that need to be covered can be configured, without the need to manually record what specific file operations are to be performed each time and the expected synchronization results. Multiple file operations and various file and folder types can be covered, thereby improving the test coverage and better simulating real user scenarios, thereby making the final verification results more reliable. On the other hand, the operations on the first target file can be automatically simulated based on the file operation use case of the first target file, thereby realizing the automation of synchronization verification. There is no need for manual file operations, which improves operating efficiency, saves a lot of manpower, and ensures that no operations are missed or erroneous operations occur. At the same time, after automatically simulating the operation on the first target file, a first target file operation message can also be generated, and the first target file operation message can be sent to the second device to trigger the second synchronization disk to perform synchronization verification on the first target file, generate a verification result, and receive the verification result sent by the second device. That is, the above-mentioned technical solution can be applied to the verification scenario of the file synchronization accuracy of the synchronization disk, thereby realizing the automation and intelligence of file synchronization verification.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0017] Figure 1A schematic diagram showing an exemplary system architecture to which the synchronization verification method or synchronization verification device of the embodiment of the present disclosure can be applied;
[0018] Figure 2 A schematic diagram of the structure of an electronic device suitable for implementing an embodiment of the present disclosure is shown;
[0019] Figure 3 A flowchart of a synchronization verification method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 4 A schematic diagram schematically shows a scenario of a synchronization verification method according to an embodiment of the present disclosure;
[0021] Figure 5 The following schematically shows a framework flow chart of a synchronization verification method according to an embodiment of the present disclosure;
[0022] Figure 6 A flowchart of a synchronization verification method according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 7 A schematic diagram showing a display of a file in a file list according to an embodiment of the present disclosure is shown schematically;
[0024] Figure 8 A schematic diagram schematically shows performance monitoring data of file synchronization according to an embodiment of the present disclosure;
[0025] Fig. 9 A block diagram of a synchronization verification device according to an embodiment of the present disclosure is schematically shown;
[0026] Fig.10 A block diagram of a synchronization verification device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0028] The features, structures or characteristics described in the present disclosure may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0029] The accompanying drawings are only schematic diagrams of the present disclosure, and the same reference numerals in the drawings represent the same or similar parts, so their repeated description will be omitted. Some block diagrams shown in the accompanying drawings do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in at least one hardware module or integrated circuit, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0030] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and steps, nor must they be executed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0031] In this specification, the terms "a", "an", "the", "said" and "at least one" are used to indicate the presence of at least one element / component / etc.; the terms "comprising", "including" and "having" are used to express an open-ended inclusion and mean that additional elements / components / etc. may exist in addition to the listed elements / components / etc.; the terms "first", "second" and "third" etc. are used only as labels and are not intended to limit the quantity of their objects.
[0032] The exemplary embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0033] Figure 1 A schematic diagram showing an exemplary system architecture that can be applied to a synchronization verification device or a synchronization verification method according to an embodiment of the present disclosure is shown.
[0034] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0035] Server 105 can be an independent server or a server cluster or distributed system composed of multiple servers. It can also be a cloud server (hereinafter referred to as the cloud) that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Any server with computing, storage and other functions will do.
[0036] The terminal devices 101, 102, and 103 have the function of storing files and can interact with the server 105. The terminal devices 101, 102, and 103 can be smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart TVs, smart watches, etc., but are not limited thereto. The terminal devices 101, 102, and 103 and the server 105 can be directly or indirectly connected via wired or wireless communication, and this application does not limit this.
[0037] File synchronization is achieved between the terminal devices 101, 102, 103 and the server 105 through a file synchronization system. The file synchronization system includes synchronization disks determined in multiple terminal devices and corresponding services in the server. In each terminal device, the synchronization disk can be specified by the user, and the specified file path is used as the synchronization disk. The file synchronization system will automatically synchronize the content in the synchronization disk to the server and other terminal devices or according to the user's operation. Creating and modifying files in the synchronization disk of a terminal device can be synchronized to other devices in real time, so that the file content in the synchronization disk of all users will be automatically synchronized to the latest and consistent state.
[0038] According to the embodiments of the present disclosure, administrators can add designated members to a project, share the project's files with them, and work collaboratively. At the same time, they can set file permissions for members, including downloadability and modifiability. The permissions can be used to control the degree of use of different files by different members, thereby reducing project risks.
[0039] Clients can be installed on the terminal devices 101, 102, and 103 respectively, for example, any one or more of a video client, an instant messaging client, a browser client, an education client, a client with a synchronization disk function, etc. Any one of the terminal devices 101, 102, and 103 can be called a first device, and the first device has a first synchronization disk. Any other one of the terminal devices 101, 102, and 103 can be called a second device, and the second device has a second synchronization disk. The first synchronization disk and the second synchronization disk have a shared space, and sample data for verifying the accuracy of file synchronization can be stored in the shared space. , the first device and / or server 105 can automatically generate a file operation use case for the first target file in the sample data, and can automatically simulate the operation on the first target file according to the file operation use case of the first target file to generate a first target file operation message; the first device and / or server 105 can send the first target file operation message to the second device to trigger the second synchronization disk to perform a synchronization check on the first target file and generate a check result; the first device and / or server 105 can receive the check result sent by the second device, thereby knowing whether the synchronization function on the second synchronization disk is normal or abnormal.
[0040] It should be understood that Figure 1 The number of terminal devices, networks and servers in the figure is only for illustration, and any number of terminal devices, networks and servers may be provided according to actual needs.
[0041] Reference below Figure 2 , which shows a schematic diagram of the structure of an electronic device 200 suitable for implementing the technical solution provided in the embodiment of the present application. The electronic device may be a terminal device or a server, Figure 2 The electronic device 200 is taken as a terminal device for illustration, which should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0042] like Figure 2 As shown, the electronic device 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage part 208 into a random access memory (RAM) 203. In the RAM 203, various programs and data required for the operation of the system 200 are also stored. The CPU 201, the ROM 202, and the RAM 203 are connected to each other via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0043] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.
[0044] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 209, and / or installed from a removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, the above-mentioned functions defined in the system of the present application are executed.
[0045] It should be noted that the computer-readable storage medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with at least one wire, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium may also be any computer-readable storage medium other than a computer-readable storage medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0046] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the above-mentioned module, program segment or a part of the code contains at least one executable instruction for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession 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 or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0047] The units involved in the embodiments described in the present application may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a sending unit, an acquiring unit, a determining unit, and a first processing unit. The names of these units do not constitute limitations on the units themselves in some cases.
[0048] As another aspect, the present application also provides a computer-readable storage medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable storage medium carries at least one program, and when the above at least one program is executed by one of the devices, the device can realize functions including: automatically generating a file operation use case for a first target file in the sample data according to the sample data in the shared space of the first synchronization disk of the first device and the second synchronization disk of the second device; automatically simulating the operation for the first target file according to the file operation use case of the first target file, and generating a first target file operation message; sending the first target file operation message to the second device to trigger the second synchronization disk to perform synchronization verification of the first target file and generate a verification result; receiving the verification result sent by the second device.
[0049] It should be understood that any number of elements in the drawings of the present disclosure is for illustration rather than limitation, and any naming is only for distinction rather than having any limiting meaning.
[0050] The following is an explanation of some of the terms involved in the embodiments of the present disclosure.
[0051] File operation: refers to operations on files and folders such as adding, moving, renaming, copying (copy and paste), deleting, editing (updating), etc.
[0052] File synchronization: After a client with the synchronization disk function downloads a file from a server such as the cloud to the local computer, the client will have a corresponding local file (also called a local physical file). When the client performs a file operation on the local file, the corresponding file in the cloud will be updated accordingly; or, when the cloud performs a file operation on the cloud file, the corresponding local file will be updated accordingly. That is, if there is a change in the file operation on one end of the client's local file and the cloud file, the other end will be updated accordingly to maintain the real-time consistency of the file data.
[0053] Synchronous disk: An application with file synchronization function, including the corresponding client and local file directory, i.e. drive letter. The file list in the synchronous disk and the local file directory downloaded to the local will be synchronized with the cloud in real time. Synchronous disk is a cloud storage service that realizes the automatic synchronization of files from the local file directory to the cloud storage.
[0054] Client: The client in the disclosed embodiment refers to an application client with a synchronization disk function. The client has a file directory and list display corresponding to the cloud data, and file operations can be performed on the client. For file operations performed by the client, the local files of the drive letter corresponding to the synchronization disk and the file data in the cloud will be synchronized.
[0055] Drive letter: refers to the local file directory part of the synchronization disk.
[0056] Multi-terminal synchronization of synchronous disks: refers to the file synchronization behavior between at least two synchronous disks. For file data shared by multiple (at least two) synchronous disks, one synchronous disk performs file operations, and other synchronous disks will perform file synchronization in real time. Multi-terminal synchronization of synchronous disks refers to file synchronization between multiple synchronous disks; the file synchronization mentioned above refers to the synchronization of file data between a single synchronous disk and the cloud. Multi-terminal synchronization of synchronous disks is achieved by using the cloud to achieve multi-terminal synchronization between synchronous disks. For example, the synchronous disk on machine A (for example, it can be any terminal device) uploads the local file on machine A to the cloud, and the synchronous disk on machine B (for example, it can be any other terminal device) downloads the cloud file corresponding to the local file from the cloud and generates the corresponding local file on machine B. After that, if the local file is operated on machine A, the cloud will synchronize the corresponding cloud file, and then the cloud will synchronize the synchronized cloud file data to the corresponding local file on machine B, thereby achieving multi-terminal synchronization of synchronous disks on machines A and B.
[0057] Synchronization accuracy: refers to the synchronization operation performed by one end of the synchronization (such as the above-mentioned machine B), which corresponds one-to-one with the operation performed by the end that initiates the file operation (such as the above-mentioned machine A), and the file data after the synchronization is completed is completely consistent.
[0058] The technical solution provided by the embodiments of the present disclosure can be applied to the field of cloud storage using cloud technology.
[0059] Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network within a wide area network or local area network to achieve data calculation, storage, processing, and sharing.
[0060] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.
[0061] Cloud storage is a new concept that extends and develops from the concept of cloud computing. A distributed cloud storage system (hereinafter referred to as storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together and provide external data storage and business access functions.
[0062] At present, the storage method of the storage system is: create a logical volume, and when creating a logical volume, allocate physical storage space for each logical volume. The physical storage space may be composed of disks of a storage device or several storage devices. The client stores data on a logical volume, that is, stores the data on the file system. The file system divides the data into many parts, each of which is an object. The object contains not only data but also additional information such as data identification (identity, ID). The file system writes each object into the physical storage space of the logical volume, and the file system records the storage location information of each object, so that when the client requests to access the data, the file system can allow the client to access the data according to the storage location information of each object.
[0063] The process of the storage system allocating physical storage space to a logical volume is as follows: based on the estimated capacity of the objects stored in the logical volume (this estimate often has a large margin relative to the actual capacity of the objects to be stored) and the grouping of independent redundant disk arrays (RAID, Redundant Array of Independent Disk), the physical storage space is divided into stripes in advance. A logical volume can be understood as a stripe, thereby allocating physical storage space to the logical volume.
[0064] In short, a database can be seen as an electronic filing cabinet - a place where electronic files are stored, and users can add, query, update, delete, and other operations on the data in the files. The so-called "database" is a collection of data that is stored together in a certain way, can be shared with multiple users, has as little redundancy as possible, and is independent of the application.
[0065] A database management system (DBMS) is a computer software system designed for managing databases. It generally has basic functions such as storage, retrieval, security, and backup. Database management systems can be classified according to the database model they support, such as relational, XML (Extensible Markup Language); or according to the type of computer they support, such as server clusters, mobile phones; or according to the query language used, such as SQL (Structured Query Language), XQuery; or according to performance focus, such as maximum scale, maximum operating speed; or other classification methods. Regardless of the classification method used, some DBMS can cross categories, for example, supporting multiple query languages at the same time.
[0066] Based on the technical problems existing in the above-mentioned related technologies, the embodiments of the present disclosure propose a synchronization verification method to at least partially solve the above-mentioned problems. The methods provided by the embodiments of the present disclosure can be executed by any electronic device, such as the above-mentioned Figure 1 The server 105, or any one or more of the terminal devices 101, 102 and 103, or the interaction between the server 105 and the terminal device is not limited in this disclosure.
[0067] Figure 3 The flowchart of the synchronization verification method according to an embodiment of the present disclosure is schematically shown. Figure 3 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0068] In step S310, a file operation use case for a first target file in the sample data is automatically generated according to the sample data in the shared space of the first synchronization disk of the first device and the second synchronization disk of the second device.
[0069] In the disclosed embodiment, the terminal device that initiates the file operation may be referred to as the first device, and the terminal device that performs the corresponding synchronization operation may be referred to as the second device. The synchronization disk on the first device may be referred to as the first synchronization disk, the client on the first synchronization disk may be referred to as the first client, and the local file directory on the first synchronization disk may be referred to as the first drive letter. The synchronization disk on the second device may be referred to as the second synchronization disk, the client on the second synchronization disk may be referred to as the second client, and the local file directory on the second synchronization disk may be referred to as the second drive letter.
[0070] At least one space can be set in the synchronization disk. Users can create spaces in the synchronization disk and add space members to each space. The file operations of members in the shared space will be synchronized to the synchronization disks of each member in the shared space. In the embodiment of the present disclosure, a shared space between the first synchronization disk of the first device and the second synchronization disk of the second device can be established, that is, the first synchronization disk of the first device and the second synchronization disk of the second device are both members of the shared space. For example, a space can be created on the first synchronization disk by the first device, and then the second synchronization disk of the second device is added as a member of the space, and the space becomes a shared space between the first synchronization disk of the first device and the second synchronization disk of the second device. Alternatively, a space can also be created on the second synchronization disk by the second device, and then the first synchronization disk of the first device is added as a member of the space, and the space becomes a shared space between the first synchronization disk of the first device and the second synchronization disk of the second device. Afterwards, if the first device uploads sample data, that is, the first client and the first drive letter of the first device, the second client of the second device and the cloud will synchronize the sample data, and after the second device downloads the sample data in the shared space, that is, the second drive letter of the second device will also have the corresponding local file. The shared space may also include more members and their corresponding synchronization disks. The present disclosure only uses two members as an example for illustration, but is not limited thereto. The present disclosure does not limit the method of creating the shared space.
[0071] In an exemplary embodiment, the method may also include: generating the sample data in the first device, the sample data including different types of files, non-empty folders and empty folders; starting the first synchronization disk on the first device; uploading the sample data in the first synchronization disk to the shared space; sending a sample upload completion notification message to the second device to trigger the second synchronization disk to automatically download the sample data from the shared space; and receiving a sample download completion notification message from the second device.
[0072] In the embodiment of the present disclosure, the sample data may also be referred to as a sample file, which may include various types of files, empty folders, and non-empty folders that need to be covered when testing the synchronization accuracy of the synchronization disk, such as various types of image files, various types of text files, etc., to improve the test coverage. The user may drag the file or folder in the sample file to the first drive letter of the first synchronization disk.
[0073] It should be noted that the order between starting the first synchronization disk and generating sample data in the first device is not limited, and they can be performed in parallel, or the first synchronization disk can be started first and then the sample data can be generated in the first device. This disclosure does not limit this.
[0074] In an exemplary embodiment, based on sample data in a shared space between a first synchronization disk of a first device and a second synchronization disk of a second device, a file operation use case for a first target file in the sample data is automatically generated, which may include: configuring a target operation type and a target file type; filtering a file set that meets the target file type from the sample data; randomly determining the first target file from the file set; and generating a file operation use case for the first target file based on the target operation type and the first target file.
[0075] In an exemplary embodiment, the target file type may include at least one of a folder, a random file type, a file suffix type, and the like.
[0076] For example, 'dir' can represent that the target file type is a folder, and 'empty' can represent that the target file type is random, that is, any type of file, non-empty folder or empty folder is randomly selected from the sample file. Or the target file type can be specified by the file suffix type, for example, 'doc' means that files with the file suffix .doc are selected from the sample file as a file set. The target file type can be set according to actual needs, and this disclosure does not limit this.
[0077] In an exemplary embodiment, the target operation type includes a target file operation type. According to the target operation type and the first target file, generating a file operation use case for the first target file may include: if the target file operation type is any one of a rename operation, a move operation, a copy operation, and an update operation, configuring operation detail data for the first target file; according to the target operation type, the operation detail data, and the first target file, generating a file operation use case for the first target file.
[0078] For example, if the target file operation type is a rename operation, that is, the original file name or original folder name of the first target file is renamed, then the configured operation detail data may include the new file name or new folder name of the first target file (the file after the first target file is renamed is called the renamed file, and its new file name or new folder name is called the identification information of the renamed file). If the target file operation type is a move operation, that is, moving the first target file, then the configured operation detail data may include the relative path of the destination directory after the first target file is moved in the shared space (referred to as the move destination directory). If the target file operation type is a copy operation, then the configured operation detail data may include the relative path of the destination directory after the first target file is copied and pasted in the shared space (referred to as the copy and paste destination directory). If the target file operation type is an update operation, the first target file is edited, then the configured operation detail data may include the size value (size value) and the message digest algorithm value (md5 (Message-Digest Algorithm) value) of the local file after the first target file is updated in the first drive letter of the first synchronization disk. The operation detail data (detail) can be configured according to actual needs, and the present disclosure does not limit this.
[0079] In step S320, according to the file operation use case of the first target file, the operation on the first target file is automatically simulated to generate a first target file operation message.
[0080] In an exemplary embodiment, the target operation type may include a target file operation type and a target operation tag. According to the file operation use case of the first target file, automatically simulating the operation on the first target file may include: if the target operation tag is a file operation on the first client of the first synchronization disk, identifying the user interface (UI) control of the first client; locating the target user interface control in the user interface controls according to the file operation use case of the first target file; simulating the corresponding operation on the target user interface control to simulate the operation on the first target file in the first client.
[0081] In an exemplary embodiment, based on the file operation use case of the first target file, automated simulation of operations on the first target file may also include: if the target operation is marked as a file operation on the first drive letter of the first synchronization disk, then based on the file operation use case of the first target file, simulating the operation on the local file of the first target file in the first drive letter through a script.
[0082] In the embodiment of the present disclosure, the synchronization verification method provided by the first device is used as an example for illustration. The automated file operation by the first device can more realistically simulate the user's usage scenario, and can cover the verification of the file synchronization status of the first device operating the cloud.
[0083] It should be noted that, although the embodiments of the present disclosure are described by taking the execution by the first device as an example, the present disclosure is not limited to this. For the file operations performed by the first device, the file operations in the cloud can also be realized through protocol simulation. For example, the https (Hyper Text Transfer Protocol over Secure Socket Layer) protocol can be used. When the first client of the first device performs an upload operation, the cloud can capture the packet to obtain the https request sent by the first client to the cloud backend, and simulate the https request by modification, and simulate the upload request of the first client to realize the update of the file operation in the cloud. That is, the operations performed on the sample files in the shared space on the first device can also operate the files in the cloud through the protocol. The cloud simulates the operations of the first synchronization disk originally performed by the first device, and the verification of file synchronization on the second device can also be realized.
[0084] In step S330, the first target file operation message is sent to the second device to trigger the second synchronization disk to perform synchronization verification on the first target file and generate a verification result.
[0085] In step S340, the verification result sent by the second device is received.
[0086] In an exemplary embodiment, the method may further include: establishing a socket connection for bidirectional communication between the first device and the second device, so as to send the first target file operation message to the second device and receive the verification result from the second device through the socket connection.
[0087] In the disclosed embodiment, a socket connection can be established between the first device and the second device, so that the second device can directly monitor the file operation performed by the first device and obtain the corresponding notification message (message, abbreviated as msg), such as the first target file operation message, without going through the cloud. The information exchange between the first device and the second device can be done through socket communication, such as the above-mentioned sample upload completion notification message, sample download completion notification message, and the message including the above-mentioned verification result.
[0088] In an exemplary embodiment, the method may further include: if the verification result is a synchronization abnormality, rebuilding the shared space in the first synchronization disk, and re-uploading the sample data in the rebuilt shared space; if the verification result is a normal synchronization, continuing to execute the file operation use case for the second target file in the sample data.
[0089] The synchronization verification method provided by the embodiment of the present disclosure, on the one hand, can automatically generate a file operation case for the first target file in the sample data according to the sample data in the shared space of the first synchronization disk of the first device and the second synchronization disk of the second device. Through the automated file operation case, the file operation and file type to be covered can be configured, without the need to manually record what specific file operation to be performed each time and the expected synchronization result, and can cover a variety of file operations and various file and folder types, thereby improving the test coverage and simulating the real user scenario, so that the final verification result is more reliable; on the other hand, according to the file operation case of the first target file, the operation for the first target file can be automatically simulated, so as to realize the automation of synchronization verification, without the need for manual file operation, improving the operation efficiency, saving a lot of manpower, and ensuring that no operation is missed or erroneous. At the same time, after the automated simulation of the operation for the first target file, a first target file operation message can also be generated, and the first target file operation message can be sent to the second device, so as to trigger the second synchronization disk to perform synchronization verification on the first target file, generate a verification result, and receive the verification result sent by the second device, that is, the above technical solution can be applied to the verification scenario of the file synchronization accuracy of the synchronization disk, realizing the automation and intelligence of file synchronization verification.
[0090] Combine the following Figure 4 and 5 The method provided in the embodiment of the present disclosure is illustrated by way of example. Figure 4 A scenario diagram of a synchronization verification method according to an embodiment of the present disclosure is schematically shown.
[0091] The disclosed embodiment provides a set of verification schemes for the accuracy of synchronization of synchronous disks and multiple terminals, and implements an automated framework, which can automatically complete the test of the synchronization scenario of synchronous disk files and multiple terminals, and output the verification results. Figure 4 As shown, here, the file synchronization between the synchronization disk A (as the first synchronization disk) of machine A (as the first device) and the synchronization disk B (as the second synchronization disk) of machine B (as the second device) is taken as an example for explanation.
[0092] Figure 5 The schematic diagram shows a framework flow chart of a synchronization verification method according to an embodiment of the present disclosure.
[0093] like Figure 5 As shown, the automated design of file operations performed by one end, namely, machine A, which performs file operations may include the following steps.
[0094] The first step, data preparation, can further include the following steps.
[0095] a) Prepare sample files on machine A, which may contain files of different types, empty folders and non-empty folders.
[0096] b) After the synchronization disk A is started, machine A uploads the sample file to the shared space of machine A and machine B. After uploading the sample file, machine A sends a message to machine B through socket communication to notify machine B that the sample upload of machine A is completed, which is called the sample upload completion message. After machine B receives the sample upload completion message, it automatically triggers the synchronization disk B to download the corresponding sample file from the shared space, generates the local file of the synchronization disk B, and constructs a scenario where the machines at both ends can synchronize files.
[0097] The second step is to generate automated file operation use cases, which can further include the following steps.
[0098] a) You can use a list format (for example only, the actual format is not limited) to configure the file operations to be overwritten, taking renaming files and moving folders as an example:
[0099] file_op_list=[{op:'rename-local',file:'doc'},
[0100] {op:'move-client',file:'dir'}]
[0101] Among them, the op value represents the target operation type to be performed. The target operation type can further include the target file operation type, such as any one of the operations such as move, rename, delete, copy, update, etc. The target operation type can also include a target operation tag. For example, if the target operation tag is local, it means a file operation for the first drive letter of the first synchronization disk, which is called a drive letter file operation. Drive letter file operation refers to the system file operation (which may include move, delete, add, rename, copy, edit, etc.) performed on the local files of the corresponding synchronization disk (here taking the first synchronization disk as an example). If the target operation tag is client, it means a file operation for the first client of the first synchronization disk, which is called a client file operation. Client file operation refers to the file operation function provided by the synchronization disk application. For example, the synchronization disk application can operate on files in the file list (which may include move, delete, add, rename, copy, etc.).
[0102] The file value represents the target file type, that is, the configured execution object type. When the value is 'dir', it indicates a folder. When it is empty, it indicates a random file type. Other values can indicate the file suffix type.
[0103] b) The automated program constructs a file directory tree of the shared space based on the database file data of the first synchronization disk, selects a set of files that meet the configuration from the sample files based on the file value configured above, and uses a random function to randomly obtain the specific file object to be currently operated on, such as the first target file, to generate an automated file operation use case. The first target file can be a file or a folder. In this file operation use case, the details of the file operation on the first target file can also be configured through a dictionary format data, such as the relative directory in the space where the first target file is located in the shared space, which is called the target operation directory; the original file name or original folder name of the first target file and the operation detail data configured for the corresponding target file operation type.
[0104] The third step is to automatically generate the above file operation use case, and then know the details of what kind of file operation to perform on the first target file and how to perform the file operation. At this time, the file operation of the first drive letter of the synchronization disk A of machine A and the first client can be automatically simulated, which can further include the following steps.
[0105] a) If the op specifies to perform a client file operation, in the embodiment of the present disclosure, a UI automation method can be used to locate and operate the UI control on the first client to simulate a click event to implement the client file operation.
[0106] For example, UI automation operation can be implemented through Selenium (an automated testing tool for Web applications), and the specific simulation method may include the following steps: identifying the UI control on the first client; locating the specific UI control specified in the file operation use case for the corresponding file operation as the target UI control through the html (Hyper Text Markup Language) attribute of the UI control; then, the corresponding operation on the target user interface control can be simulated to simulate the operation on the first target file in the first client. For example, assuming that the file operation use case specifies that the first target file is to be deleted, first locate the UI control of the first target file, and then simulate a right-click of the mouse on the UI control of the first target file to select to delete the UI control of the first target file, or simulate the delete shortcut key operation input by the keyboard.
[0107] For example, the Python ActionChains library can be used to simulate mouse clicks, double clicks, right clicks, and other operations. The Python PyKeyboard library can also be used to simulate various keyboard typing operations. The present disclosure does not limit which tool or method is used to achieve automated simulation of file operations, as long as automated simulation of file operations can be achieved. For example, it can also be achieved through automated tools such as Keyboard Wizard.
[0108] b) If the op specifies to perform a drive letter file operation, in the embodiment of the present disclosure, the file operation on the local file in the first drive letter can be implemented through a script to simulate the file operation performed by a real user on the first drive letter.
[0109] For example, you can use the Python file operation library shutil to implement drive letter file operations. Taking moving files as an example, you can use the following statement to automate the simulation:
[0110] shutil.move(srcfile,dstfile)
[0111] Among them, srcfile can be specified as the target operation directory of the first target file before moving, and dstfile can be specified as the moving destination directory of the first target file after moving.
[0112] Determine the data communication flow between machine A for automated file operations and machine B for file synchronization. It is assumed that a socket connection has been established between machine A and machine B to enable the following socket two-way communication between machine A and machine B and to send notification messages to each other.
[0113] When machine B (called the synchronization end) completes downloading the sample file, it sends a sample download completion message to machine A (called the operation end), triggering machine A to start executing the file operation in the file operation use case.
[0114] When machine A completes a file operation use case (here, the file operation use case of the first target file is taken as an example), it sends the first target file operation message to machine B through socket communication to notify machine B of the file operation details performed by machine A, triggering the synchronization end machine B to perform file operation synchronization verification. The verification method is as follows: Figure 6 The verification scheme of the file synchronization result described in the embodiment is described.
[0115] The first target file operation message may include the data shown in Table 1 below:
[0116] Table 1
[0117]
[0118] After receiving the first target file operation message, machine B can verify the accuracy of file synchronization according to the first target file operation message. For each file operation, machine B will verify the synchronization results from three aspects: client, drive letter, and database. At this time, the client refers to the client of the synchronization disk B of machine B, that is, the second client; the drive letter refers to the local file directory of the synchronization disk B, that is, the second drive letter; the database refers to the database on machine B. That is, it refers to verifying the client & drive letter & database of machine B. Client verification refers to verifying the content of the file list displayed by the client to determine whether the client file synchronization is accurate; the drive letter verifies whether the local file synchronization is accurate; the database verifies whether the file data synchronization in the database is accurate.
[0119] After the synchronization end machine B verifies the synchronization status of the file operation of machine A, it records the corresponding operation and synchronization status and sends a message to machine A. The specific data of the communication can be shown in the following Table 2:
[0120] Table 2
[0121]
[0122] After receiving the synchronization accuracy verification result from machine B, machine A can perform the following steps:
[0123] i. If the synchronization is normal, machine A continues to execute the next file operation use case, such as the file operation use case of the second target file in the sample set. The generation and execution methods of the file operation use case of the second target file can refer to the first target file.
[0124] ii. If the synchronization is abnormal, machine A can record the specific file operation details through the output log, rebuild the shared space, and re-upload the sample data to avoid the impact of erroneous data, and then continue to perform automated testing.
[0125] The synchronization verification method of the disclosed embodiment, on the one hand, by preparing local files covering multiple types of files and directories on the operating end machine A, and uploading them to the synchronization disk A of machine A, so that machine A will have the file data of the local synchronization disk A, the file data of the database and the data synchronized to the cloud, and then the automation program can select the file set that meets the configuration from the database file data on machine A according to the file value configured in the list format, and then use the random function to randomly obtain the specific file object of the operation from the file set, and perform the file operation to be covered by the op value configuration in the list format on the specific file object, and can also configure the detail of the file operation through the dictionary format data, that is, the file operation use case can be automatically generated, freeing up manpower, and the operation is random, which can better simulate the scene of real users performing file operations, and the file operation and file type to be covered in the automatic configuration file operation use case can make the file operation coverage more comprehensive, avoiding missed operations and erroneous operations. On the other hand, the automation of client file operations and disk letter file operations can be realized through simulation, which improves the efficiency of file operations.
[0126] Figure 6 The flowchart of the synchronization verification method according to an embodiment of the present disclosure is schematically shown. In the embodiment of the present disclosure, the second device is used as an example for illustration. Figure 6 As shown, the method provided by the embodiment of the present disclosure may include the following steps.
[0127] In step S610, a first target file operation message is received, where the first target file operation message is generated based on an operation on the first target file. The first synchronization disk of the first device and the second synchronization disk of the second device have a shared space, and the shared space contains sample data, and the sample data includes the first target file.
[0128] In the embodiment of the present disclosure, the second device can receive the first target file operation message from the first device, and can also receive the first target file operation message from the cloud. In the following examples, receiving the first target file operation message from the first device is used as an example.
[0129] In step S620, according to the first target file operation message, a synchronization check of the first target file in the second synchronization disk is triggered to generate a check result.
[0130] In an exemplary embodiment, the first target file operation message may include a target file operation type, a target operation directory, and identification information of the first target file (eg, an original file name or an original folder name) of the first synchronization disk for the first target file.
[0131] Among them, according to the first target file operation message, triggering the execution of synchronization verification of the first target file in the second synchronization disk and generating a verification result may include: if the target file operation type is an upload operation, then by identifying the user interface control of the second client of the second synchronization disk, the target operation directory of the second client is displayed; if there is a list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, it is determined that the file list synchronization of the second client is normal; combining the identification information of the target operation directory and the first target file to generate a relative path for the uploaded file; if the file relative path column in the database file data of the second synchronization disk contains a path value corresponding to the relative path of the uploaded file, it is determined that the database file data of the second synchronization disk is synchronized normally; if the file list synchronization of the second client is normal, and the database file data synchronization of the second synchronization disk is normal, the verification result is normal synchronization.
[0132] In the disclosed embodiment, the user interface control (UI control) of the second client refers to the HTML element of the file list in the second client of the second synchronization disk. The list item corresponding to the original file name refers to the file HTML element in which the text in the HTML element of each file in the file list corresponds to the uploaded original file name.
[0133] For example, Figure 7 As shown, it is a file displayed in the file list of the second client. Assuming it is the first target file, the identification information of the first target file is the original file name "upload.mov" of the first target file, and the corresponding html element is:
[0134] <div class="a">
[0135] <span title="上传.mov"class="b"> file name
[0136]
[0137] For example, UI automation can be implemented through Python's selenium library. Selenium provides a method element.text() for obtaining the text content of a UI element. Through UI automation, the target operation directory where the first target file uploaded in the second client is located is entered to determine whether there is an element in the current file UI element whose text value corresponds to the original file name of the uploaded first target file. If so, it can be determined that the file list synchronization of the second client is normal; if not, it can be determined that the file list synchronization of the second client is abnormal.
[0138] In the disclosed embodiment, when verifying whether the synchronization of the database file data of the second synchronization disk is normal, for example, assuming that the first target file with the original file name a.txt is uploaded to the local file directory / shared space / folder B / of the second synchronization disk, the corresponding relative path of the uploaded file obtained by the combination is / shared space / folder B / a.txt. In the file table of the database file data of the second synchronization disk, there is a column of relativePath values (referred to as path values) that records the relative path of each file in the second synchronization disk. By judging whether the relativePath of the relative path of the uploaded file obtained by the above combination exists, if it exists, it can be verified that the first target file uploaded by the first synchronization disk and the database file data of the second synchronization disk are synchronized normally; if it does not exist, it can be verified that the synchronization of the database file data of the second synchronization disk is abnormal. If the synchronization of the file list of the second client is abnormal, or the synchronization of the database file data of the second synchronization disk is abnormal, the verification result is determined to be a synchronization abnormality.
[0139] In an exemplary embodiment, triggering the execution of synchronization verification of the first target file in the second synchronization disk according to the first target file operation message and generating a verification result may also include: if the target file operation type is a delete operation, then displaying the target operation directory of the second client by identifying the user interface control of the second client of the second synchronization disk; if there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, it is determined that the file list synchronization of the second client is normal; if the first target file does not exist in the second drive letter of the second synchronization disk, it is determined that the synchronization of the second drive letter is normal; combining the identification information of the target operation directory and the first target file to generate the original file relative path; if the file relative path column in the database file data of the second synchronization disk does not have a path value corresponding to the original file relative path, it is determined that the database file data of the second synchronization disk is synchronized normally; if the file list synchronization of the second client is normal and the second drive letter synchronization is normal, and the database file data of the second synchronization disk is synchronized normally, the verification result is normal synchronization.
[0140] In an exemplary embodiment, the first target file operation message may further include operation detail data for the first target file.
[0141] Among them, according to the first target file operation message, triggering the execution of synchronization verification of the first target file in the second synchronization disk to generate a verification result, can also include: if the target file operation type is a copy operation, the operation detail data includes the copy and paste destination directory; by identifying the user interface control of the second client of the second synchronization disk, the copy and paste destination directory of the second client is displayed; if there is a list item corresponding to the identification information of the first target file in the file user interface element under the copy and paste destination directory of the second client, it is determined that the file list synchronization of the second client is normal; combining the identification information of the copy and paste destination directory and the first target file to generate a relative path of the copied file; if the file relative path column in the database file data of the second synchronization disk has a path value corresponding to the relative path of the copied file, it is determined that the database file data of the second synchronization disk is synchronized normally; if the file list synchronization of the second client is normal, and the database file data of the second synchronization disk is synchronized normally, the verification result is normal synchronization.
[0142] In the embodiment of the present disclosure, similar to the above-mentioned upload operation, the copy and paste destination directory of the first target file can be copied and pasted through UI automation, and it can be determined whether there is an html element in the UI control under the copy and paste destination directory whose text value corresponds to the original file name of the first target file copied and pasted. If so, it can be determined that the file list synchronization of the second client is normal; if not, it can be determined that the file list synchronization of the second client is abnormal.
[0143] In an exemplary embodiment, according to the first target file operation message, triggering the execution of synchronous verification of the first target file in the second synchronization disk to generate a verification result may also include: if the target file operation type is a rename operation, the operation detail data includes the identification information of the renamed file after the first target file is renamed; by identifying the user interface control of the second client of the second synchronization disk, the target operation directory of the second client is displayed; if there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, and there is a list item corresponding to the identification information of the renamed file, it is determined that the file list synchronization of the second client is normal; if the second synchronization disk If the first target file does not exist in the second drive letter of the device, but the renamed file exists, then it is determined that the synchronization of the second drive letter is normal; the identification information of the target operation directory and the renamed file is combined to generate a relative path of the renamed file; the identification information of the target operation directory and the first target file is combined to generate a relative path of the old file; if the file relative path column in the database file data of the second synchronization disk contains a path value corresponding to the relative path of the renamed file, and does not contain a path value corresponding to the relative path of the old file, then it is determined that the synchronization of the database file data of the second synchronization disk is normal; if the file list synchronization of the second client is normal and the synchronization of the second drive letter is normal, and the database file data of the second synchronization disk is synchronized normally, the verification result is that the synchronization is normal.
[0144] In an exemplary embodiment, according to the first target file operation message, triggering the execution of synchronous verification of the first target file in the second synchronization disk to generate a verification result may also include: if the target file operation type is a move operation, the operation detail data includes the move destination directory; by identifying the user interface control of the second client of the second synchronization disk, the target operation directory and the move destination directory of the second client are displayed respectively; if there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, and there is a list item corresponding to the identification information of the first target file in the file user interface element under the move destination directory, it is determined that the file list synchronization of the second client is normal; if the second drive letter of the second synchronization disk If the first target file does not exist in the target operation directory and the first target file exists in the move destination directory, then it is determined that the synchronization of the second drive letter is normal; the identification information of the target operation directory and the first target file are combined to generate a relative path of the file before the move; the identification information of the move destination directory and the first target file are combined to generate a relative path of the file after the move; if the file relative path column in the database file data of the second synchronization disk contains a path value corresponding to the relative path of the file after the move, and does not contain a path value corresponding to the relative path before the move, then it is determined that the synchronization of the database file data of the second synchronization disk is normal; if the file list synchronization of the second client is normal and the second drive letter synchronization is normal, and the file data synchronization of the database of the second synchronization disk is normal, then the verification result is that the synchronization is normal.
[0145] In an exemplary embodiment, according to the first target file operation message, triggering the execution of synchronous verification of the first target file in the second synchronous disk to generate a verification result may also include: if the target file operation type is an update operation, the operation detail data includes the size value and information digest algorithm value of the local file after the first target file is updated in the first drive letter of the first synchronous disk; obtaining the size value and information digest algorithm value of the local file after the first target file is updated in the second drive letter of the second synchronous disk; if the size value and information digest algorithm value of the local file updated by the first target file in the second drive letter of the second synchronous disk respectively match the size value and information digest algorithm value of the local file updated by the first target file in the second drive letter of the first synchronous disk The method comprises the following steps: determining the size value and information digest algorithm value of the local file after the first target file is updated, determining that the synchronization of the second drive letter is normal; obtaining the size value and information digest algorithm value of the corresponding file after the first target file is updated in the database of the second synchronization disk; if the size value and information digest algorithm value of the corresponding file after the first target file is updated in the database of the second synchronization disk respectively match the size value and information digest algorithm value of the local file after the first target file is updated in the first drive letter of the first synchronization disk, determining that the synchronization of the database file data of the second synchronization disk is normal; if the synchronization of the second drive letter is normal, and the synchronization of the database file data of the second synchronization disk is normal, the verification result is that the synchronization is normal.
[0146] In the disclosed embodiment, after the local file of the first target file is updated in the first synchronization disk, the md5 value and size value of the updated local file are obtained as expected values and sent to the second synchronization disk via socket communication as operation detail data.
[0147] In the disclosed embodiment, the file data related to the second synchronization disk includes the UI control display of the file list of the second client & the database file data & the local files of the second drive letter. The synchronization of these three aspects of data may be wrong. Therefore, the synchronization results are checked respectively from the UI control display of the file list of the second client (referred to as the client file list UI check in Table 3) & the database file data (referred to as the database check in Table 3) & the local files of the second drive letter (referred to as the drive letter file check in Table 3). Only when the data of these three aspects are synchronized accurately can the complete consistency of file synchronization be determined.
[0148] Or Figure 5 For example, the synchronization end machine B adopts the corresponding synchronization accuracy verification methods shown in Table 3 below according to the corresponding file operation information included in the first target file operation message sent by machine A:
[0149] Table 3
[0150]
[0151]
[0152] In step S630, the verification result is sent.
[0153] The synchronization verification method provided by the embodiment of the present disclosure can, on the one hand, realize automatic verification of the accuracy of multi-terminal synchronization of files by performing drive letter file consistency verification, client file related UI verification and database file data verification for file operations. Among them, the drive letter file consistency verification can include drive letter file path consistency verification and drive letter file content consistency verification at the same time, and the consistency of the drive letter file content can be verified by judging the md5 value and size value of the file. On the other hand, through the socket communication of multiple machines, it is possible to receive notifications of automatic execution of file operations on other machines without going through the cloud, and then check the synchronization of files through the cloud based on the file operation content of the operating end given by the notification. The verification result of the accuracy of file synchronization is returned to the first device or the cloud in the form of a message through socket communication, and the specific operation details of the synchronization abnormality can be obtained according to the log output during the synchronization process, and the corresponding problem can be troubleshooted.
[0154] There is also a problem in the related art, that is, since manual testing is time-consuming and labor-intensive, it is difficult to perform continuous testing, and it is also difficult to verify the stability of file synchronization and the performance of the machine during the synchronization process.
[0155] In the disclosed embodiment, since the generation, execution and synchronization verification process of the file operation use case all adopt an automated framework, a long-term file synchronization automated verification can be performed. While verifying the accuracy of the file synchronization function based on the verification results, a script can also be called to capture the machine performance data during the automated synchronization process to monitor the resource consumption during the file synchronization process. Furthermore, the captured machine performance data can also be statistically analyzed and plotted to achieve visualization for intuitive viewing.
[0156] For example, you can use Python's psutil library, which can specify a process to capture corresponding machine performance data such as CPU usage and memory usage. During the automation process, the psutil library is used to obtain machine performance data every 5 seconds (for example only) and record it in a local CSV (Comma-Separated Values, also known as character-separated values) file (the format is not limited) to implement performance data monitoring during file synchronization.
[0157] like Figure 8As shown, it is assumed that the process.cpu_percent() method of the psutil library of Python is used to capture the CPU percentage corresponding to the application process every 5 seconds during the file synchronization process. After the final automated file operation and synchronization are completed, the data can be plotted and the mean, percentile and other data can be calculated.
[0158] The synchronization verification method provided in the embodiment of the present disclosure can determine whether there are any resource anomalies during file operations and synchronization, such as memory leaks, by monitoring resource consumption, and can promptly discover abnormal resource growth by comparing with historical data.
[0159] Fig. 9 The block diagram of a synchronization verification device according to an embodiment of the present disclosure is schematically shown. Fig. 9 As shown, the synchronization verification device 900 provided in the embodiment of the present disclosure may include: a file operation use case automatic generation unit 910, a file operation message generation unit 920, a file operation message sending unit 930 and a verification result receiving unit 940.
[0160] In the disclosed embodiment, the file operation use case automatic generation unit 910 can be used to automatically generate a file operation use case for a first target file in the sample data based on the sample data in the shared space of the first synchronization disk of the first device and the second synchronization disk of the second device. The file operation message generation unit 920 can be used to automatically simulate the operation on the first target file based on the file operation use case of the first target file to generate a first target file operation message. The file operation message sending unit 930 can be used to send the first target file operation message to the second device so as to trigger the second synchronization disk to perform a synchronization check on the first target file and generate a check result. The check result receiving unit 940 can be used to receive the check result sent by the second device.
[0161] The synchronization verification device provided by the embodiment of the present disclosure, on the one hand, can automatically generate a file operation case for the first target file in the sample data according to the sample data in the shared space of the first synchronization disk of the first device and the second synchronization disk of the second device. Through the automated file operation case, the file operation and file type to be covered can be configured, without the need to manually record what specific file operation to be performed each time and the expected synchronization result, and can cover multiple file operations and various file and folder types, thereby improving the test coverage and simulating the real user scenario, so that the final verification result is more reliable; on the other hand, it can also automatically simulate the operation for the first target file according to the file operation case of the first target file, realize the automation of synchronization verification, without the need for manual file operation, improve the operation efficiency, save a lot of manpower, and ensure that there is no missing operation or wrong operation. At the same time, after the automated simulation of the operation for the first target file, a first target file operation message can also be generated, and the first target file operation message can be sent to the second device, so as to trigger the second synchronization disk to perform synchronization verification on the first target file, generate a verification result, and receive the verification result sent by the second device, that is, the above technical solution can be applied to the verification scenario of the file synchronization accuracy of the synchronization disk, realizing the automation and intelligence of file synchronization verification.
[0162] In an exemplary embodiment, the file operation case automatic generation unit 910 may include: a file operation configuration unit, which can be used to configure the target operation type and the target file type; a file collection screening unit, which can be used to screen a file collection that meets the target file type from the sample data; a target file determination unit, which can be used to randomly determine the first target file from the file collection; a file operation case generation unit, which can be used to generate a file operation case for the first target file based on the target operation type and the first target file.
[0163] In an exemplary embodiment, the target operation type may include a target file operation type and a target operation tag. The file operation message generating unit 920 may include: a user interface control identification unit, which may be used to identify the user interface control of the first client if the target operation tag is a file operation of the first client of the first synchronization disk; a target user interface control positioning unit, which may be used to locate the target user interface control in the user interface control according to the file operation use case of the first target file; and a client file operation automatic simulation unit, which may be used to simulate the corresponding operation of the target user interface control to simulate the operation of the first target file in the first client.
[0164] In an exemplary embodiment, the file operation message generation unit 920 may also include: a drive letter file automatic simulation operation unit, which can be used to simulate the operation of the local file of the first target file in the first drive letter through a script according to the file operation use case of the first target file if the target operation is marked as a file operation for the first drive letter of the first synchronization disk.
[0165] In an exemplary embodiment, the target operation type may include a target file operation type. The file operation use case generation unit may include: an operation detail configuration unit, which may be used to configure operation detail data for the first target file if the target file operation type is any one of a rename operation, a move operation, a copy operation, and an update operation; and a first file operation use case generation unit, which may be used to generate a file operation use case for the first target file according to the target operation type, the operation detail data, and the first target file.
[0166] In an exemplary embodiment, the target file type may include at least one of a folder, a random file type, a file suffix type, and the like.
[0167] In an exemplary embodiment, the synchronization verification device 900 may also include: a sample data generation unit, which can be used to generate the sample data in the first device, and the sample data includes different types of files, non-empty folders and empty folders; a first synchronization disk startup unit, which can be used to start the first synchronization disk on the first device; a sample data upload unit, which can be used to upload the sample data in the first synchronization disk to the shared space; a sample upload completion notification unit, which can be used to send a sample upload completion notification message to the second device, so as to trigger the second synchronization disk to automatically download the sample data from the shared space; a sample download completion notification receiving unit, which can be used to receive a sample download completion notification message from the second device.
[0168] In an exemplary embodiment, the synchronization verification device 900 may also include: a socket connection establishment unit, which can be used to establish a socket connection for bidirectional communication between the first device and the second device, so as to send the first target file operation message to the second device and receive the verification result from the second device through the socket connection.
[0169] In an exemplary embodiment, the synchronization verification device 900 may also include: a shared space reconstruction unit, which can be used to rebuild the shared space in the first synchronization disk and re-upload the sample data in the reconstructed shared space if the verification result is a synchronization abnormality; a second file operation use case execution unit, which can be used to continue executing the file operation use case for the second target file in the sample data if the verification result is a normal synchronization.
[0170] Other contents of the synchronization verification device of the embodiment of the present disclosure may refer to the above embodiment.
[0171] Fig.10 The block diagram of a synchronization verification device according to an embodiment of the present disclosure is schematically shown. Fig.10 As shown, the synchronization verification device 1000 provided in the embodiment of the present disclosure may include: a file operation message receiving unit 1010, a synchronization verification unit 1020 and a verification result sending unit 1030.
[0172] In the embodiment of the present disclosure, the file operation message receiving unit 1010 can be used to receive a first target file operation message, the first target file operation message is generated according to the operation on the first target file, the first synchronization disk of the first device and the second synchronization disk of the second device have a shared space, the shared space contains sample data, and the sample data may include the first target file. The synchronization verification unit 1020 can be used to trigger the execution of synchronization verification of the first target file in the second synchronization disk according to the first target file operation message, and generate a verification result. The verification result sending unit 1030 can be used to send the verification result.
[0173] The synchronization verification device provided by the embodiment of the present disclosure can, on the one hand, realize automatic verification of the accuracy of multi-terminal synchronization of files by performing drive letter file consistency verification, client file related UI verification and database file data verification for file operations. Among them, the drive letter file consistency verification can simultaneously include the drive letter file path consistency verification and the drive letter file content consistency verification, and the consistency of the drive letter file content can be verified by judging the md5 value and size value of the file. On the other hand, through the socket communication of multiple machines, it is possible to receive notifications of automatic execution of file operations on other machines without going through the cloud, and then check the synchronization of files through the cloud based on the file operation content of the operating end given by the notification. The verification result of the accuracy of file synchronization is returned to the first device or the cloud in the form of a message through socket communication, and the specific operation details of the synchronization abnormality can be obtained based on the log output during the synchronization process, and the corresponding problem can be troubleshooted.
[0174] In an exemplary embodiment, the first target file operation message may include the target file operation type, target operation directory and identification information of the first target file of the first synchronization disk for the first target file. The synchronization verification unit 1020 may include: an upload target operation directory display unit, which may be used to display the target operation directory of the second client by identifying the user interface control of the second client of the second synchronization disk if the target file operation type is an upload operation; a client upload synchronization normal determination unit, which may be used to determine that the file list synchronization of the second client is normal if there is a list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client; an upload file relative path generation unit, which may be used to combine the target operation directory and the identification information of the first target file to generate an upload file relative path; a database file data upload synchronization normal determination unit, which may be used to determine that the database file data of the second synchronization disk is synchronized normally if there is a path value corresponding to the upload file relative path in the file relative path column in the database file data of the second synchronization disk; and a synchronization disk upload synchronization normal determination unit, which may be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file list synchronization of the second client and the database file data of the second synchronization disk are synchronized normally.
[0175] In an exemplary embodiment, the synchronization verification unit 1020 may further include: a deletion target operation directory display unit, which may be used to display the target operation directory of the second client by identifying the user interface control of the second client of the second synchronization disk if the target file operation type is a deletion operation; a client deletion synchronization normal determination unit, which may be used to determine that the file list synchronization of the second client is normal if there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client; a drive letter deletion synchronization normal determination unit, which may be used to determine that the synchronization of the second drive letter is normal if the first target file does not exist in the second drive letter of the second synchronization disk; an original file relative path generation unit, which is used to combine the target operation directory and the identification information of the first target file to generate an original file relative path; a database file data deletion synchronization normal determination unit, which may be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file relative path column in the database file data of the second synchronization disk does not have a path value corresponding to the original file relative path; a synchronization disk deletion synchronization normal determination unit, which may be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the synchronization of the file list of the second client and the synchronization of the second drive letter are normal, and the synchronization of the database file data of the second synchronization disk is normal.
[0176] In an exemplary embodiment, the first target file operation message may also include operation detail data for the first target file. The synchronization verification unit may also include: a copy and paste destination directory acquisition unit, which may be used to determine that if the target file operation type is a copy operation, the operation detail data includes the copy and paste destination directory; a copy and paste destination directory display unit, which may be used to display the copy and paste destination directory of the second client by identifying the user interface control of the second client of the second synchronization disk; a client copy and paste synchronization normal determination unit, which may be used to determine that the file list synchronization of the second client is normal if there is a list item corresponding to the identification information of the first target file in the file user interface element under the copy and paste destination directory of the second client; a copy file relative path generation unit, which may be used to combine the identification information of the copy and paste destination directory and the first target file to generate a copy file relative path; a database file data copy and synchronization normal determination unit, which may be used to determine that the database file data of the second synchronization disk is synchronized normally if there is a path value corresponding to the copy file relative path in the file relative path column in the database file data of the second synchronization disk; a synchronization disk copy and synchronization normal determination unit, which may be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file list synchronization of the second client is normal and the database file data of the second synchronization disk is synchronized normally.
[0177] In an exemplary embodiment, the synchronization verification unit 1020 may also include: a rename file identification information acquisition unit, which can be used to, if the target file operation type is a rename operation, then the operation detail data includes the identification information of the renamed file after the first target file is renamed; a rename target operation directory display unit, which can be used to display the target operation directory of the second client by identifying the user interface control of the second client of the second synchronization disk; a client rename synchronization normal judgment unit, which can be used to determine that the file list synchronization of the second client is normal if there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, and there is a list item corresponding to the identification information of the renamed file; a drive letter rename synchronization normal judgment unit, which can be used to determine that the first target file does not exist in the second drive letter of the second synchronization disk, and there is a list item corresponding to the identification information of the renamed file. the renamed file, then it is determined that the synchronization of the second drive letter is normal; the renamed file relative path generation unit can be used to combine the target operation directory and the identification information of the renamed file to generate the renamed file relative path; the old file relative path generation unit can be used to combine the target operation directory and the identification information of the first target file to generate the old file relative path; the database file data renaming synchronization normal determination unit can be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file relative path column in the database file data of the second synchronization disk has a path value corresponding to the relative path of the renamed file, and does not have a path value corresponding to the relative path of the old file; the synchronous disk renaming synchronization normal determination unit can be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file list synchronization of the second client and the second drive letter synchronization are normal, and the database file data of the second synchronization disk are synchronized normally, then the verification result is that the synchronization is normal.
[0178] In an exemplary embodiment, the synchronization verification unit 1020 may also include: a mobile destination directory acquisition unit, which can be used to, if the target file operation type is a move operation, the operation detail data includes the move destination directory; a mobile directory display unit, which can be used to display the target operation directory and the move destination directory of the second client respectively by identifying the user interface control of the second client of the second synchronization disk; a client mobile synchronization normal judgment unit, which can be used to, if there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, and there is a list item corresponding to the identification information of the first target file in the file user interface element under the move destination directory, then determine that the file list synchronization of the second client is normal; a drive letter move synchronization normal judgment unit, which can be used to, if the first target file does not exist in the target operation directory of the second drive letter of the second synchronization disk, and the move If the first target file exists in the destination directory, it is determined that the synchronization of the second drive letter is normal; the relative path generation unit for files before movement can be used to combine the identification information of the target operation directory and the first target file to generate the relative path of the file before movement; the relative path generation unit for files after movement can be used to combine the identification information of the destination directory for movement and the first target file to generate the relative path of the file after movement; the database file data movement synchronization normal determination unit can be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file relative path column in the database file data of the second synchronization disk has a path value corresponding to the relative path of the file after movement, and does not have a path value corresponding to the relative path before movement; the synchronization disk movement synchronization normal determination unit can be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the file list synchronization of the second client and the synchronization of the second drive letter are normal, and the file data synchronization of the database of the second synchronization disk is normal.
[0179] In an exemplary embodiment, the synchronization verification unit 1020 may also include: a first updated local file content information acquisition unit, which can be used to, if the target file operation type is an update operation, then the operation detail data includes the size value and information digest algorithm value of the local file after the first target file is updated in the first drive letter of the first synchronization disk; a second updated local file content information acquisition unit, which can be used to acquire the size value and information digest algorithm value of the local file after the first target file is updated in the second drive letter of the second synchronization disk; a drive letter update synchronization normal judgment unit, which can be used to, if the size value and information digest algorithm value of the local file after the first target file is updated in the second drive letter of the second synchronization disk respectively match the size value and information digest algorithm value of the local file updated by the first target file in the first drive letter of the first synchronization disk. the information digest algorithm value is matched with the local file size value and the information digest algorithm value of the first target file in the first drive letter of the first synchronization disk, then it is determined that the synchronization of the second drive letter is normal; the updated database content information acquisition unit can be used to obtain the size value and the information digest algorithm value of the corresponding file after the first target file is updated in the database of the second synchronization disk; the database file data update synchronization normal determination unit can be used to determine that the synchronization of the database file data of the second synchronization disk is normal if the size value and the information digest algorithm value of the corresponding file after the first target file is updated in the database of the second synchronization disk respectively match the size value and the information digest algorithm value of the local file after the first target file is updated in the first drive letter of the first synchronization disk; the synchronization disk update synchronization normal determination unit can be used to determine that the synchronization result is normal if the synchronization of the second drive letter is normal and the synchronization of the database file data of the second synchronization disk is normal.
[0180] Other contents of the synchronization verification device of the embodiment of the present disclosure may refer to the above embodiment.
[0181] It should be noted that although several units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0182] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0183] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0184] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A synchronization verification method, characterized in that: include: Automatically generate a file operation use case for a first target file in the sample data according to sample data in a shared space of a first synchronization disk of a first device and a second synchronization disk of a second device; According to the file operation use case of the first target file, automatically simulate the operation on the first target file and generate a first target file operation message; Sending the first target file operation message to the second device to trigger the second synchronization disk to perform synchronization verification on the first target file and generate a verification result; Receive the verification result sent by the second device.
2. The method according to claim 1, characterized in that: Automatically generating a file operation use case for a first target file in the sample data according to sample data in a shared space of a first synchronization disk of a first device and a second synchronization disk of a second device, including: Configure the target operation type and target file type; Filtering a file set that matches the target file type from the sample data; Randomly determine the first target file from the file set; A file operation use case for the first target file is generated according to the target operation type and the first target file.
3. The method according to claim 2, characterized in that The target operation type includes a target file operation type and a target operation tag; wherein, according to a file operation use case of the first target file, automatically simulating an operation on the first target file includes: If the target operation is marked as a file operation of the first client of the first synchronization disk, identifying a user interface control of the first client; Locating a target user interface control among the user interface controls according to a file operation use case of the first target file; A corresponding operation on the target user interface control is simulated to simulate an operation on the first target file in the first client.
4. The method according to claim 3, characterized in that According to the file operation use case of the first target file, automatically simulating the operation on the first target file further includes: If the target operation is marked as a file operation on the first drive letter of the first synchronization disk, the operation on the local file of the first target file in the first drive letter is simulated through a script according to a file operation use case of the first target file.
5. The method according to claim 2, characterized in that: The target operation type includes a target file operation type; wherein, according to the target operation type and the first target file, generating a file operation use case for the first target file includes: If the target file operation type is any one of a rename operation, a move operation, a copy operation and an update operation, then configuring operation detail data for the first target file; A file operation use case for the first target file is generated according to the target operation type, the operation detail data and the first target file.
6. The method according to any one of claims 1 to 5, characterized in that: Also includes: generating the sample data in the first device, the sample data including different types of files, non-empty folders and empty folders; Starting the first synchronization disk on the first device; Uploading the sample data to the shared space in the first synchronization disk; Sending a sample upload completion notification message to the second device, so as to trigger the second synchronization disk to automatically download the sample data from the shared space; A sample download completion notification message is received from the second device.
7. The method according to claim 1, characterized in that Also includes: A socket connection for bidirectional communication is established between the first device and the second device, so as to send the first target file operation message to the second device and receive the verification result from the second device through the socket connection.
8. The method according to claim 1, characterized in that Also includes: If the verification result is a synchronization anomaly, rebuilding the shared space in the first synchronization disk, and re-uploading the sample data in the rebuilt shared space; If the verification result is that the synchronization is normal, the file operation use case for the second target file in the sample data continues to be executed.
9. A synchronization verification method, characterized in that: include: receiving a first target file operation message, wherein the first target file operation message is automatically generated according to sample data in a shared space of a first synchronization disk of a first device and a second synchronization disk of a second device, and a file operation use case for a first target file in the sample data; According to a file operation use case of the first target file, an automatic simulation is generated for the operation of the first target file, wherein a first synchronization disk of the first device and a second synchronization disk of the second device have a shared space, and sample data are contained in the shared space, and the sample data include the first target file; triggering, according to the first target file operation message, execution of synchronization verification of the first target file in the second synchronization disk, and generating a verification result; The verification result is sent.
10. The method according to claim 9, characterized in that The first target file operation message includes a target file operation type, a target operation directory, and identification information of the first target file of the first synchronization disk; wherein, according to the first target file operation message, triggering execution of a synchronization check of the first target file in the second synchronization disk, and generating a check result, includes: If the target file operation type is an upload operation, displaying the target operation directory of the second client by identifying a user interface control of the second client of the second synchronization disk; If a list item corresponding to the identification information of the first target file exists in the file user interface element under the target operation directory of the second client, it is determined that the file list synchronization of the second client is normal; Combining the target operation directory and the identification information of the first target file to generate a relative path for the uploaded file; If the file relative path column in the database file data of the second synchronization disk contains a path value corresponding to the relative path of the uploaded file, it is determined that the synchronization of the database file data of the second synchronization disk is normal; If the file list of the second client is synchronized normally, and the database file data of the second synchronization disk is synchronized normally, the verification result is that the synchronization is normal.
11. The method according to claim 10, characterized in that triggering, according to the first target file operation message, to execute synchronization verification of the first target file in the second synchronization disk and generating a verification result, further comprising: If the target file operation type is a deletion operation, displaying the target operation directory of the second client by identifying a user interface control of the second client of the second synchronization disk; If there is no list item corresponding to the identification information of the first target file in the file user interface element under the target operation directory of the second client, it is determined that the file list synchronization of the second client is normal; If the first target file does not exist in the second drive letter of the second synchronization disk, it is determined that the synchronization of the second drive letter is normal; Combining the target operation directory and the identification information of the first target file to generate a relative path of the original file; If the file relative path column in the database file data of the second synchronization disk does not contain a path value corresponding to the original file relative path, it is determined that the synchronization of the database file data of the second synchronization disk is normal; If the file list of the second client is synchronized normally, the second drive letter is synchronized normally, and the database file data of the second synchronization disk is synchronized normally, the verification result is that the synchronization is normal.
12. The method according to claim 10, characterized in that The first target file operation message also includes operation detail data for the first target file. If the target file operation type is a copy operation, the operation detail data includes a copy and paste destination directory; if the target file operation type is a rename operation, the operation detail data includes identification information of a renamed file after the first target file is renamed; if the target file operation type is a move operation, the operation detail data includes a move destination directory; if the target file operation type is an update operation, the operation detail data includes a size value and an information digest algorithm value of a local file after the first target file is updated in the first drive letter of the first synchronization disk; wherein, according to the first target file operation message, triggering execution of synchronization verification of the first target file in the second synchronization disk to generate a verification result, further includes: By identifying the user interface control of the second client of the second synchronization disk, the copy and paste destination directory of the second client is displayed, or the target operation directory of the second client is displayed, or the target operation directory and the move destination directory of the second client are displayed respectively; or, the size value and information digest algorithm value of the local file after the first target file is updated in the second drive letter of the second synchronization disk are obtained; If a list item corresponding to the identification information of the first target file exists in the file user interface element under the copy-and-paste destination directory of the second client; or, if a list item corresponding to the identification information of the first target file does not exist in the file user interface element under the target operation directory of the second client, and a list item corresponding to the identification information of the renamed file exists; or, if a list item corresponding to the identification information of the first target file does not exist in the file user interface element under the target operation directory of the second client, and a list item corresponding to the identification information of the first target file exists in the file user interface element under the move destination directory; or, if the size value and information digest algorithm value of the updated local file of the first target file in the second drive letter of the second synchronization disk respectively match the size value and information digest algorithm value of the updated local file of the first target file in the first drive letter of the first synchronization disk, then it is determined that the file list synchronization of the second client is normal; If the first target file does not exist in the second drive letter of the second synchronization disk, and the renamed file exists; or if the first target file does not exist in the target operation directory of the second drive letter of the second synchronization disk, and the first target file exists in the move destination directory, it is determined that the synchronization of the second drive letter is normal; Combine the identification information of the copy and paste destination directory and the first target file to generate a relative path for the copied file, if the file relative path column in the database file data of the second synchronization disk has a path value corresponding to the relative path of the copied file; or, combine the identification information of the target operation directory and the renamed file to generate a relative path for the renamed file, combine the identification information of the target operation directory and the first target file to generate a relative path for the old file, if the file relative path column in the database file data of the second synchronization disk has a path value corresponding to the relative path of the renamed file, and does not have a path value corresponding to the relative path of the old file; or, combine the identification information of the target operation directory and the first target file to generate a relative path for the file before the move path, combining the identification information of the moving destination directory and the first target file to generate a relative path of the file after the move, if the file relative path column in the database file data of the second synchronization disk has a path value corresponding to the relative path of the file after the move, and does not have a path value corresponding to the relative path before the move; or, obtaining the size value and information digest algorithm value of the corresponding file after the first target file is updated in the database of the second synchronization disk, if the size value and information digest algorithm value of the corresponding file after the first target file is updated in the database of the second synchronization disk respectively match the size value and information digest algorithm value of the local file after the first target file is updated in the first drive letter of the first synchronization disk, then it is determined that the synchronization of the database file data of the second synchronization disk is normal; If the file list of the second client is synchronized normally, the second drive letter is synchronized normally, and the file data of the database of the second synchronization disk is synchronized normally, the verification result is that the synchronization is normal.
13. A synchronization verification device, characterized in that: include: A file operation case automatic generation unit, configured to automatically generate a file operation case for a first target file in the sample data according to sample data in a shared space of a first synchronization disk of a first device and a second synchronization disk of a second device; A file operation message generating unit, configured to automatically simulate an operation on the first target file according to a file operation use case of the first target file, and generate a first target file operation message; A file operation message sending unit, configured to send the first target file operation message to the second device, so as to trigger the second synchronization disk to perform synchronization verification on the first target file and generate a verification result; A verification result receiving unit is used to receive the verification result sent by the second device.
14. A computer storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the synchronization verification method according to any one of claims 1 to 12 is implemented.
15. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the synchronization verification method as described in any one of claims 1 to 12. 16 . A computer program product, comprising a computer program, the computer program containing program codes for executing the synchronization checking method according to claim 1 .
Citation Information
Patent Citations
A method and apparatus for data synchronization
CN109471901A
Restoring a directory to a state prior to a past synchronization event
US20200133782A1