CN110554929B - Data verification method, device, computer equipment and storage medium - Google Patents

Data verification method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN110554929B
CN110554929B CN201810565142.0A CN201810565142A CN110554929B CN 110554929 B CN110554929 B CN 110554929B CN 201810565142 A CN201810565142 A CN 201810565142A CN 110554929 B CN110554929 B CN 110554929B
Authority
CN
China
Prior art keywords
data
port
field
backed
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810565142.0A
Other languages
Chinese (zh)
Other versions
CN110554929A (en
Inventor
欧阳灿
叶思
熊伟
蒋佳峻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201810565142.0A priority Critical patent/CN110554929B/en
Publication of CN110554929A publication Critical patent/CN110554929A/en
Application granted granted Critical
Publication of CN110554929B publication Critical patent/CN110554929B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1064Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices in cache or content addressable memories
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a data verification method, a data verification device, computer equipment and a storage medium, wherein the method comprises the following steps: when any port of the server is monitored to have data output, the data is backed up into a cache area; according to a preset check file, checking the attribute of each field in the data backed up into the cache region; and when determining that the attribute of any field in the data backed up into the cache region is abnormal, updating an abnormal log corresponding to any port of the server according to the abnormal state of any field. By the method, the data of the service interface can be automatically checked, the efficiency and the instantaneity of data check are improved, and the technical problems of low efficiency and poor instantaneity of manually checking the data in the prior art are solved.

Description

Data verification method, device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of data verification technologies, and in particular, to a data verification method, a data verification device, a computer device, and a storage medium.
Background
JSON (Java Script Object Notation, JS object identifier) is a lightweight data exchange format, and has the characteristics of small data volume, fast network transmission, convenient conversion and the like, and is a main data transmission format for data transmission of the internet application at present, and a large number of server interfaces transmit data through the JSON format.
The correctness of the data at the service end interface has an important influence on the normal use of the client, and the error of the data at the interface often leads to the error of the client, for example, the client may crash due to the lack of certain necessary fields in the data returned by the interface at the service end. Therefore, the service interface data needs to be checked.
The traditional mode of checking the service end interface data is manual check, and the accuracy of the JSON data output by the service end is checked manually.
Disclosure of Invention
The present application aims to solve, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present application is to provide a data verification method, so as to realize automatic verification of service interface data, improve efficiency and instantaneity of data verification, and solve the technical problems of low efficiency and poor instantaneity of manually performing data verification in the prior art.
A second object of the present application is to provide a data verification device.
A third object of the present application is to propose a computer device.
A fourth object of the present application is to propose a non-transitory computer readable storage medium.
A fifth object of the present application is to propose a computer programme product.
To achieve the above object, an embodiment of a first aspect of the present application provides a data verification method, including:
when any port of the server is monitored to have data output, the data is backed up into a cache area;
according to a preset check file, checking the attribute of each field in the data backed up into the cache region;
and when determining that the attribute of any field in the data backed up into the cache region is abnormal, updating an abnormal log corresponding to any port of the server according to the abnormal state of any field.
According to the data verification method, when any port of the server is monitored to output data, the output data is backed up into the cache region, the attribute of each field in the data backed up into the cache region is verified according to the preset verification file, and when the attribute of any field in the data backed up into the cache region is abnormal, the abnormal log corresponding to any port of the server is updated according to the abnormal state of any field. Therefore, the data output by the server port is backed up into the cache region, and the data in the cache region is checked, so that the normal output of the server port is not influenced in the data checking process, and the usability of the port is improved; by checking the data of the cache region according to the preset check file, the abnormal log corresponding to the port is updated when the data is abnormal, so that the automatic check of the data of the service port is realized, the efficiency and the instantaneity of data check are improved, and a reliable basis is provided for timely updating the server port.
To achieve the above object, an embodiment of a second aspect of the present application provides a data verification device, including:
the backup module is used for backing up the data into the cache area when any port of the server is monitored to have data output;
the verification module is used for verifying the attribute of each field in the data backed up into the cache region according to a preset verification file;
and the log updating module is used for updating the exception log corresponding to any port of the server according to the exception state of any field when determining that the attribute of any field in the data backed up into the cache region is abnormal.
According to the data verification device, when any port of the server is monitored to output data, the output data is backed up into the cache region, the attribute of each field in the data backed up into the cache region is verified according to the preset verification file, and when the attribute of any field in the data backed up into the cache region is abnormal, the abnormal log corresponding to any port of the server is updated according to the abnormal state of any field. Therefore, the data output by the server port is backed up into the cache region, and the data in the cache region is checked, so that the normal output of the server port is not influenced in the data checking process, and the usability of the port is improved; by checking the data of the cache region according to the preset check file, the abnormal log corresponding to the port is updated when the data is abnormal, so that the automatic check of the data of the service port is realized, the efficiency and the instantaneity of data check are improved, and a reliable basis is provided for timely updating the server port.
To achieve the above object, embodiments of a third aspect of the present application provide a computer apparatus, including: a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, for implementing the data verification method according to the embodiment of the first aspect.
To achieve the above object, an embodiment of a fourth aspect of the present application proposes a non-transitory computer readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a data verification method according to the embodiment of the first aspect.
To achieve the above object, an embodiment of a fifth aspect of the present application proposes a computer program product, which when executed by a processor implements a data verification method as described in the embodiment of the first aspect.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
Fig. 1 is a flow chart of a data verification method according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating another data verification method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating another data verification method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating another data verification method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a data verification device according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of another data verification device according to an embodiment of the present disclosure;
FIG. 7 is a schematic structural diagram of another data verification device according to an embodiment of the present disclosure;
FIG. 8 is a schematic structural diagram of another data verification device according to an embodiment of the present disclosure; and
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present application and are not to be construed as limiting the present application.
The following describes a data verification method, a data verification device, a computer device and a storage medium according to embodiments of the present application with reference to the accompanying drawings.
Fig. 1 is a flow chart of a data verification method according to an embodiment of the present application.
As shown in fig. 1, the data verification method may include the steps of:
and step 101, backing up data into a cache area when any port of the server is monitored to have data output.
A server is typically provided with a plurality of different services, e.g., the same server may be a web server, mail server, FTP server, etc. at the same time, with the different services being provided by different ports, e.g., web using port No. 80, FTP using port No. 21, mail server using port No. 25, etc. The maximum number of the ports of the server can be 65547, and the client can acquire different services from the server through different ports.
In this embodiment, a monitoring program may be set for the server port, for monitoring the output of the server port. When any one of the server ports is monitored to have data output, the data output by the server ports are cached in the cache area for backup.
Step 102, checking the attribute of each field in the data backed up into the buffer area according to the preset checking file.
The attributes of the fields may include, but are not limited to, the data type, size, etc. of the fields.
In this embodiment, for the data stored in the buffer, the attribute of each field in the data backed up into the buffer may be checked according to a preset check file.
The preset check file may be, for example, a schema file, where the schema file is a standard for describing JSON data format, and the interface data format may be defined in detail according to the JSON schema syntax specification, where the content of the schema file definition includes, but is not limited to, errno (last error for recording system) equals 0, types of fields in the data array, necessary field definitions, array element number definitions, and so on.
Since there are multiple ports of the server, the data types of the data output by each port may be different, a corresponding check file may be preconfigured for each port, and a correspondence between the port and the check file may be stored, for example, a correspondence between the port number of each port and the check file may be stored. In this embodiment, when any port is monitored to have data output, the port number of the port can be obtained in addition to backing up the data output by the port into the buffer, then the check file corresponding to the port is determined by querying the pre-stored correspondence, and further the attribute of each field in the data backed up into the buffer is checked by using the determined check file.
Further, in one possible implementation manner of the embodiment of the present application, before checking the attribute of each field in the data of the buffer, the check timing of the data in the buffer may be further confirmed, and when the check timing is met, the data in the buffer is checked again.
As one example, the current coincidence check opportunity may be determined upon determining that the number of times the check has been currently completed is less than a second threshold. Because the verifier occupies certain service resources when data verification is performed each time, in order to reduce the influence times of the verifier on the service as much as possible, a verification time, namely a second threshold value, can be preset. The second threshold may be determined according to the total number of verification times required for verifying the data in the buffer area when the data amount stored in the buffer area reaches the maximum. And if the number of times of checking which is finished currently does not reach a second threshold value, checking the data backed up into the cache area. Therefore, the data backed up into the buffer area can be ensured to be checked, and omission is avoided.
As an example, when the time interval between the current time and the time of the previous verification is determined to be greater than the third threshold value, it may be determined that the verification opportunity is currently satisfied. Wherein the third threshold may be determined according to a maximum time required to complete one data check, and the third threshold may be set to be greater than or equal to the maximum time required to complete one data check. In order to avoid the problem that the current data checking process is not completed and new data checking is started to cause conflict of the data checking process, a third threshold value can be preset, and if the time interval between the current time and the time of the previous checking is greater than the third threshold value, the data backed up into the buffer area can be checked if the previous checking process is considered to be completed. Therefore, the conflict of the data verification process can be avoided, and the smooth verification is ensured.
As an example, when it is determined that the preset check file includes a check field with the same identifier as the data identifier backed up into the buffer, it may also be determined that the check occasion is currently satisfied. In practical use, the types of different fields are defined in the check file, and are used for checking the data output by the corresponding server port. And in the verification process, judging whether the type of the corresponding field in the output data is correct according to the field type defined in the verification file. Therefore, in this example, each field in the data output by the check file and the server port may be identified, the same identification is used to represent the same field, and when it is determined that the preset check file includes a check field with the same identification as the data identification backed up into the buffer, the check file may be considered to be used to check the data in the buffer, and then the data backed up into the buffer is further checked according to the check file. Therefore, targeted data verification can be realized, and verification errors are avoided.
As an example, when the verification function is turned on and a verification file matching the port having the data output is obtained, it may also be determined that the verification opportunity is currently satisfied. In this example, when any server port is monitored to have data output, a check file corresponding to the port may be obtained, and whether the check function is currently turned on is detected, and when the check function is detected to be turned on, and or the corresponding check file is detected, the data backed up into the cache area is checked.
In one possible implementation manner of the embodiment of the present application, when checking the attribute of each field in the data backed up into the buffer area, the attribute of each field in all the data backed up into the buffer area and not checked can be checked, so as to avoid multiple checks on the same data, waste check resources and time, and improve the data checking efficiency.
Step 103, when determining that the attribute of any field in the data backed up into the cache is abnormal, updating an exception log corresponding to any port of the server according to the exception state of any field.
In this embodiment, when checking determines that the attribute of any field in the data backed up into the buffer is abnormal, the exception log of the corresponding server port may be updated according to the abnormal state.
For example, when a certain field of a certain port of the server is of a character (String) type, the type of the corresponding field is defined as a String type in a check file corresponding to the port of the server, and the type of data actually output by the port is of a whole (int) type, when the data in the buffer is checked by using the check file, the type error of the field can be determined, and further, the check result and the abnormal information of the field can be recorded in an abnormal log corresponding to the port.
According to the data verification method, when any port of the server is monitored to output data, the output data is backed up into the cache region, the attribute of each field in the data backed up into the cache region is verified according to the preset verification file, and when the attribute of any field in the data backed up into the cache region is abnormal, the abnormal log corresponding to any port of the server is updated according to the abnormal state of any field. Therefore, the data output by the server port is backed up into the cache region, and the data in the cache region is checked, so that the normal output of the server port is not influenced in the data checking process, and the usability of the port is improved; by checking the data of the cache region according to the preset check file, the abnormal log corresponding to the port is updated when the data is abnormal, so that the automatic check of the data of the service port is realized, the efficiency and the instantaneity of data check are improved, and a reliable basis is provided for timely updating the server port.
In the process of checking the data in the buffer area, the server port is still in a normal working state, and the data output by the server port is sent to the client. In order to avoid that the client uses the abnormal data again, so that the client fails or crashes, in one possible implementation manner of the embodiment of the application, when the attribute of any field in the data is confirmed to be abnormal by verification, an abnormal early warning message can be fed back to the client receiving the data, so that the client processes the received abnormal data. Therefore, another data verification method is provided in the embodiment of the present application, and fig. 2 is a schematic flow chart of another data verification method provided in the embodiment of the present application.
As shown in fig. 2, following step 103, the embodiment shown in fig. 1 may further include the following steps:
step 201, determining a receiving client corresponding to the data backed up into the buffer.
When the server port outputs data, accordingly, the client receives the data output by the server port. In this embodiment, a client that communicates with a server port that outputs data may be determined. In actual use, the data output by the server port generally includes the identifier of the receiving client, so that the corresponding receiving client can be determined directly according to the data backed up into the buffer.
Step 202, sending an early warning message with any field abnormal to the receiving client, so that the receiving client clears the data of any field cached in the receiving client according to the acquired early warning message.
In the case where the client normally communicates with the server, after the client acquires the requested data from the server, the received data is cached in the storage area of the client, so that the previously cached data is preferentially retrieved from the storage area of the client when the same data is requested next time. Therefore, in this embodiment, when it is determined that the attribute of any field in the data backed up into the cache area is abnormal, the data received by the client from the server and cached in the storage area of the client is also abnormal.
In order to avoid that the abnormal data stored in the client side affects the normal use of the client side, after determining that the attribute of any field in the data backed up into the cache area is abnormal, an early warning message of any field abnormality can be sent to the receiving client side, so that the receiving client side can clear the cached abnormal data in the receiving client side according to the obtained early warning message.
According to the data verification method, when the attribute of any field in the data backed up into the cache area is abnormal, the receiving client corresponding to the data backed up into the cache area is further determined, and an early warning message of any field abnormality is sent to the receiving client, so that the receiving client can clear the data of any field cached in the receiving client according to the acquired early warning message, abnormal data can be prevented from being left in the client, the client is prevented from acquiring the same abnormal data again, and the probability of failure or breakdown of the client is reduced.
In one possible implementation manner of the embodiment of the present application, when the attribute of any field in the check and determination data is abnormal, the port may be updated according to the existing abnormality, so that the updated port may output normal data. Therefore, another data verification method is provided in the embodiment of the present application, and fig. 3 is a schematic flow chart of another data verification method provided in the embodiment of the present application.
As shown in fig. 3, step 103 may further include, based on the embodiment shown in fig. 1:
step 301, analyzing the exception log corresponding to any port, and determining an update mode corresponding to any port.
In this embodiment, when determining that the attribute of any field in the data backed up into the buffer is abnormal, and updating the exception log according to the abnormal state, the exception log may be analyzed to determine an update mode corresponding to the port outputting the data abnormality.
Wherein, different updating modes can be set for different abnormal states. For example, when the abnormal state is a field type error, the update mode may be the type of a field in the output data of the update server port; when the abnormal state is a field size error, the updating mode may be to adjust the size of the field in the output data of the server port.
Step 302, according to the update mode, any port is updated.
In this embodiment, after determining the update mode corresponding to the server port outputting the abnormal data, the port may be updated according to the update mode, so that the updated port may output the normal data.
In particular, when the monitoring and warning platform is used for monitoring the abnormal log, the monitoring and warning platform can be used for collecting log information in real time, and when a new abnormal log is monitored, the monitoring and warning platform can feed the abnormal information recorded in the abnormal log back to a technician in a mode of short messages, mails and the like to give an alarm, for example, the technician can feed back the information of the name, the port number, the abnormal occurrence time, the abnormal state and the like of the port outputting the abnormal data to the technician, and the technician updates the port with the abnormality according to the received alarm information.
According to the data verification method, the abnormal log corresponding to any port is analyzed, the updating mode corresponding to any port is determined, the port is updated according to the updating mode, the abnormal port can be processed, normal data is output by the updated port, and the risk that the server port outputs the abnormal data again is reduced.
It should be noted that, the schemes shown in fig. 2 and fig. 3 may be executed only or may be executed together, so as to update the server port, ensure that the data output by the server port later is normal, and delete the abnormal data stored in the client, so as to avoid frequent occurrence of the same abnormal data in the client.
In order to avoid repeated checking of the same data, in a possible implementation manner of the embodiment of the present application, the data in the buffer area may be cleared. Therefore, another data verification method is provided in the embodiment of the present application, and fig. 4 is a schematic flow chart of another data verification method provided in the embodiment of the present application.
As shown in fig. 4, the data verification method may further include the following steps, based on the embodiment shown in fig. 1:
step 401, determining that the backed up data in the buffer area has all been checked, and the time interval between the current time and the previous time of clearing the data in the buffer area is greater than the first threshold, and clearing the data in the buffer area.
When the data in the buffer area is checked, the data which is checked in the buffer area can be monitored in the process of checking the data in the buffer area. For example, each time data verification is completed, a verification completion tag may be set for data corresponding to the data verification, and when the data in the cache area is all set with the verification completion tag, the backed up data in the cache area may be considered to be all completed. After the data in the buffer area are determined to be checked, the current time can be further obtained, the time interval between the current time and the time when the data in the buffer area are cleared is calculated according to the current time and the time when the data in the buffer area are cleared, the time interval is compared with a preset first threshold value, and when the time interval is larger than the first threshold value, the data in the buffer area are cleared. The first threshold may be determined according to a total time length consumed for completing data verification when the data amount stored in the buffer area is maximum, and the first threshold may be set to be not less than the total time length.
According to the data verification method, when the fact that the backed-up data in the cache area are all verified and the time interval between the current time and the time when the data in the cache area are cleared is greater than the first threshold value is determined, the data in the cache area are cleared, the data backed-up in the cache area can be updated regularly, and repeated verification of the same data is avoided.
In order to achieve the above embodiment, the present application further provides a data verification device.
Fig. 5 is a schematic structural diagram of a data verification device according to an embodiment of the present application.
As shown in fig. 5, the data verification device 50 may include: a backup module 510, a verification module 520, and a log update module 530.
The backup module 510 is configured to backup data into the buffer when it is detected that any port of the server has data output.
And the verification module 520 is configured to verify the attribute of each field in the data backed up into the buffer according to a preset verification file.
In one possible implementation manner of this embodiment of the present application, the verification module 520 is further configured to determine a verification opportunity before verifying the attribute of each field in the data backed up into the buffer. Specifically, the verification module 520 first determines that the number of times the verification is currently completed is less than a second threshold; or determining that the time interval between the current time and the time of the previous verification is greater than a third threshold value; or determining that the preset check file comprises a check field with the same identification as the data identification backed up in the cache area. After determining that the check time is met, the check module 520 checks the attribute of each field in the data backed up into the buffer according to the preset check file.
In one possible implementation manner of this embodiment of the present application, when the verification module 520 verifies the attribute of each field in the data backed up into the buffer, specifically, verifies the attribute of each field in all the data backed up into the buffer and not verified.
The log updating module 530 is configured to update an exception log corresponding to any port of the server according to an exception status of any field when determining that an attribute of any field in the data backed up into the cache is abnormal.
Further, in one possible implementation manner of the embodiment of the present application, as shown in fig. 6, on the basis of the embodiment shown in fig. 5, the data verification apparatus 50 may further include:
the alarm module 540 is configured to determine a receiving client corresponding to the data backed up into the buffer, and send an early warning message with any field abnormal to the receiving client, so that the receiving client clears the data in which any field cached in the receiving client is located according to the obtained early warning message.
The receiving client corresponding to the data backed up into the cache area is determined, and an early warning message of any field abnormality is sent to the receiving client, so that the receiving client can clear the data of any field cached in the receiving client according to the acquired early warning message, thereby avoiding that abnormal data is left in the client, avoiding that the client acquires the same abnormal data again, and reducing the probability of the client failure or breakdown.
In one possible implementation manner of the embodiment of the present application, as shown in fig. 7, on the basis of the embodiment shown in fig. 5, the data verification device 50 may further include:
the port updating module 550 is configured to analyze the exception log corresponding to any port, and determine an updating mode corresponding to any port; and according to the updating mode, updating any port.
The method has the advantages that the abnormal logs corresponding to any port are analyzed, the updating mode corresponding to any port is determined, the ports are updated according to the updating mode, the abnormal ports can be processed, normal data are output by the updated ports, and the risk that the server ports output the abnormal data again is reduced.
It should be noted that, the data verification device 50 may further include an alarm module 540 and a port update module 550, so as to update the server port, ensure that the data output by the server port is normal, and delete the abnormal data stored in the client, so as to avoid frequent occurrence of the same abnormal data in the client.
In one possible implementation manner of the embodiment of the present application, as shown in fig. 8, on the basis of the embodiment shown in fig. 5, the data verification device 50 may further include:
And the data clearing module 560 is configured to clear the data in the buffer when it is determined that the backed up data in the buffer has all been checked and a time interval between the current time and the previous time of clearing the data in the buffer is greater than a first threshold.
When the backed-up data in the buffer area is confirmed to be checked, and the time interval between the current time and the previous time for clearing the data in the buffer area is larger than a first threshold value, the data in the buffer area is cleared, so that the backed-up data in the buffer area can be updated regularly, and repeated check on the same data is avoided.
It should be noted that the foregoing explanation of the embodiment of the data verification method is also applicable to the data verification device of this embodiment, and the implementation principle is similar, and will not be repeated here.
According to the data verification device, when any port of the server is monitored to output data, the output data is backed up into the cache region, the attribute of each field in the data backed up into the cache region is verified according to the preset verification file, and when the attribute of any field in the data backed up into the cache region is abnormal, the abnormal log corresponding to any port of the server is updated according to the abnormal state of any field. Therefore, the data output by the server port is backed up into the cache region, and the data in the cache region is checked, so that the normal output of the server port is not influenced in the data checking process, and the usability of the port is improved; by checking the data of the cache region according to the preset check file, the abnormal log corresponding to the port is updated when the data is abnormal, so that the automatic check of the data of the service port is realized, the efficiency and the instantaneity of data check are improved, and a reliable basis is provided for timely updating the server port.
In order to implement the above embodiment, the present application further proposes a computer device, including: a processor and a memory. Wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the data verification method as described in the foregoing embodiment.
Fig. 9 is a schematic structural diagram of a computer device proposed by an embodiment of the present application, showing a block diagram of an exemplary computer device 90 suitable for use in implementing the embodiments of the present application. The computer device 90 shown in fig. 9 is merely an example, and should not be construed as limiting the functionality and scope of use of the embodiments herein.
As shown in fig. 9, the computer device 90 is in the form of a general purpose computer device. Components of computer device 90 may include, but are not limited to: one or more processors or processing units 906, a system memory 910, and a bus 908 that connects the various system components, including the system memory 910 and the processing units 906.
Bus 908 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include industry Standard architecture (Industry Standard Architecture; hereinafter ISA) bus, micro channel architecture (Micro Channel Architecture; hereinafter MAC) bus, enhanced ISA bus, video electronics standards Association (Video Electronics Standards Association; hereinafter VESA) local bus, and peripheral component interconnect (Peripheral Component Interconnection; hereinafter PCI) bus.
Computer device 90 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 90 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 910 may include computer-system-readable media in the form of volatile memory such as random access memory (Random Access Memory; hereinafter: RAM) 911 and/or cache memory 912. The computer device 90 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, the storage system 913 may be used to read from or write to a non-removable, nonvolatile magnetic medium (not shown in FIG. 9, commonly referred to as a "hard disk drive"). Although not shown in fig. 9, a magnetic disk drive for reading from and writing to a removable nonvolatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable nonvolatile optical disk (e.g., a compact disk read only memory (Compact Disc Read Only Memory; hereinafter CD-ROM), digital versatile read only optical disk (Digital Video Disc Read Only Memory; hereinafter DVD-ROM), or other optical media) may be provided. In such cases, each drive may be coupled to bus 908 via one or more data media interfaces. The system memory 910 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the present application.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present application may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
Programs/utilities 914 having a set (at least one) of program modules 9140 can be stored in, for example, system memory 910, such program modules 9140 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 9140 generally perform the functions and/or methods in the embodiments described herein.
The computer device 90 may also communicate with one or more external devices 10 (e.g., keyboard, pointing device, display 100, etc.), one or more devices that enable a user to interact with the terminal device 90, and/or any devices (e.g., network card, modem, etc.) that enable the computer device 90 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 902. Moreover, computer device 90 may also communicate with one or more networks such as a local area network (Local Area Network; hereinafter LAN), a wide area network (Wide Area Network; hereinafter WAN) and/or a public network such as the Internet via network adapter 900. As shown in fig. 9, network adapter 900 communicates with other modules of computer device 90 over bus 908. It should be appreciated that although not shown in fig. 9, other hardware and/or software modules may be used in connection with computer device 90, including, but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, data backup storage systems, and the like.
The processing unit 906 executes various functional applications and data processing by running a program stored in the system memory 910, for example, implementing the data verification method mentioned in the foregoing embodiment.
In order to implement the above-described embodiments, the present application also proposes a non-transitory computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, implements a data verification method as described in the above-described embodiments.
In order to implement the above embodiments, the present application also proposes a computer program product, which, when executed by a processor, implements a data verification method as described in the above embodiments.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless explicitly defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. Although embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives, and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (8)

1. The data verification method is applied to a server side and is characterized by comprising the following steps:
when any port of the server is monitored to have data output, the data is backed up into a cache area;
according to a preset check file, checking the attribute of each field in the data backed up into the cache region;
when the attribute of any field in the data backed up into the cache area is abnormal, updating an abnormal log corresponding to any port of the server according to the abnormal state of any field;
determining a receiving client corresponding to the data backed up into the cache region according to the identification of the receiving client, wherein the data backed up into the cache region contains the identification of the receiving client;
and sending the early warning message with any abnormal field to the receiving client so that the receiving client can clear the data of any cached field in the receiving client according to the acquired early warning message.
2. The method of claim 1, wherein after updating the exception log corresponding to any port of the server, further comprising:
analyzing the exception log corresponding to any port, and determining an updating mode corresponding to any port;
and according to the updating mode, updating any port.
3. The method of claim 1, wherein the method further comprises:
and if the backed-up data in the buffer area is checked, and the time interval between the current time and the time of clearing the data in the buffer area is larger than a first threshold value, clearing the data in the buffer area.
4. The method of claim 1, wherein before verifying the attribute of each field in the data backed up into the buffer, further comprising:
determining that the number of times of verification which is currently completed is smaller than a second threshold value;
or alternatively, the process may be performed,
determining that the time interval between the current time and the time of the previous verification is larger than a third threshold value;
or alternatively, the process may be performed,
and determining that the preset check file comprises a check field with the same identification as the data identification backed up in the buffer area.
5. The method as claimed in any one of claims 1-4, wherein verifying the attributes of the fields in the data backed up into the buffer comprises:
and checking the attribute of each field in all the data which are backed up into the buffer area and are not checked.
6. A data verification device applied to a server, comprising:
the backup module is used for backing up the data into the cache area when any port of the server is monitored to have data output;
the verification module is used for verifying the attribute of each field in the data backed up into the cache region according to a preset verification file;
the log updating module is used for updating the abnormal log corresponding to any port of the server according to the abnormal state of any field when the attribute of any field in the data backed up into the cache area is abnormal;
and the alarm module is used for determining a receiving client corresponding to the data backed up in the cache area according to the identification of the receiving client, and sending an early warning message with any abnormal field to the receiving client so that the receiving client can clear the data of any cached field in the receiving client according to the acquired early warning message, wherein the data backed up in the cache area contains the identification of the receiving client.
7. A computer device comprising a processor and a memory;
wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the data verification method according to any one of claims 1 to 5.
8. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a data verification method according to any of claims 1-5.
CN201810565142.0A 2018-06-04 2018-06-04 Data verification method, device, computer equipment and storage medium Active CN110554929B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810565142.0A CN110554929B (en) 2018-06-04 2018-06-04 Data verification method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810565142.0A CN110554929B (en) 2018-06-04 2018-06-04 Data verification method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110554929A CN110554929A (en) 2019-12-10
CN110554929B true CN110554929B (en) 2023-07-07

Family

ID=68736088

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810565142.0A Active CN110554929B (en) 2018-06-04 2018-06-04 Data verification method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110554929B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111176685A (en) * 2019-12-27 2020-05-19 深圳市优必选科技股份有限公司 Upgrading method and device
CN113128943B (en) * 2019-12-30 2023-12-05 北京懿医云科技有限公司 Data quality monitoring method, device, electronic equipment and storage medium
CN112631695A (en) * 2020-12-22 2021-04-09 北京达佳互联信息技术有限公司 Data verification method and device, electronic equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100483419C (en) * 2007-07-27 2009-04-29 华为技术有限公司 Data format verification method and device
US8615496B2 (en) * 2007-10-19 2013-12-24 Apple Inc. File system reliability using journaling on a storage medium
CN104182228B (en) * 2014-08-22 2018-01-26 徐增超 A kind of method and system for creating network application
CN106155891B (en) * 2015-04-02 2019-07-05 阿里巴巴集团控股有限公司 Interface test method, interface description data library generating method and device
CN107347048B (en) * 2016-05-04 2021-04-30 北京京东尚科信息技术有限公司 Data verification method, device and system
CN106991023B (en) * 2017-03-22 2020-10-09 深圳市彬讯科技有限公司 Interface parameter checking method and component
CN113688006B (en) * 2017-10-16 2024-03-29 创新先进技术有限公司 Log data verification method and device

Also Published As

Publication number Publication date
CN110554929A (en) 2019-12-10

Similar Documents

Publication Publication Date Title
KR100943012B1 (en) Merging multi-line log entries
CN110554929B (en) Data verification method, device, computer equipment and storage medium
CN110674025B (en) Interactive behavior monitoring method and device and computer equipment
JP5528640B2 (en) Exception processing test apparatus and method
CN109710439B (en) Fault processing method and device
CN109922079B (en) Service agent method and device based on block chain
CN111522703A (en) Method, apparatus and computer program product for monitoring access requests
CN111796978B (en) Interface detection method, device, system, equipment and storage medium
CN113382056A (en) Data reporting method, device, equipment, storage medium and system
CN109299124B (en) Method and apparatus for updating a model
CN111694684B (en) Abnormal construction method and device of storage device, electronic device and storage medium
CN112713964B (en) Data verification acceleration method and device, computer equipment and storage medium
CN112527678A (en) Method, apparatus, device and storage medium for testing protocol
CN114553663B (en) Abnormality detection method, abnormality detection device, abnormality detection equipment and storage medium
US9348721B2 (en) Diagnosing entities associated with software components
CN113852610B (en) Message processing method, device, computer equipment and storage medium
US20230025081A1 (en) Model training method, failure determining method, electronic device, and program product
CN112650698A (en) Data transmission method and device, electronic equipment and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN109918231B (en) Data reforming abnormity repairing method, device, equipment and storage medium
CN110362464B (en) Software analysis method and equipment
CN112084114A (en) Method and apparatus for testing an interface
CN113485881B (en) Test method and device of temporary speed limiting server, electronic equipment and medium
CN113096269B (en) Information acquisition method and device, electronic equipment and storage medium
CN116521721A (en) Data processing method, device, medium and computing equipment

Legal Events

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