Real-time index lifecycle test verification method, storage medium and electronic device
Patent Information
- Application Number
- CN202311345391.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-10-17
AI Technical Summary
而且每次只能对单个实时指标做验证测试,且需要花费一定的人工耗时,无法一次性完成多个实时指标生命周期的验证,也无法给实时指标的快速版本迭代提供高效的测试保障
[0017] The testing and verification method for the lifecycle of real-time indicators provided in this application can effectively improve the efficiency and reliability of testing and verification of the lifecycle of real-time indicators, provide testers with an effective and convenient testing approach, and provide data support for subsequent data analysis.
Smart Images

Figure CN117453535B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet big data technology, and in particular relates to a testing and verification method, storage medium and electronic device for real-time indicator lifecycle. Background Technology
[0002] In today's internet age, real-time indicators are becoming increasingly important in various real-time data risk control scenarios, and higher requirements are being placed on the stability and accuracy of real-time indicator calculations.
[0003] Therefore, the lifecycle, a crucial attribute of real-time metrics, has become one of the important factors affecting the accuracy of real-time metrics. How to correctly and efficiently verify the lifecycle of real-time metrics plays a decisive role in the rapid iteration of real-time metrics.
[0004] Traditional verification methods, for a single real-time metric under test, require manual input of query commands into the data storage to obtain the results, which are then compared with the expected values. Furthermore, only the lifecycle of one real-time metric can be queried at a time. This testing approach is relatively simplistic and inefficient, failing to provide effective testing assurance for the rapid iterative updates of real-time metrics.
[0005] Therefore, the current verification testing of the lifecycle of real-time metrics mainly relies on manually entering database query commands to obtain the results, which are then compared with the expected values to ultimately verify their accuracy. Moreover, verification testing can only be performed on a single real-time metric at a time, and it requires a certain amount of manual time, making it impossible to complete the verification of the lifecycle of multiple real-time metrics at once, nor can it provide efficient testing assurance for the rapid version iteration of real-time metrics. Summary of the Invention
[0006] This application provides a method, storage medium, and electronic device for testing and verifying the lifecycle of real-time metrics, which can improve the efficiency of testing and verifying the lifecycle of real-time metrics.
[0007] In a first aspect, embodiments of this application provide a method for testing and verifying the lifecycle of a real-time indicator, comprising: creating a verification task for a target real-time indicator to be tested, and initializing the verification task according to the configuration of the target real-time indicator to be tested; acquiring input data source data, performing indicator calculation on the input data source data through a cloud computing platform, and outputting the lifecycle of the real-time indicator calculation result to the output data source; during the operation of the verification task: periodically querying the lifecycle of the real-time indicator calculation result from the output data source, comparing the lifecycle of the real-time indicator calculation result with the expected value, generating test results, until the lifecycle of the target real-time indicator to be tested is exhausted.
[0008] In one implementation of the first aspect, initializing the verification task according to the configuration of the target real-time indicator includes: reading the configuration of the target real-time indicator; and generating a visual list page for the target real-time indicator to display relevant information of the target real-time indicator.
[0009] In one implementation of the first aspect, the method further includes: configuring the target real-time indicator to be tested, including adding, deleting, modifying and querying the target real-time indicator to be tested, configuring the online or offline status of the real-time indicator, configuring the attributes of the real-time indicator, configuring the automatic data collection interval after the verification task is run, and configuring the threshold for judging the test results.
[0010] In one implementation of the first aspect, the threshold is the inconsistency rate between the actual value and the expected value of the lifecycle; inconsistency rate = number of inconsistent sampling tests / total number of sampling test comparisons.
[0011] In one implementation of the first aspect, the attributes of the real-time metric include a combination of name, code, input data source, calculation dimension, calculation window, calculation method, lifecycle, and output data source.
[0012] In one implementation of the first aspect, the output data source is a Redis database, and the lifecycle of the target real-time metric is determined based on the expiration time of the Redis key-value pairs.
[0013] In one implementation of the first aspect, the lifecycle is the same as the duration of the calculation window for the target measured real-time indicator.
[0014] In one implementation of the first aspect, the expected value is a theoretical lifecycle value calculated based on a calculation window, and one way to obtain the expected value is: E x =E x-1 -I; where, E x E represents the expected value currently being collected. x-1 Let x be the expected value of the previous collection, x be the number of collections, and I be the collection interval.
[0015] Secondly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the test and verification method for the lifecycle of real-time indicators as described in any of the first aspects of this application.
[0016] Thirdly, embodiments of this application provide an electronic device, the electronic device comprising: a memory storing a computer program; and a processor communicatively connected to the memory, which, when the computer program is invoked, executes the test and verification method for the real-time indicator lifecycle as described in the first aspect of this application.
[0017] The testing and verification method for the lifecycle of real-time indicators provided in this application can effectively improve the efficiency and reliability of testing and verification of the lifecycle of real-time indicators, provide testers with an effective and convenient testing approach, and provide data support for subsequent data analysis. Attached Figure Description
[0018] Figure 1 The diagram shows an application scenario of a test and verification method for the lifecycle of real-time metrics according to an embodiment of this application.
[0019] Figure 2 The flowchart shown is a test and verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0020] Figure 3 The flowchart shown is a process for creating a verification task in a test and verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0021] Figure 4 The diagram shown illustrates the configuration of real-time metrics in a test and verification method for the lifecycle of real-time metrics according to an embodiment of this application.
[0022] Figure 5 The diagram shows the real-time indicator attributes in a test and verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0023] Figure 6 This is a schematic diagram of the list page after the verification task is initialized in the test and verification method for the real-time indicator lifecycle of an embodiment of this application.
[0024] Figure 7 The diagram shows an interactive illustration of the real-time indicator calculation process, which is part of a test and verification method for the lifecycle of real-time indicators according to an embodiment of this application.
[0025] Figure 8 The diagram shown is a schematic representation of the calculation principle of a real-time indicator calculation method for a real-time indicator lifecycle testing and verification method according to an embodiment of this application.
[0026] Figure 9 This diagram illustrates the test process during task execution in a test and verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0027] Figure 10 The diagram shown is a test structure schematic of a test verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0028] Figure 11 This diagram illustrates the overall implementation process of a testing and verification method for the lifecycle of real-time metrics according to an embodiment of this application.
[0029] Figure 12 The diagram shown is a structural schematic of an electronic device according to an embodiment of this application.
[0030] Component designation explanation
[0031] 100 Electronic devices
[0032] 101 Memory
[0033] 102 processor
[0034] 103 Monitor
[0035] S100~S300 Steps Detailed Implementation
[0036] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0037] This embodiment follows the Standard Operating Procedure (SOP), utilizes a self-developed unified verification mechanism for real-time metric lifecycles, batch reads configuration data of the metrics under test, queries the lifecycle of the metrics in real time, provides real-time notification of test results, and offers a unified data result display page for centralized management of test data. This provides a fast and efficient testing and verification method for real-time metric lifecycle testing.
[0038] Figure 1 This diagram illustrates an application scenario of a testing and verification method for the real-time indicator lifecycle, as described in an embodiment of this application. Figure 1 As shown, the real-time indicator lifecycle testing and verification method in this embodiment requires creating a verification task for the target real-time indicator under test. Based on the data asset service platform, the target real-time indicator under test and the verification task are configured. The target real-time indicator under test and the verification task are sent to the cloud computing platform (such as Alibaba Cloud Flink VVP platform) for real-time indicator calculation. The calculation result is written to the output data source (Redis). According to the custom-configured timed polling interval, the expiration time (TTL value) of the key-value pair of the indicator under test in Redis is queried periodically. The actual value is compared with the expected value. The sampling data and comparison results for each time are recorded. The results are displayed on the test task list page.
[0039] Therefore, the real-time indicator lifecycle testing and verification method provided in this embodiment offers a complete and systematic testing method for real-time indicator lifecycle testing. It can effectively improve the efficiency and reliability of real-time indicator lifecycle testing and verification, provide testers with an effective and convenient testing approach, and provide data support for subsequent data analysis.
[0040] The following will refer to the appendices in the embodiments of this application. Figure 2 To be continued Figure 11 The technical solutions in the embodiments of this application will be described in detail.
[0041] Figure 2 This is a flowchart illustrating the testing and verification method for the lifecycle of real-time metrics in an embodiment of this application. For example... Figure 2 As shown, the test and verification method for the lifecycle of real-time indicators provided in this application includes the following steps S100 to S300.
[0042] Step S100: Create a verification task for the target real-time indicator and initialize the verification task according to the configuration of the target real-time indicator.
[0043] Step S200: Obtain input data source data, perform indicator calculations on the input data source data through a cloud computing platform, and output the lifecycle of the real-time indicator calculation results to the output data source;
[0044] Step S300: During the execution of the verification task: periodically query the lifecycle of the real-time indicator calculation result from the output data source, compare the lifecycle of the real-time indicator calculation result with the expected value, generate test results, until the lifecycle of the target real-time indicator is exhausted.
[0045] The following describes in detail steps S100 to S300 of the test and verification method for the real-time indicator lifecycle of this embodiment.
[0046] Step S100: Create a verification task for the target real-time indicator and initialize the verification task according to the configuration of the target real-time indicator.
[0047] Figure 3 This is a flowchart illustrating the creation of a verification task in a test and verification method for the real-time metric lifecycle according to an embodiment of this application. For example... Figure 3As shown, select the target metric from all online real-time metrics. (Real-time metric status is divided into two categories: online and offline. Only online metrics can be calculated in real time; therefore, the metric to be tested must be online). When creating the verification task, set the automatic data sampling interval (unit: seconds) after the task runs, and set the threshold for judging the test results after the task runs: unit: percentage (accurate to two decimal places). The threshold is defined as the inconsistency rate between the actual value and the expected value over the lifecycle. Inconsistency rate = number of inconsistent samples / total number of sampled test comparisons.
[0048] Figure 4 This diagram illustrates the configuration of real-time metrics in a test and verification method for the lifecycle of real-time metrics according to an embodiment of this application. Figure 4 As shown, in one implementation of this embodiment, the method further includes: configuring the target real-time indicator to be tested: including adding, deleting, modifying and querying the target real-time indicator to be tested, configuring the online or offline status of the real-time indicator, configuring the attributes of the real-time indicator, configuring the automatic data collection interval after the verification task is run, and configuring the threshold for judging the test results.
[0049] In this embodiment, a data asset service platform (data asset management system) is used to uniformly manage and maintain various data assets, such as real-time indicators and input data sources. Figure 4 As shown, the data asset service platform can be used to perform various operations such as real-time indicator configuration (add, delete, modify, query) through its functions.
[0050] In this embodiment, the data asset service platform launches real-time metrics, generates real-time metric tasks corresponding to the real-time metrics, and waits for a callback from the cloud computing platform (Alibaba Cloud Flink VVP platform) to update the online status of the real-time metrics.
[0051] In one implementation of this embodiment, the threshold is the inconsistency rate between the actual value and the expected value of the lifecycle; inconsistency rate = number of inconsistent sampling tests / total number of sampling test comparisons.
[0052] Figure 5 This diagram illustrates the real-time indicator attributes in a test and verification method for the real-time indicator lifecycle, as described in an embodiment of this application. Figure 5 As shown, in one implementation of this embodiment, the attributes of the real-time indicator include a combination of name, code, input data source, calculation dimension, calculation window, calculation method, lifecycle, and output data source.
[0053] In one implementation of this embodiment, initializing the verification task according to the configuration of the target measured real-time index includes:
[0054] 1) Read the configuration of the target's real-time measured indicators.
[0055] The configuration of the measured indicator is read, including but not limited to indicator code, calculation window, etc. The indicator configuration information is stored in MySQL, and data is read from MySQL during initialization.
[0056] 2) Generate a visual list page for the target measured real-time indicator to display relevant information about the target measured real-time indicator.
[0057] Figure 6 This is a schematic diagram of the list page after the verification task is initialized in the test and verification method for the real-time indicator lifecycle of an embodiment of this application. For example... Figure 6 As shown, the information displayed for the measured indicator includes, but is not limited to, indicator name, calculation window, current TTL value, expected TTL, comparison report, etc. The current TTL and expected TTL are initially empty by default.
[0058] Once the task initialization is complete, operations can be performed on the task, including but not limited to the following:
[0059] Start: Starts a task that was in an initialized / stopped state and puts it into a running state.
[0060] Stop: Stops the running task. After stopping, the test task will no longer perform timed data collection / comparison operations.
[0061] Edit: Tasks in the initialization / stopped state can be edited to adjust the data sampling interval and judgment threshold.
[0062] View Report: View the test results and detailed records for the current metric.
[0063] Step S200: Obtain input data source data, perform indicator calculations on the input data source data through a cloud computing platform, and output the lifecycle of the real-time indicator calculation results to the output data source.
[0064] The test environment has a limited amount of data in terms of quantity and content, which cannot cover all logical scenarios for calculating metrics. Therefore, a self-developed test data generation tool is used as an auxiliary tool to manually / automatically simulate triggering the source data source to send messages. The source data source is Kafka (a high-throughput distributed publish-subscribe messaging system), and the messages are sent in JSON format (JSON: JavaScript Object Notation, a lightweight data exchange format). The main mock logic is: Java implementation of Kafka message sending.
[0065] In this embodiment, the target real-time metric is configured based on the data asset service platform and runs on the Alibaba Cloud Flink VVP platform. It reads the corresponding input data source field information, performs real-time calculations according to the configuration logic (content statistics of different attribute dimensions under various business scenarios), and stores the results to the corresponding output data source for other business links to call.
[0066] In this embodiment, the cloud computing platform adopts, but is not limited to, the Alibaba Cloud Flink VVP platform. The Alibaba Cloud Flink VVP platform is a one-stop real-time big data development, operation and maintenance management platform built on Apache Flink, supporting full lifecycle capabilities such as job development, data debugging, operation and monitoring, automatic optimization, and intelligent diagnosis.
[0067] In this embodiment, the Alibaba Cloud Flink VVP platform consumes and parses the data sent from the input data source, performs indicator calculations according to the configured computational logic, and writes the calculation results to the output data source for storage.
[0068] In one implementation of this embodiment, the output data source is a Redis database, and the lifecycle of the target real-time metric is determined based on the expiration time of the Redis key-value pairs.
[0069] Redis (Remote Dictionary Server) is a high-performance key-value database. Key: a unique code for an indicator; Value: the result of the indicator calculation.
[0070] In the current business process, Redis uses the TTL (Time To Live) value to define the lifecycle of real-time metrics. Redis's TTL refers to the expiration time of a key-value pair. When the TTL of a key-value pair expires, Redis will automatically delete the key-value pair.
[0071] Using the TTL logic, after a real-time metric completes a calculation, the result is output to Redis storage, and a TTL value (unit: seconds) is set for the result. Subsequently, the TTL decreases by seconds following the current system time until it reaches zero, indicating that the TTL has expired, and Redis will remove the calculation result of that real-time metric.
[0072] In one implementation of this embodiment, the lifecycle is the same as the duration of the calculation window for the target measured real-time index.
[0073] The lifecycle is set when configuring metrics, and it is generally consistent with the calculation window of the current metric.
[0074] For example: if the indicator calculation window is the most recent hour, then the expected lifespan value is 1 hour (3600 seconds); if the indicator calculation window is the most recent day, then the expected lifespan value is 24 hours (86400 seconds). And so on.
[0075] In this embodiment, the edge computing platform performs indicator calculations on the input data source data, that is, it performs calculations on the real-time consumption data and writes the results to the sink data source (Redis).
[0076] Figure 7 The diagram shows an interactive illustration of the real-time indicator calculation process, which is part of a test and verification method for the lifecycle of real-time indicators according to an embodiment of this application. Figure 8 This diagram illustrates the calculation principle of a real-time indicator, representing a test and verification method for the lifecycle of a real-time indicator according to an embodiment of this application. Figure 7 and Figure 8 As shown, the calculation process for real-time metrics in this embodiment is as follows: For example, real-time metric A: the number of orders placed by users in the last 12 hours, calculated as follows:
[0077] 1. Users place orders on the platform;
[0078] 2. Each time an order is placed, the upstream side (order service) will send the corresponding data to the input data source;
[0079] 3. Real-time indicator calculation tasks, consuming data sent from upstream;
[0080] 4. Data is aggregated and processed according to the calculation logic of the indicator. For example, if the current indicator is to count the number of orders placed by users, the order data will be counted and counted according to the user dimension.
[0081] 5. The statistical results are the calculation results of real-time indicators;
[0082] 6. Finally, write the results to the output data source.
[0083] For example, real-time metric B: payment amount of the same mobile phone in the last 24 hours; the calculation logic for the above metric is as follows:
[0084] 1. The calculation window is the most recent 24 hours; data outside the window is not calculated.
[0085] 2. The calculation function = Sum sums all payment amounts displayed in the window;
[0086] Similarly, there are other operational logics, such as:
[0087] Calculation functions: count, most recent, earliest, variance, standard deviation, mean, etc.;
[0088] Calculation window: the most recent x hours, the current day, etc.
[0089] Step S300: During the execution of the verification task: periodically query the lifecycle of the real-time indicator calculation result from the output data source, compare the lifecycle of the real-time indicator calculation result with the expected value, generate test results, until the lifecycle of the target real-time indicator is exhausted.
[0090] Figure 9 This diagram illustrates the test process during task execution in a test and verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0091] Monitor the Redis storage of each tested metric: When the tested metric completes the calculation, write the result to Redis, and at the same time send the initial value to the unified verification process of the metric lifecycle in the form of a Kafka message. The unified verification process of the metric lifecycle obtains the actual initial value of the tested metric lifecycle and displays it in the task list; at the same time, it obtains the expected initial value of the lifecycle according to the calculation window in the metric configuration.
[0092] Actual value: The TTL value set when the real-time metric task is completed and the result is written to Redis (the TTL value retrieved from Redis in real time during each subsequent polling query).
[0093] The expected lifecycle theoretical value is calculated based on the time window set when configuring real-time metrics (and deducted from the initial expected value for each subsequent comparison).
[0094] In one implementation of this embodiment, the expected value is the theoretical lifespan value calculated based on the calculation window, and one way to obtain the expected value is: E x =E x-1 -I; where, E x E represents the expected value currently being collected. x-1 Let x be the expected value of the previous collection, x be the number of collections, and I be the collection interval.
[0095] For example, if the real-time indicator calculation window is configured to be 1 hour, then: the initial expected value E = 3600 seconds, and the task data collection interval is set to 30 seconds, the expected value Ex of the timed data collection is calculated as follows:
[0096] E1 = E0 – 30 = 3570 seconds;
[0097] E2 = E1 – 30 = 3540 seconds;
[0098] ...
[0099] And so on.
[0100] Based on the custom-configured timed polling interval, periodically query the TTL value of the tested metric in Redis, compare the actual value with the expected value, record the sampling data and comparison results for each time, and display the results on the test task list page. Figure 10 The diagram shown is a test structure schematic of a test verification method for the real-time indicator lifecycle according to an embodiment of this application.
[0101] In this embodiment, test results are generated only after the lifecycle of the target real-time metric is exhausted. This involves summarizing data from all sampling points, calculating the test inconsistency rate, comparing it to a set threshold, and outputting the test results.
[0102] 1) If the inconsistency rate is greater than the threshold, the test fails;
[0103] 2) If the inconsistency rate is less than or equal to the threshold, the test is considered passed;
[0104] The final test results data will be archived for subsequent analysis.
[0105] In addition, test results are also sent in this embodiment:
[0106] 1) Call the email service interface to send the test results to the test task creator via email;
[0107] 2) Call the Lark service interface to send the test results to the test task creator in the form of Lark notification.
[0108] Finally, in this embodiment, the lifecycle of the tested metric can be determined based on the test results to see if it meets expectations (whether it can be launched). Test records can be reviewed to fix potential problems in the real-time metric calculation logic code. Test records can also be reviewed to adjust the collection frequency / judgment threshold of the test task, thereby improving the reliability of subsequent tests.
[0109] Figure 11 This diagram illustrates the overall implementation process of a testing and verification method for the real-time indicator lifecycle according to an embodiment of this application. Figure 11 As shown, in this embodiment, a new test task is first created: a verification task is created for the target real-time metric. The target metric is selected, and custom parameters for the task are set: the automatic data collection interval after the task runs is set, and the threshold for judging the test results after the task runs is set. Then, the task is initialized: the configuration of the target real-time metric is read, and a visual list page is generated to display the relevant information of the target real-time metric. The task is then started. During the verification task execution: the TTL value of the metric under test is queried periodically in Redis, the results are updated in real time, and the test results and detailed data are output until the lifecycle of the target real-time metric is exhausted, the test is completed, and the task stops.
[0110] The scope of protection for the real-time indicator lifecycle testing and verification method described in this application is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this application is included within the scope of protection of this application.
[0111] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the test and verification method for the real-time indicator lifecycle provided in any embodiment of this application.
[0112] In the embodiments of this application, any combination of one or more storage media can be used. The storage medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0113] This application also provides an electronic device. Figure 12 The diagram shown is a structural schematic of the electronic device 100 provided in an embodiment of this application. In some embodiments, the electronic device may be a mobile phone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other terminal device. Furthermore, the real-time indicator lifecycle testing and verification method provided in this application can also be applied to databases, servers, and data service systems based on terminal artificial intelligence. This application embodiment does not impose any limitations on the specific application scenarios of the real-time indicator lifecycle testing and verification method.
[0114] like Figure 12 As shown, the electronic device 100 provided in this application embodiment includes a memory 101 and a processor 102.
[0115] The memory 101 is used to store computer programs; preferably, the memory 101 includes various media that can store program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk.
[0116] Specifically, memory 101 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. Electronic device 100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. Memory 101 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.
[0117] The processor 102 is connected to the memory 101 and is used to execute the computer program stored in the memory 101 so that the electronic device 100 executes the real-time indicator lifecycle test and verification method provided in any embodiment of this application.
[0118] Optionally, the processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0119] Optionally, in this embodiment, the electronic device 100 may further include a display 103. The display 103 is communicatively connected to the memory 101 and the processor 102, and is used to display the relevant GUI interactive interface of the test and verification method for the real-time indicator lifecycle.
[0120] In summary, the testing and verification method for the real-time indicator lifecycle provided in this application can effectively improve the efficiency and reliability of testing and verification of real-time indicator lifecycles, providing testers with an effective and convenient testing approach and data support for subsequent data analysis. Therefore, this application effectively overcomes the various shortcomings of the prior art and has high industrial application value.
[0121] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.
Claims
1. A method for testing and verifying the lifecycle of a real-time indicator, characterized in that, include: Create a verification task for the target real-time indicator and initialize the verification task according to the configuration of the target real-time indicator; The system acquires input data from a data source, performs indicator calculations on the input data source data through a cloud computing platform, and outputs the lifecycle of the real-time indicator calculation results to the output data source. During the verification task: the lifecycle of the real-time indicator calculation result is queried periodically from the output data source, and the lifecycle of the real-time indicator calculation result is compared with the expected value to generate test results until the lifecycle of the target real-time indicator is exhausted; The initialization of the verification task based on the configuration of the target measured real-time indicators includes: Read the configuration of the target's real-time measured indicators; Generate a visual list page for the target measured real-time indicator to display relevant information about the target measured real-time indicator; It also includes: configuring target real-time metrics under test: including adding, deleting, modifying and querying target real-time metrics under test, configuring the online or offline status of real-time metrics, configuring the attributes of real-time metrics, configuring the automatic data collection interval after the verification task runs, and configuring the threshold for judging test results. The expected value is the theoretical lifespan value calculated based on the calculation window. One way to obtain the expected value is as follows: ; in, This represents the expected value currently being collected. This is the expected value from the previous data collection. For the number of collections, The data collection interval.
2. The testing and verification method for the real-time indicator lifecycle according to claim 1, characterized in that, The threshold is the inconsistency rate between the actual value and the expected value of the lifecycle; inconsistency rate = number of inconsistent samples / total number of samples compared.
3. The testing and verification method for the real-time indicator lifecycle according to claim 1, characterized in that, The attributes of the real-time metric include a combination of name, code, input data source, calculation dimension, calculation window, calculation method, lifecycle, and output data source.
4. The testing and verification method for the real-time indicator lifecycle according to claim 1, characterized in that, The output data source is a Redis database, and the lifecycle of the target real-time metric is determined based on the expiration time of the Redis key-value pairs.
5. The testing and verification method for the real-time indicator lifecycle according to claim 3 or 4, characterized in that, The lifecycle is the same as the calculation window length for the target measured real-time index.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the test and verification method for the real-time indicator lifecycle as described in any one of claims 1 to 5.
7. An electronic device, characterized in that, The electronic device includes: A memory that stores a computer program; The processor, which is communicatively connected to the memory, executes the test and verification method for the real-time indicator lifecycle as described in any one of claims 1 to 5 when calling the computer program.
Citation Information
Patent Citations
Instant time clock precise verification system and method
CN101364978A
Method and device for deleting expired data
CN110716924A