Device and method for monitoring accuracy of online data in live scene
1. An apparatus for monitoring accuracy of online data in a live broadcast scene, comprising:
the real data acquisition module is used for acquiring real data of the target index from the live broadcast page;
the original data acquisition module is used for acquiring service data from a service library, and calculating the service data according to the calculation mode of the target index to obtain original data of the target index;
the deviation ratio calculation module is used for calculating the deviation ratio of the real data and the original data;
the accuracy judgment module is used for judging whether the deviation rate exceeds a threshold value; if the difference exceeds the preset threshold, prompt information of data deviation is generated.
2. The apparatus of claim 1, wherein the target metrics comprise any one or more of: amount of transaction, amount of transaction order, amount of transaction commodities, and number of types of transaction commodities.
3. The apparatus of claim 2, wherein when the target metric comprises a plurality of metrics, the accuracy determination module is to:
and respectively judging whether the deviation rate of each index exceeds the threshold value of the index, and if the deviation rate of any index exceeds the threshold value of the index, generating prompt information of data deviation.
4. The apparatus of claim 2, wherein when the target indicator comprises a deal amount, the accuracy determination module is to:
when the deal amount is less than or equal to a first amount, judging whether the deviation rate exceeds a first threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the deal amount is larger than the first amount and smaller than or equal to the second amount, judging whether the deviation rate exceeds a second threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the deal amount is larger than the second amount, judging whether the deviation rate exceeds a third threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
wherein the first threshold is greater than the second threshold, which is greater than the third threshold.
5. The apparatus of claim 1, further comprising:
the anchor information reading module is used for determining an anchor list which is in live broadcasting; traversing the anchor list, and reading the live broadcast information of each anchor, wherein the live broadcast information comprises any one or more of the following items: anchor ID, anchor name and playing time;
correspondingly, the real data obtaining module is configured to: and traversing the anchor list, and acquiring real data of the target index from the live broadcast page of each anchor.
6. The apparatus of claim 1, wherein the raw data acquisition module is further to:
and connecting the service library through a tool kit of a third party.
7. The apparatus of any one of claims 1 to 6, wherein the accuracy determination module is configured to:
when the current time belongs to the consumption peak period, judging whether the deviation rate exceeds a fourth threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the current time belongs to the consumption peak-balancing time period, judging whether the deviation rate exceeds a fifth threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the current time belongs to the consumption peak period, judging whether the deviation rate exceeds a sixth threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
wherein the fourth threshold is greater than the fifth threshold, which is greater than the sixth threshold.
8. A method for monitoring accuracy of online data in a live broadcast scene is characterized by comprising the following steps:
acquiring real data of a target index from a live broadcast page;
acquiring service data from a service library, and calculating the service data according to the calculation mode of the target index to obtain original data of the target index;
calculating the deviation rate of the real data and the original data;
judging whether the deviation rate exceeds a threshold value; if the difference exceeds the preset threshold, prompt information of data deviation is generated.
9. An apparatus for monitoring accuracy of online data in a live broadcast scene, comprising:
a memory: for storing a computer program;
a processor: for executing said computer program for implementing a method of accuracy monitoring of online data in a live scene as claimed in claim 8.
10. A readable storage medium having stored thereon a computer program for implementing a method of accuracy monitoring of online data in a live scene as claimed in claim 8 when executed by a processor.
Background
Under a big data scene, a large amount of service data needs to be processed and calculated in the live broadcast process, and finally the processed data is displayed on a page to be checked and used by service personnel, but the data displayed on the page often has deviation, delay and error due to unstable data, long data link and unstable environment, so that the operation decision of the service personnel is influenced.
How to overcome the defect of inaccurate online data in a live broadcast environment is a problem to be urgently solved by technical personnel in the field.
Disclosure of Invention
The application aims to provide a device, a method and equipment for monitoring the accuracy of online data in a live broadcast scene and a readable storage medium, which are used for solving the problem of inaccurate online data in a live broadcast environment. The specific scheme is as follows:
in a first aspect, the present application provides a device for monitoring accuracy of online data in a live broadcast scene, including:
the real data acquisition module is used for acquiring real data of the target index from the live broadcast page;
the original data acquisition module is used for acquiring service data from a service library, and calculating the service data according to the calculation mode of the target index to obtain original data of the target index;
the deviation ratio calculation module is used for calculating the deviation ratio of the real data and the original data;
the accuracy judgment module is used for judging whether the deviation rate exceeds a threshold value; if the difference exceeds the preset threshold, prompt information of data deviation is generated.
Optionally, the target index includes any one or more of the following: amount of transaction, amount of transaction order, amount of transaction commodities, and number of types of transaction commodities.
Optionally, when the target index includes multiple indexes, the accuracy determining module is configured to:
and respectively judging whether the deviation rate of each index exceeds the threshold value of the index, and if the deviation rate of any index exceeds the threshold value of the index, generating prompt information of data deviation.
Optionally, when the target indicator includes a deal amount, the accuracy determination module is configured to:
when the deal amount is less than or equal to a first amount, judging whether the deviation rate exceeds a first threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the deal amount is larger than the first amount and smaller than or equal to the second amount, judging whether the deviation rate exceeds a second threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the deal amount is larger than the second amount, judging whether the deviation rate exceeds a third threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
wherein the first threshold is greater than the second threshold, which is greater than the third threshold.
Optionally, the method further includes:
the anchor information reading module is used for determining an anchor list which is in live broadcasting; traversing the anchor list, and reading the live broadcast information of each anchor, wherein the live broadcast information comprises any one or more of the following items: anchor ID, anchor name and playing time;
correspondingly, the real data obtaining module is configured to: and traversing the anchor list, and acquiring real data of the target index from the live broadcast page of each anchor.
Optionally, the raw data obtaining module is further configured to:
and connecting the service library through a tool kit of a third party.
Optionally, the accuracy determining module is configured to:
when the current time belongs to the consumption peak period, judging whether the deviation rate exceeds a fourth threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the current time belongs to the consumption peak-balancing time period, judging whether the deviation rate exceeds a fifth threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
when the current time belongs to the consumption peak period, judging whether the deviation rate exceeds a sixth threshold value; if the data deviation exceeds the preset threshold value, generating prompt information of the data deviation;
wherein the fourth threshold is greater than the fifth threshold, which is greater than the sixth threshold.
In a second aspect, the present application provides a method for monitoring accuracy of online data in a live broadcast scene, including:
acquiring real data of a target index from a live broadcast page;
acquiring service data from a service library, and calculating the service data according to the calculation mode of the target index to obtain original data of the target index;
calculating the deviation rate of the real data and the original data;
judging whether the deviation rate exceeds a threshold value; if the difference exceeds the preset threshold, prompt information of data deviation is generated.
In a third aspect, the present application provides a device for monitoring accuracy of online data in a live broadcast scene, including:
a memory: for storing a computer program;
a processor: for executing the computer program to implement the method for accuracy monitoring of online data in a live scene as described above.
In a fourth aspect, the present application provides a readable storage medium having stored thereon a computer program for implementing, when being executed by a processor, a method for accuracy monitoring of online data in a live scene as described above.
The application provides a line data's accuracy monitoring devices in live scene includes: the device comprises a real data acquisition module, an original data acquisition module, a deviation ratio calculation module and an accuracy judgment module, wherein the modules are matched with each other to realize the following processes: acquiring real data of a target index from a live broadcast page; acquiring service data from a service library, and calculating the service data according to a calculation mode of a target index to obtain original data of the target index; calculating the deviation rate of the real data and the original data; judging whether the deviation rate exceeds a threshold value; if the difference exceeds the preset threshold, prompt information of data deviation is generated.
Therefore, the device can acquire real data of indexes on a live broadcast page in real time in the live broadcast process, acquire service data from a service library and calculate to obtain original data of the indexes, judge whether the index data are accurate according to the deviation rate of the real data and the original data, and generate prompt information of data deviation when the index data are inaccurate. The purpose of automatically monitoring the accuracy of live broadcast data is achieved, the influence of wrong data on operation decisions of service personnel is avoided, and the live broadcast effect is improved.
In addition, the application also provides a method, equipment and a readable storage medium for monitoring the accuracy of online data in a live broadcast scene, and the technical effect of the method and the equipment corresponds to that of the device, and the details are not repeated here.
Drawings
For a clearer explanation of the embodiments or technical solutions of the prior art of the present application, the drawings needed for the description of the embodiments or prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a functional block diagram of an embodiment of an apparatus for monitoring accuracy of online data in a live broadcast scenario provided in the present application;
fig. 2 is a flowchart of an embodiment of a method for monitoring accuracy of online data in a live broadcast scene provided in the present application;
fig. 3 is a schematic structural diagram of an embodiment of a device for monitoring accuracy of online data in a live broadcast scene provided by the present application.
Detailed Description
The core of the application is to provide a device, a method, equipment and a readable storage medium for monitoring the accuracy of online data in a live broadcast scene, so that the purpose of automatically monitoring the accuracy of online data in the live broadcast process is realized, the influence of wrong data on the operation decision of business personnel is avoided, and the live broadcast effect is improved.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present application and not all 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.
The following describes an embodiment of an apparatus for monitoring accuracy of online data in a live broadcast scene, where referring to fig. 1, the embodiment includes:
a real data obtaining module 11, configured to obtain real data of a target index from a live broadcast page;
the original data acquisition module 12 is configured to acquire service data from a service library, and calculate the service data according to a calculation method of a target index to obtain original data of the target index;
a deviation ratio calculation module 13, configured to calculate a deviation ratio between the real data and the raw data;
an accuracy judgment module 14, configured to judge whether the deviation ratio exceeds a threshold; if the error exceeds the preset threshold value, determining that the data is inaccurate, and generating prompt information of data deviation; if not, the data is determined to be more accurate and is not processed.
In this embodiment, the real data of the target index refers to data displayed on a live broadcast page, and the original data of the target index refers to data stored in a service library. Theoretically, the two data should be equal, but in a big data scene, data deviation, delay and even errors caused by data instability, long data link and environmental instability are inevitable, so the embodiment realizes the accuracy monitoring of the online data by comparing the real data and the original data of the same index.
Specifically, a anchor to be subjected to accuracy detection is determined first, and relevant information of the anchor is acquired. Therefore, the present embodiment may further include a anchor information reading module, where the anchor information reading module is configured to: determining a main broadcasting list which is being live; and traversing the anchor list, and reading the live broadcast information of each anchor, wherein the live broadcast information comprises any one or more of the following items: anchor ID, anchor name, and upload time. Correspondingly, the real data acquisition module is configured to: and traversing the anchor list, and acquiring real data of the target index from the live broadcast page of each anchor.
As a specific implementation manner, the target indexes of the embodiment include any one or more of the following indexes: amount of transaction, amount of transaction order, amount of transaction commodities, and number of types of transaction commodities.
In practical applications, if the target index includes multiple indexes, a corresponding threshold may be set for each index. Correspondingly, when the data accuracy is judged, the accuracy judging module is used for: and respectively judging whether the deviation rate of each index exceeds the threshold value of the index, and if the deviation rate of any index exceeds the threshold value of the index, generating prompt information of data deviation.
In addition, taking the transaction amount as an example, in practical application, the user is sensitive to the large transaction amount and not sensitive to the small transaction amount, so in order to save computing resources, different threshold values are set for different transaction amounts in the embodiment. Specifically, the deal amount is divided into three intervals according to the value, and when the deal amount falls into an interval with a smaller value, the deal amount is matched with a larger threshold value, namely inaccuracy to a certain extent is allowed; when the deal amount falls into the interval with a larger numerical value, a smaller threshold value is matched with the deal amount, and the data accuracy is required to be higher. The method comprises the following specific steps:
when the target index includes a deal amount, the accuracy judgment module is used for: when the transaction amount is less than or equal to the first amount, judging whether the deviation rate exceeds a first threshold value, and if so, generating prompt information of data deviation; when the transaction amount is larger than the first amount and smaller than or equal to the second amount, judging whether the deviation rate exceeds a second threshold value, and if so, generating prompt information of data deviation; when the transaction amount is larger than the second amount, judging whether the deviation rate exceeds a third threshold value, and if so, generating prompt information of data deviation; wherein the first threshold is greater than the second threshold, and the second threshold is greater than the third threshold.
In addition, considering that the live broadcast selling process has consumption peak time and consumption peak time, and the number of orders made in each unit time is definitely relatively large in the consumption peak time, the threshold is set to be high in the adaptability of the embodiment, and correspondingly, the threshold is set to be low in the consumption peak time. The method comprises the following specific steps:
in this embodiment, the accuracy determining module is configured to: when the current time belongs to the consumption peak period, judging whether the deviation rate exceeds a fourth threshold value, and if so, generating prompt information of data deviation; when the current time belongs to the consumption peak-balancing time period, judging whether the deviation rate exceeds a fifth threshold value, and if so, generating prompt information of data deviation; when the current time belongs to the consumption peak period, judging whether the deviation rate exceeds a sixth threshold value, and if so, generating prompt information of data deviation; wherein the fourth threshold is greater than the fifth threshold, and the fifth threshold is greater than the sixth threshold.
Specifically, in this embodiment, accuracy monitoring of online data in a live broadcast scene is implemented based on a computer device, and in practical application, the computer device may be a software project. Firstly, a software project is developed, then the software project is tested by using a test script, and after the test is passed, the software project is deployed on a server, and specifically can be deployed on jenkins to run at regular time. Specifically, a Jenkins integration git is used for pulling the latest project code; setting a timing rule, such as once per hour in the time period from 0 point to 2 points and from 8 points to 12 points, and once per half hour in the time period from 12 points to 24 points; moving the project code to a specified execution directory; the item code is executed periodically by command.
The online data accuracy monitoring devices in live scene that this embodiment provided includes: the device comprises a real data acquisition module, an original data acquisition module, a deviation ratio calculation module and an accuracy judgment module, wherein the modules are matched with each other to realize the following processes: in the live broadcast process, real data of indexes on a live broadcast page are acquired in real time, service data are acquired from a service library and calculated to obtain original data of the indexes, whether the index data are accurate or not is judged according to the deviation rate of the real data and the original data, and prompt information of data deviation is generated when the index data are inaccurate. The purpose of automatically monitoring the accuracy of live broadcast data is achieved, the influence of wrong data on operation decisions of service personnel is avoided, and the live broadcast effect is improved.
In an actual application scenario, the embodiment of the device for monitoring accuracy of online data in a live broadcast scenario can specifically realize the following processes:
s11, searching a live broadcast list through a requests package of python; and traversing the anchor list, and acquiring the live broadcast information of each anchor, such as an anchor ID, an anchor name, the broadcast time and the like.
S12, obtaining real data of a target index shown on the live broadcast page by the anchor, where the target index may include any one or more of the following: amount of transaction, amount of transaction order, amount of transaction commodities, and number of types of transaction commodities.
S13, connecting the service library through a psycpg 2 (third party toolkit), and acquiring service data of the anchor in the service library; and associating the order form table with the order commodity table, and calculating to obtain the original data of the target index of the anchor program in the live broadcast period according to the service data. Only order status is considered here as successfully paid orders, not refunded, unpaid and expired orders, and to avoid data duplication, a deduplication process is required.
And S14, calculating the deviation ratio of each index, wherein the deviation ratio is 1-real data/original data. For example, for the index of the deal amount, the deviation rate is 1-true data of the deal amount/original data of the deal amount.
S15, checking accuracy, and judging whether the data is accurate or not according to the deviation rate of the real data and the original data of the same index; and if not, generating prompt information of the data deviation. Taking the transaction amount as an example, the check logic is as follows:
firstly, if the transaction amount is null or <0, determining the transaction amount as error data;
secondly, judging the current time, if the current time falls into the following interval: 0 to 2, or 8 to 12, or 14 to 18, then the following logic is performed:
(1) when the transaction amount is less than 1 ten thousand, the threshold value of the deviation rate is 3%, and if the actual deviation rate is more than 3%, the data is judged to be error data;
(2) if the actual deviation rate is more than 1%, determining that the data is wrong;
(3) the sum of transaction > is 10 ten thousand, the threshold value of the deviation ratio is 0.2%, and if the actual deviation ratio is greater than 0.2%, it is determined as erroneous data.
Thirdly, judging the current time, if the current time falls into the following interval: 12 to 14, or 18 to 20, or 23 to 24, then the following logic is performed:
(1) the transaction amount is less than 1 ten thousand, the threshold value of the deviation rate is 5%, and if the actual deviation rate is more than 5%, the data is judged to be error data;
(2) if the actual deviation rate is more than 2%, determining that the data is wrong;
(3) the sum of transaction > is 10 ten thousand, the threshold value of the deviation ratio is 0.5%, and if the actual deviation ratio is greater than 0.5%, it is determined as erroneous data.
Fourthly, judging the current time, if the current time falls into the following interval: from point 20 to point 23, the following logic is executed:
(1) the transaction amount is less than 1 ten thousand, the threshold value of the deviation rate is 8%, and if the actual deviation rate is more than 8%, the data is judged to be error data;
(2) if the actual deviation rate is more than 3%, determining that the data is wrong;
(3) the sum of transaction > is 10 ten thousand, the threshold value of the deviation ratio is 1%, and if the actual deviation ratio is greater than 1%, it is determined as erroneous data.
The device for monitoring the accuracy of the online data in the live broadcast scene provided by the embodiment can acquire the real data of the target index on the live broadcast page; connecting with a service library to obtain service data, and locally performing a series of calculations by using an index calculation method to obtain original data of a target index; and finally, comparing the two data to obtain the deviation rate of the data, setting different deviation rate thresholds according to different time periods and different indexes, and pushing the deviation values to corresponding business personnel if the deviation is large, so that the aim of comparing the data displayed on the verification page with the data in the business library in real time is fulfilled, and the automatic alarm of the accuracy of the online data is realized.
The method for monitoring accuracy of online data in a live broadcast scene provided by the embodiment of the present application is introduced below, and the method for monitoring accuracy of online data in a live broadcast scene described below and the method for monitoring accuracy of online data in a live broadcast scene described above may be referred to in a corresponding manner.
As shown in fig. 2, the method for monitoring accuracy of online data in a live broadcast scene in this embodiment includes:
s21, acquiring real data of the target index from the live broadcast page;
s22, acquiring service data from a service library, and calculating the service data according to the calculation mode of the target index to obtain original data of the target index;
s23, calculating the deviation ratio of the real data and the original data;
s24, judging whether the deviation rate exceeds a threshold value; if the difference exceeds the preset threshold, prompt information of data deviation is generated.
The method for monitoring the accuracy of the online data in the live broadcast scene is implemented based on the apparatus for monitoring the accuracy of the online data in the live broadcast scene, and thus a specific implementation of the method can be seen in the foregoing embodiment of the apparatus for monitoring the accuracy of the online data in the live broadcast scene, and the function of the method corresponds to that of the apparatus, and is not described here.
In addition, this application still provides an accuracy monitoring facilities of online data in live scene, as shown in fig. 3, includes:
the memory 100: for storing a computer program;
the processor 200: for executing the computer program to implement the method for accuracy monitoring of online data in a live scene as described above.
Finally, the present application provides a readable storage medium having stored thereon a computer program for implementing, when being executed by a processor, a method for accuracy monitoring of online data in a live scene as described above.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above detailed descriptions of the solutions provided in the present application, and the specific examples applied herein are set forth to explain the principles and implementations of the present application, and the above descriptions of the examples are only used to help understand the method and its core ideas of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种微服务监控方法及系统