Data verification method, storage medium, and electronic device

By obtaining data features and using assertion messages for filtering, the problem of low efficiency in data synchronization verification is solved, thus simplifying the verification process and improving efficiency.

CN116405248BActive Publication Date: 2026-01-23QINGDAO HAIER TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310184089.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2026-01-23
Estimated Expiration
2043-02-28

AI Technical Summary

Technical Problem

The existing technology for verifying whether data files have been successfully synchronized is complex and inefficient.

Method used

By acquiring the data characteristics and assertion messages of the data to be synchronized, the assertion messages are filtered based on the data characteristics to obtain filtered messages. The filtered messages are then used to determine whether the data synchronization is successful, avoiding field-by-field comparisons.

Benefits of technology

It simplifies the data synchronization and verification process and improves verification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116405248B_ABST
    Figure CN116405248B_ABST
Patent Text Reader

Abstract

The application discloses a data verification method, a storage medium and an electronic device, and relates to the field of smart homes. The data verification method comprises the following steps: acquiring data features of to-be-synchronized data and assertion messages, wherein the assertion messages are used for representing messages generated at assertion positions in the process of synchronizing the to-be-synchronized data; filtering the assertion messages based on the data features to obtain filtered messages; and determining whether the to-be-synchronized data is successfully synchronized based on the filtered messages. The application solves the technical problem of low verification efficiency when verifying whether to-be-synchronized data is successfully synchronized in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of smart home, in particular, to a data verification method, a storage medium and an electronic device. BACKGROUND

[0002] With the continuous development of network services, a service system often needs many data processing devices to support the operation of the system. In order to synchronize the data files between multiple devices, so that the service can be normally executed, the user usually directly configures the data files to be synchronized in the server, such as a cloud server, according to the user's own needs, and then synchronizes the configured data files to the target device through a network, such as a local area network.

[0003] However, when verifying whether the data files are synchronized, the data files received by the target device are usually compared with the data files configured by the user one by one, which leads to a complex process of verifying whether the data files are synchronized successfully and low verification efficiency.

[0004] At present, there is no effective solution to the above problems. SUMMARY

[0005] The embodiments of the present application provide a data verification method, a storage medium and an electronic device to at least solve the technical problem of low verification efficiency in verifying whether the to-be-synchronized data is synchronized successfully in the related art.

[0006] According to an aspect of an embodiment of the present application, a data verification method is provided, including: obtaining data characteristics of to-be-synchronized data and assertion messages, wherein the assertion messages are used to represent messages generated at assertion positions in the process of synchronizing the to-be-synchronized data; filtering the assertion messages based on the data characteristics to obtain filtered messages; and determining whether the to-be-synchronized data is synchronized successfully based on the filtered messages.

[0007] Optionally, filtering the assertion messages based on the data characteristics to obtain the filtered messages includes: reorganizing the data characteristics according to a preset data format to obtain expected messages; and screening the assertion messages based on the expected messages to determine the filtered messages.

[0008] Optionally, reorganizing the data characteristics according to the preset data format to obtain the expected messages includes: obtaining an interface type of an interface used to transmit the to-be-synchronized data; determining a target field matched with the interface type from the to-be-synchronized data based on the interface type; and reorganizing the data characteristics and the target field according to a preset format to obtain the expected messages.

[0009] Optionally, the filtering the assertion message based on the expected message comprises: filtering a first filtering result from the assertion message based on a structural feature of the expected message; in response to the first filtering result being not empty, filtering a second filtering result from the first filtering result based on a preset feature and a target field of the expected message; and in response to the second filtering result being not empty, determining the second filtering result as the filtering message.

[0010] Optionally, the method further comprises: in response to the first filtering result being empty or the second filtering result being empty, obtaining a running time, wherein the running time is used to represent a time from a starting time of synchronizing the to-be-synchronized data to a current time; and in response to the running time being less than or equal to a time threshold, re-obtaining the assertion message and filtering the re-obtained assertion message.

[0011] Optionally, the method further comprises: in response to the running time being greater than the time threshold, determining that the to-be-synchronized data fails in synchronization; wherein the time threshold is determined based on a data attribute of the to-be-synchronized data.

[0012] Optionally, the method further comprises: obtaining a data synchronization parameter; generating synchronization information based on the data synchronization parameter; and outputting the synchronization information.

[0013] Optionally, the determining whether the to-be-synchronized data succeeds in synchronization based on the filtering message comprises: obtaining a first data identifier of the filtering message and a second data identifier of the to-be-synchronized data; in response to the first data identifier being successfully obtained and the first data identifier being identical to the second data identifier, determining that the to-be-synchronized data succeeds in synchronization; and in response to the first data identifier failing to be obtained or the first data identifier being different from the second data identifier, determining that the to-be-synchronized data fails in synchronization.

[0014] According to another aspect of the embodiments of the present application, a data verification method is further provided, comprising: an obtaining module, configured to obtain a data feature of to-be-synchronized data and an assertion message, wherein the assertion message is used to represent a message generated at an assertion position in a process of synchronizing the to-be-synchronized data; a filtering module, configured to filter the assertion message based on the data feature to obtain a filtering message; and a determining module, configured to determine whether the to-be-synchronized data succeeds in synchronization based on the filtering message.

[0015] Optionally, the filtering module comprises: a recombining unit, configured to recombine the data feature according to a preset data format to obtain an expected message; and a screening unit, configured to filter the assertion message based on the expected message to determine the filtering message.

[0016] Optionally, the reorganizing unit comprises: a first obtaining sub-unit, configured to obtain an interface type of an interface used for transmitting the data to be synchronized; a second obtaining sub-unit, configured to determine a target field matching the interface type from the data to be synchronized based on the interface type; and a reorganizing sub-unit, configured to reorganize the data feature and the target field according to a preset format to obtain the expected message.

[0017] Optionally, the screening unit comprises: a first filtering sub-unit, configured to filter a first filtering result from the assertion message based on a structural feature of the expected message; a second filtering sub-unit, configured to filter a second filtering result from the first filtering result based on a preset feature of the expected message and the target field in response to the first filtering result being not empty; and a message determining sub-unit, configured to determine the second filtering result as the filtered message in response to the second filtering result being not empty.

[0018] Optionally, the apparatus further comprises: a time obtaining module, configured to obtain a running time in response to the first filtering result being empty or the second filtering result being empty, wherein the running time is used to represent a time from a starting time of synchronizing the data to be synchronized to a current time; and a message verifying module, configured to re-obtain the assertion message and filter the re-obtained assertion message in response to the running time being less than or equal to a time threshold.

[0019] Optionally, the apparatus further comprises: a determining module, configured to determine that the data to be synchronized fails to be synchronized in response to the running time being greater than the time threshold, wherein the time threshold is determined based on a data attribute of the data to be synchronized.

[0020] Optionally, the apparatus further comprises: a parameter obtaining module, configured to obtain a data synchronization parameter; an information generating module, configured to generate synchronization information based on the data synchronization parameter; and an information outputting module, configured to output the synchronization information.

[0021] Optionally, the determining module comprises: an identifier obtaining unit, configured to obtain a first data identifier of the filtered message and a second data identifier of the data to be synchronized; a first determining unit, configured to determine that the data to be synchronized succeeds to be synchronized in response to the first data identifier being successfully obtained and the first data identifier being identical to the second data identifier; and a second determining unit, configured to determine that the data to be synchronized fails to be synchronized in response to the first data identifier failing to be obtained or the first data identifier being different from the second data identifier.

[0022] According to another aspect of the embodiments of the present application, a computer readable storage medium is further provided, characterized by storing a program, wherein the program is executed to perform any of the above data verification methods.

[0023] According to another aspect of the embodiments of the present application, an electronic device is also provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute any of the above data verification methods through the computer program.

[0024] In the embodiments of the present application, the data features of the to-be-synchronized data and the assertion messages are acquired, the assertion messages are filtered based on the data features to obtain filtered messages, and the manner of determining whether the to-be-synchronized data is successfully synchronized is determined based on the filtered messages. In this way, the assertion messages generated in the process of synchronizing the to-be-synchronized data are filtered by using the data features of the to-be-synchronized data, and whether the to-be-synchronized data is successfully synchronized is directly determined by using the filtered messages, without the need of comparing the synchronized data with the to-be-synchronized data field by field, so that the process of verifying whether the data is successfully synchronized is simplified, the efficiency of verifying whether the to-be-synchronized data is successfully synchronized is improved, and the technical problem of low verification efficiency in verifying whether the to-be-synchronized data is successfully synchronized in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which are incorporated herein and form a part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the present application.

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

[0027] Figure 1 FIG. 1 is a hardware environment schematic diagram of an interactive method of a smart device according to an embodiment of the present application;

[0028] Figure 2 FIG. 2 is a step flowchart of a data verification method according to an embodiment of the present application;

[0029] Figure 3 FIG. 3 is a flowchart of a data feature reorganization method according to an embodiment of the present application;

[0030] Figure 4 FIG. 4 is a schematic diagram of a data verification process according to an embodiment of the present application;

[0031] Figure 5 FIG. 5 is a structural block diagram of a data verification device according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to better understand the present application by those skilled in the art, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should be within the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0034] According to an aspect of an embodiment of the present application, an interaction method of a smart home device is provided. The interaction method of the smart home device is widely applied to smart home, smart home, smart home device ecology, intelligence house ecology and other whole-house intelligent digital control application scenarios. Figure 1 is a hardware environment schematic diagram of an interaction method of a smart device according to an embodiment of the present application, as Figure 1 The server 104 is connected with the terminal device 102 through a network, and can be used to provide services (such as application services, etc.) for the terminal or the client installed on the terminal, a database can be set on the server or independently of the server, used to provide data storage services for the server 104, cloud computing and / or edge computing services can be configured on the server or independently of the server, used to provide data operation services for the server 104. Optionally, in the present embodiment, the above-mentioned interaction method of the smart home device can be applied to the hardware environment composed of the terminal device 102 and the server 104 as shown in Figure 1

[0035] ​The network can include, but is not limited to, at least one of the following: a wired network, a wireless network. The wired network can include, but is not limited to, at least one of the following: a wide area network, a metropolitan area network, a local area network. The wireless network can include, but is not limited to, at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 can include, but is not limited to, at least one of the following: a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart oven, a smart refrigerator, a smart oven, a smart oven, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart television, a smart clothesline, a smart curtain, a smart audio and video, a smart socket, a smart sound, a smart sound box, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0036] Embodiment 1

[0037] According to the embodiments of the present application, a data verification method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0038] Figure 2 is a step flowchart of a data verification method according to the embodiments of the present application, as shown in Figure 2 The method comprises the following steps:

[0039] Step S202, obtaining data features and assertion messages of the to-be-synchronized data.

[0040] The assertion message is used to represent all messages generated at the assertion position in the process of synchronizing the to-be-synchronized data.

[0041] The data features can refer to message features used to represent the framework and content of the to-be-synchronized data. For example, the framework features can refer to label information, ID (Identity document, identity number) information, etc. of the to-be-synchronized data, and the content features can refer to entity information, additional information, etc. of the to-be-synchronized data.

[0042] In an optional solution of the present embodiment, since the assertion message can be used to judge whether the to-be-synchronized data is synchronized successfully, but considering that the assertion message does not contain all the contents of the messages output from the interface, the corresponding data features can be extracted from the to-be-synchronized data according to the content format of the assertion message corresponding to the interface, such as message framework, message entity, additional content, etc.

[0043] In an optional solution of the embodiment, when the data to be synchronized is output from the preset interface, the data verification system can obtain all the messages generated at the assertion position, i.e., the assertion messages, and perform feature extraction on the data to be synchronized to determine the framework and content of the data to be synchronized, thereby obtaining the data features.

[0044] In step S204, the assertion messages are filtered based on the data features to obtain filtered messages.

[0045] In an optional solution of the embodiment, after obtaining the array features, the assertion messages can be filtered multiple times according to a preset filtering order by using different features in the data features, because the large data features correspond to the content format of the assertion messages, thereby obtaining the filtered messages.

[0046] For example, because the feature of the data framework can be directly obtained when performing feature extraction on the data, the framework features can be used to preliminarily filter the assertion messages. Because the feature of the data content is obtained by deeply analyzing the data, the feature of the data content can be used to secondarily filter the result of the preliminary filtering, thereby obtaining the filtered messages.

[0047] In step S206, it is determined whether the data to be synchronized is successfully synchronized based on the filtered messages.

[0048] After obtaining the filtered messages, the filtered messages can be used to determine whether the data to be synchronized is successfully synchronized.

[0049] For example, if the filtered messages are not empty, it indicates that the data to be synchronized can be successfully synchronized. In order to improve the accuracy of the verification, the filtered result can be further detected, and the data corresponding to the filtered result is compared with the data to be synchronized. If the comparison is successful, it is determined that the synchronization is successful. If the filtered messages are empty data sets, it indicates that the data to be synchronized can not be successfully synchronized. At this time, the above steps can be repeated to further determine the synchronization result of the data to be synchronized.

[0050] In the embodiment of the present application, the data features of the to-be-synchronized data and the assertion message are acquired, the assertion message is filtered based on the data features to obtain a filtered message, and a manner of determining whether the to-be-synchronized data is successfully synchronized is determined based on the filtered message. In the process of synchronizing the to-be-synchronized data by using the data features of the to-be-synchronized data, the assertion message generated in the process is filtered, and the result after filtering is directly used to determine whether the synchronization of the to-be-synchronized data is successful. It is not necessary to compare the synchronized data with the to-be-synchronized data field by field, the process of verifying whether the data synchronization is successful is simplified, the efficiency of verifying whether the synchronization of the to-be-synchronized data is successful is improved, and the technical problem of low verification efficiency in verifying whether the to-be-synchronized data is successfully synchronized in the related art is solved.

[0051] Optionally, filtering the assertion message based on the data features to obtain the filtered message comprises: reorganizing the data features according to a preset data format to obtain an expected message; and screening the assertion message based on the expected message to determine the filtered message.

[0052] The preset format can be the content format corresponding to the assertion message.

[0053] The expected message can be a message used to filter the assertion message and having the same content format as the assertion message.

[0054] In an optional solution of the embodiment, considering that directly filtering the assertion message by using the acquired data features may cause filtering confusion and long filtering time, after the data features of the to-be-synchronized data are acquired, the data features can be reorganized according to the content format of the assertion message to obtain the expected message, and the expected message is used to filter the assertion message.

[0055] Optionally, reorganizing the data features according to the preset data format to obtain the expected message comprises: acquiring an interface type of an interface used to transmit the to-be-synchronized data; determining a target field matched with the interface type from the to-be-synchronized data based on the interface type; and reorganizing the data features and the target field according to the preset format to obtain the expected message.

[0056] Figure 3 is a flowchart of a data feature reorganization method according to the embodiment of the present application, as shown in Figure 3 The method comprises the following steps:

[0057] In step S302, an interface type of an interface used to transmit the to-be-synchronized data is acquired.

[0058] In an optional solution of the embodiment, since there can be multiple messages similar to the data feature in the assertion message, in order to improve the accuracy of removing the messages irrelevant to the data to be synchronized, an interface type of an interface used for transmitting the data to be synchronized can be acquired, such as a service type interface and a data type interface, and the interface type is applied to the process of filtering the assertion message.

[0059] In step S304, the target field matching the interface type is determined from the data to be synchronized based on the interface type.

[0060] In an optional solution of the embodiment, after the interface type is acquired, the target field matching the interface type can be determined from the data to be synchronized, and the target field is also applied to the process of filtering the assertion message.

[0061] For example, if the interface type is a service type, it indicates that the data to be synchronized is data having a service logic relationship, and at this time, a data segment related to the service, such as purchase information, can be selected from the data to be synchronized as the target field.

[0062] In an optional solution of the embodiment, when the target field is determined from the data to be synchronized, the data to be synchronized can be divided into multiple data segments based on a preset condition, and then the target field required is determined from the multiple data segments.

[0063] The preset condition can be to divide the data to be synchronized into multiple data segments according to a time at which the data to be synchronized is configured by a user, or to divide the data to be synchronized into multiple data segments according to different data types in the data to be synchronized, and the specific preset condition can be set according to actual conditions, as long as the data to be synchronized can be divided into multiple data segments, which is not limited here.

[0064] In an optional solution of the embodiment, the relevance of the interface type and the multiple data segments can be determined, and the data segment with a relevance greater than a certain threshold or the maximum relevance is taken as the target field.

[0065] In step S306, the data feature and the target field are recombined according to a preset format to obtain an expected message.

[0066] Finally, the target field is recombined with the data feature according to the preset format to obtain the expected message.

[0067] The above data features and target fields are reorganized according to the preset format, which can make the verification method more applicable, and the system only needs to filter the assertion message according to different parts of the expected message, such as the above structural features, preset features and target field parts, and does not need to screen the assertion message field by field, which can further improve the filtering efficiency. At the same time, if the importance of the data to be synchronized is high, the user can also judge whether the extracted data features are accurate according to the expected message, so as to avoid extracting ordinary data features, which can cause inaccurate filtering results when filtering the assertion message.

[0068] Optionally, the filtering of the assertion message based on the expected message to determine the filtered message comprises: filtering a first filtering result from the assertion message based on the structural features of the expected message; in response to the first filtering result being not empty, filtering a second filtering result from the first filtering result based on the preset features and the target field of the expected message; and in response to the second filtering result being not empty, determining the second filtering result as the filtered message.

[0069] The above structural features can refer to the frame features in the data features, such as tag information, key information (i.e. ID information) and the like.

[0070] The above preset features can refer to the content features in the data features, such as body entity information and additional information.

[0071] In an optional solution of the embodiment, in order to improve the verification of whether the data to be synchronized is synchronized successfully by using the filtered message, after the expected message is obtained, the assertion message can be filtered according to the structural features of the expected message, such as the above tag information, ID information and the like, to obtain the above first filtering result.

[0072] If the structural features of the expected message exist in the assertion message, the above first filtering result can refer to one or more messages containing the structural features in the assertion message; if the above structural features do not exist in the assertion message, the above first filtering result is an empty set.

[0073] When the first filtering result is not empty, i.e. the first filtering result is one or more messages containing the above structural features, the first filtering result can be further filtered according to the above preset features, such as entity information and additional information, to further remove the messages irrelevant to the data to be synchronized in the first filtering result, so as to ensure the accuracy of verifying whether the data to be synchronized is successful.

[0074] If the preset feature and the target field exist in the first filtering result, the second filtering result can refer to one or more messages in the first filtering result that contain the preset feature and the target field; if the preset feature or the target field does not exist in the first filtering result, the second filtering result is an empty set.

[0075] Optionally, the method further comprises: in response to the first filtering result being empty or the second filtering result being empty, obtaining a running time, wherein the running time is used to represent a time from a starting time of synchronizing the to-be-synchronized data to a current time; and in response to the running time being less than or equal to a time threshold, reacquiring the assertion message and filtering the reacquired assertion message.

[0076] The time threshold can be a maximum waiting time expected to be consumed when synchronizing the to-be-synchronized data. The time threshold can be a time determined by the data verification system according to data attributes, or a time set by a user.

[0077] If the result of filtering the assertion message by using the expected message is empty, it means that the to-be-synchronized data can not have been synchronized, and therefore, in order to avoid misjudgment when verifying whether the to-be-synchronized data is successfully synchronized, the running time from a time of synchronizing the to-be-synchronized data to a current time can be obtained when the first filtering result is empty or the second filtering result is empty.

[0078] After obtaining the running time, the running time can be compared with the time threshold. If the running time does not exceed the time threshold, the data verification system can continue to acquire the assertion message and filter the assertion message by using the expected message multiple times until the second filtering result is not an empty set.

[0079] In an optional solution of the embodiment, if the first filtering result or the second filtering result is an empty set after filtering the currently acquired assertion message, the assertion message can be marked, and when the assertion message is reacquired, the filtered message can be removed according to the mark.

[0080] In an optional solution of the embodiment, if the running pressure of the data verification system is small, the data verification system can continuously acquire the assertion message within the time threshold, so as to avoid the situation that the verification system is still filtering the assertion message before synchronization is completed when the to-be-synchronized data is synchronized, thereby improving the efficiency of verifying whether the to-be-synchronized data is successfully synchronized.

[0081] Optionally, the method further comprises: in response to the running time being greater than the time threshold, determining that the to-be-synchronized data fails to be synchronized; wherein the time threshold is determined based on a data attribute of the to-be-synchronized data.

[0082] The data attribute can refer to a data size, a data complexity, a target storage location of the to-be-synchronized data, and the like.

[0083] In an optional solution of the embodiment, if the running time exceeds the time threshold, it can be determined that the to-be-synchronized data currently fails to be synchronized.

[0084] In an optional solution of the embodiment, when verifying whether the to-be-synchronized data is successfully synchronized, the verification system can first determine a maximum waiting time consumed by the to-be-synchronized data when being synchronized, i.e., the time threshold, based on the data attribute.

[0085] For example, the verification system can first acquire a data size, a data importance, a data complexity, and the like of the to-be-synchronized data, wherein the data importance can be input by a user and represented by a value from 1 to 100, and the higher the value, the higher the importance of the data.

[0086] After acquiring the attributes, different weights can be assigned to different attributes, and the multiple attributes can be weighted and summed to determine the time threshold.

[0087] For example, the time consumed by data synchronization is generally directly related to the data size, and therefore, a greater weight can be assigned to the data size to ensure the rationality of the determined time threshold.

[0088] Optionally, the method further comprises: acquiring a data synchronization parameter; generating synchronization information based on the data synchronization parameter; and outputting the synchronization information.

[0089] The data synchronization parameter can refer to data generated in the process of synchronizing the to-be-synchronized data, such as running data consumed by synchronization, a data error rate, a number of times of acquiring assertion messages, and the like.

[0090] In an optional solution of the embodiment, a corresponding synchronization report can be generated based on the data synchronization parameter, i.e., the synchronization information, and the synchronization information can be output.

[0091] For example, if the to-be-synchronized data is synchronized successfully, the time taken by the entire synchronization process and the number of times of obtaining the assertion message can be aggregated to generate a report of successful data synchronization; if the to-be-synchronized data fails to be synchronized, the number of times of obtaining the assertion message and the number of times of occurrence of errors, such as the number of times that the first filtering result contains the preset feature but does not contain the target field or contains the target field but does not contain the preset feature, can be aggregated to generate a report of failed data synchronization.

[0092] Optionally, the determining whether the to-be-synchronized data is synchronized successfully based on the filtering message comprises: obtaining a first data identifier of the filtering message and a second data identifier of the to-be-synchronized data; in response to successful obtaining of the first data identifier and the first data identifier being identical to the second data identifier, determining that the to-be-synchronized data is synchronized successfully; and in response to failed obtaining of the first data identifier or the first data identifier being different from the second data identifier, determining that the to-be-synchronized data fails to be synchronized.

[0093] In an optional solution of the embodiment, the user can set a corresponding data identifier for the to-be-synchronized message according to a requirement, for example, adding a version number, a personnel signature, or the like to the to-be-synchronized data.

[0094] In an optional solution of the embodiment, after obtaining the filtering message, a first data identifier corresponding to the filtering message can be further obtained, and the first data identifier is compared with a second data identifier of the to-be-synchronized data; if the two data identifiers are identical, it is determined that the to-be-synchronized data is synchronized successfully; if the two data identifiers are different, it is determined that the to-be-synchronized data fails to be synchronized.

[0095] In order to clearly show the process of the above data verification, Figure 4 is a schematic diagram of a data verification process according to an embodiment of the present application, as shown in Figure 4 the data feature of the to-be-synchronized data and the assertion message, to obtain an expected message, and then the tag label information and the key information of the expected message are used to preliminarily filter the assertion message; in a case where the first filtering result obtained through the preliminary filtering is a non-empty data set, the body entity information of the expected message is used to secondarily filter the first filtering result; when the second filtering result obtained through the secondary filtering is a non-empty data set, the second filtering result is determined as the filtering message; finally, the data identifier of the filtering message is compared with the data identifier of the to-be-synchronized data; if the two data identifiers are identical, it is determined that the synchronization is successful; if the two data identifiers are different, it is determined that the synchronization fails.

[0096] If the first filtering result is empty or the second filtering result is empty, it is determined whether the current running time exceeds a time threshold; if not, the assertion message is re-obtained and re-filtered; if yes, it is determined that the synchronization fails.

[0097] Finally, whether the synchronization succeeds or fails, a synchronization report can be generated according to the synchronization parameters generated in the synchronization process.

[0098] The above merely preferred embodiments of the present application, it should be noted that for those skilled in the technical field, without departing from the principles of the present application, can make several improvements and refinements, these improvements and refinements should also be considered as the protection scope of the present application.

[0099] Embodiment 2

[0100] According to another aspect of the embodiments of the present application, corresponding to the above-mentioned data verification method, the present application also provides a data verification device.

[0101] Figure 5 is a structural block diagram of a data verification device according to an embodiment of the present application, as shown in Figure 5 The device comprises: an acquisition module 502, configured to acquire data features of to-be-synchronized data and assertion messages, wherein the assertion messages are used to represent messages generated at assertion positions in the process of synchronizing the to-be-synchronized data; a filtering module 504, configured to filter the assertion messages based on the data features to obtain filtered messages; and a determination module 506, configured to determine whether the to-be-synchronized data is synchronized successfully based on the filtered messages.

[0102] Optionally, the filtering module 504 comprises: a recombination unit, configured to recombine the data features according to a preset data format to obtain expected messages; and a screening unit, configured to screen the assertion messages based on the expected messages to determine the filtered messages.

[0103] Optionally, the recombination unit comprises: a first acquisition subunit, configured to acquire an interface type of an interface used to transmit the to-be-synchronized data; a second acquisition subunit, configured to determine, based on the interface type, a target field matched with the interface type from the to-be-synchronized data; and a recombination subunit, configured to recombine the data features and the target field according to a preset format to obtain the expected messages.

[0104] Optionally, the screening unit comprises: a first filtering unit, configured to filter a first filtering result from the assertion messages based on structural features of the expected messages; a second filtering unit, configured to, in response to the first filtering result being not empty, filter a second filtering result from the first filtering result based on preset features of the expected messages and the target field; and a message determination unit, configured to, in response to the second filtering result being not empty, determine the second filtering result as the filtered messages.

[0105] Optionally, the apparatus further comprises a time obtaining module configured to obtain a running time in response to the first filtering result being empty or the second filtering result being empty, wherein the running time is used to represent a time from a starting time of the to-be-synchronized data to a current time; and a message verifying module configured to re-obtain the assertion message and filter the re-obtained assertion message in response to the running time being less than or equal to a time threshold.

[0106] Optionally, the apparatus further comprises a determining module configured to determine that the to-be-synchronized data fails to be synchronized in response to the running time being greater than the time threshold, wherein the time threshold is determined based on a data attribute of the to-be-synchronized data.

[0107] Optionally, the apparatus further comprises a parameter obtaining module configured to obtain a data synchronization parameter; an information generating module configured to generate synchronization information based on the data synchronization parameter; and an information outputting module configured to output the synchronization information.

[0108] Optionally, the determining module 506 comprises an identification obtaining unit configured to obtain a first data identification of the filtered message and a second data identification of the to-be-synchronized data; a first determining unit configured to determine that the to-be-synchronized data succeeds to be synchronized in response to the first data identification being successfully obtained and the first data identification being identical to the second data identification; and a second determining unit configured to determine that the to-be-synchronized data fails to be synchronized in response to the first data identification being unsuccessfully obtained or the first data identification being different from the second data identification.

[0109] Embodiment 3

[0110] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, including a stored program, wherein the program controls the device where the computer readable storage medium is located to execute the data verifying method of any of the above when the program is running.

[0111] Embodiment 4

[0112] According to another aspect of the embodiments of the present application, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the data verifying method of any of the above by the computer program.

[0113] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0114] In the above-mentioned embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0115] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other manners. For example, the described unit embodiments can be divided into other ways, for example, the division of units can be a logical function division, and there can be another division manner in actual implementation; for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between units can be indirect coupling or communication connection through some interfaces, and can be electrical or other forms.

[0116] The units described as separate components may or can not be physically separate, and the components shown as units may or can not be physical units, i.e., they can be located in one place, or can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0117] In addition, the functional units in each embodiment of the present application can be integrated into a processing unit, or each unit can be physically present alone, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0118] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the embodiments of the present application. The aforementioned storage medium includes: a U disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.

[0119] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.

Claims

1. A data verification method, characterized in that, The method includes: Obtain the data characteristics and assertion messages of the data to be synchronized, wherein the assertion messages are used to characterize the messages generated at the assertion position during the synchronization of the data to be synchronized, and the data characteristics correspond to the content format of the assertion messages; The assertion message is filtered based on the data features to obtain a filtered message. The assertion message is filtered multiple times according to a preset filtering order based on multiple different features in the data features to obtain the filtered message. Based on the filter message, it is determined whether the data to be synchronized has been successfully synchronized. Specifically, if the filter message is not empty, it is determined that the data to be synchronized has been successfully synchronized. If the filter message is empty, it is determined that the data to be synchronized has not been synchronized or has failed to be synchronized.

2. The method according to claim 1, characterized in that, The assertion message is filtered based on the data features to obtain a filtered message, including: The data features are reorganized according to a preset data format to obtain the desired message; The assertion messages are filtered based on the expected messages to determine the filtered messages.

3. The method according to claim 2, characterized in that, The data features are reorganized according to a preset data format to obtain the desired message, including: Obtain the interface type of the interface used to transmit the data to be synchronized; Based on the interface type, a target field matching the interface type is determined from the data to be synchronized; The data features and the target field are reorganized according to a preset format to obtain the desired message.

4. The method according to claim 3, wherein filtering the assertion messages based on the expected messages to determine the filtered messages includes: Based on the structural features of the expected message, a first filtering result is filtered out from the assertion message; In response to the first filtering result being non-empty, a second filtering result is filtered out from the first filtering result based on the preset characteristics of the desired message and the target field; In response to the second filtering result being non-empty, the second filtering result is determined as the filtering message.

5. The method according to claim 4, characterized in that, The method further includes: In response to the first filtering result being empty or the second filtering result being empty, the running time is obtained, wherein the running time is used to characterize the time from the start time of synchronizing the data to be synchronized to the current time; In response to the running time being less than or equal to a time threshold, the assertion message is reacquired and filtered.

6. The method according to claim 5, characterized in that, The method further includes: In response to the running time exceeding the time threshold, it is determined that the synchronization of the data to be synchronized has failed; The time threshold is determined based on the data attributes of the data to be synchronized.

7. The method according to any one of claims 1-6, characterized in that, The method further includes: Get data synchronization parameters; Based on the data synchronization parameters, synchronization information is generated; Output the synchronization information.

8. The method according to any one of claims 1-6, characterized in that, Determining whether the data to be synchronized has been successfully synchronized based on the filtered message includes: Obtain the first data identifier of the filter message and the second data identifier of the data to be synchronized; In response to the successful acquisition of the first data identifier, and the fact that the first data identifier is the same as the second data identifier, it is determined that the data to be synchronized has been successfully synchronized; In response to the failure to obtain the first data identifier, or the first data identifier being different from the second data identifier, it is determined that the synchronization of the data to be synchronized has failed.

9. A data verification device, characterized in that, The device includes: The acquisition module is used to acquire the data characteristics and assertion messages of the data to be synchronized, wherein the assertion messages are used to characterize the messages generated at the assertion position during the synchronization of the data to be synchronized, and the data characteristics correspond to the content format of the assertion messages; A filtering module is used to filter the assertion message based on the data features to obtain a filtered message, wherein the assertion message is filtered multiple times according to a preset filtering order based on multiple different features in the data features to obtain the filtered message. The determination module is used to determine whether the data to be synchronized has been successfully synchronized based on the filter message, wherein the data to be synchronized is determined to be successfully synchronized if the filter message is not empty, and the data to be synchronized is determined to be unsynchronized or failed to be synchronized if the filter message is empty.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for checking consistency of memory bank and relation bank of power grid monitoring system

    CN113420036A

  • Method and system for data synchronization, and apparatus thereof

    US20090157802A1