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

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

Info

Publication number
CN111428132A
CN111428132A CN202010190810.3A CN202010190810A CN111428132A CN 111428132 A CN111428132 A CN 111428132A CN 202010190810 A CN202010190810 A CN 202010190810A CN 111428132 A CN111428132 A CN 111428132A
Authority
CN
China
Prior art keywords
reported
data
verification
rule
background
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.)
Granted
Application number
CN202010190810.3A
Other languages
Chinese (zh)
Other versions
CN111428132B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010190810.3A priority Critical patent/CN111428132B/en
Publication of CN111428132A publication Critical patent/CN111428132A/en
Application granted granted Critical
Publication of CN111428132B publication Critical patent/CN111428132B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • 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/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Storage Device Security (AREA)

Abstract

The application provides a data verification method and device, a computer storage medium and electronic equipment; the data verification method is applied to a client, and specifically comprises the following steps: intercepting reported data sent to a background by the client; the reported data at least comprises a reported scene identifier and reported contents; matching a target check rule corresponding to the reported scene identifier from a plurality of check rules, and checking the reported content based on the target check rule; wherein, one of the reported scene identifiers at least corresponds to one of the check rules; the check rule is obtained from the background in advance; if the reported content is verified to be illegal, outputting alarm information on a user interface, and feeding error information back to the background; the error information is used for explaining a detailed verification result of the reported content.

Description

Data verification method and device, computer storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of data verification technologies, and in particular, to a method and an apparatus for verifying data, a computer storage medium, and an electronic device.
Background
Most of the clients, as the user-oriented end, generally have very limited capability of processing data, so that the data is often required to be reported to a background and processed through the background. For example, in a product recommended based on personalization, a client often needs to report behavior data of a user to a background, and the background analyzes the reported data to describe an interest figure of the user and customize personalized recommended content for the user.
The values, formats and the like of the reported data must meet corresponding preset requirements, and the background can be guaranteed to analyze and process the data. Therefore, in the process of developing the client, the client is often required to report data to the background, and before further processing the data, the reported data is checked according to the check rule to determine whether the data reported by the client is legal or not.
In the prior art, data verification is performed in the background, but under the condition of a large data volume, the background needs to process a large data volume, which has a large pressure on calculation, storage and the like of the background. Moreover, when the data sent by the client is checked to be incorrect, the developer cannot be informed in time, so that the client cannot be corrected in time.
Disclosure of Invention
Based on the defects of the prior art, the application provides a data verification method and device, a computer storage medium and electronic equipment, so as to solve the problems that in the prior art, data is verified through a background, the pressure on the background is too large when the data volume is large, and the data cannot be informed in time when an error occurs.
In order to achieve the above object, the present application provides the following technical solutions:
a first aspect of the present application provides a data verification method, which is applied to a client, where the data verification method includes:
intercepting reported data sent to a background by the client; the reported data at least comprises a reported scene identifier and reported contents;
matching a target check rule corresponding to the reported scene identifier from a plurality of check rules, and checking the reported content based on the target check rule; wherein, one of the reported scene identifiers at least corresponds to one of the check rules; the check rule is obtained from the background in advance;
if the reported content is verified to be illegal, outputting alarm information on a user interface, and feeding error information back to the background; the error information is used for explaining a detailed verification result of the reported content.
Optionally, in the verification method, the intercepting the report data sent by the client to the background includes:
calling a script engine to execute an interception script, and monitoring and intercepting reported data sent to a background by the client in real time; the script engine is arranged in the client, and the interception script is obtained from the background in advance.
Optionally, in the verification method, the matching a target verification rule corresponding to the reported scene identifier from the multiple verification rules, and verifying the reported content based on the target verification rule includes:
for each segment of data in the reported content, respectively calling a script engine to execute a verification script, matching a target verification rule corresponding to each segment of data from a plurality of verification rules, and verifying the corresponding data based on the target verification rule corresponding to each segment of data; the target verification rule corresponding to each section of data has a corresponding relation with the reported scene identifier; the verification script is obtained from the background in advance;
if it is verified that any section of the data in the reported content does not conform to the corresponding target verification rule, determining that the reported content is illegal.
Optionally, in the foregoing verification method, the invoking the script engine to execute a verification script respectively for each piece of data in the reported content, and matching a target verification rule corresponding to each piece of data from the multiple verification rules includes:
and calling the script engine to execute a verification script respectively aiming at each section of data in the reported content, and matching out a target verification rule which contains the reported scene identifier and the rule identifier which is consistent with the attribute identifier of each section of data from the plurality of verification rules.
Optionally, in the foregoing verification method, the outputting warning information on the user interface and feeding back error information to the background includes:
calling a script engine to execute an error information generation script, generating error information containing detailed verification results of the reported content, and feeding the error information back to the background;
calling a script engine to execute an alarm script and generating and outputting an alarm window; and the alarm window is internally provided with the alarm information and an operation key for copying the error information, and the alarm information comprises alarm prompt information and developer information.
Optionally, in the verification method, the method further includes:
receiving the latest verification rule sent by the background; the latest verification rule is generated by a background according to information input by a user in a preset rule template;
and storing the latest verification rule, and deleting the verification rule which contains the same reporting scene identifier and rule identifier as the latest verification rule in the prestored verification rules.
A second aspect of the present application provides a data verification apparatus, including:
the intercepting unit is used for intercepting the reported data sent to the background by the client; the reported data at least comprises a reported scene identifier and reported contents;
the verification unit is used for matching a target verification rule corresponding to the reported scene identifier from a plurality of verification rules and verifying the reported content based on the target verification rule; wherein, one of the reported scene identifiers at least corresponds to one of the check rules; the check rule is obtained from the background in advance;
the alarm unit is used for outputting alarm information on a user interface and feeding back error information to the background when the reported content is verified to be illegal; the error information is used for explaining a detailed verification result of the reported content.
Optionally, in the above apparatus for verifying data, the intercepting unit includes:
the intercepting subunit is used for calling a script engine to execute the intercepting script, and monitoring and intercepting the reported data sent to the background by the client in real time; the script engine is arranged in the client, and the interception script is obtained from the background in advance.
Optionally, in the above client, the verification unit includes:
the verification subunit is configured to call a script engine to execute a verification script respectively for each piece of data in the reported content, match a target verification rule corresponding to each piece of data from the multiple verification rules, and verify the corresponding data based on the target verification rule corresponding to each piece of data; the target verification rule corresponding to each section of data has a corresponding relation with the reported scene identifier; the verification script is obtained from the background in advance;
if it is verified that any section of the data in the reported content does not conform to the corresponding target verification rule, determining that the reported content is illegal.
Optionally, in the above apparatus for verifying data, the verifying subunit executes the verification script for each piece of data in the reported content, and calls the script engine to execute the verification script, and when a target verification rule corresponding to each piece of data is matched from a plurality of verification rules, the verifying subunit is configured to:
and calling the script engine to execute a verification script respectively aiming at each section of data in the reported content, and matching out a target verification rule which contains the reported scene identifier and the rule identifier which is consistent with the attribute identifier of each section of data from the plurality of verification rules.
Optionally, in the above apparatus for verifying data, the alarm unit includes:
the feedback unit is used for calling a script engine to execute an error information generation script, generating error information containing detailed verification results of the reported contents and feeding the error information back to the background;
the alarm subunit is used for calling the script engine to execute the alarm script and generating and outputting an alarm window; and the alarm window is internally provided with the alarm information and an operation key for copying the error information, and the alarm information comprises alarm prompt information and developer information.
Optionally, the data verification apparatus further includes:
the receiving unit is used for receiving the latest verification rule sent by the background; the latest verification rule is generated by a background according to information input by a user in a preset rule template;
and the updating unit is used for storing the latest check rule and deleting the check rule which contains the same reporting scene identifier and rule identifier with the latest check rule in the pre-stored check rules.
A third aspect of the present application provides an electronic device comprising:
one or more processors;
a memory having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of verifying data as recited in any of the above.
A fourth aspect of the present application provides a computer storage medium storing a program for implementing the method of verifying data as described in any one of the above when the program is executed.
The data checking method is applied to the client, the reported data sent to the background are intercepted by the client, then the target checking rule corresponding to the reported scene identifier in the reported data is matched from the plurality of checking rules, and the reported content is checked based on the target checking rule, so that the data is checked at the client, the data does not need to be sent to the background and checked by the background, the too much pressure on calculation, storage and the like of the background is avoided, and the resources of the background are saved. And when the reported content is checked to be illegal, alarm information is output on a user interface, and error information is fed back to the background, so that developers can be assisted to find and correct errors in time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flowchart of a data verification method according to an embodiment of the present disclosure;
FIG. 2 is a data format in an application scenario of a personalized recommendation function in the prior art;
fig. 3 is a schematic flowchart of another data verification method according to another embodiment of the present application;
FIG. 4 is a schematic diagram of an alert window provided for output at a user interface according to another embodiment of the present application;
fig. 5 is a schematic flowchart of another data verification method according to another embodiment of the present application;
fig. 6 is a schematic flowchart of another data verification method according to another embodiment of the present application;
FIG. 7 is a diagram illustrating a default rule template according to another embodiment of the present application;
fig. 8 is a schematic structural diagram of a data verification apparatus according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In this application, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the application provides a data verification method which is applied to a client. The verification method can be particularly applied to the development and test processes of the personalized recommendation function of the client, in the process, developers need the client to send behavior data of users to the background, and the behavior data of the users are analyzed, so that contents which accord with the preferences of the users are pushed to the users. Therefore, before reporting data to the background, the client can check the data. Of course, the verification method provided by the embodiment of the present application may also be applied to the online running process of the client, and may also be applied to an application scenario in which other clients send data to the background.
First, it should be noted that the data verification method provided in the embodiment of the present application may be implemented by transplanting a script engine (JavaScript engine) in a client, and then executing a corresponding script by the script engine. Therefore, the method provided by the application can be realized through the client very simply and conveniently without changing the client too much.
For example, the javascript core engine developed by apple inc may be ported directly in the client. Therefore, in the electronic equipment using the IOS, the script engine can realize the method provided by the application through the engine interface provided by the operating system. For the electronic device using the android system, corresponding codes (C + + codes) in the script engine can be compiled into a dynamic link file (SO file), and an Interface of the engine is exposed to the android system for use through a (java native Interface, JNI) script local Interface.
Specifically, as shown in fig. 1, the method for verifying data applied to a client provided in the embodiment of the present application specifically includes:
s101, intercepting reported data sent by a client to a background, wherein the reported data at least comprises a reported scene identifier and reported content.
The reporting scene refers to a scene in which different functions report data. Therefore, the reporting scene identifier can be used to indicate which function the reported data is to realize. In different reporting scenarios, the types of data in the reported content sent by the client to the background are different, and the requirements on the format and the like of the reported content are also different, so that the reported data need to be distinguished through the reported scenario identifier. Reporting content mainly means that the data needs to be checked subsequently and is sent to a background, and the background mainly processes and analyzes the data. For example, in an application scenario of a personalized push function, the reported content mainly refers to behavior data of a user.
Of course, the reported data may further include data such as a user identifier, in addition to the reported scene identifier and the reported content. For example, as shown in fig. 2, in an application scenario of a personalized push function, four reported data structures exist in a reported data structure sent by a client, specifically, a service identifier, a user identifier, a reported scenario identifier, and a reported content. Different data are divided by separators, so that when the reported content is checked, the reported content can be determined from the reported data by the separators. (JavaScript object notation, JSON) object notation format strings, which consist of a series of key-value pairs. The value corresponding to the attribute "a" is "1", and the value corresponding to the attribute "b" is "2". The key value pairs represent different user behavior data, so that in the application scene, the reported content is checked, namely the format, value and the like of the key value pairs are checked, so that the background can understand the reported content sent by the client.
Since the method for verifying data provided by the present application can be implemented by a script engine, in another implementation of the present application, a specific implementation manner of step S101 is as follows: and calling a script engine to execute the interception script, and monitoring and intercepting the reported data sent to the background by the client in real time.
Wherein, the script engine is transplanted in the client in advance, and the interception script is also obtained from the background in advance. That is to say, in the embodiment of the present application, the client executes the pre-compiled interception script by calling the script engine to implement the function of intercepting the reported data.
S102, matching out a target check rule corresponding to the reported scene identifier from the plurality of check rules, and checking whether the reported content is legal or not based on the target check rule.
Wherein, one reported scene mark at least corresponds to one check rule. The check rule is obtained from the background in advance. The target check rule refers to a check rule corresponding to the current reported scene identifier in the pre-stored check rules.
Similarly, because the reported contents under different reporting scenes are different and the requirements for the reported contents are also different, corresponding verification rules exist for verifying the reported contents under different reporting scenes. For example, in an application scenario of a personalized push function, the reported content is generally behavior data of a user. When a video is recommended to a user, the reported behavior data of the user can be a video identifier, a video type, a viewing frequency and the like of the video recently viewed by the user, and corresponding requirements exist for different behavior data of the user, such as the type requirement, the format requirement, the value taking rule requirement and the like of the video identifier.
Optionally. The corresponding relation between each check rule and the reported scene identifier can be pre-established, so that all the check rules corresponding to the reported scene identifier can be matched, and the matched check rules are determined as target check rules.
Since more data are stored in the report content, and the requirements of values, formats and the like of different data are different, one report scene identifier may correspond to multiple check rules. The matched check rules may be one or more.
Specifically, the check rule for the reported content mainly determines whether the format, value, and the like of each data in the reported content meet the regulations in the check rule, so as to determine whether each data in the reported content is legal, that is, whether the reported content meets the requirements. For example, if the check rule specifies that a certain data type is an object and a certain specific attribute data is required to be included, the check rule checks the data type first, and if the check rule determines that the data type is the object, it further determines whether the specified attribute data is included, and if not, it determines that the reported content is illegal. Or whether certain data is integer type is checked, whether the value of the data is in a value interval set in the check rule is checked, and the like.
Optionally, in another embodiment of the present application, a specific implementation manner of step S102 is specifically:
and aiming at each section of data in the reported content, respectively calling a script engine to execute a verification script, matching a target verification rule corresponding to each section of data from a plurality of verification rules, and verifying whether the corresponding data is legal or not based on the target verification rule corresponding to each section of data.
Wherein, the verification script is obtained from the background in advance. And the target verification rule corresponding to each section of data has a corresponding relation with the reported scene identifier. That is, in the multiple target verification rules corresponding to the reporting scene identifier, each target verification rule at least corresponds to one piece of data, for example, in the reporting scene recommended by the video, one target verification rule corresponds to one piece of data or multiple pieces of data in the multiple pieces of data, such as the video identifier, the video type, and the viewing times. Because the reporting scenes are the same, the format of the reported content is determined, that is, the quantity of data contained in the reported content is the same, and the requirements of the data are also the same. Since the rules of each piece of data are usually different, it is necessary to perform verification by matching each piece of data with the target verification rule corresponding to each piece of data.
Specifically, the mapping relationship between the attribute identifier of each piece of data and the check rule may also be constructed in advance. For example, for the first piece of data in the report in fig. 2, that is, the first key-value pair, a corresponding relationship between the attribute "a" and the check rule for checking the piece of data may be established. Therefore, the corresponding relation among the verification rule, the reported scene identifier and the data attribute is established.
In the embodiment of the application, the pulling of the check rule and the check of the reported content based on the check rule are realized by the client terminal by calling the script engine to execute the check script. Therefore, the format of the check rule is JSON characters, so that the reported content can be checked based on the check rule by executing the check script. Optionally, the check rule of the JSON character format may be specifically configured as follows:
Figure BDA0002415832860000091
Figure BDA0002415832860000101
the meaning of the main content in the check rule code is shown in table 1:
TABLE 1
Figure BDA0002415832860000102
Optionally, a target check rule corresponding to a piece of data in the reported content may be matched with a piece of data, the piece of data is checked based on the matched target check rule, then a target check rule corresponding to another piece of data is matched, and the piece of data is also checked based on the matched target check rule until each piece of data is checked. Of course, all the target verification rules may be matched first, and then each piece of data is verified sequentially or simultaneously.
It should be noted that, if it is verified that any piece of data in the reported content does not conform to the corresponding target verification rule, it is determined that the reported content is illegal. In addition, in the embodiment of the application, in the checking process, even if a piece of data is checked to be inconsistent with the corresponding target checking rule, each piece of data is continued to be finished, so that all the conditions which are inconsistent with the checking rule in the reported content can be known, and the client can be modified conveniently according to the checking result. Of course, this is only one optional manner, and when it is checked that a piece of data does not conform to the check rule, the check of the reported content is ended, and step S103 is executed.
Optionally, in another embodiment of the present application, a script engine is respectively invoked for each piece of data in the reported content to execute a verification script, and a specific implementation manner of matching a target verification rule corresponding to each piece of data from a plurality of verification rules is as follows:
and respectively calling a script engine to execute a verification script aiming at each section of data in the reported content, and matching a target verification rule which contains a reported scene identifier and the rule identifier is consistent with the attribute identifier of each section of data from a plurality of verification rules.
That is to say, in the embodiment of the present application, the generated check rule includes a reporting scenario identifier and a rule identifier. The reporting scene identifier is the same as the reporting scene identifier in the reporting data to be verified, and the rule identifier is the same as the attribute identifier of the data to be verified. Therefore, the corresponding relation between the check rule and the reported scene identifier and the attribute identifier is not required to be established additionally. Therefore, when the check rule is matched, the check rule corresponding to each section of data does not need to be matched through a preset corresponding relation table. The matching of the check rule and the data is directly carried out through the reported scene and the rule identification in the check rule, so that the matching of the check rule and the newly added check rule are more convenient.
It should be noted that, if the reported content is verified to be illegal, step S103 is executed, and if the reported content is verified to be legal, the reported data is normally sent to the background for further processing.
S103, outputting alarm information on the user interface, and feeding error information back to the background.
The error information is used for explaining the detailed verification result of the reported content. The detailed verification result can refer to information obtained by verification of data with errors, types with errors, correct forms and the like in the reported content, and is mainly used for timely correcting the places with the errors by developers. Therefore, in the embodiment of the present application, the detailed verification result is not simply one of two final results of "legal" or "illegal" verification.
For example, for the reported scene identifier "0X 700844A", after the data is checked by the check rule with the rule identifier "5", the generated error information is:
1. error type [ keymiss ], error information: #/r 5/rowkey;
2. error type [ value error ], error information: #/r5/folder _ status, reported value [1], correct value [2, 3 ];
3. error type [ type error ], error information: #/r5/version _ standard, report type [ string ], correct data [ coolean ].
The type of the first part in the data which does not meet the verification rule is that the keywords of the key value pair cannot be found, that is, the keywords in the data which are not verified are not included in the keywords which are specified in advance. The second error is that the value in the key value pair is wrong, the currently reported value is [1], and the correct value should be [2, 3 ]. The third error is that the data has a data type error, the currently reported data type is a string (string), and the data type is a boolean value (boolean).
Optionally, in another embodiment of the present application, as shown in fig. 3, a specific implementation manner of the step S103 includes:
s301, calling a script engine to execute the error information generation script, generating error information containing detailed verification results of reported contents, and feeding the error information back to the background.
The error information generation script is also previously acquired from the background.
And after the error information is fed back to the background, the error information is stored by the background so that a developer can modify the client terminal aiming at the error information subsequently.
S302, calling a script engine to execute the alarm script, and generating and outputting an alarm window.
The alarm window is internally provided with alarm information and operation keys for copying error information, and the alarm information comprises alarm prompt information and developer information.
That is to say, in the embodiment of the present application, the warning information is prompted to the user in a manner of popping up the warning window, so that the user can know more directly and clearly that the error occurs in the reported data, and if the user is a developer, the user can know in time that the error occurs in the verification, so that the error is corrected in time, and the missing of the best correction opportunity is avoided. Wherein, the alarm window mainly displays alarm information and operation keys. The alarm information comprises alarm prompt information and developer information, and the alarm prompt information is used for prompting a user to report that the data has a verification error. The developer information refers to information of a developer who develops and reports current data, such as a mailbox, a mobile phone number or a job number, so that when the user is a tester, the developer can be contacted timely to correct errors through the developer information.
For example, as shown in fig. 4, when the reported content reported for recommending a video to a user is illegal, an alarm window immediately pops up on the user interface of the video topic. Wherein, the warning window displays warning prompt information: checking for errors, and information of developers behind "please contact". Certainly, the alarm window further includes an operation key for copying error information, that is, a virtual key corresponding to the word "copy information to clipboard" in the alarm window. As long as the key is clicked, the error information can be copied to the pasting board by one key, so that the error information can be directly pasted and sent to developers according to the information of the developers, and the developers can find the error information from the background more timely.
Therefore, the data verification method provided in the embodiment of the present application is generally roughly as shown in fig. 5, and the background issues the verification rule to the client in advance. When the client side reports the data to the background, the reported data sent to the background is intercepted, then the target check rule corresponding to the reported scene identifier in the reported data is matched from the plurality of check rules, and the reported content is checked based on the target check rule, so that the data is checked at the client side, the data does not need to be sent to the background and checked by the background, the too much pressure on calculation, storage and the like of the background is avoided, and the resources of the background are saved. And when the reported content is checked to be illegal, namely the reported data is determined to be illegal, an alarm popup is output on a user interface and error information is fed back to the background, and the user can feed back the error information to developers, so that the developers can be assisted to find and correct the data more timely.
Optionally, in another embodiment of the present application, the verification rule may be further updated, and a process of specifically updating the verification rule, as shown in fig. 6, includes:
s601, receiving the latest verification rule sent by the background.
And the latest verification rule is generated by the background according to the information input by the user in the preset rule template. That is to say, in the embodiment of the present application, a user may input corresponding information in a pre-constructed rule template, so that a background automatically generates a JOSN character string corresponding to a check rule, and the user does not need to compile a complete check rule. It should be noted that, in the embodiment of the present application, the user who sets the verification rule mentioned herein refers to a developer or a tester.
Optionally, a data reporting management platform may be built in the background, and a preset rule template is provided for the user in the data reporting management platform, so that the user can modify the verification rule or add a new verification rule in real time. Specifically, the data reporting management platform provides a visual interface for the user to perform verification rule configuration, and as shown in fig. 7, a preset rule template is arranged on the left side of the visual interface. A plurality of key value pair input boxes are provided on the preset rule template, a user can input or select corresponding values in the input boxes corresponding to the keys given on the template, and the data reporting management platform can automatically generate corresponding key value pairs. For example, referring to fig. 7, the user needs to input "0X 8007409" in the input box under "op _ type" given, and the data reporting management platform will automatically use "op _ type" and "0X 8007409" as a pair of key value pairs, that is, equivalent to setting the reporting scene identifier to "0X 8007409". And finally, generating a corresponding check rule by using each key value, and displaying the check rule on the right side of the visual interface. Therefore, the user only needs to input the corresponding limited content of the data in each input box on the left, and the JOSN character string of the check rule is correspondingly generated on the right, previewed for the user, stored after the user determines the check rule, and sent to the client.
S602, storing the latest verification rule, and deleting the verification rule which contains the same reporting scene identifier and rule identifier as the latest verification rule in the prestored verification rules.
In order to avoid collision, after receiving the latest check rule, the check rule with the error in advance corresponding to the latest check rule is deleted.
Another embodiment of the present application provides a data verification apparatus, as shown in fig. 8, including:
the intercepting unit 801 is configured to intercept reporting data sent by the client to the background.
The reporting data at least comprises a reporting scene identifier and reporting content.
The checking unit 802 is configured to match a target checking rule corresponding to the reported scene identifier from the multiple checking rules, and check the reported content based on the target checking rule.
Wherein, one reported scene mark at least corresponds to one check rule. The check rule is obtained from the background in advance.
And the alarm unit 803 is configured to output alarm information on the user interface and feed back error information to the background when the reported content is verified to be illegal.
The error information is used for explaining the detailed verification result of the reported content.
It should be noted that, for the specific working process of the foregoing unit in the embodiment of the present application, reference may be made to step S101 to step S103 in the foregoing method embodiment, which is not described herein again.
Optionally, in another embodiment of the present application, the intercepting unit 801 specifically includes:
and the intercepting subunit is used for calling the script engine to execute the intercepting script, and monitoring and intercepting the reported data sent to the background by the client in real time.
The script engine is arranged in the client, and the interception script is acquired from the background in advance.
It should be noted that, for the specific working process of the intercepting subunit, a specific implementation manner of step S101 in the foregoing method embodiment may be referred to accordingly, and details are not described here again.
Optionally, in another embodiment of the present application, the verification unit 802 includes:
and the checking subunit is used for calling the script engine to execute the checking script respectively aiming at each section of data in the reported content, matching a target checking rule corresponding to each section of data from the plurality of checking rules, and checking the corresponding data based on the target checking rule corresponding to each section of data.
And the target verification rule corresponding to each section of data has a corresponding relation with the reported scene identifier. The verification script is obtained from the background in advance. And if any section of data in the reported content is verified to be not in accordance with the corresponding target verification rule, determining that the reported content is illegal.
It should be noted that, for the specific working process of the verification subunit, reference may be made to a specific implementation manner of step S102 in the foregoing method embodiment, and details are not described here again.
Optionally, in another embodiment of the present application, the verifying subunit executes to call a script engine to execute the verifying script for each piece of data in the reported content, and when a target verifying rule corresponding to each piece of data is matched from the multiple verifying rules, the verifying subunit is configured to:
and respectively calling a script engine to execute a verification script aiming at each section of data in the reported content, and matching a target verification rule which contains a reported scene identifier and the rule identifier is consistent with the attribute identifier of each section of data from a plurality of verification rules.
Optionally, in another embodiment of the present application, the alarm unit 803 includes:
and the feedback unit is used for calling the script engine to execute the error information generation script, generating error information containing detailed verification results of the reported contents and feeding the error information back to the background.
And the alarm subunit is used for calling the script engine to execute the alarm script and generating and outputting an alarm window.
The alarm window is internally provided with alarm information and operation keys for copying error information, and the alarm information comprises alarm prompt information and developer information.
It should be noted that, for the specific working process of the foregoing unit in the embodiment of the present application, reference may be made to step S301 to step S302 in the foregoing method embodiment, which is not described herein again.
Optionally, in another embodiment of the present application, the data verification apparatus may further include:
and the receiving unit is used for receiving the latest verification rule sent by the background.
And the latest verification rule is generated by the background according to the information input by the user in the preset rule template.
And the updating unit is used for storing the latest verification rule and deleting the verification rule which contains the same reporting scene identifier and rule identifier as the latest verification rule in the prestored verification rules.
It should be noted that, for the specific working process of the foregoing unit in the embodiment of the present application, reference may be made to step S601 to step S602 in the foregoing method embodiment, which is not described herein again.
According to the client side provided by the embodiment of the application, the reported data sent to the background is intercepted, the target verification rule corresponding to the reported scene identifier in the reported data is matched from the multiple verification rules, and the reported content is verified based on the target verification rule, so that the data is verified at the client side, the data does not need to be sent to the background and verified by the background, too much pressure on calculation, storage and the like of the background is avoided, and resources of the background are saved. And when the reported content is verified to be illegal, alarm information is output on a user interface, and error information is fed back to the background, so that developers can be assisted to find and correct errors in time.
Another embodiment of the present application provides an electronic device, as shown in fig. 9, including:
one or more processors 901, and memory 902.
Wherein one or more programs are stored on the memory 902. The one or more programs on the memory 902, when executed by the one or more processors 901, cause the one or more processors 901 to implement a method of verifying data as provided in any of the method embodiments described above.
Another embodiment of the present application provides a computer storage medium for storing a program, which when executed, implements a method for verifying data as provided in any one of the above method embodiments.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A data verification method is applied to a client, and the data verification method comprises the following steps:
intercepting reported data sent to a background by the client; the reported data at least comprises a reported scene identifier and reported contents;
matching a target check rule corresponding to the reported scene identifier from a plurality of check rules, and checking the reported content based on the target check rule; wherein, one of the reported scene identifiers at least corresponds to one of the check rules; the check rule is obtained from the background in advance;
if the reported content is verified to be illegal, outputting alarm information on a user interface, and feeding error information back to the background; the error information is used for explaining a detailed verification result of the reported content.
2. The method of claim 1, wherein intercepting the report data sent by the client to the background comprises:
calling a script engine to execute an interception script, and monitoring and intercepting reported data sent to a background by the client in real time; the script engine is arranged in the client, and the interception script is obtained from the background in advance.
3. The method of claim 1, wherein matching out a target check rule corresponding to the reporting scenario identifier from a plurality of check rules, and checking the reporting content based on the target check rule comprises:
for each segment of data in the reported content, respectively calling a script engine to execute a verification script, matching a target verification rule corresponding to each segment of data from a plurality of verification rules, and verifying the corresponding data based on the target verification rule corresponding to each segment of data; the target verification rule corresponding to each section of data has a corresponding relation with the reported scene identifier; the verification script is obtained from the background in advance;
if it is verified that any section of the data in the reported content does not conform to the corresponding target verification rule, determining that the reported content is illegal.
4. The method of claim 3, wherein the invoking the script engine to execute a verification script for each piece of data in the reported content, and matching a target verification rule corresponding to each piece of data from the plurality of verification rules comprises:
and calling the script engine to execute a verification script respectively aiming at each section of data in the reported content, and matching out a target verification rule which contains the reported scene identifier and the rule identifier which is consistent with the attribute identifier of each section of data from the plurality of verification rules.
5. The method of claim 1, wherein outputting alarm information at the user interface and feeding error information back to the background comprises:
calling a script engine to execute an error information generation script, generating error information containing detailed verification results of the reported content, and feeding the error information back to the background;
calling a script engine to execute an alarm script and generating and outputting an alarm window; and the alarm window is internally provided with the alarm information and an operation key for copying the error information, and the alarm information comprises alarm prompt information and developer information.
6. The method of claim 1, further comprising:
receiving the latest verification rule sent by the background; the latest verification rule is generated by a background according to information input by a user in a preset rule template;
and storing the latest verification rule, and deleting the verification rule which contains the same reporting scene identifier and rule identifier as the latest verification rule in the prestored verification rules.
7. An apparatus for verifying data, comprising:
the intercepting unit is used for intercepting the reported data sent to the background by the client; the reported data at least comprises a reported scene identifier and reported contents;
the verification unit is used for matching a target verification rule corresponding to the reported scene identifier from a plurality of verification rules and verifying the reported content based on the target verification rule; wherein, one of the reported scene identifiers at least corresponds to one of the check rules; the check rule is obtained from the background in advance;
the alarm unit is used for outputting alarm information on a user interface and feeding back error information to the background when the reported content is verified to be illegal; the error information is used for explaining a detailed verification result of the reported content.
8. The apparatus according to claim 7, wherein the intercepting unit comprises:
the intercepting subunit is used for calling a script engine to execute the intercepting script, and monitoring and intercepting the reported data sent to the background by the client in real time; the script engine is arranged in the client, and the interception script is obtained from the background in advance.
9. An electronic device, comprising:
one or more processors;
a memory having one or more programs stored thereon;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method of verifying data as recited in any of claims 1 to 6.
10. A computer storage medium storing a program for implementing a method of verifying data according to any one of claims 1 to 6 when the program is executed.
CN202010190810.3A 2020-03-18 2020-03-18 Data verification method and device, computer storage medium and electronic equipment Active CN111428132B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010190810.3A CN111428132B (en) 2020-03-18 2020-03-18 Data verification method and device, computer storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010190810.3A CN111428132B (en) 2020-03-18 2020-03-18 Data verification method and device, computer storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN111428132A true CN111428132A (en) 2020-07-17
CN111428132B CN111428132B (en) 2023-09-19

Family

ID=71546483

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010190810.3A Active CN111428132B (en) 2020-03-18 2020-03-18 Data verification method and device, computer storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111428132B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380200A (en) * 2020-11-10 2021-02-19 中国人寿保险股份有限公司 Insurance information verification method and device
CN112883422A (en) * 2021-02-24 2021-06-01 江苏保旺达软件技术有限公司 Database access control method and device based on protocol analysis and server
CN113986898A (en) * 2021-10-26 2022-01-28 深信服科技股份有限公司 Data quality detection method, device, equipment and readable storage medium
CN114553666A (en) * 2022-01-07 2022-05-27 广东万丈金数信息技术股份有限公司 Channel event reporting method, system, device and storage medium
CN116633698A (en) * 2023-07-25 2023-08-22 中国电信股份有限公司 Data transmission method, apparatus, computer device, storage medium, and program product

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090063319A1 (en) * 2007-09-05 2009-03-05 American Express Travel Related Services Company, Inc. System and method for monitoring acquisition channels
CN102063306A (en) * 2011-01-06 2011-05-18 夏春秋 Technical implementation method for application development through electronic form
CN102932332A (en) * 2012-09-28 2013-02-13 用友软件股份有限公司 Data verifying system and data verifying method
CN104239162A (en) * 2014-09-09 2014-12-24 北京国双科技有限公司 Data check method and data check device
CN106227862A (en) * 2016-07-29 2016-12-14 浪潮软件集团有限公司 E-commerce data integration method based on distribution
CN107895286A (en) * 2017-11-13 2018-04-10 天津幸福生命科技有限公司 Amount for which loss settled determines method and device, storage medium and electronic equipment
CN108629180A (en) * 2018-03-29 2018-10-09 腾讯科技(深圳)有限公司 The determination method and apparatus of abnormal operation, storage medium, electronic device
CN109033206A (en) * 2018-06-29 2018-12-18 北京奇虎科技有限公司 A kind of rule matching method, Cloud Server and rule match system
CN109377393A (en) * 2018-10-18 2019-02-22 阳光人寿保险股份有限公司 Regular method of calibration and device
US20190230129A1 (en) * 2018-01-23 2019-07-25 CYBRIC Inc. Monitoring & reporting enterprise level cybersecurity remediation
CN110287971A (en) * 2019-05-22 2019-09-27 平安银行股份有限公司 Data verification method, device, computer equipment and storage medium
CN110704381A (en) * 2019-09-06 2020-01-17 平安城市建设科技(深圳)有限公司 Data analysis method, device and storage medium
CN110766160A (en) * 2019-10-21 2020-02-07 北京明略软件系统有限公司 Data verification method and device, storage medium and electronic equipment

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090063319A1 (en) * 2007-09-05 2009-03-05 American Express Travel Related Services Company, Inc. System and method for monitoring acquisition channels
CN102063306A (en) * 2011-01-06 2011-05-18 夏春秋 Technical implementation method for application development through electronic form
CN102932332A (en) * 2012-09-28 2013-02-13 用友软件股份有限公司 Data verifying system and data verifying method
CN104239162A (en) * 2014-09-09 2014-12-24 北京国双科技有限公司 Data check method and data check device
CN106227862A (en) * 2016-07-29 2016-12-14 浪潮软件集团有限公司 E-commerce data integration method based on distribution
CN107895286A (en) * 2017-11-13 2018-04-10 天津幸福生命科技有限公司 Amount for which loss settled determines method and device, storage medium and electronic equipment
US20190230129A1 (en) * 2018-01-23 2019-07-25 CYBRIC Inc. Monitoring & reporting enterprise level cybersecurity remediation
CN108629180A (en) * 2018-03-29 2018-10-09 腾讯科技(深圳)有限公司 The determination method and apparatus of abnormal operation, storage medium, electronic device
CN109033206A (en) * 2018-06-29 2018-12-18 北京奇虎科技有限公司 A kind of rule matching method, Cloud Server and rule match system
CN109377393A (en) * 2018-10-18 2019-02-22 阳光人寿保险股份有限公司 Regular method of calibration and device
CN110287971A (en) * 2019-05-22 2019-09-27 平安银行股份有限公司 Data verification method, device, computer equipment and storage medium
CN110704381A (en) * 2019-09-06 2020-01-17 平安城市建设科技(深圳)有限公司 Data analysis method, device and storage medium
CN110766160A (en) * 2019-10-21 2020-02-07 北京明略软件系统有限公司 Data verification method and device, storage medium and electronic equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
LIHONG Z: ""Data Integrity Verification Method with Secure Deduplication in Cloud Storage"", <COMPUTER ENGINEERING>, pages 32 - 42 *
韩心慧 等: ""云端Web服务器敏感数据保护方法研究"", 《清华大学学报(自然科学版)》, pages 51 - 65 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112380200A (en) * 2020-11-10 2021-02-19 中国人寿保险股份有限公司 Insurance information verification method and device
CN112883422A (en) * 2021-02-24 2021-06-01 江苏保旺达软件技术有限公司 Database access control method and device based on protocol analysis and server
CN113986898A (en) * 2021-10-26 2022-01-28 深信服科技股份有限公司 Data quality detection method, device, equipment and readable storage medium
CN114553666A (en) * 2022-01-07 2022-05-27 广东万丈金数信息技术股份有限公司 Channel event reporting method, system, device and storage medium
CN114553666B (en) * 2022-01-07 2024-01-19 广东万丈金数信息技术股份有限公司 Channel event reporting method, system, device and storage medium
CN116633698A (en) * 2023-07-25 2023-08-22 中国电信股份有限公司 Data transmission method, apparatus, computer device, storage medium, and program product
CN116633698B (en) * 2023-07-25 2023-10-31 中国电信股份有限公司 Data transmission method, apparatus, computer device, storage medium, and program product

Also Published As

Publication number Publication date
CN111428132B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
CN111428132B (en) Data verification method and device, computer storage medium and electronic equipment
US20180314622A1 (en) System and method for implementing an api validator tool
US10540270B1 (en) Representation-based automated software testing
US20080127175A1 (en) Packaging software products as single-file executables containing scripting logic
AU2021206497B2 (en) Method and apparatus for authority control, computer device and storage medium
CN110933095A (en) Message parsing method and device
CN111290742A (en) Parameter verification method and device, electronic equipment and readable storage medium
CN108959095B (en) Method for verifying XML document based on XML Schema
CN112100078A (en) Method, device and equipment for generating interface test case
WO2023179749A1 (en) Configuration data processing system and method, and electronic device
CN113986256A (en) Method and device for issuing application program, electronic equipment and storage medium
CN113330419A (en) Equipment application installation method and device
CN113760697A (en) Interface testing method and device, electronic equipment and storage medium
CN113778725A (en) Data verification method and device
US11366642B1 (en) Change migration: processes for ensuring successful deployment of design changes
CN112182552B (en) Real-name authentication method and device, electronic equipment and storage medium
CN114090060A (en) Webpage configuration method and device, terminal equipment and readable storage medium
CN108170557B (en) Method and apparatus for outputting information
CN114816965A (en) Data verification method and device
CN114371866A (en) Version reconfiguration test method, device and equipment of service system
CN111752642A (en) Configuration modification method and device, computing equipment and storage medium
CN114741274B (en) Abnormality testing method and device
CN116303729B (en) Information acquisition method, device, equipment and medium
CN115543227B (en) Cross-system data migration method, system, electronic device and storage medium
US20230370331A1 (en) Parameter value setting system, control method of parameter value setting system and program

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