A method, device, equipment and storage medium for obtaining audit data
A cache queue system addresses database overload by managing lock requests, ensuring efficient and stable video data retrieval, thereby improving the auditing process.
Patent Information
- Application Number
- CN202111093427.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-09-17
AI Technical Summary
In the prior art, the video audit system is too high due to the database processing a large number of concurrent lock requests, which affects the system stability and manual audit efficiency, and cannot guarantee the timeliness of video data.
The cache queue is introduced to cache the video data to be reviewed. The cache queue handles order collection requests, reduces the database load pressure, and obtains data from the cache queue in parallel. The hash rule is used to disperse high concurrent requests and improves order collection efficiency.
It reduces the system's dependence on the database, improves the order collection efficiency and system stability, and ensures the uniqueness of data allocation and the timeliness of audits.
Smart Images

Figure CN114003395B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a method, device, equipment, and storage medium for obtaining audit data. Background Art
[0002] Before uploading a video in a video application, machine audit, manual audit, and content tagging need to be performed on the video content. Videos that pass the machine audit link flow into the manual audit link, where the manual audit link conducts a more detailed audit of the video content to screen out videos that are misjudged or missed in the machine audit link.
[0003] After the videos that pass the machine audit link are persisted to the database, the auditor triggers a single fetch request to poll and obtain the videos to be audited from the database. Since each video data is only allowed to be processed by one person at the same time, a lock is added to the video data queried in the database during the single fetch to ensure unique allocation. Therefore, when multiple auditors actively fetch a single at the same time, the database needs to process a large number of concurrent lock requests, resulting in an excessive load on the database, which is not conducive to the stability of the system. In addition, the database locks all the currently queried video data, and a large number of lock operations cause other single fetch requests to be in a long-term empty poll and unable to obtain video data. Most of the audit time in the manual audit link is spent on fetching a single, seriously reducing the manual audit efficiency and unable to ensure the timeliness of video data. Summary of the Invention
[0004] Embodiments of the present application provide a method, device, equipment, and storage medium for obtaining audit data to solve the problem of low single fetch efficiency caused by the database processing a large number of concurrent lock requests in the prior art, reduce the dependence of the system on the database, reduce the load pressure on the database, and ensure the stability of the system. While ensuring the uniqueness of data allocation, the single fetch efficiency is improved.
[0005] In a first aspect, embodiments of the present application provide a method for obtaining audit data, including:
[0006] Obtain the videos to be audited in the database, and cache the videos to be audited in a preset cache queue;
[0007] Determine the corresponding cache queue according to the received single fetch request, and obtain the videos to be audited from the cache queue; wherein, when obtaining the videos to be audited, lock the cache queue, and unlock the cache queue after obtaining the videos to be audited;
[0008] Transmit the obtained videos to be audited to the sending end that sent the single fetch request to perform the audit process of the videos to be audited.
[0009] Second aspect, an embodiment of the present application provides an audit data acquisition device, including
[0010] A data caching module, configured to acquire to-be-audited video data in a database and cache the to-be-audited video data into a preset cache queue;
[0011] A data acquisition module, configured to determine a corresponding cache queue according to a received order-taking request and acquire the to-be-audited video data from the cache queue; wherein, when acquiring the to-be-audited video data, lock the cache queue, and unlock the cache queue after acquiring the to-be-audited video data;
[0012] A data transmission module, configured to transmit the acquired to-be-audited video data to a sending end that sends the order-taking request for an audit process of the to-be-audited video data.
[0013] Third aspect, an embodiment of the present application provides an audit data acquisition device, including: a memory and one or more processors;
[0014] The memory is used to store one or more programs;
[0015] When the one or more programs are executed by the one or more processors, the one or more processors implement the audit data acquisition method as described in the first aspect.
[0016] In a fourth aspect, an embodiment of the present application provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the audit data acquisition method as described in the first aspect when executed by a computer processor.
[0017] In the embodiments of the present application, the data read from the database is cached through a cache queue. When an order-taking request is received, the data is read from the cache queue and transmitted to the video audit end. This is to query the data in the database in advance, make the concurrency of querying the database controllable, reduce the dependence of the system on the database, reduce the load pressure on the database, and ensure the stability of the system. Moreover, the processing efficiency of the cache queue is much higher than that of the database. Querying the data from the cache queue and transmitting it to the video audit end improves the order-taking efficiency. When reading data from the cache queue, the corresponding cache queue is locked, and unlocked after the reading is completed, ensuring the atomicity of the reading operation and the uniqueness of data allocation. Compared with the locking operation in the database, locking the cache queue in memory is more convenient, reducing the running time and improving the order-taking efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 is a flowchart of an audit data acquisition method provided by an embodiment of the present application;
[0019] Figure 2 It is the first schematic diagram of the order-taking system architecture provided by the embodiments of the present application;
[0020] Figure 3 It is the second schematic diagram of the order-taking system architecture provided by the embodiments of the present application;
[0021] Figure 4 It is the third schematic diagram of the order-taking system architecture provided by the embodiments of the present application;
[0022] Figure 5 It is the flowchart of another method for obtaining audit data provided by the embodiments of the present application;
[0023] Figure 6 It is the fourth schematic diagram of the order-taking system architecture provided by the embodiments of the present application;
[0024] Figure 7 It is the fifth schematic diagram of the order-taking system architecture provided by the embodiments of the present application;
[0025] Figure 8 It is the structural schematic diagram of an audit data acquisition device provided by the embodiments of the present application;
[0026] Figure 9 It is the structural schematic diagram of an audit data acquisition device provided by the embodiments of the present application. Detailed implementation manners
[0027] In order to make the objectives, technical solutions and advantages of the present application clearer, the following further describes the specific embodiments of the present application in detail with reference to the accompanying drawings. It can be understood that the specific embodiments described herein are only for explaining the present application, rather than limiting the present application. Additionally, it should be noted that for the sake of convenience of description, only parts related to the present application rather than all contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the operations (or steps) as sequential processes, many of the operations can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. When the operations are completed, the process can be terminated, but there can also be additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0028] Figure 1 The flowchart of a method for obtaining audit data provided by the embodiments of the present application is given. The method for obtaining audit data provided by the embodiments of the present application can be executed by an audit data acquisition device, and the audit data acquisition device can be implemented in a hardware and / or software manner and integrated in an audit data acquisition device.
[0029] The following describes the method for obtaining audit data by an audit data acquisition device as an example. Refer to Figure 1 , the method for obtaining audit data includes:
[0030] S110. Obtain the video data to be audited in the database, and cache the video data to be audited into a preset cache queue.
[0031] Among them, the video data to be audited is the video data that needs to be manually audited by the auditors at the video audit end. Exemplarily, after passing through the machine audit link, it is persisted in the database, and the auditors at the video audit end query the video data to be audited from the database and audit the video data to be audited. The traditional method for obtaining video data to be audited is that after the auditor triggers a single-taking request through the video audit end, the video audit end polls the video data to be audited in the database. Since each video data is only allowed to be processed by one auditor at the same time, a lock is added to the video data to be audited queried from the database during single-taking to ensure unique allocation. Therefore, when multiple auditors take the order actively at the same time, the database needs to process a large number of concurrent lock requests, resulting in too high a load on the database, which is not conducive to the stability of the single-taking system. Moreover, a large number of lock operations in the database cause most of the video audit ends to be in a long-term empty polling state, seriously reducing the manual audit efficiency and unable to ensure the timeliness of video data. Based on this, the method for obtaining audit data provided in this embodiment aims to introduce a cache queue, cache the video data to be audited from the database through the cache queue, and handle the single-taking request from the video audit end through the cache queue, so as to avoid the database directly processing the single-taking request and reduce the load pressure on the database. And the processing efficiency of the cache queue is much greater than that of the database. Obtaining the video data to be audited from the cache queue can effectively improve the single-taking efficiency.
[0032] It should be noted that after obtaining the video data to be audited in the database, mark the to-be-audited status of the corresponding video data in the database as the auditing status according to the video ID of the video data to be audited, so as to avoid accessing the same video data multiple times and ensure the uniqueness of the allocation of the video data to be audited.
[0033] In this embodiment, Figure 2 is the first schematic diagram of the single-taking system architecture provided by the embodiment of the present application. Among them, the single-taking system is a system composed of a database, an audit data acquisition device, and a video audit end for auditors to extract the video data to be audited. As Figure 2As shown, a pipeline service is set between the database and the cache queue. The pipeline service is used to extract the video data to be audited from the database to the cache queue in a polling manner. The pipeline service supports configuring the number of polling threads for the database and the number of data extracted in each poll. The pipeline service regularly extracts the video data to be audited in the database through the pre-configured polling threads. The video data to be audited can be extracted from the database in advance through the pipeline service to avoid the uncontrollable exponential growth of query volume caused by directly polling the database when a large number of video audit terminals take orders simultaneously, making the order-taking system controllable and ensuring the stability of the order-taking system. In addition, the number of polling threads, the amount of data extracted, and the polling frequency of the pipeline service can be adjusted according to actual needs to control the amount and rate of the video data to be audited written into the cache queue, and avoid the cache queue being overloaded due to the excessive amount and high frequency of the video data to be audited. Exemplarily, the steps of extracting the video data to be audited from the database through the pipeline service and writing it into the cache queue specifically include S1101 - S1102:
[0034] S1101. At every first preset time interval, extract the video data to be audited in the database through multiple pre-configured polling threads, and each polling thread extracts at least one piece of video data to be audited each time.
[0035] Among them, the first preset time is used to represent the frequency of the management service polling the database. Exemplarily, referring to Figure 2 , the management service has pre-configured multiple polling threads 12, and each polling thread 12 extracts multiple pieces of video data to be audited 11 each time. The management service extracts multiple pieces of video data to be audited from the database through multiple polling threads at every first preset time interval. Among them, when a certain polling process extracts the video data to be audited in the database, a locking operation is performed on the video data to be audited being extracted to prevent other polling processes from extracting the same video data to be audited, so as to ensure the uniqueness of the video data to be audited in the cache queue. It can be understood that although multiple polling processes access the database concurrently and the database needs to handle concurrent locking operations, in this embodiment, the number of polling processes and the extraction of video data can be configured based on actual needs, and the rate at which the pipeline service polls the video data to be audited is controllable, and correspondingly, the load of the database when handling concurrent locking operations is also controllable. Therefore, compared with the situation where multiple video audit terminals poll the database, resulting in a sharp increase in the database load pressure, the controllable database load in this embodiment improves the stability of the order-taking system.
[0036] S1102. Randomly cache each piece of video data to be audited in each polling thread into a cache queue in sequence.
[0037] Exemplarily, referring to Figure 2, a single system pre-configures multiple cache queues 13. The management service obtains the corresponding video data to be audited from each polling thread and randomly writes each video data to be audited into a cache queue, that is, there is no identical video data to be audited in all cache queues, ensuring the uniqueness of the data in the cache queue.
[0038] It should be noted that the cache queue refers to a storage space pre-divided from the memory of the audit data acquisition device for caching the video data to be audited retrieved from the database. The management service is used by the audit data acquisition device to extract the video data to be audited from the database for configuration. The audit data acquisition device includes a cache queue and a management service.
[0039] S120. Determine the corresponding cache queue according to the received order-taking request, and obtain the video data to be audited from the cache queue; wherein, when obtaining the video data to be audited, lock the cache queue, and unlock the cache queue after obtaining the video data to be audited.
[0040] Exemplarily, the cache queue can be implemented based on a distributed system such as redis or kafka. In this embodiment, the cache queue is implemented based on redis. The redis cache queue supports parallel data pulling from multiple queues, can effectively handle high-concurrency order-taking requests, and improve the order-taking efficiency. Configure several redis cache queues in the memory in advance through redis, and obtain at least one video data to be audited from the database at a certain frequency. Randomly store the video data to be audited into the preset redis cache queue, and one video data to be audited is only stored in one redis cache queue. When multiple order-taking requests are received, randomly allocate the multiple order-taking requests to multiple redis cache queues, and pull the video data to be audited for each order-taking request in parallel from the multiple redis cache queues.
[0041] In this embodiment, Figure 3 is the second schematic diagram of the order-taking system architecture provided by the embodiment of the present application. As Figure 3As shown, the audit data acquisition device is provided with a query service, which is used to receive the order fetching request sent by the video audit terminal and pull the to-be-audited video data corresponding to an order fetching request from a certain cache queue. During the pulling process, a locking operation is performed on the cache queue and unlocked after the pulling is successful, ensuring the atomicity of the order fetching operation and the unique allocation of the order fetching data. The cache queue belongs to the memory space, and the cost of locking in the memory is much lower than that in the database, reducing the locking time and unlocking time, reducing the possibility of order fetching competition caused by empty polling, and improving the order fetching efficiency. The query service supports configuring the number of data pulled in each batch. The query service can pull multiple to-be-audited video data in one batch, and the video audit terminal locally caches the multiple to-be-audited video data so that the auditor can preferentially obtain the to-be-audited video data from the local cache for auditing, avoiding affecting the audit efficiency due to long-term waiting for order fetching. Exemplarily, the steps of extracting the to-be-audited video data from the cache queue through the query service specifically include S1201 - S1202:
[0042] S1201. When multiple order fetching requests are received, determine the cache queue corresponding to each order fetching request based on a preset hash rule.
[0043] Exemplarily, referring to Figure 3 , when the auditor triggers an order fetching request through the order fetching control on the video audit terminal, the video audit terminal sends the order fetching request to the query service, and the query service accurately locates the order fetching operation corresponding to the order fetching request to a certain cache queue according to the preset hash rule. Among them, the mechanism of the hash rule is to scatter the data. If the query service receives high-concurrency order fetching requests, the high-concurrency order fetching requests are scattered through the hash rule to allocate each order fetching request to each cache queue.
[0044] S1202. Pull at least one to-be-audited video data from the corresponding cache queues in parallel.
[0045] As can be seen from the above, different redis cache queues support parallel pulling of data in the corresponding queues. Therefore, after the high-concurrency order fetching requests are scattered through the hash rule and located to multiple redis cache queues, the to-be-audited video data corresponding to the order fetching requests are extracted from the multiple located redis cache queues in parallel, and the extraction quantity is configured by the query service. In this embodiment, the redis cache queue supports push / pop operations. The management service pushes the to-be-audited video data extracted from the database by the polling process to the redis cache queue. After the query service receives the order fetching request, it locates the redis cache queue corresponding to the order fetching request according to the hash rule and pops the to-be-audited video data from the redis cache queue.
[0046] In this embodiment, through the parallel extraction mechanism of the redis cache queue and the scattering mechanism of the hash rule, the high-concurrency single-taking requests are scattered to each redis cache queue, and data is extracted from each redis cache queue in parallel, greatly avoiding competition caused by high concurrency and improving the single-taking efficiency.
[0047] S130. Transmit the obtained video data to be audited to the sending end that sends the single-taking request to perform the audit process of the video data to be audited.
[0048] Among them, the sending end that sends the single-taking request refers to the video audit end. After the auditor triggers the single-taking request through the single-taking control of the video audit end, the video audit end sends the single-taking request to the query service in the audit data acquisition device. The query service pulls the video data to be audited for this single-taking request from the cache queue, and then the video audit end that sends this single-taking request pulls the video data to be audited from the query service. After the video audit end pulls the video data to be audited, the corresponding auditor audits the video data to be audited to promote the video data audit process. Exemplarily, since the query service can pull multiple video data to be audited in each batch, after the video audit end pulls multiple video data to be audited from the query service, the video data to be audited is saved to the local cache. The auditor audits the videos one by one. Therefore, after the auditor triggers the single-taking request through the single-taking control, the video audit end first determines whether there is video data to be audited cached locally. If so, the video data to be audited cached locally is obtained; if not, the single-taking request is sent to the query service to pull the corresponding video data to be audited from the query service. This embodiment is based on the pre-loaded judgment of local cache data, reducing the access frequency of the cache queue and effectively reducing the possibility of competition caused by high concurrency.
[0049] In this embodiment, the obtained video data to be audited is cached in the first preset cache space so that the sending end pulls the video data to be audited from the first preset cache space. Exemplarily, Figure 4 is the third schematic diagram of the single-taking system architecture provided by the embodiment of the present application. As Figure 4As shown in the figure, the audit data acquisition device is provided with a first preset cache space, which is used to cache the to-be-audited video data pulled by the query service from the cache queue, so that the video audit terminal preferentially pulls the corresponding to-be-audited video data from the first preset cache space. After the auditor triggers a single-taking request through the single-taking control of the video audit terminal, the video audit terminal first determines whether there is to-be-audited video data cached in the first preset cache space. If there is, it pulls the to-be-audited video data from the first preset cache space; if not, it sends the single-taking request to the query service, and the query service pulls the to-be-audited video data from the cache queue and stores it in the first preset cache space, and then the video audit terminal pulls the to-be-audited video data from the first preset cache space. It can be understood that pulling the first preset cache space is also based on the preloading idea to reduce the access frequency of the cache queue and effectively reduce the possibility of competition caused by high concurrency. It should be noted that the single-taking request includes the first identification information of the corresponding video audit terminal, and the first identification information is used to represent the identity of the corresponding video audit terminal, generally the auditor ID. After the query service pulls the to-be-audited video data corresponding to the single-taking request, it associates and stores the to-be-audited video data with the first identification information in the single-taking request in the first preset cache space. When the video audit terminal pulls the to-be-audited video data in the first preset cache space, it determines the corresponding to-be-audited video data according to its own first identification information to avoid single-taking competition when the video audit terminal pulls the same data in the first preset cache space.
[0050] Based on the above embodiments, Figure 5 is a flowchart of another audit data acquisition method provided by an embodiment of the present application. As Figure 5 shown, the method includes:
[0051] S210. Obtain the to-be-audited video data in the database and cache the to-be-audited video data in a preset cache queue.
[0052] S220. Determine the corresponding cache queue according to the received single-taking request, and obtain the to-be-audited video data from the cache queue; wherein, the cache queue is locked when obtaining the to-be-audited video data, and the cache queue is unlocked after obtaining the to-be-audited video data.
[0053] S230. Transmit the obtained to-be-audited video data to the sending end that sent the single-taking request to perform the to-be-audited video data audit process.
[0054] Exemplarily, steps S210-S230 can refer to steps S110-S130.
[0055] S240. Determine the second identification information of the to-be-audited video data corresponding to the single-taking request, and determine the first identification information of the sending end for auditing the to-be-audited video data according to the single-taking request.
[0056] Among them, the second identification information is used to characterize the identity of the video data to be audited, generally the video ID. Exemplarily, after the query service receives the order-taking request A, it obtains the auditor ID of the video auditing terminal A that sends the order-taking request A from the order-taking request A. After the query service pulls the video data A to be audited corresponding to the order-taking request A from the cache queue, it determines the video ID of the video data A to be audited. According to the auditor ID corresponding to the order-taking request A, the corresponding video auditing terminal A is determined as the video auditing terminal for auditing the video data A to be audited.
[0057] S250. Cache the video data to be audited, the corresponding first identification information, second identification information, storage time threshold, and third identification information of the cache queue where it is located in the second preset cache space.
[0058] Among them, the third identification information is used to characterize the position of the cache queue where the video data to be audited was previously stored. The storage position of the cache queue can be uniquely determined through the third identification information, which is generally the queue number. The second preset cache space is used to store the video data to be audited and the corresponding video information. The video information includes the video ID, auditor ID, status information, and queue number. The storage time threshold refers to the audit deadline node of the video data to be audited, that is, if the auditor has not completed the audit of the video data to be audited at this audit deadline node, it is determined that the audit has timed out. Exemplarily, the second preset cache space is implemented based on redis. The second preset cache space is pre-configured with a duration threshold, which refers to the maximum duration given to the auditor to audit the video data to be audited, that is, if the auditor's audit duration exceeds this duration threshold, the audit has timed out. After the video data to be audited is stored in the second preset cache space, the second preset cache space determines the storage time threshold of the video data to be audited according to this duration threshold and the time node when the video data to be audited is stored.
[0059] It should be noted that both the second preset cache space and the cache queue are implemented by redis, that is, the cached data of the two is of the same type but different data structures. Caching data of the same type facilitates centralized management and later maintenance, effectively reducing the later maintenance cost.
[0060] S260. Query the storage time threshold of each video data to be audited in the second preset cache space every third preset time to determine whether the corresponding video data to be audited has timed out according to the storage time threshold.
[0061] Among them, the third preset time is used to characterize the frequency of querying whether the video data to be audited in the second preset cache space times out. Exemplarily, the storage time threshold of the video data to be audited in the second preset cache space is regularly queried, and the storage time threshold is compared with the current time node. If the current time node has exceeded the storage time threshold, it indicates that the video data to be audited has not been completed before the audit deadline node, that is, it is determined that the video data to be audited times out; if the current time node does not exceed the storage time threshold, it indicates that the video data to be audited has not reached the audit deadline, that is, it is determined that the video data to be audited does not time out.
[0062] S270. When it is determined that the video data to be audited times out, the video data to be audited is cached into the corresponding cache queue according to the third identification information corresponding to the video data to be audited, and the video data to be audited and the corresponding video information in the second preset cache space are deleted.
[0063] In this embodiment, Figure 6 is the fourth schematic diagram of the order picking system architecture provided by the embodiment of the present application. As Figure 6 shown, the audit data acquisition device is provided with a submission service, and the submission service is used to regularly check whether each piece of video data to be audited in the second preset cache space times out, and record the video ID of the video data to be audited and the corresponding check result. If it is queried that the video data to be audited does not time out, check whether the next piece of video data to be audited times out or wait for the next round of checks. If the video data to be audited is in a timeout state, the third identification information associated with the video data to be audited, that is, the queue number, is obtained from the second preset cache space. According to the queue number, the video data to be audited is stored in the corresponding cache queue, so that other video audit terminals can pull and audit the audit video data, so as to prevent the auditor from delaying the upload time of the video data due to forgetting to audit the video data and ensure the timeliness of the video data.
[0064] Furthermore, since the video data to be audited has been stored in the cache queue, the video data to be audited in the second preset cache space has become invalid. Therefore, the video data to be audited and the corresponding video information can be deleted to save memory space.
[0065] S280. Receive the audit result sent by the sending end, and determine whether the corresponding video data to be audited times out according to the second identification information in the audit result.
[0066] Exemplarily, when an auditor finishes auditing a piece of video data, the auditor selects the audit result through the submission control of the video audit terminal, and the video audit terminal uploads the audit result to the audit data acquisition device. The audit result includes the video ID of the corresponding video data. After receiving the audit result, it is determined whether the corresponding video times out according to the video ID of the audit result from the check results of the most recent round of checks.
[0067] S290. When it is determined that the video data to be audited has timed out, send an audit timeout message to the sending end.
[0068] Exemplarily, if the video data to be audited times out, an audit timeout message is sent to the corresponding video audit end to remind the auditor of the video audit end that the video data has timed out.
[0069] S300. When it is determined that the video data to be audited has not timed out, delete the video data to be audited and the corresponding video information in the second preset cache space, and mark the corresponding video data to be audited in the database as the audited state.
[0070] Exemplarily, if the video data to be audited does not time out, the auditing state of the corresponding video data in the database is marked as the audited video state according to the video ID of the audit result, so as to prevent the polling process from querying the audited video data. In addition, if the corresponding video data and information in the second preset cache space are not cleared after the video data to be audited has been audited on time, the submission service will re-store the video data to be audited into the cache queue after regularly checking that the video data times out, and the video data will be extracted and audited by other video audit ends, resulting in chaos in the entire order-taking system. Moreover, the video data and the corresponding information that have not timed out and have ended the audit in the second preset cache space are already invalid data, and deleting them can save memory space.
[0071] In this embodiment, Figure 7 is the fifth schematic diagram of the order-taking system architecture provided by the embodiment of the present application. As Figure 7 shown, Figure 7 shows the architecture of the entire order-taking system. The specific functions such as the pipeline service and the query service can refer to the above embodiments and will not be elaborated here. In this embodiment, the video audit end sends the audit result to the submission service, and the submission service queries whether the corresponding video data in the inspection result of the most recent round of inspection times out according to the video ID in the audit result. If it times out, the submission service sends a timeout message to the video audit end; if it does not time out, the submission service marks the corresponding video data in the database as the audited state according to the video ID. By processing the audit result sent by the video audit end and real-time checking the timeout state of the video data to be audited through the submission service in this embodiment, the entire order-taking system forms a closed loop, improving the system stability.
[0072] In one embodiment, when the submission service periodically checks that a certain video data to be audited in the second preset cache space times out, according to the first identification information corresponding to the video data to be audited, an audit timeout message is sent to the sender corresponding to the first identification information. Exemplarily, after determining that the video data to be audited times out, the first identification information associated with the video data to be audited is obtained from the second preset cache space, that is, the auditor ID. An audit timeout message is sent to the corresponding video audit terminal according to the auditor ID to prompt the auditor assigned to the video data to be audited that the video data has timed out and is assigned to other auditors. This avoids wasting audit time for the auditor to continue auditing this video data and affecting the audit efficiency of other video data.
[0073] In summary, the audit data acquisition method provided by the embodiment of the present application caches the data read from the database through a cache queue, reads the data from the cache queue when receiving a single-taking request and transmits it to the video audit terminal. This enables querying the data in the database in advance, making the concurrency of querying the database controllable, reducing the system's dependence on the database, reducing the load pressure on the database, and ensuring the stability of the system. Moreover, the processing efficiency of the cache queue is much higher than that of the database. Querying the data from the cache queue and transmitting it to the video audit terminal improves the single-taking efficiency. When reading data from the cache queue, a locking operation is performed on the corresponding cache queue and unlocked after the reading is completed to ensure the atomicity of the reading operation and the uniqueness of data allocation. Compared with the locking operation in the database, performing a locking operation on the cache queue in memory is more convenient, reducing the running time and improving the single-taking efficiency. In addition, this embodiment introduces a cache queue, a preset cache space, a pipeline service, a query service, and a submission service into the single-taking system. By refining the functions of each link in the system architecture, the single-taking efficiency and stability of the single-taking system are improved, greatly enhancing the performance of the single-taking system and helping to improve the audit efficiency of the audit team.
[0074] Based on the above embodiment, Figure 8 is a schematic structural diagram of an audit data acquisition device provided by an embodiment of the present application. As Figure 8 shown, the audit data acquisition device includes a data cache module 31, a data acquisition module 32, and a data transmission module 33.
[0075] Among them, the data cache module is configured to obtain the video data to be audited in the database and cache the video data to be audited into a preset cache queue;
[0076] The data acquisition module is configured to determine the corresponding cache queue according to the received single-taking request and obtain the video data to be audited from the cache queue; among them, when obtaining the video data to be audited, the cache queue is locked, and the cache queue is unlocked after obtaining the video data to be audited;
[0077] A data transmission module, configured to transmit the obtained video data to be audited to the sending end that sends a bill pickup request, so as to perform the audit process of the video data to be audited.
[0078] In summary, the audit data acquisition device provided by the embodiment of the present application caches the data read from the database through a cache queue, reads the data from the cache queue when receiving a bill pickup request, and transmits it to the video audit end. This is to query the data in the database in advance, make the concurrency of querying the database controllable, reduce the dependence of the system on the database, reduce the load pressure on the database, and ensure the stability of the system. Moreover, the processing efficiency of the cache queue is much higher than that of the database. Querying data from the cache queue and transmitting it to the video audit end can improve the bill pickup efficiency. When reading data from the cache queue, a locking operation is performed on the corresponding cache queue and unlocked after reading, ensuring the atomicity of the reading operation and the uniqueness of data allocation. Compared with the locking operation in the database, performing a locking operation on the cache queue in memory is more convenient, reducing the running time and improving the bill pickup efficiency.
[0079] The embodiment of the present application also provides an audit data acquisition device, and this audit data acquisition device can integrate the audit data acquisition device provided by the embodiment of the present application. Figure 9 It is a schematic structural diagram of an audit data acquisition device provided by the embodiment of the present application. Refer to Figure 9 , this audit data acquisition device includes: an input device 43, an output device 44, a memory 42, and one or more processors 41; the memory 42 is used to store one or more programs; when the one or more programs are executed by the one or more processors 41, the one or more processors 41 implement the audit data acquisition method provided by the above embodiment. The above-provided audit data acquisition device, equipment, and computer can be used to execute the audit data acquisition method provided by any of the above embodiments, and have corresponding functions and beneficial effects.
[0080] The embodiment of the present application also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the audit data acquisition method provided by the above embodiment when executed by a computer processor. Of course, for the storage medium containing computer-executable instructions provided by the embodiment of the present application, its computer-executable instructions are not limited to the above-mentioned audit data acquisition method, and can also execute related operations in the audit data acquisition method provided by any embodiment of the present application. The audit data acquisition device, equipment, and storage medium provided in the above embodiments can execute the audit data acquisition method provided by any embodiment of the present application. For technical details not described in detail in the above embodiments, reference can be made to the audit data acquisition method provided by any embodiment of the present application.
[0081] The above are only the preferred embodiments of the present application and the technical principles applied. The present application is not limited to the specific embodiments described herein. Various obvious changes, re-adjustments and substitutions that can be made by those skilled in the art will not depart from the protection scope of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments. Without departing from the concept of the present application, more other equivalent embodiments can be included, and the scope of the present application is determined by the scope of the claims.
Claims
1. A method for obtaining audit data, characterized in that, Including: Extract the video data to be audited in the database at intervals of a first preset time through a plurality of pre-configured polling threads, and each of the polling threads extracts at least one video data to be audited each time; Randomly cache each of the video data to be audited in each of the polling threads into a cache queue in turn; wherein, after the video data to be audited is cached into the cache queue, the to-be-audited status of the corresponding video data in the database is marked as being audited; the number of the polling threads, the first preset time, and the data extraction quantity are adjusted through a pipeline service; Determine the corresponding cache queue according to the received order-taking request, and obtain the video data to be audited from the cache queue; wherein, lock the cache queue when obtaining the video data to be audited, and unlock the cache queue after obtaining the video data to be audited; after obtaining the video data to be audited from the cache queue, determine the second identification information of the video data to be audited corresponding to the order-taking request, and determine the first identification information of the sending end for auditing the video data to be audited according to the order-taking request; cache the video data to be audited in association with the corresponding first identification information, second identification information, storage time threshold, and third identification information of the cache queue where it is located into a second preset cache space; Transmit the obtained video data to be audited to the sending end that sends the order-taking request to perform the audit process of the video data to be audited.
2. The method for obtaining audit data according to claim 1, characterized in that, The determining the corresponding cache queue according to the received order-taking request and obtaining the video data to be audited from the cache queue includes: When multiple order-taking requests are received, determine the cache queue corresponding to each order-taking request based on a preset hash rule; Pull at least one video data to be audited from the corresponding cache queues in parallel.
3. The audit data acquisition method according to claim 1, characterized in that The transmitting the obtained video data to be audited to the sending end that sends the order-taking request includes: Cache the obtained video data to be audited into a first preset cache space so that the sending end pulls the video data to be audited from the first preset cache space.
4. The audit data acquisition method according to claim 1, wherein The audit data acquisition method further includes: Query the storage time threshold of each video data to be audited in the second preset cache space at intervals of a third preset time to determine whether the corresponding video data to be audited is audited overdue according to the storage time threshold; When it is determined that the video data to be audited is audited overdue, cache the video data to be audited into the corresponding cache queue according to the third identification information corresponding to the video data to be audited, and delete the video data to be audited and the corresponding video information in the second preset cache space.
5. The audit data acquisition method according to claim 4, wherein The audit data acquisition method further includes: Receive the audit result sent by the sending end, and determine whether the corresponding video data to be audited is audited overdue according to the second identification information in the audit result; When it is determined that the video data to be audited is audited overdue, send an audit overdue message to the sending end; When it is determined that the video data to be reviewed has not timed out, delete the video data to be reviewed and the corresponding video information in the second preset cache space, and mark the video data to be reviewed in the database as reviewed.
6. The method for obtaining audit data according to claim 4, wherein, After determining that the video data to be reviewed has timed out, it further includes: According to the first identification information corresponding to the video data to be reviewed, send a timeout message to the sending end corresponding to the first identification information.
7. An audit data acquisition device, characterized in that, It includes: A data caching module, configured to obtain the video data to be reviewed in the database and cache the video data to be reviewed into a preset cache queue; Specifically, the data caching module is configured to extract the video data to be reviewed in the database every first preset time interval through a plurality of pre-configured polling threads, and each polling thread extracts at least one video data to be reviewed each time; Randomly cache each piece of the video data to be reviewed in each polling thread into one of the cache queues in turn; wherein, after the video data to be reviewed is cached into the cache queue, the to-be-reviewed status of the corresponding video data in the database is marked as being reviewed; the number of polling threads, the first preset time, and the data extraction quantity are adjusted through a pipeline service; A data acquisition module, configured to determine the corresponding cache queue according to the received order-taking request and obtain the video data to be reviewed from the cache queue; wherein, lock the cache queue when obtaining the video data to be reviewed, and unlock the cache queue after obtaining the video data to be reviewed; after obtaining the video data to be reviewed from the cache queue, determine the second identification information of the video data to be reviewed corresponding to the order-taking request, and determine the first identification information of the sending end for reviewing the video data to be reviewed according to the order-taking request; cache the video data to be reviewed in association with the corresponding first identification information, second identification information, storage time threshold, and third identification information of the cache queue where it is located into a second preset cache space; A data transmission module, configured to transmit the obtained video data to be reviewed to the sending end that sent the order-taking request to perform the review process of the video data to be reviewed.
8. An audit data acquisition device, characterized in that, It includes: A memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the review data acquisition method according to any one of claims 1-6.
9. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions are used to execute the review data acquisition method according to any one of claims 1-6 when executed by a computer processor.
Citation Information
Patent Citations
Message processing method and device
CN110851288A