CN114003609B - Method and device for monitoring number of to-be-examined data - Google Patents

Method and device for monitoring number of to-be-examined data Download PDF

Info

Publication number
CN114003609B
CN114003609B CN202111629567.1A CN202111629567A CN114003609B CN 114003609 B CN114003609 B CN 114003609B CN 202111629567 A CN202111629567 A CN 202111629567A CN 114003609 B CN114003609 B CN 114003609B
Authority
CN
China
Prior art keywords
pending
counter
group identifier
database
items
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
CN202111629567.1A
Other languages
Chinese (zh)
Other versions
CN114003609A (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.)
Feihu Information Technology Tianjin Co Ltd
Original Assignee
Feihu Information Technology Tianjin 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 Feihu Information Technology Tianjin Co Ltd filed Critical Feihu Information Technology Tianjin Co Ltd
Priority to CN202111629567.1A priority Critical patent/CN114003609B/en
Publication of CN114003609A publication Critical patent/CN114003609A/en
Application granted granted Critical
Publication of CN114003609B publication Critical patent/CN114003609B/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/26Visual data mining; Browsing structured data

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method and a device for monitoring the number of data to be examined, wherein the method comprises the following steps: when it is detected that the pending data carrying the target group identifier is processed, updating the number of pending entries corresponding to the target group identifier in the pending counter, and pushing each group identifier in the updated pending counter and the number of pending entries corresponding to each group identifier to the visual page. On one hand, the change of the number of the data to be inspected is recorded in real time by using the counter to be inspected, a database table to be inspected does not need to be frequently inquired, the pressure of the database is reduced, on the other hand, when the number of the items to be inspected corresponding to the group identification or the group identification in the counter to be inspected changes, the group identification in the counter to be inspected and the number of the items to be inspected corresponding to the group identification are pushed to a visual page, and occupied server resources are reduced.

Description

Method and device for monitoring number of to-be-examined data
Technical Field
The invention relates to the technical field of data processing, in particular to a method and a device for monitoring the number of data to be examined.
Background
In the auditing system, different data to be audited are grouped according to the content of the data to be audited. In order to remind the auditors of the backlog of the data to be audited, the number of the items of the data to be audited in each group needs to be displayed.
At present, a page polling mode is adopted to query the number of data to be examined in different groups from a database in real time and return the data to a page for displaying. However, due to the large number of groups, frequent database queries can cause the database to be over-stressed and occupy excessive server resources.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for monitoring the amount of pending data, so as to solve the problems of excessive database pressure and excessive server resource occupation caused by frequently querying a database.
In order to achieve the above purpose, the embodiments of the present invention provide the following technical solutions:
the first aspect of the embodiment of the invention discloses a method for monitoring the number of pending data, which comprises the following steps:
when it is detected that pending data carrying a target group identifier is processed, updating the number of pending entries corresponding to the target group identifier in a pending counter, wherein the pending counter comprises a plurality of group identifiers and the number of pending entries corresponding to each group identifier, the target group identifier is any group identifier contained in the pending counter, and the pending counter is initialized in advance according to a database pending table;
and pushing each group identifier in the updated counter to be examined and the number of the items to be examined corresponding to the group identifier to a visual page.
Preferably, when it is detected that the pending data carrying the target group identifier is processed, updating the number of pending entries corresponding to the target group identifier in the pending counter includes:
when it is detected that the data to be examined carrying the target grouping identifier is stored in an auditing system, adding n to the number of items to be examined corresponding to the target grouping identifier in the counter to be examined, wherein n is the number of the data to be examined;
and when the examined data carrying the target grouping identification is detected to be examined completely, subtracting n from the number of the examined items corresponding to the target grouping identification in the examined counter.
Preferably, the process of initializing the pending counter includes:
scanning a database pending table to obtain a group identifier in the database pending table and the number of pending entries corresponding to the group identifier, and storing the obtained group identifier in the database pending table and the number of pending entries corresponding to the group identifier in the database pending table to the pending counter.
Preferably, the method further comprises:
according to the timing task, periodically acquiring the grouping identification in the database pending list and the number of the items to be checked corresponding to the grouping identification;
comparing whether the group identification acquired from the database pending list is consistent with the group identification in the pending counter, and comparing whether the corresponding pending items in the database pending list and the pending counter of the same group identification are consistent;
and if any one of the group identifications acquired from the database pending list is not consistent with the group identification in the pending counter, or if any one of the group identifications is not consistent with the number of the corresponding pending items in the database pending list and the pending counter, replacing the group identification in the pending counter and the number of the corresponding pending items by using the group identification acquired from the database pending list and the number of the corresponding pending items.
Preferably, the method further comprises:
when an instruction of a calibration request sent by a user is detected, acquiring a group identifier in the database pending table and the number of entries to be checked corresponding to the group identifier;
comparing whether the group identification acquired from the database pending list is consistent with the group identification in the pending counter, and comparing whether the corresponding pending items in the database pending list and the pending counter of the same group identification are consistent;
and if any one of the group identifications acquired from the database pending list is not consistent with the group identification in the pending counter, or if any one of the group identifications is not consistent with the number of the corresponding pending items in the database pending list and the pending counter, replacing the group identification in the pending counter and the number of the corresponding pending items by using the group identification acquired from the database pending list and the number of the corresponding pending items.
Preferably, before pushing each of the group identifiers in the updated pending counter and the number of pending entries corresponding to the group identifier to a visual page, the method further includes:
and establishing long connection with the visual page.
A second aspect of the embodiments of the present invention discloses a device for monitoring the number of pending data, where the device includes:
the updating unit is used for updating the number of the items to be inspected corresponding to the target group identifier in a counter to be inspected when the fact that the data to be inspected carrying the target group identifier is processed is detected, the counter to be inspected comprises a plurality of group identifiers and the number of the items to be inspected corresponding to each group identifier, the target group identifier is any group identifier contained in the counter to be inspected, and the counter to be inspected is initialized in advance according to a database table to be inspected;
and the pushing unit is used for pushing each group identifier in the updated pending counter and the number of the items to be checked corresponding to the group identifier to a visual page.
Preferably, the update unit includes:
the increasing module is used for adding n to the number of items to be examined corresponding to the target group identifier in the counter to be examined when the data to be examined carrying the target group identifier is detected to be stored in an auditing system, wherein n is the number of the data to be examined;
and the reduction module is used for reducing the number of the to-be-examined items corresponding to the target group identifier in the to-be-examined counter by n when the to-be-examined data carrying the target group identifier is detected to be examined completely.
Preferably, the pushing unit includes:
and the initialization module is used for scanning the database pending table to obtain the group identifier in the database pending table and the number of pending items corresponding to the group identifier, and storing the obtained group identifier in the database pending table and the number of pending items corresponding to the group identifier in the database pending table to the pending counter.
Preferably, the apparatus further comprises:
the first acquisition unit is used for periodically acquiring the grouping identification in the database pending table and the number of items to be checked corresponding to the grouping identification according to the timing task;
the first comparison unit is used for comparing whether the group identification acquired from the database pending table is consistent with the group identification in the pending counter or not and comparing whether the number of corresponding pending items of the same group identification in the database pending table and the pending counter is consistent or not;
and the first replacing unit is used for replacing the group identifier in the pending counter and the number of the items to be checked corresponding to the group identifier by using the group identifier acquired from the database pending table and the number of the items to be checked corresponding to the group identifier if any one group identifier acquired from the database pending table is inconsistent with the group identifier in the pending counter or if any one group identifier is inconsistent with the number of the items to be checked corresponding to the group identifier in the database pending table and the number of the items to be checked corresponding to the group identifier acquired from the database pending table.
Based on the method and the device for monitoring the number of the data to be examined provided by the embodiment of the invention, the method comprises the following steps: when it is detected that the pending data carrying the target group identifier is processed, updating the number of pending entries corresponding to the target group identifier in the pending counter, and pushing each group identifier in the updated pending counter and the number of pending entries corresponding to each group identifier to the visual page. The method has the advantages that the counter to be audited is used for counting the number of the items to be audited of the data to be audited in the auditing system, the database is prevented from being inquired for many times, the pressure of the database is reduced, the grouping identification in the counter to be audited and the number of the items to be audited corresponding to the grouping identification are pushed to the visual page, and occupied server resources are reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for monitoring the amount of pending data according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a relationship between a group identifier and a pending entry number according to an embodiment of the present invention;
FIG. 3 is a flowchart of calibrating a pending counter according to an embodiment of the present invention;
FIG. 4 is another flowchart of calibrating a pending counter according to an embodiment of the present invention;
fig. 5 is a block diagram of an apparatus for monitoring the amount of pending data according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
In this application, 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.
As can be seen from the background art, a page polling method is currently used, that is, an interface is called every few seconds to query the number of pieces of data to be reviewed in different groups from a database, and the queried number and groups are sent to a page for presentation. However, due to the large number of groups, frequent database query can cause data to be over-stressed and occupy excessive server resources.
Therefore, embodiments of the present invention provide a method and an apparatus for monitoring the number of pending data, where when it is detected that pending data carrying a target group identifier is processed, the number of pending entries corresponding to the target group identifier in a pending counter is updated, and each updated group identifier in the pending counter and the number of pending entries corresponding to each group identifier are pushed to a visual page. On one hand, the change of the number of the to-be-examined items of the to-be-examined data is recorded in real time by using the to-be-examined counter, the to-be-examined table of the database does not need to be frequently inquired, the pressure of the database is reduced, on the other hand, when the number of the to-be-examined items corresponding to any group identification or any group identification in the to-be-examined counter changes, the group identification in the to-be-examined counter and the number of the to-be-examined items corresponding to the group identification are pushed to a visual page, and the occupation of server resources is reduced.
It should be noted that the method and the device for monitoring the amount of the pending data provided by the embodiment of the present invention can be applied to an auditing system. In the embodiment of the present invention, data auditing may be understood as that data in a business system is stored in an auditing system to wait for auditing. The group identification can be understood as: the auditing system divides a plurality of pieces of data to be audited into a plurality of groups according to contents, and each group has a corresponding group identifier (such as group id). The number of the items to be examined corresponding to the grouping identification is as follows: the group identifies the amount of pending data in the corresponding group.
Referring to fig. 1, a flowchart of a method for monitoring a quantity of pending data according to an embodiment of the present invention is shown, where the method for monitoring a quantity of pending data includes:
step S101: and when the data to be examined carrying the target grouping identification is detected to be processed, updating the number of the items to be examined corresponding to the target grouping identification in the counter to be examined.
In the process of implementing step S101 specifically, when it is detected that the pending data carrying the target group identifier is processed, the number of pending entries corresponding to the target group identifier in the pending counter is updated according to the processing mode. The pending counter comprises a plurality of group identifiers and the number of pending items corresponding to the group identifiers, and the target group identifier can be any one of the group identifiers in the pending counter.
It is understood that before step S101 is executed, the pending counter has been initialized in advance according to the database pending table. Specifically, the method may be understood as scanning the database pending table to obtain a plurality of group identifiers and the number of pending entries corresponding to each group identifier in the database pending table, and storing the group identifiers and the number of pending entries corresponding to the group identifiers in the pending counter.
It should be noted that the database in the embodiment of the present invention may be a redis database, and the database pending table is a mysql table using a redis data structure. Each piece of data to be examined is assigned a group identifier (e.g., groupId) when being stored in the database table to be examined.
It is understood that the pending counter may be a hash table stored in the redis cache, where the hash table has three fields of key, field, and value, and one key corresponds to one hash table, and one hash table may store multiple sets of field and value key value pairs. The field indicates a group identifier (grouped) in the pending counter, and the field value indicates the number of pending entries corresponding to the group identifier. That is, the field value is a group identifier (grouped), and the field value is the number of entries to be examined corresponding to the group identifier.
It can be understood that, when it is detected that the pending data carrying the target group identifier is stored in a database pending table (e.g., mysql table) in the auditing system, that is, when the data is pending, n (n > = 1) is added to the number of pending entries corresponding to the target group identifier in the pending counter, where n is the number of pending entries of the pending data stored in the auditing system.
For example, when the pending data a carrying the target group identifier a is stored in the database pending table of the auditing system, the number of pending entries corresponding to the group identified by the group identifier a is added by 1, and the pending data a is indicated to be stored in the auditing system, that is, the data is subject to auditing.
And when the fact that the data to be examined carrying the target grouping identification is examined and finished is detected, namely the data to be examined is examined and finished, the number of the items to be examined corresponding to the target grouping identification in the counter to be examined is reduced by n (n > = 1).
It should be noted that the data auditing specifically refers to: and (5) auditing the data to be audited in the database table to be audited, and judging whether the data to be audited is normal or abnormal.
For example: and after the data to be examined B carrying the target grouping identification a completes data examination, subtracting 1 from the number of the items to be examined corresponding to the grouping with the grouping identification a in the counter to be examined.
Step S102: and pushing each group identifier in the updated counter to be examined and the number of the corresponding items to be examined to a visual page.
In the process of implementing step S102 specifically, when the group identifier in the pending counter or the number of pending entries corresponding to the group identifier is updated, the data pusher is used to push the group identifier in the pending counter and the number of pending entries corresponding to the group identifier (in a push message pushing manner) to the visual page.
It will be appreciated that the visualization page may be a page in the audit system that is provided to the user for data processing (e.g., a page of audit data). A schematic diagram of a relationship between the group identifier and the number of the to-be-inspected items corresponding to the group identifier is shown in fig. 2, for example, the group identifier is PGC, and the number of the to-be-inspected items corresponding to the group identifier is 6; the grouping mark is a reported video, the number of the corresponding items to be examined is 20, the grouping mark is recorded and broadcast, and the number of the corresponding items to be examined is 681.
Preferably, before step S102 is executed, a long connection is established with the visualization page, wherein the long connection means that a plurality of data packets can be continuously transmitted over one connection. The data pusher can push the group identification in the counter to be examined and the number of the items to be examined corresponding to the group identification to the visual page in real time based on the long connection established with the visual page.
According to the content, when the group identifier in the counter to be examined and/or the number of the items to be examined corresponding to the group identifier are/is changed, the changed group identifier in the counter to be examined and the number of the items to be examined corresponding to the group identifier are pushed to the visual page. However, in a specific engineering application, the group identifier in the pending counter and the number of pending entries corresponding to the group identifier may be periodically pushed to a visualization page, for example: and pushing all the group identifications in the counter to be examined and the number of the items to be examined corresponding to the group identifications to a visual page by using a data pusher every second for displaying.
In some embodiments, to ensure the accuracy of the data in the pending counter, the data (the group identifier and the number of entries to be checked) in the pending counter may be calibrated, so as to prevent inconsistency between the data stored in the pending table of the database and the data stored in the pending counter. The specific implementation manner of calibrating the to-be-audited counter is detailed in the following description of the embodiment of the present invention in fig. 3 and 4.
In the embodiment of the invention, after the data to be examined is processed, the number of the items to be examined corresponding to the target group identifier carried by the data to be examined is maintained in real time by using the counter to be examined, and the updated group identifier in the counter to be examined and the number of the items to be examined corresponding to the group identifier are pushed to the visual page through the data pusher so as to be visually displayed. The method effectively avoids frequently inquiring the database to obtain the group identification and the number of the to-be-examined items corresponding to the group identification by using the to-be-examined counter, reduces the pressure of the database, establishes long connection with the visual page and reduces occupied server resources.
In the above-mentioned embodiment of the present invention, a specific implementation manner of calibrating a to-be-audited counter by using a number calibrator in fig. 1 is shown in fig. 3, which is a flowchart illustrating calibration of the to-be-audited counter provided in the embodiment of the present invention, and includes:
step S301: and according to the timing task, periodically acquiring the group identification in the pending table of the database and the number of the entries to be checked corresponding to the group identification.
In the process of implementing step S301, periodically obtaining all the group identifiers and the number of to-be-examined entries corresponding to the group identifiers in the to-be-examined table of the database according to a preset time (e.g., 30 minutes). For comparison with the group identification and the number of pending items corresponding to the group identification in the pending counter.
Step S302: and comparing whether the group identification acquired from the database pending table is consistent with the group identification in the pending counter. If the group identifier obtained from the database pending table is consistent with the group identifier in the pending counter, executing step S303; if the group identifier obtained from the database pending table is not consistent with the group identifier in the pending counter, step S304 is executed.
It should be noted that, under normal conditions, the group identifier in the pending counter is consistent with the group identifier in the database pending table, but a situation that the group identifier stored in the pending counter is inconsistent with the group identifier stored in the database pending table may occur, and when the group identifier acquired from the database pending table is inconsistent with the group identifier in the pending counter, it is indicated that the group identifier stored in the pending counter has an error, and the to-be-audited counter needs to be calibrated.
It is to be understood that the grouping identification obtained from the database pending table is, for example, A, B, C; and comparing the grouping identifiers of the pending counter to obtain A, B, C, wherein the two grouping identifiers are both A, B, C, and indicating that the grouping identifier obtained from the database pending table is consistent with the grouping identifier in the pending counter. And if the group identifier in the pending counter is A, B, D, indicating that the group identifier obtained from the database pending table is inconsistent with the group identifier in the pending counter.
Step S303: and comparing whether the number of corresponding items to be checked in the database to be checked and the counter to be checked of the same group identifier is consistent or not. If the number of corresponding items to be checked in the database to be checked and the counter to be checked of the same group identifier is consistent, executing the step S301; if any one of the group identifiers is inconsistent with the corresponding number of the items to be checked in the database to be checked and the counter to be checked, step S304 is executed.
It should be noted that, under normal conditions, the number of the pending entries corresponding to the group identifier in the pending counter is the same as the number of the pending entries corresponding to the group identifier in the database pending table, but in order to prevent the number of the pending entries corresponding to the group identifier in the pending counter from being inconsistent with the number of the pending entries corresponding to the group identifier in the database pending table, and further, an abnormal situation of pushing the wrong data to the visual page occurs, calibration needs to be performed on the pending counter.
In the process of implementing step S303 specifically, after determining that the group identifier obtained from the database pending table is consistent with the group identifier in the pending counter through step S302, comparing whether the number of the pending entries corresponding to the same group identifier in the database pending table and the pending counter is the same, when the number of the pending entries corresponding to the same group identifier in the database pending table and the pending counter is the same, indicating that the number of the pending entries corresponding to the same group identifier in the pending counter is consistent with the number of the pending entries corresponding to the database pending table, and returning to step S301 to continue waiting for the next certain time task.
It can be understood that, for example, the number of pending entries corresponding to the group identifier a, the number of pending entries corresponding to the group identifier B, and the number of pending entries corresponding to the group identifier C, which are obtained from the database pending table, are 2, 4, and 1; the number of the to-be-inspected items corresponding to the group identifier A in the to-be-inspected counter is 2, the number of the to-be-inspected items corresponding to the group identifier B is 4, and the number of the to-be-inspected items corresponding to the group identifier C is 1, and at the moment, the numbers of the to-be-inspected items corresponding to the group identifiers are compared, so that the numbers of the to-be-inspected items corresponding to the same group identifier in the database to-be-inspected counter and the to-be-inspected counter are indicated to be consistent. If the number of the pending entries corresponding to the group identifier a in the pending counter is 4, the number of the pending entries corresponding to the group identifier B is 4, and the number of the pending entries corresponding to the group identifier C is 1, indicating that the number of the pending entries corresponding to the group identifier a obtained from the pending table of the database is inconsistent with the number of the pending entries corresponding to the group identifier a in the pending counter.
That is to say, it is determined that the data in the pending counter is consistent with the data in the database pending table, and two conditions need to be simultaneously satisfied, where the first condition is that the group identifier obtained from the database pending table is consistent with the group identifier in the pending counter, and the second condition is that the number of the corresponding pending entries in the database pending table and the pending counter of the same group identifier is consistent.
Step S304: and replacing the group identification and the corresponding number of the items to be examined in the counter to be examined by using the group identification and the corresponding number of the items to be examined which are obtained from the database table to be examined.
In the process of implementing step S304 specifically, when the group identifier obtained from the database pending table is inconsistent with the group identifier in the pending counter, or when any one of the group identifiers is inconsistent with the number of the pending entries corresponding to the database pending table and the pending counter, the group identifier obtained from the database pending table and the number of the pending entries corresponding to the group identifier are stored in the pending counter to replace the group identifier in the pending counter and the number of the pending entries corresponding to the group identifier, thereby implementing the calibration of the pending counter.
It should be noted that, after the calibration of the counter to be audited is completed, the process returns to step S301 to continue waiting for the next timing task.
In the embodiment of the invention, whether the data in the counter to be checked is consistent with the data in the database table to be checked or not is periodically checked according to the timing task, and when the data in the counter to be checked is inconsistent with the data in the database table to be checked, the data in the counter to be checked is replaced by the data in the database table to be checked, so that the data in the counter to be checked is ensured to be accurate, and the reliability of the counter to be checked is improved.
Referring to fig. 4, another flowchart of calibrating a counter under examination provided by an embodiment of the present invention is shown, including:
step S401: and when an instruction of a calibration request sent by a user is detected, acquiring the group identification in the pending table of the database and the number of the entries to be checked corresponding to the group identification.
It can be understood that, when an instruction of a calibration request sent by a user is detected, the user is instructed to wish to calibrate the counter to be audited to check the accuracy of the counter to be audited, and at this time, the group identifier and the number of entries to be audited corresponding to the group identifier are obtained from the database table to be audited.
Step S402: and comparing whether the group identification acquired from the database pending table is consistent with the group identification in the pending counter. If the group identifier obtained from the database pending list is consistent with the group identifier in the pending counter, step S403 is executed, and if the group identifier obtained from the database pending list is inconsistent with the group identifier in the pending counter, step S404 is executed.
It should be noted that, for the specific implementation process of comparing whether the group identifier obtained from the pending table of the database in step S402 is consistent with the group identifier in the pending counter, the implementation principle of the step mentioned in step S302 is the same, and details are not repeated here.
Step S403: and comparing whether the number of corresponding items to be checked in the database to be checked and the counter to be checked of the same group identifier is consistent or not. If the number of corresponding items to be checked in the database to be checked and the counter to be checked of the same group identifier is consistent, executing the step S401; if the number of the corresponding items to be examined in the database to be examined and the counter to be examined of any one group identifier is not consistent, step S404 is executed.
It should be noted that, for the specific implementation process of comparing whether the numbers of the corresponding pending entries in the pending table and the pending counter of the same group identifier in step S403 are consistent, the implementation principle of the step mentioned in step S303 is the same, and details are not repeated here.
Step S404: and replacing the group identification and the corresponding number of the items to be examined in the counter to be examined by using the group identification and the corresponding number of the items to be examined which are obtained from the database table to be examined.
It should be noted that, the specific implementation process of calibrating the pending counter in step S404 is the same as the implementation principle of the step mentioned in step S304, and is not described herein again.
It is understood that, after the calibration of the counter to be audited is completed, the process returns to step S401 to continue to detect whether there is a calibration request sent by the user.
In the real-time embodiment of the invention, when a request sent by a user for calibrating the counter to be examined is detected, the group identification and the number of the corresponding items stored in the counter to be examined are compared with the group identification and the number of the corresponding items stored in the table to be examined of the database, when the group identification acquired from the table to be examined of the database is inconsistent with the group identification in the counter to be examined, or when any one group identification is inconsistent with the number of the corresponding items to be examined in the table to be examined of the database and the counter to be examined, the quantity calibrator is used for calibrating the counter to be examined, and the reliability and the accuracy of the counter to be examined are effectively improved.
Corresponding to the method for monitoring the number of the pending items of the pending data provided by the embodiment of the present invention, referring to fig. 5, the embodiment of the present invention further provides a structural block diagram of a device for monitoring the number of the pending items of the pending data, where the device for monitoring the number of the pending items of the pending data includes: update section 501, push section 502:
the updating unit 501 is configured to update the number of to-be-inspected entries in the to-be-inspected counter corresponding to the target group identifier when it is detected that the to-be-inspected data carrying the target group identifier is processed, where the to-be-inspected counter includes a plurality of group identifiers and the number of to-be-inspected entries corresponding to each group identifier, the target group identifier is any group identifier included in the to-be-inspected counter, and the to-be-inspected counter completes initialization in advance according to a database to-be-inspected table.
The pushing unit 502 is configured to push each group identifier in the updated pending counter and the number of pending entries corresponding to the group identifier to a visual page.
In the embodiment of the invention, the number of the to-be-examined items of the to-be-examined data carrying the target group identification in the auditing system is recorded by using the to-be-examined counter, and the group identification stored in the to-be-examined counter and the number of the to-be-examined items corresponding to the group identification are pushed to the visual page, so that the times of accessing the database are reduced, the pressure of the database is reduced, and the occupation of server resources is reduced.
Preferably, in conjunction with the content shown in fig. 5, the updating unit 501 includes: the method comprises the following steps of adding modules and reducing modules, wherein the execution principle of each module is as follows:
and the adding module is used for adding n to the number of the items to be examined corresponding to the target group identifier in the counter to be examined when the data to be examined carrying the target group identifier is detected to be stored in the auditing system, wherein n is the number of the items to be examined of the data to be examined.
And the reduction module is used for reducing the number of the to-be-examined items corresponding to the target group identifier in the to-be-examined counter by n when the to-be-examined data carrying the target group identifier is detected to be examined completely.
Preferably, in conjunction with the content shown in fig. 5, the pushing unit 502 includes:
an initialization module: the device is used for scanning the database pending table to obtain the group identifier in the database pending table and the number of pending items corresponding to the group identifier, and storing the obtained group identifier in the database pending table and the number of pending items corresponding to the group identifier in the database pending table to a pending counter.
Preferably, in combination with the content shown in fig. 5, the apparatus for monitoring the number of pending items of the pending data further includes: the device comprises a first acquisition unit, a first comparison unit and a first replacement unit; and the first acquisition unit is used for periodically acquiring the group identifier in the pending table of the database and the number of the entries to be checked corresponding to the group identifier according to the timing task.
And the first comparison unit is used for comparing whether the group identification acquired from the database pending table is consistent with the group identification in the pending counter or not and comparing whether the number of corresponding pending items of the same group identification in the database pending table and the pending counter is consistent or not.
And the first replacing unit is used for replacing the group identification in the counter to be examined and the number of the corresponding items to be examined by using the group identification acquired from the database table to be examined and the number of the corresponding items to be examined if any one group identification acquired from the database table to be examined is inconsistent with the group identification in the counter to be examined or if any one group identification is inconsistent with the number of the corresponding items to be examined in the database table to be examined and the number of the corresponding items to be examined.
In the embodiment of the invention, whether the data in the counter to be checked is consistent with the data in the database table to be checked or not is periodically checked according to the timing task, and when the data in the counter to be checked is inconsistent with the data in the database table to be checked, the data in the counter to be checked is replaced by the data in the database table to be checked, so that the data in the counter to be checked is ensured to be accurate, and the reliability of the counter to be checked is improved.
Preferably, in combination with the content shown in fig. 5, the apparatus for monitoring the number of pending items of the pending data further includes: the second acquisition unit, the second comparison unit and the second replacement unit;
and the second acquisition unit is used for acquiring the group identifier in the database pending table and the number of the entries to be checked corresponding to the group identifier when the instruction of the calibration request sent by the user is detected.
And the second comparison unit is used for comparing whether the group identification acquired from the database pending table is consistent with the group identification in the pending counter or not and comparing whether the number of corresponding pending items of the same group identification in the database pending table and the pending counter is consistent or not.
And the second replacing unit is used for replacing the group identification in the counter to be examined and the number of the corresponding items to be examined by using the group identification acquired from the database table to be examined and the number of the corresponding items to be examined if any one group identification acquired from the database table to be examined is inconsistent with the group identification in the counter to be examined or if any one group identification is inconsistent with the number of the corresponding items to be examined in the database table to be examined and the counter to be examined.
In the real-time embodiment of the invention, when a request sent by a user for calibrating the counter to be examined is detected, the group identification and the number of the corresponding items stored in the counter to be examined are compared with the group identification and the number of the corresponding items stored in the table to be examined of the database, when the group identification acquired from the table to be examined of the database is inconsistent with the group identification in the counter to be examined, or when any one group identification is inconsistent with the number of the corresponding items to be examined in the table to be examined of the database and the counter to be examined, the quantity calibrator is used for calibrating the counter to be examined, and the reliability and the accuracy of the counter to be examined are effectively improved.
In summary, embodiments of the present invention provide a method and an apparatus for monitoring the number of pending items of pending data, where the method includes: initializing a counter to be audited according to a database pending table, recording grouping identifications and the number of items to be audited corresponding to the grouping identifications in the counter to be audited according to the processing condition of data to be audited carrying target grouping identifications, and pushing the data in the counter to be audited to a visual page for displaying through a pre-established long connection, so that on one hand, frequent access to the database is not needed, and the pressure of the database is reduced; on the other hand, long connection is established with the visual page, so that waste and occupation of server resources are reduced.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the system or system embodiments are substantially similar to the method embodiments and therefore are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described system and system embodiments are only illustrative, wherein the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
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 invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. 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 invention. Thus, the present invention 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 (8)

1. A method of monitoring a quantity of data to be reviewed, the method comprising:
when it is detected that to-be-inspected data carrying a target group identifier is processed, updating the number of to-be-inspected items corresponding to the target group identifier in a to-be-inspected counter, wherein the processing is to store the to-be-inspected items in an inspection system or finish the inspection, the to-be-inspected counter comprises a plurality of group identifiers and the number of to-be-inspected items corresponding to each group identifier, the target group identifier is any group identifier contained in the to-be-inspected counter, and the to-be-inspected counter completes initialization in advance according to a database to-be-inspected table;
pushing each group identifier in the updated counter to be examined and the number of the items to be examined corresponding to the group identifier to a visual page;
according to the timing task, periodically acquiring the grouping identification in the database pending list and the number of the items to be checked corresponding to the grouping identification;
comparing whether the group identification acquired from the database pending list is consistent with the group identification in the pending counter, and comparing whether the corresponding pending items in the database pending list and the pending counter of the same group identification are consistent;
and if any one of the group identifications acquired from the database pending list is not consistent with the group identification in the pending counter, or if any one of the group identifications is not consistent with the number of the corresponding pending items in the database pending list and the pending counter, replacing the group identification in the pending counter and the number of the corresponding pending items by using the group identification acquired from the database pending list and the number of the corresponding pending items.
2. The method according to claim 1, wherein when it is detected that pending data carrying a target group identifier is processed, updating the number of pending entries corresponding to the target group identifier in a pending counter, includes:
when it is detected that the data to be examined carrying the target grouping identifier is stored in an auditing system, adding n to the number of items to be examined corresponding to the target grouping identifier in the counter to be examined, wherein n is the number of the data to be examined;
and when the examined data carrying the target grouping identification is detected to be examined completely, subtracting n from the number of the examined items corresponding to the target grouping identification in the examined counter.
3. The method of claim 1, wherein initializing a pending counter comprises:
scanning a database pending table to obtain a group identifier in the database pending table and the number of pending entries corresponding to the group identifier, and storing the obtained group identifier in the database pending table and the number of pending entries corresponding to the group identifier in the database pending table to the pending counter.
4. The method of claim 1, further comprising:
when an instruction of a calibration request sent by a user is detected, acquiring a group identifier in the database pending table and the number of entries to be checked corresponding to the group identifier;
comparing whether the group identification acquired from the database pending list is consistent with the group identification in the pending counter, and comparing whether the corresponding pending items in the database pending list and the pending counter of the same group identification are consistent;
and if any one of the group identifications acquired from the database pending list is not consistent with the group identification in the pending counter, or if any one of the group identifications is not consistent with the number of the corresponding pending items in the database pending list and the pending counter, replacing the group identification in the pending counter and the number of the corresponding pending items by using the group identification acquired from the database pending list and the number of the corresponding pending items.
5. The method according to claim 1, wherein before pushing each of the group identifiers and the number of pending entries corresponding thereto in the updated pending counter to a visualization page, the method further comprises:
and establishing long connection with the visual page.
6. An apparatus for monitoring a quantity of data to be reviewed, the apparatus comprising:
the updating unit is used for updating the number of items to be inspected corresponding to the target group identifier in a counter to be inspected when the fact that the data to be inspected carrying the target group identifier is processed is detected, the processing is stored in an auditing system or audited, the counter to be inspected comprises a plurality of group identifiers and the number of the items to be inspected corresponding to each group identifier, the target group identifier is any group identifier contained in the counter to be inspected, and the counter to be inspected is initialized in advance according to a database table to be inspected;
the pushing unit is used for pushing each group identifier in the updated counter to be examined and the number of the items to be examined corresponding to the group identifier to be examined to a visual page;
the first acquisition unit is used for periodically acquiring the grouping identification in the database pending table and the number of items to be checked corresponding to the grouping identification according to the timing task;
the first comparison unit is used for comparing whether the group identification acquired from the database pending table is consistent with the group identification in the pending counter or not and comparing whether the number of corresponding pending items of the same group identification in the database pending table and the pending counter is consistent or not;
and the first replacing unit is used for replacing the group identifier in the pending counter and the number of the items to be checked corresponding to the group identifier by using the group identifier acquired from the database pending table and the number of the items to be checked corresponding to the group identifier if any one group identifier acquired from the database pending table is inconsistent with the group identifier in the pending counter or if any one group identifier is inconsistent with the number of the items to be checked corresponding to the group identifier in the database pending table and the number of the items to be checked corresponding to the group identifier acquired from the database pending table.
7. The apparatus of claim 6, wherein the updating unit comprises:
the increasing module is used for adding n to the number of items to be examined corresponding to the target group identifier in the counter to be examined when the data to be examined carrying the target group identifier is detected to be stored in an auditing system, wherein n is the number of the data to be examined;
and the reduction module is used for reducing the number of the to-be-examined items corresponding to the target group identifier in the to-be-examined counter by n when the to-be-examined data carrying the target group identifier is detected to be examined completely.
8. The apparatus of claim 6, wherein the pushing unit comprises:
and the initialization module is used for scanning the database pending table to obtain the group identifier in the database pending table and the number of pending items corresponding to the group identifier, and storing the obtained group identifier in the database pending table and the number of pending items corresponding to the group identifier in the database pending table to the pending counter.
CN202111629567.1A 2021-12-29 2021-12-29 Method and device for monitoring number of to-be-examined data Active CN114003609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111629567.1A CN114003609B (en) 2021-12-29 2021-12-29 Method and device for monitoring number of to-be-examined data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111629567.1A CN114003609B (en) 2021-12-29 2021-12-29 Method and device for monitoring number of to-be-examined data

Publications (2)

Publication Number Publication Date
CN114003609A CN114003609A (en) 2022-02-01
CN114003609B true CN114003609B (en) 2022-04-26

Family

ID=79932123

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111629567.1A Active CN114003609B (en) 2021-12-29 2021-12-29 Method and device for monitoring number of to-be-examined data

Country Status (1)

Country Link
CN (1) CN114003609B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102218A (en) * 2018-06-29 2018-12-28 张家港市泰克软件有限公司 Warehouse management system and method
CN111628859A (en) * 2020-06-05 2020-09-04 上海创蓝文化传播有限公司 Method and device for auditing short message text based on distributed high concurrency condition

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103237296A (en) * 2013-04-19 2013-08-07 中国建设银行股份有限公司 Message sending method and message sending system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109102218A (en) * 2018-06-29 2018-12-28 张家港市泰克软件有限公司 Warehouse management system and method
CN111628859A (en) * 2020-06-05 2020-09-04 上海创蓝文化传播有限公司 Method and device for auditing short message text based on distributed high concurrency condition

Also Published As

Publication number Publication date
CN114003609A (en) 2022-02-01

Similar Documents

Publication Publication Date Title
CN107748790B (en) Online service system, data loading method, device and equipment
JP5564941B2 (en) Fault location estimation system, fault location estimation apparatus, and fault location estimation method
CN111047419A (en) Vehicle type standardization method and related device
CN106682167B (en) Statistical device and method for user behavior data
CN111078688B (en) Method for micro-service health check and storage medium
CN113836126A (en) Data cleaning method, device, equipment and storage medium
CN104468222A (en) Method, device and system for reporting log information
CN114003609B (en) Method and device for monitoring number of to-be-examined data
US20200202005A1 (en) Automated Software Vulnerability Determination
CA3142579A1 (en) Method and apparatus for validation of event tracking acquired data
CN111930611B (en) Statistical method and device for test data
CN112287027B (en) Database synchronization method, device, equipment and storage medium
US11416517B2 (en) Partitioning data in a clustered database environment
CN111291127B (en) Data synchronization method, device, server and storage medium
CN111552566B (en) Data processing system, method, electronic equipment and storage medium
CN114039878A (en) Network request processing method and device, electronic equipment and storage medium
CN112598385A (en) Material selection and matching method and device, computer readable medium and electronic equipment
CN105701186A (en) System and method for retrieving patent family
CN114611473B (en) Generation method of inspection execution file and electronic equipment
CN106933912B (en) Keyword acquisition method and device
CN114428789B (en) Data processing method and device
CN111459743B (en) Data processing method and device and readable storage medium
CN112486823B (en) Error code verification method and device, electronic equipment and readable storage medium
CN116703220A (en) Material inspection method, device, computer equipment and computer readable storage medium
US20230300152A1 (en) Event stream-based threat detection

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